Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <nobody@localhost>2002-02-27 12:38:18 +0300
committernobody <nobody@localhost>2002-02-27 12:38:18 +0300
commit9f187b5dd0b323582e2aec7c7f17f7a1cd4ba07b (patch)
tree79bb36b51e637d540f90fd6a389cbafef2fe0f49
parent5755971d0063ee3ab6278448f026367495a8aa3c (diff)
parentb3a9502b960559d7a6b6c9712be8dd052b2e0e19 (diff)
This commit was manufactured by cvs2svn to create branch 'NUNIT'.
svn path=/branches/NUNIT/mcs/; revision=2712
-rwxr-xr-xmcs/AUTHORS13
-rw-r--r--mcs/ChangeLog12
-rwxr-xr-xmcs/README23
-rw-r--r--mcs/class/.cvsignore1
-rw-r--r--mcs/class/README70
-rw-r--r--mcs/class/System.Data/ChangeLog9
-rw-r--r--mcs/class/System.Data/System.Data.build24
-rw-r--r--mcs/class/System.Data/System.Data/AcceptRejectRule.cs23
-rw-r--r--mcs/class/System.Data/System.Data/CommandBehavior.cs30
-rw-r--r--mcs/class/System.Data/System.Data/CommandType.cs25
-rw-r--r--mcs/class/System.Data/System.Data/ConnectionState.cs30
-rw-r--r--mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs80
-rw-r--r--mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/DataColumnCollection.cs413
-rw-r--r--mcs/class/System.Data/System.Data/DataRowAction.cs28
-rw-r--r--mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/DataRowState.cs26
-rw-r--r--mcs/class/System.Data/System.Data/DataRowVersion.cs23
-rw-r--r--mcs/class/System.Data/System.Data/DataViewRowState.cs29
-rw-r--r--mcs/class/System.Data/System.Data/DbType.cs44
-rw-r--r--mcs/class/System.Data/System.Data/FillErrorEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/IColumnMapping.cs35
-rw-r--r--mcs/class/System.Data/System.Data/IColumnMappingCollection.cs35
-rw-r--r--mcs/class/System.Data/System.Data/IDataAdapter.cs33
-rw-r--r--mcs/class/System.Data/System.Data/IDataParameter.cs34
-rw-r--r--mcs/class/System.Data/System.Data/IDataParameterCollection.cs27
-rw-r--r--mcs/class/System.Data/System.Data/IDataReader.cs33
-rw-r--r--mcs/class/System.Data/System.Data/IDataRecord.cs67
-rw-r--r--mcs/class/System.Data/System.Data/IDbCommand.cs46
-rw-r--r--mcs/class/System.Data/System.Data/IDbConnection.cs39
-rw-r--r--mcs/class/System.Data/System.Data/IDbDataAdapter.cs25
-rw-r--r--mcs/class/System.Data/System.Data/IDbDataParameter.cs23
-rw-r--r--mcs/class/System.Data/System.Data/IDbTransaction.cs25
-rw-r--r--mcs/class/System.Data/System.Data/ITableMapping.cs23
-rw-r--r--mcs/class/System.Data/System.Data/ITableMappingCollection.cs31
-rw-r--r--mcs/class/System.Data/System.Data/IsolationLevel.cs27
-rw-r--r--mcs/class/System.Data/System.Data/MappingType.cs26
-rw-r--r--mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/MissingMappingAction.cs24
-rw-r--r--mcs/class/System.Data/System.Data/MissingSchemaAction.cs25
-rw-r--r--mcs/class/System.Data/System.Data/ParameterDirection.cs25
-rw-r--r--mcs/class/System.Data/System.Data/PropertyAttributes.cs28
-rw-r--r--mcs/class/System.Data/System.Data/Rule.cs25
-rw-r--r--mcs/class/System.Data/System.Data/SchemaType.cs23
-rw-r--r--mcs/class/System.Data/System.Data/SqlDbType.cs45
-rw-r--r--mcs/class/System.Data/System.Data/StateChangeEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/StatementType.cs25
-rw-r--r--mcs/class/System.Data/System.Data/UpdateRowSource.cs25
-rw-r--r--mcs/class/System.Data/System.Data/UpdateStatus.cs25
-rw-r--r--mcs/class/System.Data/System.Data/XmlReadMode.cs27
-rw-r--r--mcs/class/System.Data/System.Data/XmlWriteMode.cs24
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog7
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Drawing2D/Enums.cs258
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.cs453
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing.Drawing2D/PenAlignment.cs21
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Drawing2D/TODOAttribute.cs37
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/FrameDimension.cs59
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/PixelFormat.cs36
-rw-r--r--mcs/class/System.Drawing/System.Drawing.build21
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing/Bitmap.cs146
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing/Brush.cs34
-rw-r--r--mcs/class/System.Drawing/System.Drawing/ChangeLog25
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Image.cs217
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing/Pen.cs113
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Point.cs339
-rw-r--r--mcs/class/System.Drawing/System.Drawing/PointF.cs204
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Rectangle.cs584
-rw-r--r--mcs/class/System.Drawing/System.Drawing/RectangleF.cs531
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Size.cs309
-rw-r--r--mcs/class/System.Drawing/System.Drawing/SizeF.cs249
-rw-r--r--mcs/class/System.Drawing/Test/System.Drawing/ChangeLog4
-rw-r--r--mcs/class/System.Drawing/Test/System.Drawing/TestPoint.cs159
-rw-r--r--mcs/class/System.Web/.cvsignore4
-rw-r--r--mcs/class/System.Web/ChangeLog29
-rw-r--r--mcs/class/System.Web/System.Web.Caching/Cache.cs520
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheDefinitions.cs53
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheDependency.cs97
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheEntry.cs363
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheExpires.cs145
-rw-r--r--mcs/class/System.Web/System.Web.Caching/ChangeLog12
-rw-r--r--mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs253
-rwxr-xr-xmcs/class/System.Web/System.Web.Configuration/AuthenticationMode.cs19
-rw-r--r--mcs/class/System.Web/System.Web.Configuration/ClientTargetSectionHandler.cs44
-rwxr-xr-xmcs/class/System.Web/System.Web.Configuration/FormsAuthPasswordFormat.cs18
-rwxr-xr-xmcs/class/System.Web/System.Web.Configuration/FormsProtectionEnum.cs19
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/AppDomainFactory.cs19
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs17
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/ChangeLog8
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/IAppDomainFactory.cs18
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/IISAPIRuntime.cs21
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/ISAPIRuntime.cs22
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs46
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog10
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs99
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs74
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs83
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs138
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs152
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs32
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs90
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs88
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs68
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs63
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs71
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs52
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs129
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs115
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs98
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs402
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs171
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs129
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCellCollection.cs84
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRow.cs137
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRowCollection.cs83
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs118
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventArgs.cs92
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs17
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs328
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs307
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BaseDataList.cs231
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs208
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs29
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BoundColumn.cs109
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/Button.cs164
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ButtonColumn.cs186
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs21
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs1098
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CalendarDay.cs112
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs23
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog273
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs251
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs251
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs50
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs87
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs741
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs46
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs79
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemCollection.cs83
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs16
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/DataList.cs807
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs46
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs16
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs23
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventArgs.cs43
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs154
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs27
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs251
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/FontNamesConverter.cs62
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs30
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs209
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs63
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs23
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs24
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/HyperLink.cs146
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs222
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkControlBuilder.cs27
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs29
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Image.cs115
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs29
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs179
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Label.cs83
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/LabelControlBuilder.cs27
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs183
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonControlBuilder.cs31
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs217
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs326
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs249
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListItemCollection.cs362
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListItemControlBuilder.cs36
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs27
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Literal.cs64
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/LiteralControlBuilder.cs36
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs16
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs22
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs21
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs22
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Panel.cs93
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolder.cs26
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolderControlBuilder.cs31
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs139
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RadioButtonList.cs220
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs266
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs46
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs23
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs57
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Style.cs535
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/TODO156
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Table.cs170
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs166
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableCellCollection.cs176
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableCellControlBuilder.cs31
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderCell.cs26
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableItemStyle.cs156
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs110
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs175
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs234
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TargetConverter.cs55
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TemplateColumn.cs108
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs283
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TextBoxControlBuilder.cs36
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs22
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/TitleFormat.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs254
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs65
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs28
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs75
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs26
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs24
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs142
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs22
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs22
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs23
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs55
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs414
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs202
-rw-r--r--mcs/class/System.Web/System.Web.UI/BuildMethod.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI/BuildTemplateMethod.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI/ChangeLog77
-rw-r--r--mcs/class/System.Web/System.Web.UI/Control.cs608
-rw-r--r--mcs/class/System.Web/System.Web.UI/DesignTimeParseData.cs29
-rw-r--r--mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs1028
-rw-r--r--mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs54
-rw-r--r--mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs28
-rw-r--r--mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs111
-rw-r--r--mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs20
-rw-r--r--mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs20
-rw-r--r--mcs/class/System.Web/System.Web.UI/INamingContainer.cs18
-rw-r--r--mcs/class/System.Web/System.Web.UI/IParserAccessor.cs19
-rw-r--r--mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs19
-rw-r--r--mcs/class/System.Web/System.Web.UI/IStateManager.cs22
-rw-r--r--mcs/class/System.Web/System.Web.UI/ITagNameToTypeMapper.cs20
-rw-r--r--mcs/class/System.Web/System.Web.UI/ITemplate.cs19
-rw-r--r--mcs/class/System.Web/System.Web.UI/IValidator.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI/LiteralControl.cs39
-rw-r--r--mcs/class/System.Web/System.Web.UI/OutputCacheLocation.cs23
-rw-r--r--mcs/class/System.Web/System.Web.UI/Pair.cs36
-rw-r--r--mcs/class/System.Web/System.Web.UI/PersistanceMode.cs22
-rw-r--r--mcs/class/System.Web/System.Web.UI/PropertyConverter.cs124
-rw-r--r--mcs/class/System.Web/System.Web.UI/StateBag.cs278
-rw-r--r--mcs/class/System.Web/System.Web.UI/StateItem.cs47
-rw-r--r--mcs/class/System.Web/System.Web.UI/TODO42
-rw-r--r--mcs/class/System.Web/System.Web.UI/Utils.cs46
-rw-r--r--mcs/class/System.Web/System.Web.Utils/.cvsignore1
-rw-r--r--mcs/class/System.Web/System.Web.Utils/ApacheVersionInfo.cs31
-rw-r--r--mcs/class/System.Web/System.Web.Utils/ChangeLog57
-rw-r--r--mcs/class/System.Web/System.Web.Utils/DataSourceHelper.cs72
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FileAction.cs26
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FileChangeEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FileChangedEventArgs.cs43
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FileChangesMonitor.cs62
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FilePathParser.cs82
-rw-r--r--mcs/class/System.Web/System.Web.Utils/IISVersionInfo.cs110
-rw-r--r--mcs/class/System.Web/System.Web.Utils/NativeFileChangeEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.Utils/UrlUtils.cs283
-rw-r--r--mcs/class/System.Web/System.Web.Utils/WebEqualComparer.cs107
-rw-r--r--mcs/class/System.Web/System.Web.Utils/WebHashCodeProvider.cs54
-rw-r--r--mcs/class/System.Web/System.Web.build31
-rw-r--r--mcs/class/System.Web/System.Web/.cvsignore1
-rw-r--r--mcs/class/System.Web/System.Web/BeginEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web/ChangeLog43
-rw-r--r--mcs/class/System.Web/System.Web/EndEventHandler.cs13
-rw-r--r--mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs18
-rw-r--r--mcs/class/System.Web/System.Web/HttpCacheValidateHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web/HttpCacheability.cs19
-rw-r--r--mcs/class/System.Web/System.Web/HttpCookie.cs117
-rw-r--r--mcs/class/System.Web/System.Web/HttpCookieCollection.cs70
-rw-r--r--mcs/class/System.Web/System.Web/HttpRuntime.cs355
-rw-r--r--mcs/class/System.Web/System.Web/HttpValidationStatus.cs18
-rw-r--r--mcs/class/System.Web/System.Web/HttpWorkerRequest.EndOfSendNotification.cs17
-rw-r--r--mcs/class/System.Web/System.Web/HttpWorkerRequest.cs141
-rw-r--r--mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs19
-rw-r--r--mcs/class/System.Web/System.Web/IHttpHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs20
-rw-r--r--mcs/class/System.Web/System.Web/IHttpModule.cs17
-rw-r--r--mcs/class/System.Web/System.Web/NOTES21
-rw-r--r--mcs/class/System.Web/System.Web/ProcessShutdownReason.cs23
-rw-r--r--mcs/class/System.Web/System.Web/ProcessStatus.cs19
-rw-r--r--mcs/class/System.Web/System.Web/TODO27
-rw-r--r--mcs/class/System.Web/System.Web/TODOAttribute.cs32
-rw-r--r--mcs/class/System.Web/System.Web/TraceMode.cs17
-rw-r--r--mcs/class/System.Web/Test/test.aspx29
-rw-r--r--mcs/class/System.Web/Test/test2.aspx101
-rw-r--r--mcs/class/System.Web/Test/test3.aspx23
-rw-r--r--mcs/class/System.Web/Test/test4.aspx119
-rw-r--r--mcs/class/System.Web/Test/test5.aspx121
-rw-r--r--mcs/class/System.Web/Test/test6.aspx83
-rw-r--r--mcs/class/System.XML/.cvsignore2
-rw-r--r--mcs/class/System.XML/ChangeLog11
-rw-r--r--mcs/class/System.XML/System.XML.build33
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/IXPathNavigable.cs17
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs17
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog67
-rw-r--r--mcs/class/System.XML/System.Xml/DomEncodingType.cs42
-rw-r--r--mcs/class/System.XML/System.Xml/Driver.cs57
-rwxr-xr-xmcs/class/System.XML/System.Xml/EntityHandling.cs29
-rwxr-xr-xmcs/class/System.XML/System.Xml/Formatting.cs29
-rw-r--r--mcs/class/System.XML/System.Xml/IXmlLineInfo.cs20
-rwxr-xr-xmcs/class/System.XML/System.Xml/NameTable.cs75
-rw-r--r--mcs/class/System.XML/System.Xml/Profile.cs47
-rw-r--r--mcs/class/System.XML/System.Xml/ReadState.cs41
-rw-r--r--mcs/class/System.XML/System.Xml/TODOAttribute.cs32
-rwxr-xr-xmcs/class/System.XML/System.Xml/TreePosition.cs53
-rwxr-xr-xmcs/class/System.XML/System.Xml/Validation.cs37
-rw-r--r--mcs/class/System.XML/System.Xml/WhitespaceHandling.cs33
-rwxr-xr-xmcs/class/System.XML/System.Xml/WriteState.cs53
-rwxr-xr-xmcs/class/System.XML/System.Xml/XPathNodeType.cs37
-rw-r--r--mcs/class/System.XML/System.Xml/XmlAttribute.cs144
-rw-r--r--mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs506
-rw-r--r--mcs/class/System.XML/System.Xml/XmlCDataSection.cs50
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlCaseOrder.cs33
-rw-r--r--mcs/class/System.XML/System.Xml/XmlChar.cs200
-rw-r--r--mcs/class/System.XML/System.Xml/XmlCharacterData.cs154
-rw-r--r--mcs/class/System.XML/System.Xml/XmlComment.cs120
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlDataType.cs37
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDeclaration.cs174
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDocument.cs511
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDocumentFragment.cs96
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDocumentType.cs98
-rw-r--r--mcs/class/System.XML/System.Xml/XmlElement.cs168
-rw-r--r--mcs/class/System.XML/System.Xml/XmlEntityReference.cs17
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlException.cs99
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlExceptionCode.cs1045
-rw-r--r--mcs/class/System.XML/System.Xml/XmlImplementation.cs34
-rw-r--r--mcs/class/System.XML/System.Xml/XmlInputSource.cs619
-rw-r--r--mcs/class/System.XML/System.Xml/XmlLinkedNode.cs58
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNameTable.cs20
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNamedNodeMap.cs279
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlNames_1_0.cs547
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs141
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNode.cs749
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlNodeChangedAction.cs27
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNodeChangedEventArgs.cs67
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNodeList.cs42
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNodeListAsArrayList.cs57
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlNodeOrder.cs19
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNodeType.cs93
-rw-r--r--mcs/class/System.XML/System.Xml/XmlParser.cs516
-rw-r--r--mcs/class/System.XML/System.Xml/XmlParserContext.cs127
-rw-r--r--mcs/class/System.XML/System.Xml/XmlProcessingInstruction.cs17
-rw-r--r--mcs/class/System.XML/System.Xml/XmlQualifiedName.cs104
-rw-r--r--mcs/class/System.XML/System.Xml/XmlReader.cs238
-rw-r--r--mcs/class/System.XML/System.Xml/XmlResolver.cs32
-rw-r--r--mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs17
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlSortOrder.cs33
-rw-r--r--mcs/class/System.XML/System.Xml/XmlSpace.cs37
-rw-r--r--mcs/class/System.XML/System.Xml/XmlText.cs88
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextReader.cs1331
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlTokenizedType.cs27
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlUrlResolver.cs41
-rw-r--r--mcs/class/System.XML/System.Xml/XmlUtil.cs1067
-rw-r--r--mcs/class/System.XML/System.Xml/XmlWhitespace.cs17
-rw-r--r--mcs/class/System.XML/System.Xml/XmlWriter.cs77
-rw-r--r--mcs/class/System.XML/Test/.cvsignore1
-rw-r--r--mcs/class/System.XML/Test/AllTests.cs30
-rw-r--r--mcs/class/System.XML/Test/ChangeLog29
-rwxr-xr-xmcs/class/System.XML/Test/NameTableTests.cs88
-rw-r--r--mcs/class/System.XML/Test/System.XML_test.build33
-rw-r--r--mcs/class/System.XML/Test/XmlDocumentTests.cs32
-rw-r--r--mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs87
-rw-r--r--mcs/class/System.XML/Test/XmlTextReaderTests.cs1612
-rw-r--r--mcs/class/System/.cvsignore2
-rw-r--r--mcs/class/System/ChangeLog13
-rwxr-xr-xmcs/class/System/System.CodeDom.Compiler/ChangeLog9
-rwxr-xr-xmcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs238
-rwxr-xr-xmcs/class/System/System.CodeDom.Compiler/ICodeGenerator.cs30
-rw-r--r--mcs/class/System/System.CodeDom/ChangeLog19
-rwxr-xr-xmcs/class/System/System.CodeDom/Code-X-Collection.cs159
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs89
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAssignStatement.cs52
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttachEventStatement.cs62
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttributeArgument.cs60
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs166
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttributeBlock.cs42
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs60
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs165
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs15
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs88
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs30
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeCastExpression.cs52
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeCatchClause.cs46
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs165
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeClass.cs107
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeClassCollection.cs165
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeClassConstructor.cs17
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeClassDelegate.cs52
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeClassMember.cs80
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeClassMemberCollection.cs165
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeCommentStatement.cs39
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeConstructor.cs43
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs66
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs59
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs55
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeDetachEventStatement.cs62
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeExpression.cs35
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeExpressionCollection.cs165
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs71
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeForLoopStatement.cs78
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeIfStatement.cs73
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeIndexerExpression.cs34
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeLinePragma.cs50
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeLiteralClassMember.cs40
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeLiteralExpression.cs40
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeLiteralNamespace.cs48
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeLiteralStatement.cs36
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMemberEvent.cs50
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMemberField.cs49
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMemberMethod.cs73
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMemberProperty.cs108
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs68
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs84
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs15
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeNamespace.cs92
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeNamespaceImport.cs36
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs165
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeObject.cs15
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs54
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs68
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs165
-rwxr-xr-xmcs/class/System/System.CodeDom/CodePrimitiveExpression.cs33
-rwxr-xr-xmcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs59
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeStatement.cs15
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeStatementCollection.cs165
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs16
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs31
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs70
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTypeDeclaration.cs15
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTypeMember.cs24
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTypeOfExpression.cs32
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs32
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs62
-rwxr-xr-xmcs/class/System/System.CodeDom/FieldDirection.cs14
-rwxr-xr-xmcs/class/System/System.CodeDom/MemberAttributes.cs29
-rw-r--r--mcs/class/System/System.Collections.Specialized/BitVector32.cs68
-rwxr-xr-xmcs/class/System/System.Collections.Specialized/ChangeLog41
-rw-r--r--mcs/class/System/System.Collections.Specialized/ListDictionary.cs434
-rw-r--r--mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs513
-rw-r--r--mcs/class/System/System.Collections.Specialized/NameValueCollection.cs364
-rwxr-xr-xmcs/class/System/System.Collections.Specialized/StringCollection.cs292
-rw-r--r--mcs/class/System/System.Collections.Specialized/StringDictionary.cs97
-rw-r--r--mcs/class/System/System.Collections.Specialized/StringEnumerator.cs36
-rwxr-xr-xmcs/class/System/System.ComponentModel/BrowsableAttribute.cs38
-rwxr-xr-xmcs/class/System/System.ComponentModel/CategoryAttribute.cs227
-rw-r--r--mcs/class/System/System.ComponentModel/ChangeLog46
-rw-r--r--mcs/class/System/System.ComponentModel/Component.cs126
-rw-r--r--mcs/class/System/System.ComponentModel/ComponentCollection.cs21
-rw-r--r--mcs/class/System/System.ComponentModel/Container.cs159
-rwxr-xr-xmcs/class/System/System.ComponentModel/DescriptionAttribute.cs46
-rwxr-xr-xmcs/class/System/System.ComponentModel/DesignOnlyAttribute.cs37
-rwxr-xr-xmcs/class/System/System.ComponentModel/DesignerSerializationVisibility.cs16
-rwxr-xr-xmcs/class/System/System.ComponentModel/DesignerSerializationVisibilityAttribute.cs42
-rw-r--r--mcs/class/System/System.ComponentModel/EventHandlerList.cs64
-rw-r--r--mcs/class/System/System.ComponentModel/IComponent.cs20
-rw-r--r--mcs/class/System/System.ComponentModel/IContainer.cs24
-rw-r--r--mcs/class/System/System.ComponentModel/ISite.cs21
-rwxr-xr-xmcs/class/System/System.ComponentModel/LocalizableAttribute.cs40
-rwxr-xr-xmcs/class/System/System.ComponentModel/MemberDescriptor.cs120
-rwxr-xr-xmcs/class/System/System.ComponentModel/PropertyDescriptor.cs114
-rwxr-xr-xmcs/class/System/System.ComponentModel/TypeConverter.cs8
-rwxr-xr-xmcs/class/System/System.ComponentModel/Win32Exception.cs84
-rw-r--r--mcs/class/System/System.Configuration/ChangeLog25
-rw-r--r--mcs/class/System/System.Configuration/ConfigurationException.cs132
-rw-r--r--mcs/class/System/System.Configuration/ConfigurationSettings.cs198
-rw-r--r--mcs/class/System/System.Configuration/DictionarySectionHandler.cs91
-rw-r--r--mcs/class/System/System.Configuration/IConfigurationSectionHandler.cs27
-rw-r--r--mcs/class/System/System.Configuration/IgnoreSectionHandler.cs45
-rw-r--r--mcs/class/System/System.Configuration/NameValueSectionHandler.cs107
-rw-r--r--mcs/class/System/System.Configuration/SingleTagSectionHandler.cs64
-rwxr-xr-xmcs/class/System/System.Diagnostics/BooleanSwitch.cs59
-rw-r--r--mcs/class/System/System.Diagnostics/ChangeLog31
-rw-r--r--mcs/class/System/System.Diagnostics/Debug.cs407
-rw-r--r--mcs/class/System/System.Diagnostics/DefaultTraceListener.cs98
-rw-r--r--mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs63
-rwxr-xr-xmcs/class/System/System.Diagnostics/Switch.cs94
-rw-r--r--mcs/class/System/System.Diagnostics/TextWriterTraceListener.cs227
-rwxr-xr-xmcs/class/System/System.Diagnostics/TraceLevel.cs41
-rw-r--r--mcs/class/System/System.Diagnostics/TraceListener.cs300
-rw-r--r--mcs/class/System/System.Diagnostics/TraceListenerCollection.cs290
-rwxr-xr-xmcs/class/System/System.Diagnostics/TraceSwitch.cs97
-rwxr-xr-xmcs/class/System/System.Globalization/Locale.cs22
-rw-r--r--mcs/class/System/System.Net.Sockets/AddressFamily.cs50
-rw-r--r--mcs/class/System/System.Net.Sockets/ChangeLog33
-rw-r--r--mcs/class/System/System.Net.Sockets/LingerOption.cs42
-rw-r--r--mcs/class/System/System.Net.Sockets/MulticastOption.cs48
-rw-r--r--mcs/class/System/System.Net.Sockets/NetworkStream.cs272
-rw-r--r--mcs/class/System/System.Net.Sockets/ProtocolFamily.cs46
-rw-r--r--mcs/class/System/System.Net.Sockets/ProtocolType.cs81
-rw-r--r--mcs/class/System/System.Net.Sockets/SelectMode.cs33
-rw-r--r--mcs/class/System/System.Net.Sockets/Socket.cs937
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketException.cs41
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketFlags.cs42
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs37
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketOptionName.cs181
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketShutdown.cs33
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketType.cs45
-rwxr-xr-xmcs/class/System/System.Net.Sockets/TcpClient.cs321
-rwxr-xr-xmcs/class/System/System.Net.Sockets/TcpListener.cs165
-rwxr-xr-xmcs/class/System/System.Net/AuthenticationManager.cs55
-rwxr-xr-xmcs/class/System/System.Net/Authorization.cs36
-rw-r--r--mcs/class/System/System.Net/ChangeLog74
-rwxr-xr-xmcs/class/System/System.Net/ConnectionModes.cs37
-rw-r--r--mcs/class/System/System.Net/Dns.cs206
-rwxr-xr-xmcs/class/System/System.Net/EndPoint.cs40
-rwxr-xr-xmcs/class/System/System.Net/HttpStatusCode.cs205
-rwxr-xr-xmcs/class/System/System.Net/IAuthenticationModule.cs30
-rwxr-xr-xmcs/class/System/System.Net/ICredentialLookup.cs18
-rwxr-xr-xmcs/class/System/System.Net/IPAddress.cs144
-rwxr-xr-xmcs/class/System/System.Net/IPEndPoint.cs120
-rw-r--r--mcs/class/System/System.Net/IPHostEntry.cs75
-rwxr-xr-xmcs/class/System/System.Net/NetworkAccess.cs29
-rwxr-xr-xmcs/class/System/System.Net/NetworkCredential.cs63
-rwxr-xr-xmcs/class/System/System.Net/ProxyUseType.cs37
-rwxr-xr-xmcs/class/System/System.Net/SocketAddress.cs77
-rwxr-xr-xmcs/class/System/System.Net/TransportType.cs41
-rwxr-xr-xmcs/class/System/System.Net/WebExceptionStatus.cs85
-rwxr-xr-xmcs/class/System/System.Net/WebStatus.cs77
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/arch.cs333
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/cache.cs138
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/category.cs637
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/collections.cs124
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/compiler.cs368
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/debug.cs208
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/interpreter.cs889
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/interval.cs305
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/match.cs215
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/notes.txt45
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/parser.cs1109
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/quicksearch.cs108
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/regex.cs386
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/replace.cs181
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/syntax.cs976
-rwxr-xr-xmcs/class/System/System.Threading/ChangeLog9
-rwxr-xr-xmcs/class/System/System.Threading/ThreadExceptionEventArgs.cs27
-rwxr-xr-xmcs/class/System/System.Threading/ThreadExceptionEventHandler.cs14
-rw-r--r--mcs/class/System/System.build33
-rw-r--r--mcs/class/System/System/ChangeLog14
-rw-r--r--mcs/class/System/System/TODOAttribute.cs32
-rwxr-xr-xmcs/class/System/System/Uri.cs328
-rwxr-xr-xmcs/class/System/System/UriFormatException.cs43
-rwxr-xr-xmcs/class/System/System/UriHostNameType.cs37
-rwxr-xr-xmcs/class/System/System/UriPartial.cs33
-rw-r--r--mcs/class/System/Test/.cvsignore1
-rw-r--r--mcs/class/System/Test/AllTests.cs32
-rw-r--r--mcs/class/System/Test/ChangeLog22
-rw-r--r--mcs/class/System/Test/DnsTest.cs159
-rw-r--r--mcs/class/System/Test/NameValueCollectionTest.cs178
-rw-r--r--mcs/class/System/Test/StringCollectionTest.cs148
-rwxr-xr-xmcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs82
-rwxr-xr-xmcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs85
-rw-r--r--mcs/class/System/Test/System.Net/DnsTest.cs159
-rw-r--r--mcs/class/System/Test/System.Text.RegularExpressions/AllTests.cs26
-rw-r--r--mcs/class/System/Test/System.Text.RegularExpressions/PerlTest.cs40
-rw-r--r--mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs746
-rw-r--r--mcs/class/System/Test/System.Text.RegularExpressions/RegexTrial.cs98
-rw-r--r--mcs/class/System/Test/System_test.build32
-rwxr-xr-xmcs/class/System/Test/TcpClientTest.cs82
-rwxr-xr-xmcs/class/System/Test/TcpListenerTest.cs85
-rw-r--r--mcs/class/corlib/.cvsignore2
-rw-r--r--mcs/class/corlib/ChangeLog59
-rw-r--r--mcs/class/corlib/Linux/ChangeLog23
-rw-r--r--mcs/class/corlib/Linux/Linux.cs575
-rw-r--r--mcs/class/corlib/System.Collections/ArrayList.cs572
-rw-r--r--mcs/class/corlib/System.Collections/BitArray.cs502
-rw-r--r--mcs/class/corlib/System.Collections/CaseInsensitiveComparer.cs82
-rw-r--r--mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs97
-rw-r--r--mcs/class/corlib/System.Collections/ChangeLog168
-rw-r--r--mcs/class/corlib/System.Collections/CollectionBase.cs136
-rw-r--r--mcs/class/corlib/System.Collections/Comparer.cs60
-rwxr-xr-xmcs/class/corlib/System.Collections/DictionaryBase.cs370
-rw-r--r--mcs/class/corlib/System.Collections/DictionaryEntry.cs23
-rw-r--r--mcs/class/corlib/System.Collections/Hashtable.cs1048
-rw-r--r--mcs/class/corlib/System.Collections/ICollection.cs24
-rw-r--r--mcs/class/corlib/System.Collections/IComparer.cs19
-rw-r--r--mcs/class/corlib/System.Collections/IDictionary.cs40
-rw-r--r--mcs/class/corlib/System.Collections/IDictionaryEnumerator.cs20
-rw-r--r--mcs/class/corlib/System.Collections/IEnumerable.cs18
-rw-r--r--mcs/class/corlib/System.Collections/IEnumerator.cs22
-rw-r--r--mcs/class/corlib/System.Collections/IHashCodeProvider.cs18
-rw-r--r--mcs/class/corlib/System.Collections/IList.cs40
-rw-r--r--mcs/class/corlib/System.Collections/Queue.cs328
-rw-r--r--mcs/class/corlib/System.Collections/ReadOnlyCollectionBase.cs44
-rw-r--r--mcs/class/corlib/System.Collections/SortedList.cs865
-rw-r--r--mcs/class/corlib/System.Collections/Stack.cs315
-rw-r--r--mcs/class/corlib/System.Configuration.Assemblies/AssemblyHash.cs70
-rw-r--r--mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs33
-rw-r--r--mcs/class/corlib/System.Configuration.Assemblies/AssemblyVersionCompatibility.cs33
-rw-r--r--mcs/class/corlib/System.Configuration.Assemblies/ChangeLog6
-rwxr-xr-xmcs/class/corlib/System.Configuration.Assemblies/ProcessorID.cs101
-rw-r--r--mcs/class/corlib/System.Diagnostics.SymbolStore/ChangeLog13
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolBinder.cs19
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocument.cs29
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs13
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolMethod.cs38
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolNamespace.cs20
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolReader.cs38
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolScope.cs26
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolVariable.cs28
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolWriter.cs87
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/SymAddressKind.cs25
-rw-r--r--mcs/class/corlib/System.Diagnostics.SymbolStore/SymDocumentType.cs21
-rw-r--r--mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageType.cs31
-rw-r--r--mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageVendor.cs21
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/SymbolToken.cs30
-rw-r--r--mcs/class/corlib/System.Diagnostics/ChangeLog41
-rw-r--r--mcs/class/corlib/System.Diagnostics/ConditionalAttribute.cs28
-rw-r--r--mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs28
-rw-r--r--mcs/class/corlib/System.Diagnostics/Debugger.cs86
-rw-r--r--mcs/class/corlib/System.Diagnostics/DebuggerHiddenAttribute.cs25
-rw-r--r--mcs/class/corlib/System.Diagnostics/DebuggerStepThroughAttribute.cs23
-rw-r--r--mcs/class/corlib/System.Diagnostics/StackFrame.cs315
-rw-r--r--mcs/class/corlib/System.Diagnostics/StackTrace.cs290
-rw-r--r--mcs/class/corlib/System.Globalization/Calendar.cs410
-rw-r--r--mcs/class/corlib/System.Globalization/CalendarWeekRule.cs28
-rw-r--r--mcs/class/corlib/System.Globalization/ChangeLog74
-rwxr-xr-xmcs/class/corlib/System.Globalization/CompareOptions.cs53
-rw-r--r--mcs/class/corlib/System.Globalization/CultureInfo.cs849
-rwxr-xr-xmcs/class/corlib/System.Globalization/CultureTypes.cs37
-rw-r--r--mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs519
-rw-r--r--mcs/class/corlib/System.Globalization/DateTimeStyles.cs50
-rwxr-xr-xmcs/class/corlib/System.Globalization/DaylightTime.cs50
-rw-r--r--mcs/class/corlib/System.Globalization/GregorianCalendar.cs254
-rwxr-xr-xmcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs45
-rw-r--r--mcs/class/corlib/System.Globalization/JulianCalendar.cs230
-rwxr-xr-xmcs/class/corlib/System.Globalization/Locale.cs22
-rw-r--r--mcs/class/corlib/System.Globalization/NumberFormatInfo.cs669
-rw-r--r--mcs/class/corlib/System.Globalization/NumberStyles.cs45
-rw-r--r--mcs/class/corlib/System.Globalization/RegionInfo.cs1688
-rw-r--r--mcs/class/corlib/System.Globalization/UnicodeCategory.cs44
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog19
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs18
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs78
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageException.cs37
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs19
-rwxr-xr-xmcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs37
-rw-r--r--mcs/class/corlib/System.IO/BinaryReader.cs362
-rwxr-xr-xmcs/class/corlib/System.IO/BinaryWriter.cs164
-rw-r--r--mcs/class/corlib/System.IO/BufferedStream.cs166
-rw-r--r--mcs/class/corlib/System.IO/ChangeLog160
-rw-r--r--mcs/class/corlib/System.IO/CheckArgument.cs167
-rw-r--r--mcs/class/corlib/System.IO/CheckPermission.cs87
-rw-r--r--mcs/class/corlib/System.IO/Directory.cs388
-rw-r--r--mcs/class/corlib/System.IO/DirectoryInfo.cs231
-rwxr-xr-xmcs/class/corlib/System.IO/DirectoryNotFoundException.cs29
-rw-r--r--mcs/class/corlib/System.IO/EndOfStreamException.cs42
-rw-r--r--mcs/class/corlib/System.IO/File.cs190
-rw-r--r--mcs/class/corlib/System.IO/FileAccess.cs34
-rw-r--r--mcs/class/corlib/System.IO/FileAttributes.cs34
-rw-r--r--mcs/class/corlib/System.IO/FileInfo.cs196
-rwxr-xr-xmcs/class/corlib/System.IO/FileLoadException.cs75
-rw-r--r--mcs/class/corlib/System.IO/FileMode.cs45
-rwxr-xr-xmcs/class/corlib/System.IO/FileNotFoundException.cs90
-rw-r--r--mcs/class/corlib/System.IO/FileShare.cs38
-rw-r--r--mcs/class/corlib/System.IO/FileStream.cs200
-rw-r--r--mcs/class/corlib/System.IO/FileSystemInfo.cs220
-rw-r--r--mcs/class/corlib/System.IO/IOException.cs29
-rw-r--r--mcs/class/corlib/System.IO/MemoryStream.cs403
-rw-r--r--mcs/class/corlib/System.IO/Path.cs240
-rw-r--r--mcs/class/corlib/System.IO/PathTooLongException.cs42
-rw-r--r--mcs/class/corlib/System.IO/SeekOrigin.cs34
-rwxr-xr-xmcs/class/corlib/System.IO/Stream.cs210
-rw-r--r--mcs/class/corlib/System.IO/StreamReader.cs115
-rw-r--r--mcs/class/corlib/System.IO/StreamWriter.cs123
-rw-r--r--mcs/class/corlib/System.IO/StringReader.cs130
-rw-r--r--mcs/class/corlib/System.IO/StringWriter.cs79
-rw-r--r--mcs/class/corlib/System.IO/TextReader.cs84
-rw-r--r--mcs/class/corlib/System.IO/TextWriter.cs271
-rw-r--r--mcs/class/corlib/System.PAL/IOperatingSystem.cs194
-rw-r--r--mcs/class/corlib/System.PAL/Platform.cs23
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs228
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs16
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ChangeLog128
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs143
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs45
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs195
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/EventBuilder.cs40
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/EventToken.cs69
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs105
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/FieldToken.cs69
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/FlowControl.cs63
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs494
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/Label.cs28
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/LocalBuilder.cs37
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs156
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/MethodToken.cs69
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs141
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/OpCode.cs125
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/OpCodeType.cs49
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/OpCodes.cs486
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/OperandType.cs87
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/PEFileKinds.cs8
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/PackingSize.cs41
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs86
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ParameterToken.cs69
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/PropertyBuilder.cs124
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/PropertyToken.cs69
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs56
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/SignatureToken.cs69
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/StackBehaviour.cs126
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/StringToken.cs69
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs415
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/TypeToken.cs69
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/UnmanagedMarshal.cs50
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/common.src23
-rwxr-xr-xmcs/class/corlib/System.Reflection/AmbiguousMatchException.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/Assembly.cs304
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyAlgorithmIdAttribute.cs39
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyCompanyAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyConfigurationAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyCopyrightAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyCultureAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyDefaultAliasAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyDelaySignAttribute.cs32
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyDescriptionAttribute.cs30
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyFileVersionAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyFlagsAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyInformationalVersionAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyKeyFileAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyKeyNameAttribute.cs29
-rwxr-xr-xmcs/class/corlib/System.Reflection/AssemblyName.cs89
-rwxr-xr-xmcs/class/corlib/System.Reflection/AssemblyNameFlags.cs33
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyNameProxy.cs27
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyProductAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyTitleAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyTradeMarkAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyVersionAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/Binder.cs12
-rw-r--r--mcs/class/corlib/System.Reflection/BindingFlags.cs82
-rwxr-xr-xmcs/class/corlib/System.Reflection/CallingConventions.cs42
-rw-r--r--mcs/class/corlib/System.Reflection/ChangeLog164
-rw-r--r--mcs/class/corlib/System.Reflection/ConstructorInfo.cs37
-rw-r--r--mcs/class/corlib/System.Reflection/CustomAttributeFormatException.cs38
-rw-r--r--mcs/class/corlib/System.Reflection/DefaultMemberAttribute.cs26
-rwxr-xr-xmcs/class/corlib/System.Reflection/EventAttributes.cs37
-rwxr-xr-xmcs/class/corlib/System.Reflection/EventInfo.cs46
-rwxr-xr-xmcs/class/corlib/System.Reflection/FieldAttributes.cs101
-rwxr-xr-xmcs/class/corlib/System.Reflection/FieldInfo.cs57
-rwxr-xr-xmcs/class/corlib/System.Reflection/ICustomAttributeProvider.cs25
-rwxr-xr-xmcs/class/corlib/System.Reflection/IReflect.cs44
-rwxr-xr-xmcs/class/corlib/System.Reflection/InterfaceMapping.cs10
-rw-r--r--mcs/class/corlib/System.Reflection/InvalidFilterCriteriaException.cs37
-rw-r--r--mcs/class/corlib/System.Reflection/ManifestResourceInfo.cs12
-rw-r--r--mcs/class/corlib/System.Reflection/MemberFilter.cs7
-rwxr-xr-xmcs/class/corlib/System.Reflection/MemberInfo.cs38
-rwxr-xr-xmcs/class/corlib/System.Reflection/MemberTypes.cs57
-rwxr-xr-xmcs/class/corlib/System.Reflection/MethodAttributes.cs113
-rw-r--r--mcs/class/corlib/System.Reflection/MethodBase.cs126
-rwxr-xr-xmcs/class/corlib/System.Reflection/MethodImplAttributes.cs81
-rw-r--r--mcs/class/corlib/System.Reflection/MethodInfo.cs25
-rw-r--r--mcs/class/corlib/System.Reflection/Missing.cs15
-rw-r--r--mcs/class/corlib/System.Reflection/Module.cs100
-rwxr-xr-xmcs/class/corlib/System.Reflection/MonoField.cs94
-rwxr-xr-xmcs/class/corlib/System.Reflection/MonoMethod.cs200
-rwxr-xr-xmcs/class/corlib/System.Reflection/MonoProperty.cs149
-rwxr-xr-xmcs/class/corlib/System.Reflection/ParameterAttributes.cs66
-rw-r--r--mcs/class/corlib/System.Reflection/ParameterInfo.cs77
-rwxr-xr-xmcs/class/corlib/System.Reflection/ParameterModifier.cs26
-rwxr-xr-xmcs/class/corlib/System.Reflection/PropertyAttributes.cs54
-rwxr-xr-xmcs/class/corlib/System.Reflection/PropertyInfo.cs54
-rw-r--r--mcs/class/corlib/System.Reflection/ReflectionTypeLoadException.cs62
-rwxr-xr-xmcs/class/corlib/System.Reflection/ResourceAttributes.cs30
-rwxr-xr-xmcs/class/corlib/System.Reflection/ResourceLocation.cs34
-rwxr-xr-xmcs/class/corlib/System.Reflection/StrongNameKeyPair.cs39
-rw-r--r--mcs/class/corlib/System.Reflection/TargetException.cs37
-rw-r--r--mcs/class/corlib/System.Reflection/TargetInvocationException.cs12
-rw-r--r--mcs/class/corlib/System.Reflection/TargetParameterCountException.cs38
-rwxr-xr-xmcs/class/corlib/System.Reflection/TypeAttributes.cs138
-rwxr-xr-xmcs/class/corlib/System.Reflection/TypeDelegator.cs203
-rw-r--r--mcs/class/corlib/System.Reflection/TypeFilter.cs13
-rw-r--r--mcs/class/corlib/System.Reflection/common.src25
-rw-r--r--mcs/class/corlib/System.Resources/ChangeLog123
-rw-r--r--mcs/class/corlib/System.Resources/IResourceReader.cs20
-rw-r--r--mcs/class/corlib/System.Resources/IResourceWriter.cs25
-rw-r--r--mcs/class/corlib/System.Resources/MissingManifestResourceException.cs41
-rw-r--r--mcs/class/corlib/System.Resources/NeutralResoucesLanguageAttribute.cs28
-rw-r--r--mcs/class/corlib/System.Resources/ResourceManager.cs163
-rw-r--r--mcs/class/corlib/System.Resources/ResourceReader.cs265
-rw-r--r--mcs/class/corlib/System.Resources/ResourceSet.cs127
-rw-r--r--mcs/class/corlib/System.Resources/ResourceWriter.cs64
-rw-r--r--mcs/class/corlib/System.Resources/SatelliteContractVersionAttribute.cs27
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog12
-rwxr-xr-xmcs/class/corlib/System.Runtime.CompilerServices/IndexerNameAttribute.cs18
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/MethodCodeType.cs23
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/MethodImplAttribute.cs40
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/MethodImplOptions.cs41
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs23
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/AssemblyRegistrationFlags.cs18
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/CallingConvention.cs41
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/ChangeLog71
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/CharSet.cs33
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs17
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs33
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ExternalException.cs50
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs17
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs91
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/GCHandleType.cs38
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs25
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ICustomAdapter.cs15
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ICustomFactory.cs15
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ICustomMarshaler.cs19
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/IRegistrationServices.cs25
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs18
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs20
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ImporterEventKind.cs17
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs18
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/LayoutKind.cs33
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs21
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs27
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs10
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs26
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/PInvokeMap.cs78
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs23
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/TypeLibExporterFlags.cs16
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs168
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs50
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/ActivatorLevel.cs19
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/IActivator.cs24
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionCallMessage.cs36
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs17
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs72
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/ContextAttribute.cs95
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextAttribute.cs20
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextProperty.cs23
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs20
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicProperty.cs19
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs21
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/Header.cs57
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessage.cs20
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodMessage.cs55
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs22
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs39
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/ChangeLog8
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/LeaseState.cs41
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs71
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting/ObjectHandle.cs42
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/SoapMethodOption.cs37
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/SoapOption.cs30
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/WellKnownObjectMode.cs29
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs45
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization.Formatters/ChangeLog5
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs29
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs29
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs33
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization.Formatters/IFieldInfo.cs30
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization.Formatters/ISoapMessage.cs60
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs41
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalElementTypeE.cs33
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs37
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberValueE.cs41
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs61
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs37
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs33
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseStateE.cs37
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseTypeE.cs73
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs89
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs29
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/ChangeLog73
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/IDeserializationCallback.cs14
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/IFormatter.cs66
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/IFormatterConverter.cs33
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/IObjectReference.cs16
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/ISerializable.cs15
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/ISerializationSurrogate.cs43
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/ISurrogateSelector.cs40
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SerializationBinder.cs22
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SerializationEntry.cs40
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization/SerializationException.cs33
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SerializationInfo.cs262
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SerializationInfoEnumerator.cs62
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/StreamingContext.cs57
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/StreamingContextStates.cs53
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SurrogateSelector.cs92
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricAlgorithm.cs108
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs45
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs50
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureDeformatter.cs52
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureFormatter.cs52
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/ChangeLog90
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/CipherMode.cs24
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CryptoAPITransform.cs77
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CryptoStream.cs120
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/CryptoStreamMode.cs20
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CryptographicException.cs39
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs34
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CspParameters.cs57
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CspProviderFlags.cs19
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/DES.cs587
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs250
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DSA.cs100
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs87
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DSAParameters.cs37
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DSASignatureDeformatter.cs51
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DSASignatureFormatter.cs52
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DeriveBytes.cs27
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/FromBase64Transform.cs264
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/HashAlgorithm.cs157
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/ICryptoTransform.cs49
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/KeySizes.cs61
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/MD5.cs44
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/MD5CryptoServiceProvider.cs482
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/PaddingMode.cs22
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs52
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RSA.cs36
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RSAParameters.cs35
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs36
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/Rijndael.cs25
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs744
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA1.cs44
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs455
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA256.cs45
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA256Managed.cs290
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA384.cs45
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs33
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA512.cs45
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs33
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/SignatureDescription.cs107
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs256
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/ToBase64Transform.cs234
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/X509Certificates.cs8
-rw-r--r--mcs/class/corlib/System.Security.Permissions/ChangeLog62
-rw-r--r--mcs/class/corlib/System.Security.Permissions/CodeAccessSecurityAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAccess.cs38
-rw-r--r--mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs53
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAccess.cs21
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAttribute.cs47
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs411
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileIOPermissionAccess.cs46
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileIOPermissionAttribute.cs68
-rw-r--r--mcs/class/corlib/System.Security.Permissions/IUnrestrictedPermission.cs15
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/IsolatedStorageContainment.cs41
-rw-r--r--mcs/class/corlib/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs34
-rw-r--r--mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs48
-rw-r--r--mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermissionAttribute.cs44
-rw-r--r--mcs/class/corlib/System.Security.Permissions/PermissionSetAttribute.cs69
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/PermissionState.cs29
-rw-r--r--mcs/class/corlib/System.Security.Permissions/PrincipalPermissionAttribute.cs60
-rw-r--r--mcs/class/corlib/System.Security.Permissions/PrinciplePermissionAttribute.cs60
-rw-r--r--mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs61
-rw-r--r--mcs/class/corlib/System.Security.Permissions/ReflectionPermissionFlag.cs38
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/RegistryPermissionAccess.cs41
-rw-r--r--mcs/class/corlib/System.Security.Permissions/RegistryPermissionAttribute.cs60
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/SecurityAction.cs57
-rw-r--r--mcs/class/corlib/System.Security.Permissions/SecurityAttribute.cs58
-rw-r--r--mcs/class/corlib/System.Security.Permissions/SecurityPermission.cs65
-rw-r--r--mcs/class/corlib/System.Security.Permissions/SecurityPermissionAttribute.cs216
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs68
-rw-r--r--mcs/class/corlib/System.Security.Permissions/SiteIdentityPermissionAttribute.cs40
-rw-r--r--mcs/class/corlib/System.Security.Permissions/StrongNamePermissionAttribute.cs56
-rw-r--r--mcs/class/corlib/System.Security.Permissions/UIPermissionAttribute.cs48
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/UIPermissionClipboard.cs33
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/UIPermissionWindow.cs37
-rw-r--r--mcs/class/corlib/System.Security.Permissions/UrlIdentityPermissionAttribute.cs40
-rw-r--r--mcs/class/corlib/System.Security.Permissions/ZoneIdentityPermissionAttribute.cs40
-rwxr-xr-xmcs/class/corlib/System.Security.Policy/AllMembershipCondition.cs86
-rw-r--r--mcs/class/corlib/System.Security.Policy/ChangeLog56
-rw-r--r--mcs/class/corlib/System.Security.Policy/CodeGroup.cs252
-rw-r--r--mcs/class/corlib/System.Security.Policy/Evidence.cs26
-rw-r--r--mcs/class/corlib/System.Security.Policy/FileCodeGroup.cs135
-rw-r--r--mcs/class/corlib/System.Security.Policy/IIdentityPermissionFactory.cs13
-rw-r--r--mcs/class/corlib/System.Security.Policy/IMembershipCondition.cs17
-rw-r--r--mcs/class/corlib/System.Security.Policy/PolicyException.cs42
-rw-r--r--mcs/class/corlib/System.Security.Policy/PolicyLevel.cs60
-rw-r--r--mcs/class/corlib/System.Security.Policy/PolicyStatement.cs60
-rw-r--r--mcs/class/corlib/System.Security.Policy/PolicyStatementAttribute.cs17
-rw-r--r--mcs/class/corlib/System.Security.Principal/ChangeLog3
-rw-r--r--mcs/class/corlib/System.Security.Principal/GenericIdentity.cs45
-rw-r--r--mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs37
-rw-r--r--mcs/class/corlib/System.Security.Principal/IIdentity.cs26
-rw-r--r--mcs/class/corlib/System.Security.Principal/IPrincipal.cs20
-rw-r--r--mcs/class/corlib/System.Security.Principal/PrincipalPolicy.cs17
-rw-r--r--mcs/class/corlib/System.Security.Principal/WindowsAccountType.cs18
-rw-r--r--mcs/class/corlib/System.Security.Principal/WindowsBuiltInRole.cs23
-rwxr-xr-xmcs/class/corlib/System.Security/ChangeLog42
-rwxr-xr-xmcs/class/corlib/System.Security/CodeAccessPermission.cs84
-rw-r--r--mcs/class/corlib/System.Security/IEvidenceFactory.cs12
-rwxr-xr-xmcs/class/corlib/System.Security/IPermission.cs24
-rwxr-xr-xmcs/class/corlib/System.Security/ISecurityEncodable.cs18
-rw-r--r--mcs/class/corlib/System.Security/ISecurityPolicyEncodable.cs20
-rwxr-xr-xmcs/class/corlib/System.Security/IStackWalk.cs22
-rw-r--r--mcs/class/corlib/System.Security/NamedPermissionSet.cs65
-rw-r--r--mcs/class/corlib/System.Security/PermissionSet.cs201
-rw-r--r--mcs/class/corlib/System.Security/PolicyLevelType.cs18
-rwxr-xr-xmcs/class/corlib/System.Security/SecurityElement.cs205
-rw-r--r--mcs/class/corlib/System.Security/SecurityException.cs78
-rw-r--r--mcs/class/corlib/System.Security/SecurityManager.cs86
-rw-r--r--mcs/class/corlib/System.Security/SecurityZone.cs20
-rw-r--r--mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs13
-rw-r--r--mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs13
-rw-r--r--mcs/class/corlib/System.Security/VerificationException.cs25
-rw-r--r--mcs/class/corlib/System.Security/XmlSyntaxException.cs26
-rwxr-xr-xmcs/class/corlib/System.Text/ASCIIEncoding.cs41
-rwxr-xr-xmcs/class/corlib/System.Text/ChangeLog78
-rw-r--r--mcs/class/corlib/System.Text/Decoder.cs70
-rw-r--r--mcs/class/corlib/System.Text/Encoder.cs80
-rwxr-xr-xmcs/class/corlib/System.Text/Encoding.cs383
-rw-r--r--mcs/class/corlib/System.Text/StringBuilder.cs616
-rwxr-xr-xmcs/class/corlib/System.Text/UTF7Encoding.cs42
-rwxr-xr-xmcs/class/corlib/System.Text/UTF8Encoding.cs37
-rwxr-xr-xmcs/class/corlib/System.Text/UnicodeEncoding.cs54
-rwxr-xr-xmcs/class/corlib/System.Threading/ApartmentState.cs18
-rwxr-xr-xmcs/class/corlib/System.Threading/AutoResetEvent.cs35
-rw-r--r--mcs/class/corlib/System.Threading/ChangeLog120
-rwxr-xr-xmcs/class/corlib/System.Threading/IOCompletionCallback.cs16
-rwxr-xr-xmcs/class/corlib/System.Threading/Interlocked.cs103
-rwxr-xr-xmcs/class/corlib/System.Threading/LockCookie.cs16
-rwxr-xr-xmcs/class/corlib/System.Threading/ManualResetEvent.cs35
-rwxr-xr-xmcs/class/corlib/System.Threading/Monitor.cs217
-rwxr-xr-xmcs/class/corlib/System.Threading/Mutex.cs49
-rwxr-xr-xmcs/class/corlib/System.Threading/NativeEventCalls.cs28
-rwxr-xr-xmcs/class/corlib/System.Threading/NativeOverlapped.cs27
-rwxr-xr-xmcs/class/corlib/System.Threading/Overlapped.cs92
-rwxr-xr-xmcs/class/corlib/System.Threading/ReaderWriterLock.cs109
-rwxr-xr-xmcs/class/corlib/System.Threading/RegisteredWaitHandle.cs26
-rwxr-xr-xmcs/class/corlib/System.Threading/SynchronizationLockException.cs32
-rwxr-xr-xmcs/class/corlib/System.Threading/Thread.cs411
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadAbortException.cs23
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadInterruptedException.cs32
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadPool.cs109
-rw-r--r--mcs/class/corlib/System.Threading/ThreadPriority.cs41
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadStart.cs14
-rw-r--r--mcs/class/corlib/System.Threading/ThreadState.cs55
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadStateException.cs32
-rwxr-xr-xmcs/class/corlib/System.Threading/Timeout.cs17
-rwxr-xr-xmcs/class/corlib/System.Threading/Timer.cs112
-rwxr-xr-xmcs/class/corlib/System.Threading/TimerCallback.cs14
-rwxr-xr-xmcs/class/corlib/System.Threading/WaitCallback.cs14
-rwxr-xr-xmcs/class/corlib/System.Threading/WaitHandle.cs204
-rwxr-xr-xmcs/class/corlib/System.Threading/WaitOrTimerCallback.cs14
-rwxr-xr-xmcs/class/corlib/System/AppDomain.cs457
-rwxr-xr-xmcs/class/corlib/System/AppDomainSetup.cs160
-rw-r--r--mcs/class/corlib/System/AppDomainUnloadedException.cs42
-rw-r--r--mcs/class/corlib/System/ApplicationException.cs42
-rw-r--r--mcs/class/corlib/System/ArgumentException.cs64
-rw-r--r--mcs/class/corlib/System/ArgumentNullException.cs37
-rw-r--r--mcs/class/corlib/System/ArgumentOutOfRangeException.cs62
-rw-r--r--mcs/class/corlib/System/ArithmeticException.cs38
-rw-r--r--mcs/class/corlib/System/Array.cs547
-rw-r--r--mcs/class/corlib/System/ArrayTypeMismatchException.cs38
-rwxr-xr-xmcs/class/corlib/System/AssemblyLoadEventArgs.cs34
-rwxr-xr-xmcs/class/corlib/System/AssemblyLoadEventHandler.cs10
-rw-r--r--mcs/class/corlib/System/AsyncCallback.cs13
-rw-r--r--mcs/class/corlib/System/Attribute.cs376
-rw-r--r--mcs/class/corlib/System/AttributeTargets.cs82
-rw-r--r--mcs/class/corlib/System/AttributeUsage.cs49
-rw-r--r--mcs/class/corlib/System/BadImageFormatException.cs93
-rwxr-xr-xmcs/class/corlib/System/BitConverter.cs223
-rw-r--r--mcs/class/corlib/System/Boolean.cs265
-rwxr-xr-xmcs/class/corlib/System/Buffer.cs33
-rw-r--r--mcs/class/corlib/System/Byte.cs250
-rwxr-xr-xmcs/class/corlib/System/CLSCompliantAttribute.cs34
-rw-r--r--mcs/class/corlib/System/CannotUnloadAppDomainException.cs41
-rw-r--r--mcs/class/corlib/System/ChangeLog1297
-rw-r--r--mcs/class/corlib/System/Char.cs402
-rw-r--r--mcs/class/corlib/System/CharEnumerator.cs76
-rw-r--r--mcs/class/corlib/System/Console.cs318
-rw-r--r--mcs/class/corlib/System/ContextBoundObject.cs24
-rw-r--r--mcs/class/corlib/System/ContextMarshalException.cs42
-rwxr-xr-xmcs/class/corlib/System/ContextStaticAttribute.cs28
-rw-r--r--mcs/class/corlib/System/Convert.cs2192
-rwxr-xr-xmcs/class/corlib/System/CrossAppDomainDelegate.cs10
-rw-r--r--mcs/class/corlib/System/DBNull.cs133
-rw-r--r--mcs/class/corlib/System/DateTime.cs1461
-rw-r--r--mcs/class/corlib/System/Decimal.cs1026
-rw-r--r--mcs/class/corlib/System/DecimalFormatter.cs383
-rw-r--r--mcs/class/corlib/System/Delegate.cs126
-rw-r--r--mcs/class/corlib/System/DivideByZeroException.cs30
-rw-r--r--mcs/class/corlib/System/DllNotFoundException.cs42
-rw-r--r--mcs/class/corlib/System/Double.cs259
-rw-r--r--mcs/class/corlib/System/DuplicateWaitObjectException.cs38
-rw-r--r--mcs/class/corlib/System/EntryPointNotFoundException.cs42
-rw-r--r--mcs/class/corlib/System/Enum.cs196
-rw-r--r--mcs/class/corlib/System/Environment.cs293
-rw-r--r--mcs/class/corlib/System/EventArgs.cs25
-rw-r--r--mcs/class/corlib/System/EventHandler.cs16
-rw-r--r--mcs/class/corlib/System/Exception.cs159
-rw-r--r--mcs/class/corlib/System/ExecutionEngineException.cs30
-rw-r--r--mcs/class/corlib/System/FieldAccessException.cs41
-rwxr-xr-xmcs/class/corlib/System/FlagsAttribute.cs28
-rw-r--r--mcs/class/corlib/System/FormatException.cs38
-rwxr-xr-xmcs/class/corlib/System/GC.cs23
-rwxr-xr-xmcs/class/corlib/System/Guid.cs627
-rw-r--r--mcs/class/corlib/System/IAppDomainSetup.cs37
-rw-r--r--mcs/class/corlib/System/IAsyncResult.cs42
-rw-r--r--mcs/class/corlib/System/ICloneable.cs15
-rw-r--r--mcs/class/corlib/System/IComparable.cs15
-rw-r--r--mcs/class/corlib/System/IConvertible.cs55
-rw-r--r--mcs/class/corlib/System/ICustomFormatter.cs15
-rw-r--r--mcs/class/corlib/System/IDisposable.cs17
-rw-r--r--mcs/class/corlib/System/IFormatProvider.cs15
-rw-r--r--mcs/class/corlib/System/IFormattable.cs15
-rw-r--r--mcs/class/corlib/System/IServiceProvider.cs17
-rw-r--r--mcs/class/corlib/System/IndexOutOfRangeException.cs30
-rw-r--r--mcs/class/corlib/System/Int16.cs157
-rw-r--r--mcs/class/corlib/System/Int32.cs223
-rw-r--r--mcs/class/corlib/System/Int64.cs159
-rw-r--r--mcs/class/corlib/System/IntPtr.cs161
-rw-r--r--mcs/class/corlib/System/IntegerFormatter.cs3432
-rw-r--r--mcs/class/corlib/System/InvalidCastException.cs38
-rw-r--r--mcs/class/corlib/System/InvalidOperationException.cs38
-rw-r--r--mcs/class/corlib/System/InvalidProgramException.cs30
-rw-r--r--mcs/class/corlib/System/LoaderOptimization.cs18
-rw-r--r--mcs/class/corlib/System/LoaderOptimizationAttribute.cs34
-rwxr-xr-xmcs/class/corlib/System/LocalDataStoreSlot.cs18
-rw-r--r--mcs/class/corlib/System/MTAThreadAttribute.cs19
-rw-r--r--mcs/class/corlib/System/MarshalByRefObject.cs39
-rw-r--r--mcs/class/corlib/System/Math.cs344
-rw-r--r--mcs/class/corlib/System/MemberAccessException.cs29
-rw-r--r--mcs/class/corlib/System/MethodAccessException.cs42
-rw-r--r--mcs/class/corlib/System/MissingFieldException.cs45
-rw-r--r--mcs/class/corlib/System/MissingMemberException.cs73
-rw-r--r--mcs/class/corlib/System/MissingMethodException.cs32
-rwxr-xr-xmcs/class/corlib/System/MonoCustomAttrs.cs58
-rw-r--r--mcs/class/corlib/System/MonoDummy.cs20
-rw-r--r--mcs/class/corlib/System/MonoType.cs268
-rw-r--r--mcs/class/corlib/System/MulticastDelegate.cs109
-rw-r--r--mcs/class/corlib/System/MulticastNotSupportedException.cs30
-rwxr-xr-xmcs/class/corlib/System/NonSerializedAttribute.cs18
-rw-r--r--mcs/class/corlib/System/NotFiniteNumberException.cs66
-rwxr-xr-xmcs/class/corlib/System/NotImplementedException.cs38
-rw-r--r--mcs/class/corlib/System/NotSupportedException.cs38
-rw-r--r--mcs/class/corlib/System/NullReferenceException.cs38
-rw-r--r--mcs/class/corlib/System/Object.cs105
-rwxr-xr-xmcs/class/corlib/System/ObjectDisposedException.cs60
-rw-r--r--mcs/class/corlib/System/ObsoleteAttribute.cs38
-rw-r--r--mcs/class/corlib/System/OperatingSystem.cs105
-rw-r--r--mcs/class/corlib/System/OutOfMemoryException.cs38
-rw-r--r--mcs/class/corlib/System/OverflowException.cs38
-rw-r--r--mcs/class/corlib/System/ParamArrayAttribute.cs23
-rw-r--r--mcs/class/corlib/System/PlatformID.cs37
-rw-r--r--mcs/class/corlib/System/PlatformNotSupportedException.cs41
-rw-r--r--mcs/class/corlib/System/Random.cs82
-rw-r--r--mcs/class/corlib/System/RankException.cs39
-rw-r--r--mcs/class/corlib/System/ResolveEventArgs.cs29
-rw-r--r--mcs/class/corlib/System/ResolveEventHandler.cs10
-rw-r--r--mcs/class/corlib/System/RuntimeArgumentHandle.cs16
-rwxr-xr-xmcs/class/corlib/System/RuntimeFieldHandle.cs44
-rwxr-xr-xmcs/class/corlib/System/RuntimeMethodHandle.cs32
-rw-r--r--mcs/class/corlib/System/RuntimeTypeHandle.cs30
-rw-r--r--mcs/class/corlib/System/SByte.cs160
-rw-r--r--mcs/class/corlib/System/STAThreadAttribute.cs19
-rwxr-xr-xmcs/class/corlib/System/SerializableAttribute.cs38
-rw-r--r--mcs/class/corlib/System/Single.cs121
-rw-r--r--mcs/class/corlib/System/StackOverflowException.cs38
-rw-r--r--mcs/class/corlib/System/String.cs1801
-rw-r--r--mcs/class/corlib/System/SystemException.cs38
-rw-r--r--mcs/class/corlib/System/TODO22
-rw-r--r--mcs/class/corlib/System/TODOAttribute.cs37
-rw-r--r--mcs/class/corlib/System/ThreadStaticAttribute.cs19
-rw-r--r--mcs/class/corlib/System/TimeSpan.cs556
-rw-r--r--mcs/class/corlib/System/TimeZone.cs193
-rw-r--r--mcs/class/corlib/System/Type.cs720
-rw-r--r--mcs/class/corlib/System/TypeCode.cs93
-rw-r--r--mcs/class/corlib/System/TypeInitializationException.cs39
-rw-r--r--mcs/class/corlib/System/TypeLoadException.cs73
-rw-r--r--mcs/class/corlib/System/TypeUnloadedException.cs43
-rw-r--r--mcs/class/corlib/System/UInt16.cs146
-rw-r--r--mcs/class/corlib/System/UInt32.cs152
-rw-r--r--mcs/class/corlib/System/UInt64.cs168
-rw-r--r--mcs/class/corlib/System/UIntPtr.cs179
-rwxr-xr-xmcs/class/corlib/System/UnauthorizedAccessException.cs38
-rwxr-xr-xmcs/class/corlib/System/UnhandledExceptionEventArgs.cs42
-rwxr-xr-xmcs/class/corlib/System/UnhandledExceptionEventHandler.cs10
-rw-r--r--mcs/class/corlib/System/ValueType.cs67
-rw-r--r--mcs/class/corlib/System/Version.cs198
-rw-r--r--mcs/class/corlib/System/Void.cs14
-rwxr-xr-xmcs/class/corlib/System/WeakReference.cs119
-rwxr-xr-xmcs/class/corlib/System/_AppDomain.cs161
-rw-r--r--mcs/class/corlib/Test/.cvsignore2
-rw-r--r--mcs/class/corlib/Test/AllTests.cs37
-rw-r--r--mcs/class/corlib/Test/ChangeLog99
-rwxr-xr-xmcs/class/corlib/Test/MartinTests.cs30
-rwxr-xr-xmcs/class/corlib/Test/RunTests.cs93
-rw-r--r--mcs/class/corlib/Test/System.Collections/AllTests.cs37
-rw-r--r--mcs/class/corlib/Test/System.Collections/ArrayListTest.cs1376
-rw-r--r--mcs/class/corlib/Test/System.Collections/BitArrayTest.cs300
-rw-r--r--mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs50
-rw-r--r--mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs57
-rw-r--r--mcs/class/corlib/Test/System.Collections/ChangeLog18
-rw-r--r--mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs236
-rw-r--r--mcs/class/corlib/Test/System.Collections/ComparerTest.cs60
-rw-r--r--mcs/class/corlib/Test/System.Collections/HashtableTest.cs761
-rw-r--r--mcs/class/corlib/Test/System.Collections/QueueTest.cs179
-rw-r--r--mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs49
-rw-r--r--mcs/class/corlib/Test/System.Collections/StackTest.cs270
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/AllTests.cs31
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/ChangeLog4
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs89
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs350
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs98
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs83
-rw-r--r--mcs/class/corlib/Test/System.IO/AllTests.cs34
-rw-r--r--mcs/class/corlib/Test/System.IO/ChangeLog11
-rw-r--r--mcs/class/corlib/Test/System.IO/FileTest.cs72
-rw-r--r--mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs154
-rw-r--r--mcs/class/corlib/Test/System.IO/PathTest.cs149
-rw-r--r--mcs/class/corlib/Test/System.IO/StreamReaderTest.cs488
-rw-r--r--mcs/class/corlib/Test/System.IO/StreamWriterTest.cs319
-rw-r--r--mcs/class/corlib/Test/System.IO/StringReaderTest.cs93
-rw-r--r--mcs/class/corlib/Test/System.IO/StringWriterTest.cs56
-rw-r--r--mcs/class/corlib/Test/System.Resources/AllTests.cs27
-rw-r--r--mcs/class/corlib/Test/System.Resources/ChangeLog17
-rw-r--r--mcs/class/corlib/Test/System.Resources/Empty.resources0
-rw-r--r--mcs/class/corlib/Test/System.Resources/MyResources.resourcesbin412 -> 0 bytes
-rw-r--r--mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs144
-rw-r--r--mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs30
-rwxr-xr-xmcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs54
-rw-r--r--mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs55
-rwxr-xr-xmcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs65
-rw-r--r--mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs27
-rw-r--r--mcs/class/corlib/Test/System.Security.Permissions/ChangeLog11
-rw-r--r--mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs284
-rw-r--r--mcs/class/corlib/Test/System.Security.Policy/AllTests.cs27
-rw-r--r--mcs/class/corlib/Test/System.Security.Policy/ChangeLog15
-rw-r--r--mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs248
-rw-r--r--mcs/class/corlib/Test/System.Text/AllTests.cs29
-rw-r--r--mcs/class/corlib/Test/System.Text/ChangeLog8
-rw-r--r--mcs/class/corlib/Test/System.Text/StringBuilderTest.cs238
-rw-r--r--mcs/class/corlib/Test/System/AllTests.cs51
-rw-r--r--mcs/class/corlib/Test/System/ArrayTest.cs1447
-rwxr-xr-xmcs/class/corlib/Test/System/BitConverterTest.cs84
-rw-r--r--mcs/class/corlib/Test/System/BooleanTest.cs113
-rw-r--r--mcs/class/corlib/Test/System/ByteTest.cs180
-rw-r--r--mcs/class/corlib/Test/System/ChangeLog110
-rw-r--r--mcs/class/corlib/Test/System/CharTest.cs500
-rw-r--r--mcs/class/corlib/Test/System/ConsoleTest.cs286
-rwxr-xr-xmcs/class/corlib/Test/System/DateTimeTest.cs327
-rw-r--r--mcs/class/corlib/Test/System/DecimalTest.cs856
-rw-r--r--mcs/class/corlib/Test/System/DecimalTest2.cs3125
-rw-r--r--mcs/class/corlib/Test/System/DoubleTest.cs125
-rw-r--r--mcs/class/corlib/Test/System/EnumTest.cs711
-rwxr-xr-xmcs/class/corlib/Test/System/GuidTest.cs237
-rw-r--r--mcs/class/corlib/Test/System/Int16Test.cs177
-rw-r--r--mcs/class/corlib/Test/System/Int32Test.cs216
-rw-r--r--mcs/class/corlib/Test/System/Int64Test.cs330
-rw-r--r--mcs/class/corlib/Test/System/IntegerFormatterTest.cs385
-rwxr-xr-xmcs/class/corlib/Test/System/MartinTests.cs48
-rw-r--r--mcs/class/corlib/Test/System/ObjectTest.cs121
-rw-r--r--mcs/class/corlib/Test/System/RandomTest.cs79
-rw-r--r--mcs/class/corlib/Test/System/ResolveEventArgsTest.cs30
-rw-r--r--mcs/class/corlib/Test/System/SByteTest.cs180
-rw-r--r--mcs/class/corlib/Test/System/StringTest.cs987
-rwxr-xr-xmcs/class/corlib/Test/System/TimeSpanTest.cs265
-rw-r--r--mcs/class/corlib/Test/System/TimeZoneTest.cs71
-rw-r--r--mcs/class/corlib/Test/System/UInt16Test.cs179
-rw-r--r--mcs/class/corlib/Test/System/UInt32Test.cs200
-rw-r--r--mcs/class/corlib/Test/System/UInt64Test.cs188
-rwxr-xr-xmcs/class/corlib/Test/TheTests.cs130
-rw-r--r--mcs/class/corlib/Test/corlib_test.build58
-rwxr-xr-xmcs/class/corlib/Test/scan-tests.pl75
-rwxr-xr-xmcs/class/corlib/Unix/Errno.cs139
-rw-r--r--mcs/class/corlib/Unix/Wrapper.cs247
-rw-r--r--mcs/class/corlib/Unix/common.src1
-rw-r--r--mcs/class/corlib/Unix/mono.src0
-rw-r--r--mcs/class/corlib/Unix/windows.src0
-rw-r--r--mcs/class/corlib/Windows/Windows.cs694
-rw-r--r--mcs/class/corlib/corlib.build148
-rw-r--r--mcs/class/library.build45
-rw-r--r--mcs/class/makefile19
-rw-r--r--mcs/class/notes/BitVecto32.txt6
-rwxr-xr-xmcs/docs/clr-abi.txt3
-rwxr-xr-xmcs/docs/order.txt3
-rw-r--r--mcs/doctools/ChangeLog7
-rw-r--r--mcs/doctools/MonoDocStub.DTD19
-rw-r--r--mcs/doctools/MonoDocToHtml.xsl109
-rw-r--r--mcs/doctools/docconv.cs77
-rw-r--r--mcs/doctools/docgen.cs127
-rw-r--r--mcs/doctools/docstub.cs634
-rw-r--r--mcs/doctools/doctools.build25
-rwxr-xr-xmcs/doctools/makefile10
-rw-r--r--mcs/doctools/src/shared/AssemblyLoadException.cs14
-rw-r--r--mcs/doctools/src/shared/AssemblyLoader.cs68
-rw-r--r--mcs/doctools/src/shared/NameGenerator.cs120
-rw-r--r--mcs/doctools/src/shared/NamingFlags.cs13
-rw-r--r--mcs/doctools/src/statusgen/StatusGenDriver.cs77
-rw-r--r--mcs/doctools/src/statusgen/StatusGenerator.cs268
-rwxr-xr-xmcs/errors/1529.cs4
-rwxr-xr-xmcs/errors/bug1.cs17
-rw-r--r--mcs/errors/bug10.cs30
-rwxr-xr-xmcs/errors/bug11.cs23
-rwxr-xr-xmcs/errors/bug12.cs19
-rwxr-xr-xmcs/errors/bug13.cs11
-rwxr-xr-xmcs/errors/bug14.cs15
-rwxr-xr-xmcs/errors/bug15.cs25
-rw-r--r--mcs/errors/bug16.cs24
-rwxr-xr-xmcs/errors/bug17.cs10
-rwxr-xr-xmcs/errors/bug18.cs16
-rwxr-xr-xmcs/errors/bug19.cs18
-rwxr-xr-xmcs/errors/bug2.cs29
-rwxr-xr-xmcs/errors/bug3.cs36
-rwxr-xr-xmcs/errors/bug4.cs18
-rwxr-xr-xmcs/errors/bug5.cs23
-rwxr-xr-xmcs/errors/bug6.cs14
-rwxr-xr-xmcs/errors/bug7.cs13
-rwxr-xr-xmcs/errors/bug8.cs20
-rwxr-xr-xmcs/errors/bug9.cs7
-rw-r--r--mcs/errors/cs-11.cs20
-rwxr-xr-xmcs/errors/cs-12.cs34
-rwxr-xr-xmcs/errors/cs0017.cs9
-rw-r--r--mcs/errors/cs0019.cs14
-rw-r--r--mcs/errors/cs0023.cs13
-rwxr-xr-xmcs/errors/cs0026-2.cs10
-rwxr-xr-xmcs/errors/cs0026.cs8
-rwxr-xr-xmcs/errors/cs0029.cs12
-rw-r--r--mcs/errors/cs0030.cs15
-rw-r--r--mcs/errors/cs0031.cs14
-rwxr-xr-xmcs/errors/cs0034.cs15
-rwxr-xr-xmcs/errors/cs0051.cs15
-rwxr-xr-xmcs/errors/cs0060.cs7
-rw-r--r--mcs/errors/cs0066.cs25
-rw-r--r--mcs/errors/cs0070.cs30
-rwxr-xr-xmcs/errors/cs0107.cs6
-rwxr-xr-xmcs/errors/cs0108.cs10
-rwxr-xr-xmcs/errors/cs0110.cs29
-rw-r--r--mcs/errors/cs0111.cs21
-rwxr-xr-xmcs/errors/cs0113.cs3
-rwxr-xr-xmcs/errors/cs0114.cs9
-rwxr-xr-xmcs/errors/cs0115.cs5
-rwxr-xr-xmcs/errors/cs0117.cs10
-rwxr-xr-xmcs/errors/cs0118.cs11
-rwxr-xr-xmcs/errors/cs0120.cs15
-rwxr-xr-xmcs/errors/cs0121.cs17
-rw-r--r--mcs/errors/cs0126.cs9
-rwxr-xr-xmcs/errors/cs0127.cs8
-rwxr-xr-xmcs/errors/cs0128.cs12
-rwxr-xr-xmcs/errors/cs0131.cs8
-rwxr-xr-xmcs/errors/cs0132.cs7
-rwxr-xr-xmcs/errors/cs0133.cs8
-rwxr-xr-xmcs/errors/cs0136-2.cs9
-rwxr-xr-xmcs/errors/cs0136.cs13
-rw-r--r--mcs/errors/cs0139.cs8
-rw-r--r--mcs/errors/cs0146.cs7
-rw-r--r--mcs/errors/cs0150.cs14
-rwxr-xr-xmcs/errors/cs0151.cs19
-rwxr-xr-xmcs/errors/cs0152.cs13
-rwxr-xr-xmcs/errors/cs0153.cs8
-rwxr-xr-xmcs/errors/cs0157.cs12
-rwxr-xr-xmcs/errors/cs0159-2.cs16
-rwxr-xr-xmcs/errors/cs0159.cs23
-rwxr-xr-xmcs/errors/cs0164.cs9
-rwxr-xr-xmcs/errors/cs0165-2.cs16
-rwxr-xr-xmcs/errors/cs0165.cs11
-rwxr-xr-xmcs/errors/cs0169.cs11
-rwxr-xr-xmcs/errors/cs0171.cs11
-rwxr-xr-xmcs/errors/cs0172.cs25
-rwxr-xr-xmcs/errors/cs0176.cs14
-rw-r--r--mcs/errors/cs0178.cs12
-rwxr-xr-xmcs/errors/cs0179.cs14
-rwxr-xr-xmcs/errors/cs0180.cs12
-rwxr-xr-xmcs/errors/cs0183.cs13
-rwxr-xr-xmcs/errors/cs0184.cs13
-rwxr-xr-xmcs/errors/cs0185.cs11
-rwxr-xr-xmcs/errors/cs0187.cs8
-rwxr-xr-xmcs/errors/cs0196.cs11
-rwxr-xr-xmcs/errors/cs0200.cs15
-rwxr-xr-xmcs/errors/cs0206.cs16
-rw-r--r--mcs/errors/cs0214.cs5
-rw-r--r--mcs/errors/cs0215.cs13
-rw-r--r--mcs/errors/cs0216.cs9
-rwxr-xr-xmcs/errors/cs0234.cs4
-rw-r--r--mcs/errors/cs0239.cs34
-rwxr-xr-xmcs/errors/cs0242.cs11
-rw-r--r--mcs/errors/cs0246.cs4
-rwxr-xr-xmcs/errors/cs0255.cs13
-rwxr-xr-xmcs/errors/cs0501.cs5
-rwxr-xr-xmcs/errors/cs0503.cs5
-rw-r--r--mcs/errors/cs0509.cs8
-rwxr-xr-xmcs/errors/cs0513.cs10
-rwxr-xr-xmcs/errors/cs0515.cs7
-rwxr-xr-xmcs/errors/cs0523.cs12
-rw-r--r--mcs/errors/cs0527-2.cs8
-rw-r--r--mcs/errors/cs0527.cs7
-rw-r--r--mcs/errors/cs0529.cs7
-rwxr-xr-xmcs/errors/cs0534.cs11
-rwxr-xr-xmcs/errors/cs0542.cs6
-rw-r--r--mcs/errors/cs0543.cs14
-rwxr-xr-xmcs/errors/cs0552.cs17
-rw-r--r--mcs/errors/cs0555.cs11
-rw-r--r--mcs/errors/cs0556.cs10
-rw-r--r--mcs/errors/cs0563.cs7
-rwxr-xr-xmcs/errors/cs0574.cs13
-rwxr-xr-xmcs/errors/cs0575.cs12
-rw-r--r--mcs/errors/cs0592.cs29
-rw-r--r--mcs/errors/cs0617.cs26
-rwxr-xr-xmcs/errors/cs0621.cs5
-rwxr-xr-xmcs/errors/cs0642.cs6
-rwxr-xr-xmcs/errors/cs0644.cs4
-rwxr-xr-xmcs/errors/cs0645.cs4
-rw-r--r--mcs/errors/cs0646.cs26
-rwxr-xr-xmcs/errors/cs0649.cs11
-rwxr-xr-xmcs/errors/cs0654.cs13
-rw-r--r--mcs/errors/cs0658.cs18
-rwxr-xr-xmcs/errors/cs0664.cs8
-rwxr-xr-xmcs/errors/cs0677.cs12
-rwxr-xr-xmcs/errors/cs1001.cs11
-rwxr-xr-xmcs/errors/cs1002.cs10
-rw-r--r--mcs/errors/cs1008.cs14
-rwxr-xr-xmcs/errors/cs1011.cs6
-rwxr-xr-xmcs/errors/cs1012.cs6
-rw-r--r--mcs/errors/cs1019.cs27
-rwxr-xr-xmcs/errors/cs102.cs7
-rw-r--r--mcs/errors/cs1020.cs28
-rwxr-xr-xmcs/errors/cs1501.cs15
-rwxr-xr-xmcs/errors/cs1510.cs13
-rwxr-xr-xmcs/errors/cs1511.cs14
-rwxr-xr-xmcs/errors/cs1513.cs3
-rwxr-xr-xmcs/errors/cs1518.cs6
-rwxr-xr-xmcs/errors/cs1520.cs12
-rwxr-xr-xmcs/errors/cs1523.cs14
-rwxr-xr-xmcs/errors/cs1524.cs15
-rwxr-xr-xmcs/errors/cs1525.cs8
-rwxr-xr-xmcs/errors/cs1526.cs8
-rwxr-xr-xmcs/errors/cs1527.cs4
-rwxr-xr-xmcs/errors/cs1528.cs14
-rwxr-xr-xmcs/errors/cs1529.cs4
-rwxr-xr-xmcs/errors/cs1530.cs7
-rwxr-xr-xmcs/errors/cs1552.cs11
-rwxr-xr-xmcs/errors/cs1579.cs13
-rw-r--r--mcs/errors/cs1593.cs30
-rw-r--r--mcs/errors/cs1594.cs30
-rwxr-xr-xmcs/errors/cs1604.cs14
-rwxr-xr-xmcs/errors/cs5001.cs8
-rwxr-xr-xmcs/errors/errors.txt47
-rwxr-xr-xmcs/errors/fail53
-rwxr-xr-xmcs/errors/makefile37
-rwxr-xr-xmcs/jay/.cvsignore2
-rw-r--r--mcs/jay/ACKNOWLEDGEMENTS25
-rwxr-xr-xmcs/jay/ChangeLog9
-rw-r--r--mcs/jay/NEW_FEATURES46
-rw-r--r--mcs/jay/NOTES9
-rw-r--r--mcs/jay/README10
-rw-r--r--mcs/jay/README.jay55
-rw-r--r--mcs/jay/closure.c295
-rw-r--r--mcs/jay/defs.h308
-rw-r--r--mcs/jay/depend11
-rw-r--r--mcs/jay/error.c335
-rw-r--r--mcs/jay/jay.1120
-rw-r--r--mcs/jay/lalr.c678
-rw-r--r--mcs/jay/lr0.c637
-rw-r--r--mcs/jay/main.c341
-rw-r--r--mcs/jay/makefile14
-rw-r--r--mcs/jay/mkpar.c395
-rw-r--r--mcs/jay/output.c1173
-rw-r--r--mcs/jay/reader.c1627
-rw-r--r--mcs/jay/skeleton268
-rw-r--r--mcs/jay/skeleton.cs352
-rw-r--r--mcs/jay/symtab.c158
-rw-r--r--mcs/jay/verbose.c366
-rw-r--r--mcs/jay/warshall.c122
-rwxr-xr-xmcs/makefile23
-rw-r--r--mcs/mcs/.cvsignore5
-rwxr-xr-xmcs/mcs/ChangeLog5391
-rw-r--r--mcs/mcs/TODO318
-rwxr-xr-xmcs/mcs/assign.cs272
-rw-r--r--mcs/mcs/attribute.cs642
-rwxr-xr-xmcs/mcs/class.cs3942
-rwxr-xr-xmcs/mcs/codegen.cs309
-rwxr-xr-xmcs/mcs/compiler.csproj233
-rwxr-xr-xmcs/mcs/compiler.csproj.user48
-rw-r--r--mcs/mcs/compiler.doc114
-rwxr-xr-xmcs/mcs/compiler.sln21
-rwxr-xr-xmcs/mcs/const.cs172
-rwxr-xr-xmcs/mcs/constant.cs504
-rwxr-xr-xmcs/mcs/cs-parser.jay3904
-rwxr-xr-xmcs/mcs/cs-tokenizer.cs1437
-rwxr-xr-xmcs/mcs/decl.cs302
-rw-r--r--mcs/mcs/delegate.cs694
-rwxr-xr-xmcs/mcs/driver.cs767
-rwxr-xr-xmcs/mcs/ecore.cs3536
-rwxr-xr-xmcs/mcs/enum.cs409
-rwxr-xr-xmcs/mcs/errors.cs0
-rwxr-xr-xmcs/mcs/expression.cs5908
-rwxr-xr-xmcs/mcs/gen-il.cs100
-rwxr-xr-xmcs/mcs/gen-treedump.cs988
-rwxr-xr-xmcs/mcs/generator.cs19
-rw-r--r--mcs/mcs/genericparser.cs85
-rwxr-xr-xmcs/mcs/interface.cs848
-rwxr-xr-xmcs/mcs/literal.cs191
-rw-r--r--mcs/mcs/location.cs109
-rwxr-xr-xmcs/mcs/makefile99
-rw-r--r--mcs/mcs/mb-parser.jay480
-rw-r--r--mcs/mcs/mb-tokenizer.cs824
-rw-r--r--mcs/mcs/mcs.exe.config11
-rwxr-xr-xmcs/mcs/modifiers.cs225
-rwxr-xr-xmcs/mcs/namespace.cs138
-rwxr-xr-xmcs/mcs/old-code.cs216
-rwxr-xr-xmcs/mcs/parameter.cs335
-rwxr-xr-xmcs/mcs/parameterCollection.cs166
-rwxr-xr-xmcs/mcs/parser.cs23
-rw-r--r--mcs/mcs/report.cs189
-rwxr-xr-xmcs/mcs/rootcontext.cs453
-rwxr-xr-xmcs/mcs/statement.cs2510
-rwxr-xr-xmcs/mcs/statementCollection.cs166
-rwxr-xr-xmcs/mcs/support.cs231
-rwxr-xr-xmcs/mcs/tree.cs139
-rwxr-xr-xmcs/mcs/type.cs104
-rwxr-xr-xmcs/mcs/typemanager.cs974
-rwxr-xr-xmcs/nant/.cvsignore2
-rwxr-xr-xmcs/nant/README-nant.txt62
-rwxr-xr-xmcs/nant/doc/arrow.gifbin58 -> 0 bytes
-rwxr-xr-xmcs/nant/doc/authors.html43
-rwxr-xr-xmcs/nant/doc/changelog.html121
-rwxr-xr-xmcs/nant/doc/index.html43
-rwxr-xr-xmcs/nant/doc/license.html48
-rwxr-xr-xmcs/nant/doc/style.css71
-rwxr-xr-xmcs/nant/doc/todo.html55
-rwxr-xr-xmcs/nant/makefile9
-rwxr-xr-xmcs/nant/readme.txt4
-rwxr-xr-xmcs/nant/src/AssemblyInfo.cs37
-rwxr-xr-xmcs/nant/src/AssemblyInfo.cs~38
-rwxr-xr-xmcs/nant/src/Attributes/BooleanValidatorAttribute.cs42
-rwxr-xr-xmcs/nant/src/Attributes/Int32ValidatorAttribute.cs63
-rwxr-xr-xmcs/nant/src/Attributes/TaskAttributeAttribute.cs78
-rwxr-xr-xmcs/nant/src/Attributes/TaskFileSetAttribute.cs40
-rwxr-xr-xmcs/nant/src/Attributes/TaskNameAttribute.cs45
-rwxr-xr-xmcs/nant/src/Attributes/ValidatorAttribute.cs28
-rwxr-xr-xmcs/nant/src/BuildException.cs85
-rwxr-xr-xmcs/nant/src/DirectoryScanner.cs226
-rwxr-xr-xmcs/nant/src/FileSet.cs132
-rwxr-xr-xmcs/nant/src/Location.cs89
-rwxr-xr-xmcs/nant/src/NAnt.cs107
-rwxr-xr-xmcs/nant/src/NAnt.exebin61440 -> 0 bytes
-rwxr-xr-xmcs/nant/src/Project.cs332
-rwxr-xr-xmcs/nant/src/PropertyDictionary.cs72
-rwxr-xr-xmcs/nant/src/Target.cs115
-rwxr-xr-xmcs/nant/src/TargetCollection.cs35
-rwxr-xr-xmcs/nant/src/Task.cs192
-rwxr-xr-xmcs/nant/src/TaskBuilder.cs84
-rwxr-xr-xmcs/nant/src/TaskBuilderCollection.cs46
-rwxr-xr-xmcs/nant/src/TaskCollection.cs26
-rwxr-xr-xmcs/nant/src/TaskFactory.cs57
-rwxr-xr-xmcs/nant/src/Tasks/CallTask.cs41
-rwxr-xr-xmcs/nant/src/Tasks/CompilerBase.cs186
-rwxr-xr-xmcs/nant/src/Tasks/CopyTask.cs196
-rwxr-xr-xmcs/nant/src/Tasks/CscTask.cs45
-rwxr-xr-xmcs/nant/src/Tasks/DeleteTask.cs173
-rwxr-xr-xmcs/nant/src/Tasks/EchoTask.cs34
-rwxr-xr-xmcs/nant/src/Tasks/ExecTask.cs58
-rwxr-xr-xmcs/nant/src/Tasks/ExternalProgramBase.cs130
-rwxr-xr-xmcs/nant/src/Tasks/FailTask.cs38
-rwxr-xr-xmcs/nant/src/Tasks/IncludeTask.cs134
-rwxr-xr-xmcs/nant/src/Tasks/JscTask.cs40
-rwxr-xr-xmcs/nant/src/Tasks/MkDirTask.cs49
-rwxr-xr-xmcs/nant/src/Tasks/MoveTask.cs71
-rwxr-xr-xmcs/nant/src/Tasks/NantTask.cs65
-rwxr-xr-xmcs/nant/src/Tasks/PropertyTask.cs37
-rwxr-xr-xmcs/nant/src/Tasks/SleepTask.cs91
-rwxr-xr-xmcs/nant/src/Tasks/StyleTask.cs171
-rwxr-xr-xmcs/nant/src/Tasks/TStampTask.cs43
-rwxr-xr-xmcs/nant/src/Tasks/TaskDefTask.cs42
-rwxr-xr-xmcs/nant/src/Tasks/VbcTask.cs40
-rwxr-xr-xmcs/nant/src/Util/Log.cs155
-rwxr-xr-xmcs/nant/src/Util/XmlNodeTextPositionMap.cs187
-rw-r--r--mcs/nunit/.cvsignore1
-rwxr-xr-xmcs/nunit/NUnitGUI.exebin49152 -> 0 bytes
-rwxr-xr-xmcs/nunit/NUnitTests.dllbin40960 -> 0 bytes
-rw-r--r--mcs/nunit/makefile12
-rw-r--r--mcs/nunit/src/NUnitConsole/NUnitConsole.xml146
-rw-r--r--mcs/nunit/src/NUnitCore/IFailureDetailView.cs6
-rw-r--r--mcs/nunit/src/NUnitCore/SimpleTestCollector.cs28
-rwxr-xr-xmcs/tests/ChangeLog296
-rwxr-xr-xmcs/tests/c1.cs7
-rwxr-xr-xmcs/tests/c2.cs2
-rwxr-xr-xmcs/tests/casts.cs566
-rwxr-xr-xmcs/tests/co1.cs4
-rwxr-xr-xmcs/tests/cs1.cs5
-rwxr-xr-xmcs/tests/csc-casts.outbin5041 -> 0 bytes
-rwxr-xr-xmcs/tests/gen-cast-test.cs99
-rwxr-xr-xmcs/tests/gen-check.cs78
-rw-r--r--mcs/tests/i-recursive.cs5
-rwxr-xr-xmcs/tests/i-three.cs11
-rw-r--r--mcs/tests/i-undefined.cs2
-rwxr-xr-xmcs/tests/i1.cs2
-rwxr-xr-xmcs/tests/i2.cs5
-rwxr-xr-xmcs/tests/i3.cs5
-rwxr-xr-xmcs/tests/i4.cs8
-rwxr-xr-xmcs/tests/i5.cs8
-rwxr-xr-xmcs/tests/i6.cs4
-rwxr-xr-xmcs/tests/interfaces.cs22
-rwxr-xr-xmcs/tests/ix1.cs3
-rwxr-xr-xmcs/tests/ix2.cs15
-rwxr-xr-xmcs/tests/makefile99
-rwxr-xr-xmcs/tests/n1.cs11
-rwxr-xr-xmcs/tests/n2.cs4
-rwxr-xr-xmcs/tests/s1.cs7
-rwxr-xr-xmcs/tests/test-1.cs9
-rw-r--r--mcs/tests/test-10.cs150
-rw-r--r--mcs/tests/test-11.cs27
-rw-r--r--mcs/tests/test-12.cs44
-rw-r--r--mcs/tests/test-13.cs31
-rw-r--r--mcs/tests/test-14.cs43
-rwxr-xr-xmcs/tests/test-15.cs22
-rw-r--r--mcs/tests/test-16.cs59
-rwxr-xr-xmcs/tests/test-17.cs45
-rw-r--r--mcs/tests/test-18.cs33
-rwxr-xr-xmcs/tests/test-19.cs83
-rwxr-xr-xmcs/tests/test-2.cs7
-rwxr-xr-xmcs/tests/test-20.cs70
-rw-r--r--mcs/tests/test-21.cs35
-rw-r--r--mcs/tests/test-22.cs46
-rw-r--r--mcs/tests/test-23.cs106
-rw-r--r--mcs/tests/test-24.cs35
-rw-r--r--mcs/tests/test-25.cs65
-rw-r--r--mcs/tests/test-26.cs35
-rw-r--r--mcs/tests/test-27.cs97
-rw-r--r--mcs/tests/test-28.cs35
-rw-r--r--mcs/tests/test-29.cs40
-rwxr-xr-xmcs/tests/test-3.cs62
-rw-r--r--mcs/tests/test-30.cs60
-rw-r--r--mcs/tests/test-31.cs41
-rw-r--r--mcs/tests/test-32.cs21
-rw-r--r--mcs/tests/test-33.cs51
-rw-r--r--mcs/tests/test-34.cs75
-rwxr-xr-xmcs/tests/test-35.cs71
-rwxr-xr-xmcs/tests/test-36.cs35
-rwxr-xr-xmcs/tests/test-37.cs136
-rwxr-xr-xmcs/tests/test-38.cs36
-rw-r--r--mcs/tests/test-39.cs38
-rwxr-xr-xmcs/tests/test-4.cs40
-rw-r--r--mcs/tests/test-40.cs75
-rw-r--r--mcs/tests/test-41.cs93
-rwxr-xr-xmcs/tests/test-42.cs184
-rwxr-xr-xmcs/tests/test-43.cs78
-rwxr-xr-xmcs/tests/test-44.cs55
-rw-r--r--mcs/tests/test-45.cs101
-rwxr-xr-xmcs/tests/test-46.cs127
-rwxr-xr-xmcs/tests/test-47.cs95
-rw-r--r--mcs/tests/test-48.cs30
-rwxr-xr-xmcs/tests/test-49.cs467
-rwxr-xr-xmcs/tests/test-5.cs14
-rw-r--r--mcs/tests/test-50.cs15
-rwxr-xr-xmcs/tests/test-51.cs89
-rwxr-xr-xmcs/tests/test-52.cs17
-rwxr-xr-xmcs/tests/test-53.cs119
-rwxr-xr-xmcs/tests/test-54.cs23
-rwxr-xr-xmcs/tests/test-55.cs33
-rwxr-xr-xmcs/tests/test-56.cs96
-rw-r--r--mcs/tests/test-57.cs75
-rwxr-xr-xmcs/tests/test-58.cs25
-rwxr-xr-xmcs/tests/test-59.cs89
-rwxr-xr-xmcs/tests/test-6.cs15
-rwxr-xr-xmcs/tests/test-60.cs16
-rwxr-xr-xmcs/tests/test-61.cs39
-rwxr-xr-xmcs/tests/test-62.cs28
-rwxr-xr-xmcs/tests/test-63.cs31
-rwxr-xr-xmcs/tests/test-64.cs29
-rwxr-xr-xmcs/tests/test-65.cs51
-rwxr-xr-xmcs/tests/test-66.cs134
-rw-r--r--mcs/tests/test-67.cs93
-rwxr-xr-xmcs/tests/test-68.cs22
-rw-r--r--mcs/tests/test-69.cs13
-rw-r--r--mcs/tests/test-7.cs176
-rwxr-xr-xmcs/tests/test-70.cs48
-rwxr-xr-xmcs/tests/test-71.cs28
-rwxr-xr-xmcs/tests/test-72.cs21
-rwxr-xr-xmcs/tests/test-73.cs28
-rwxr-xr-xmcs/tests/test-74.cs22
-rwxr-xr-xmcs/tests/test-75.cs36
-rwxr-xr-xmcs/tests/test-76.cs35
-rwxr-xr-xmcs/tests/test-77.cs38
-rwxr-xr-xmcs/tests/test-78.cs59
-rwxr-xr-xmcs/tests/test-79.cs17
-rw-r--r--mcs/tests/test-8.cs29
-rwxr-xr-xmcs/tests/test-9.cs24
-rwxr-xr-xmcs/tests/try.cs53
-rwxr-xr-xmcs/tests/unsafe-1.cs163
-rwxr-xr-xmcs/tests/unsafe-2.cs25
-rw-r--r--mcs/tools/.cvsignore4
-rw-r--r--mcs/tools/ChangeLog102
-rw-r--r--mcs/tools/EnumCheck.cs132
-rw-r--r--mcs/tools/EnumCheckAssemblyCollection.cs77
-rw-r--r--mcs/tools/IFaceDisco.cs105
-rw-r--r--mcs/tools/XMLUtil.cs36
-rw-r--r--mcs/tools/assemblies.xml20
-rw-r--r--mcs/tools/corcompare/.cvsignore2
-rw-r--r--mcs/tools/corcompare/ChangeLog6
-rw-r--r--mcs/tools/corcompare/CorCompare.cs43
-rw-r--r--mcs/tools/corcompare/IMissingMember.cs18
-rw-r--r--mcs/tools/corcompare/Makefile13
-rw-r--r--mcs/tools/corcompare/MissingConstructor.cs46
-rw-r--r--mcs/tools/corcompare/MissingEvent.cs46
-rw-r--r--mcs/tools/corcompare/MissingField.cs46
-rw-r--r--mcs/tools/corcompare/MissingMethod.cs50
-rw-r--r--mcs/tools/corcompare/MissingNestedType.cs46
-rw-r--r--mcs/tools/corcompare/MissingProperty.cs59
-rw-r--r--mcs/tools/corcompare/MissingType.cs56
-rw-r--r--mcs/tools/corcompare/TODO16
-rw-r--r--mcs/tools/corcompare/ToDoAssembly.cs268
-rw-r--r--mcs/tools/corcompare/ToDoConstructor.cs41
-rw-r--r--mcs/tools/corcompare/ToDoEvent.cs41
-rw-r--r--mcs/tools/corcompare/ToDoField.cs41
-rw-r--r--mcs/tools/corcompare/ToDoMethod.cs41
-rw-r--r--mcs/tools/corcompare/ToDoNameSpace.cs288
-rw-r--r--mcs/tools/corcompare/ToDoNestedType.cs41
-rw-r--r--mcs/tools/corcompare/ToDoProperty.cs41
-rw-r--r--mcs/tools/corcompare/ToDoType.cs189
-rw-r--r--mcs/tools/corcompare/corcompare.build12
-rw-r--r--mcs/tools/ictool/Makefile10
-rw-r--r--mcs/tools/ictool/depgraph.cs69
-rw-r--r--mcs/tools/ictool/ictool-config.xml105
-rw-r--r--mcs/tools/ictool/ictool.cs428
-rw-r--r--mcs/tools/ictool/peer.cs284
-rw-r--r--mcs/tools/makefile30
-rw-r--r--mcs/tools/sample.xml21
-rwxr-xr-xmcs/tools/sample_cast_const.cs49
-rwxr-xr-xmcs/tools/serialize.cs138
-rw-r--r--mcs/tools/verifier.cs1587
1720 files changed, 6 insertions, 216667 deletions
diff --git a/mcs/AUTHORS b/mcs/AUTHORS
deleted file mode 100755
index 25de6046411..00000000000
--- a/mcs/AUTHORS
+++ /dev/null
@@ -1,13 +0,0 @@
-C# Compiler:
- Miguel de Icaza (miguel@ximian.com)
-
-Class Libraries:
- Gaurav Vaish <gvaish@iitk.ac.in>
- Jeff Stedfast (fejj@ximian.com)
- Joe Shaw (joe@ximian.com)
- Miguel de Icaza (miguel@ximian.com)
- Sean MacIsaac (macisaac@ximian.com)
- Vladimir Vukicevic (vladimir@ximian.com)
- Garrett Rooney (rooneg@electricjellyfish.net)
- Bob Smith (bob@thestuff.net)
- John Barnette (jbarn@httcb.net)
diff --git a/mcs/ChangeLog b/mcs/ChangeLog
deleted file mode 100644
index 05e53774426..00000000000
--- a/mcs/ChangeLog
+++ /dev/null
@@ -1,12 +0,0 @@
-2002-02-14 Nick Drochak <ndrochak@gol.com>
-
- * makefile: Build mcs/doctools too when one does 'make'
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * on the 'test' target, make sure NUnit is built first before building
- and running tests
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * add nunit directory to the list of dirs to build in \ No newline at end of file
diff --git a/mcs/README b/mcs/README
deleted file mode 100755
index c3d344552c2..00000000000
--- a/mcs/README
+++ /dev/null
@@ -1,23 +0,0 @@
-
-This contains the Mono C# compiler as well as the Mono runtime
-library.
-
-Layout:
-
- class/
- Class libraries
-
- errors/
- Sample programs that should generate errors by the compiler.
-
- jay/
- Yacc-based parser generator.
-
- mcs/
- The Mono C# compiler
-
- tests/
- Sample tests
-
-Thanks a lot to Sergey Chaban for his help during the development of
-the C# compiler.
diff --git a/mcs/class/.cvsignore b/mcs/class/.cvsignore
deleted file mode 100644
index a65b41774ad..00000000000
--- a/mcs/class/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-lib
diff --git a/mcs/class/README b/mcs/class/README
deleted file mode 100644
index 853c618cb41..00000000000
--- a/mcs/class/README
+++ /dev/null
@@ -1,70 +0,0 @@
-The class libraries are grouped together in the assemblies they belong.
-
-Each directory here represents an assembly, and inside each directory we
-divide the code based on the namespace they implement.
-
-In addition, each assembly directory contains a Test directory that holds the
-NUnit tests for that assembly.
-
-The nant build file for an assembly creates two versions of the dll for that
-assembly. One version is a "full" dll. The full dll contains (almost) all
-of the classes, regardless of how complete the classes are. The name of this
-dll is the normal name you would expect, like "corlib.dll" or "System.dll".
-These full dll's are created in the /mcs/class/lib directory.
-
-The other dll which is built is a "restricted" dll. The restricted dll
-omits incomplete classes that would prevent the NUnit testrunner from actually
-running the tests. These restricted dll's are created in the Test directory
-of their respective assembly and named with a "_res" suffix. So, for example,
-the NUnit-testable dll for corlib is /mcs/class/corlib/Test/corlib_res.dll.
-
-The final dll which is built is the one which houses the actual NUnit tests.
-This dll is built from all of the classes in the Test directory and below, and
-is named with a "_test" suffix. So, for example, the NUnit tests for corlib
-are in /mcs/class/corlib/Test/corlib_test.dll. This dll is also linked with
-the restricted dll found in the same directory.
-
-
-* Missing implementation bits
-
- If you implement a class and you are missing implementation bits,
- please put in the code the word "TODO" and a description of what
- is missing to be implemented.
-
-* Tagging buggy code
-
- If there is a bug in your implementation tag the problem by using
- the word "FIXME" in the code, together with a description of the
- problem.
-
- Do not use XXX or obscure descriptions, because otherwise people
- will not be able to understand what you mean.
-
-* Tagging Lame specs
-
- Sometimes the specification will be lame (consider Version.ToString (fieldCount)
- where there is no way of knowing how many fields are available, making the API
- not only stupid, but leading to unreliable code).
-
- In those cases, use the keyword "LAMESPEC".
-
-* Coding consideration
-
- Use 8 space tabs for writing your code (hopefully we can keep
- this consistent). If you are modifying someone else's code, try
- to keep the coding style similar.
-
- Please use code that looks like this:
-
- bool Method (int argument_1, int argument_2)
- {
- if (argument_1 == argument_2)
- throw new Exception (Locale.GetText ("They are equal!");
-
- if (argument_1 < argument_2) {
- if (argument_1 * 3 > 4)
- return true;
- else
- return false;
- }
- }
diff --git a/mcs/class/System.Data/ChangeLog b/mcs/class/System.Data/ChangeLog
deleted file mode 100644
index 427c3eaee97..00000000000
--- a/mcs/class/System.Data/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-2002-02-10 Christopher Podurgiel <cpodurgiel@msn.com>
-
- * Removed *.cs from System.Data as the correct files are in mcs/class/System.Data/System.Data
- * Updated all Enums, Interfaces, and Delegates in System.Data
-
-2002-02-11 Christopher Podurgiel <cpodurgiel@msn.com>
-
- * DataColumnChangeEventArgs.cs : Added
- * DataColumnChangeEventHandler.cs : Added \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.build b/mcs/class/System.Data/System.Data.build
deleted file mode 100644
index 114aa1adbc4..00000000000
--- a/mcs/class/System.Data/System.Data.build
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.Data.dll -->
-
-<project name="System.Data" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <csc target="library" output="../lib/System.Data.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/unsafe"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- </sources>
- <references>
- <includes name="../lib/corlib.dll"/>
- </references>
- </csc>
- </target>
- <target name="clean">
- <delete file="../lib/System.Data.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System.Data/System.Data/AcceptRejectRule.cs b/mcs/class/System.Data/System.Data/AcceptRejectRule.cs
deleted file mode 100644
index bb98d27cf03..00000000000
--- a/mcs/class/System.Data/System.Data/AcceptRejectRule.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Data.AcceptRejectRule.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
-
- /// <summary>
- /// Determines the action that occurs when the AcceptChanges or RejectChanges method is invoked on a DataTable with a ForeignKeyConstraint.
- /// </summary>
- [Serializable]
- public enum AcceptRejectRule
- {
- Cascade = 1,
- None = 0
- }
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/CommandBehavior.cs b/mcs/class/System.Data/System.Data/CommandBehavior.cs
deleted file mode 100644
index 918722e1937..00000000000
--- a/mcs/class/System.Data/System.Data/CommandBehavior.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Data.CommandBehavior.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
-
- /// <summary>
- /// Specifies a description of the results and the affect on the database of the query command.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum CommandBehavior
- {
- Default = 0,
- SingleResult = 1,
- SchemaOnly = 2,
- KeyInfo = 4,
- SingleRow = 8,
- SequentialAccess = 16,
- CloseConnection = 32
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/CommandType.cs b/mcs/class/System.Data/System.Data/CommandType.cs
deleted file mode 100644
index ab1b6fe72d1..00000000000
--- a/mcs/class/System.Data/System.Data/CommandType.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.CommandType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies how a command string is interpreted.
- /// </summary>
- [Serializable]
- public enum CommandType
- {
- Text = 1,
- StoredProcedure = 4,
- TableDirect = 512
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/ConnectionState.cs b/mcs/class/System.Data/System.Data/ConnectionState.cs
deleted file mode 100644
index 50d50c8a6d4..00000000000
--- a/mcs/class/System.Data/System.Data/ConnectionState.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Data.ConnectionState.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
-
- /// <summary>
- /// Returns the current state of the connection to a data source.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum ConnectionState
- {
- Closed = 0,
- Open = 1,
- Connecting = 2,
- Executing = 4,
- Fetching = 8,
- Broken = 16
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs b/mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs
deleted file mode 100644
index f79d27eaf1e..00000000000
--- a/mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.Data.DataColumnChangeEventArgs.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Provides data for the ColumnChanging event.
- /// </summary>
- public class DataColumnChangeEventArgs : EventArgs
- {
-
- private DataColumn _column = null;
- private DataRow _row = null;
- private object _proposedValue = null;
-
- /// <summary>
- /// Initializes a new instance of the DataColumnChangeEventArgs class.
- /// </summary>
- /// <param name="row"></param>
- /// <param name="column"></param>
- /// <param name="value"></param>
- public DataColumnChangeEventArgs(DataRow row, DataColumn column, object value)
- {
- _column = column;
- _row = row;
- _proposedValue = value;
- }
-
- /// <summary>
- /// Gets the DataColumn with a changing value.
- /// </summary>
- public DataColumn Column
- {
- get
- {
- return _column;
- }
- }
-
-
- /// <summary>
- /// Gets or sets the proposed new value for the column.
- /// </summary>
- public object ProposedValue
- {
- get
- {
- return _proposedValue;
- }
- set
- {
- _proposedValue = value;
- }
- }
-
-
- /// <summary>
- /// Gets the DataRow of the column with a changing value.
- /// </summary>
- public DataRow Row
- {
- get
- {
- return _row;
- }
- }
-
-
-
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs b/mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs
deleted file mode 100644
index 1932d38f2fe..00000000000
--- a/mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.DataColumnChangeEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the the ColumnChanging event.
- /// </summary>
- [Serializable]
- public delegate void DataColumnChangeEventHandler(object sender, DataColumnChangeEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataColumnCollection.cs b/mcs/class/System.Data/System.Data/DataColumnCollection.cs
deleted file mode 100644
index 8fca31e70b8..00000000000
--- a/mcs/class/System.Data/System.Data/DataColumnCollection.cs
+++ /dev/null
@@ -1,413 +0,0 @@
-//
-// System.Data.DataColumnCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a collection of DataColumn objects for a DataTable.
- /// </summary>
- public class DataColumnCollection : InternalDataCollectionBase
- {
-
- protected ArrayList list = null;
-
- // The defaultNameIndex is used to create a default name for a column if one wasn't given.
- private int defaultNameIndex;
-
- //table should be the DataTable this DataColumnCollection belongs to.
- private DataTable parentTable = null;
-
- // Internal Constructor. This Class can only be created from other classes in this assembly.
- internal DataColumnCollection(DataTable table):base()
- {
- list = new ArrayList();
- defaultNameIndex = 1;
- parentTable = table;
- }
-
-
-
- /// <summary>
- /// Gets the DataColumn from the collection at the specified index.
- /// </summary>
- public virtual DataColumn this[int index]
- {
- get
- {
- return (DataColumn)list[index];
- }
- }
-
- /// <summary>
- /// Gets the DataColumn from the collection with the specified name.
- /// </summary>
- public virtual DataColumn this[string name]
- {
- get
- {
- foreach (DataColumn column in list)
- {
- if (column.ColumnName == name)
- {
- return column;
- }
- }
-
- return null;
-
- }
- }
-
-
- /// <summary>
- /// Gets a list of the DataColumnCollection items.
- /// </summary>
- protected override ArrayList List
- {
- get
- {
- return list;
- }
- }
-
- /// <summary>
- /// Creates and adds a DataColumn object to the DataColumnCollection.
- /// </summary>
- /// <returns></returns>
- public virtual DataColumn Add()
- {
- DataColumn column = new DataColumn("Column" + defaultNameIndex.ToString());
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- list.Add(column);
- OnCollectionChanged(e);
- defaultNameIndex++;
- return column;
- }
-
- /// <summary>
- /// Creates and adds the specified DataColumn object to the DataColumnCollection.
- /// </summary>
- /// <param name="column">The DataColumn to add.</param>
- public void Add(DataColumn column)
- {
- if(Contains(column.ColumnName))
- {
- throw new DuplicateNameException("A column named " + column.ColumnName + " already belongs to this DataTable.");
- }
- else
- {
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- list.Add(column);
- OnCollectionChanged(e);
- return;
- }
- }
-
- /// <summary>
- /// Creates and adds a DataColumn object with the specified name to the DataColumnCollection.
- /// </summary>
- /// <param name="columnName">The name of the column.</param>
- /// <returns>The newly created DataColumn.</returns>
- public virtual DataColumn Add(string columnName)
- {
-
- if (columnName == null || columnName == String.Empty)
- {
- columnName = "Column" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- if(Contains(columnName))
- {
- throw new DuplicateNameException("A column named " + columnName + " already belongs to this DataTable.");
- }
- else
- {
- DataColumn column = new DataColumn(columnName);
-
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- list.Add(column);
- OnCollectionChanged(e);
- return column;
- }
- }
-
- /// <summary>
- /// Creates and adds a DataColumn object with the specified name and type to the DataColumnCollection.
- /// </summary>
- /// <param name="columnName">The ColumnName to use when cretaing the column.</param>
- /// <param name="type">The DataType of the new column.</param>
- /// <returns>The newly created DataColumn.</returns>
- public virtual DataColumn Add(string columnName, Type type)
- {
- if (columnName == null || columnName == "")
- {
- columnName = "Column" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- if(Contains(columnName))
- {
- throw new DuplicateNameException("A column named " + columnName + " already belongs to this DataTable.");
- }
- else
- {
- DataColumn column = new DataColumn(columnName, type);
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- list.Add(column);
- OnCollectionChanged(e);
- return column;
- }
- }
-
- /// <summary>
- /// Creates and adds a DataColumn object with the specified name, type, and expression to the DataColumnCollection.
- /// </summary>
- /// <param name="columnName">The name to use when creating the column.</param>
- /// <param name="type">The DataType of the new column.</param>
- /// <param name="expression">The expression to assign to the Expression property.</param>
- /// <returns>The newly created DataColumn.</returns>
- public virtual DataColumn Add(string columnName, Type type, string expression)
- {
- if (columnName == null || columnName == "")
- {
- columnName = "Column" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- if(Contains(columnName))
- {
- throw new DuplicateNameException("A column named " + columnName + " already belongs to this DataTable.");
- }
- else
- {
- DataColumn column = new DataColumn(columnName, type, expression);
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- list.Add(column);
- OnCollectionChanged(e);
- return column;
- }
- }
-
- /// <summary>
- /// Copies the elements of the specified DataColumn array to the end of the collection.
- /// </summary>
- /// <param name="columns">The array of DataColumn objects to add to the collection.</param>
- public void AddRange(DataColumn[] columns)
- {
- foreach (DataColumn column in columns)
- {
- Add(column);
- }
- return;
- }
-
- /// <summary>
- /// Checks whether a given column can be removed from the collection.
- /// </summary>
- /// <param name="column">A DataColumn in the collection.</param>
- /// <returns>true if the column can be removed; otherwise, false.</returns>
- public bool CanRemove(DataColumn column)
- {
-
- //Check that the column does not have a null reference.
- if (column == null)
- {
- return false;
- }
-
-
- //Check that the column is part of this collection.
- if (!Contains(column.ColumnName))
- {
- return false;
- }
-
-
-
- //Check if this column is part of a relationship. (this could probably be written better)
- foreach (DataRelation childRelation in parentTable.ChildRelations)
- {
- foreach (DataColumn childColumn in childRelation.ChildColumns)
- {
- if (childColumn == column)
- {
- return false;
- }
- }
-
- foreach (DataColumn parentColumn in childRelation.ParentColumns)
- {
- if (parentColumn == column)
- {
- return false;
- }
- }
- }
-
- //Check if this column is part of a relationship. (this could probably be written better)
- foreach (DataRelation parentRelation in parentTable.ParentRelations)
- {
- foreach (DataColumn childColumn in parentRelation.ChildColumns)
- {
- if (childColumn == column)
- {
- return false;
- }
- }
-
- foreach (DataColumn parentColumn in parentRelation.ParentColumns)
- {
- if (parentColumn == column)
- {
- return false;
- }
- }
- }
-
-
- //Check if another column's expression depends on this column.
-
- foreach (DataColumn dataColumn in list)
- {
- if (dataColumn.Expression.ToString().IndexOf(column.ColumnName) > 0)
- {
- return false;
- }
- }
-
-
- return true;
- }
-
- /// <summary>
- /// Clears the collection of any columns.
- /// </summary>
- public void Clear()
- {
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Refresh, this);
- list.Clear();
- OnCollectionChanged(e);
- return;
- }
-
- /// <summary>
- /// Checks whether the collection contains a column with the specified name.
- /// </summary>
- /// <param name="name">The ColumnName of the column to check for.</param>
- /// <returns>true if a column exists with this name; otherwise, false.</returns>
- public bool Contains(string name)
- {
- return (IndexOf(name) != -1);
- }
-
- /// <summary>
- /// Gets the index of a column specified by name.
- /// </summary>
- /// <param name="column">The name of the column to return.</param>
- /// <returns>The index of the column specified by column if it is found; otherwise, -1.</returns>
- public virtual int IndexOf(DataColumn column)
- {
- return list.IndexOf(column);
- }
-
- /// <summary>
- /// Gets the index of the column with the given name (the name is not case sensitive).
- /// </summary>
- /// <param name="columnName">The name of the column to find.</param>
- /// <returns>The zero-based index of the column with the specified name, or -1 if the column doesn't exist in the collection.</returns>
- public int IndexOf(string columnName)
- {
-
- DataColumn column = this[columnName];
-
- if (column != null)
- {
- return IndexOf(column);
- }
- else
- {
- return -1;
- }
- }
-
- /// <summary>
- /// Raises the OnCollectionChanged event.
- /// </summary>
- /// <param name="ccevent">A CollectionChangeEventArgs that contains the event data.</param>
- protected virtual void OnCollectionChanged(CollectionChangeEventArgs ccevent)
- {
- if (CollectionChanged != null)
- {
- // Invokes the delegate.
- CollectionChanged(this, ccevent);
- }
- }
-
- /// <summary>
- /// Raises the OnCollectionChanging event.
- /// </summary>
- /// <param name="ccevent">A CollectionChangeEventArgs that contains the event data.</param>
- protected internal virtual void OnCollectionChanging(CollectionChangeEventArgs ccevent)
- {
- if (CollectionChanged != null)
- {
- // Invokes the delegate.
- CollectionChanged(this, ccevent);
- }
- }
-
- /// <summary>
- /// Removes the specified DataColumn object from the collection.
- /// </summary>
- /// <param name="column">The DataColumn to remove.</param>
- public void Remove(DataColumn column)
- {
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Remove, this);
- list.Remove(column);
- OnCollectionChanged(e);
- return;
- }
-
- /// <summary>
- /// Removes the DataColumn object with the specified name from the collection.
- /// </summary>
- /// <param name="name">The name of the column to remove.</param>
- public void Remove(string name)
- {
- DataColumn column = this[name];
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Remove, this);
- list.Remove(column);
- OnCollectionChanged(e);
- return;
- }
-
- /// <summary>
- /// Removes the column at the specified index from the collection.
- /// </summary>
- /// <param name="index">The index of the column to remove.</param>
- public void RemoveAt(int index)
- {
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Remove, this);
- list.RemoveAt(index);
- OnCollectionChanged(e);
- return;
- }
-
- /// <summary>
- /// Occurs when the columns collection changes, either by adding or removing a column.
- /// </summary>
- public event CollectionChangeEventHandler CollectionChanged;
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowAction.cs b/mcs/class/System.Data/System.Data/DataRowAction.cs
deleted file mode 100644
index b6423b374ca..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowAction.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Data.DataRowAction.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Describes the action taken on a DataRow.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum DataRowAction
- {
- Nothing = 0,
- Delete = 1,
- Change = 2,
- Rollback = 4,
- Commit = 8,
- Add = 16
- }
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs b/mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs
deleted file mode 100644
index 4959e38f3bf..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.DataRowChangeEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the RowChanging, RowChanged, RowDeleting, and RowDeleted events of a DataTable.
- /// </summary>
- [Serializable]
- public delegate void DataRowChangeEventHandler(object sender, DataRowChangeEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowState.cs b/mcs/class/System.Data/System.Data/DataRowState.cs
deleted file mode 100644
index 4e77e406203..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowState.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Data.DataRowState.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Gets the state of a DataRow object.
- /// </summary>
- [Flags]
- [Serializable]
- public enum DataRowState
- {
- Detached = 1,
- Unchanged = 2,
- Added = 4,
- Deleted = 8,
- Modified = 16
- }
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowVersion.cs b/mcs/class/System.Data/System.Data/DataRowVersion.cs
deleted file mode 100644
index ad757946bcb..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowVersion.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Data.DataRowVersion.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Describes the version of a DataRow.
- /// </summary>
- [Serializable]
- public enum DataRowVersion
- {
- Original = 256,
- Current = 512,
- Proposed = 1024,
- Default = 1536
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataViewRowState.cs b/mcs/class/System.Data/System.Data/DataViewRowState.cs
deleted file mode 100644
index 2768fbe0e0f..00000000000
--- a/mcs/class/System.Data/System.Data/DataViewRowState.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Data.DataViewRowState.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Describes the version of data in a DataRow.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum DataViewRowState
- {
- None = 0,
- Unchanged = 2,
- Added = 4,
- Deleted = 8,
- ModifiedCurrent = 16,
- CurrentRows = 22,
- ModifiedOriginal = 32,
- OriginalRows = 42
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DbType.cs b/mcs/class/System.Data/System.Data/DbType.cs
deleted file mode 100644
index 9a0cad9a631..00000000000
--- a/mcs/class/System.Data/System.Data/DbType.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Data.DbType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Gets the data type of a field, a property, or a Parameter object of a .NET data provider.
- /// </summary>
- [Serializable]
- public enum DbType
- {
- AnsiString = 0,
- Binary = 1,
- Byte = 2,
- Boolean = 3,
- Currency = 4,
- Date = 5,
- DateTime = 6,
- Decimal = 7,
- Double = 8,
- Guid = 9,
- Int16 = 10,
- Int32 = 11,
- Int64 = 12,
- Object = 13,
- SByte = 14,
- Single = 15,
- String = 16,
- Time = 17,
- UInt16 = 18,
- UInt32 = 19,
- UInt64 = 20,
- VarNumeric = 21,
- AnsiStringFixedLength = 22,
- StringFixedLength = 23
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/FillErrorEventHandler.cs b/mcs/class/System.Data/System.Data/FillErrorEventHandler.cs
deleted file mode 100644
index 8f63a935cdb..00000000000
--- a/mcs/class/System.Data/System.Data/FillErrorEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.FillErrorEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the FillError event.
- /// </summary>
- [Serializable]
- public delegate void FillErrorEventHandler(object sender, FillErrorEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IColumnMapping.cs b/mcs/class/System.Data/System.Data/IColumnMapping.cs
deleted file mode 100644
index 2e307763533..00000000000
--- a/mcs/class/System.Data/System.Data/IColumnMapping.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Data.IColumnMapping.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Associates a data source column with a DataSet column, and is implemented by the DataColumnMapping class, which is used in common by .NET data providers.
- /// </summary>
- public interface IColumnMapping
- {
- /// <summary>
- /// Gets or sets the name of the column within the DataSet to map to.
- /// </summary>
- string DataSetColumn
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets the name of the column within the data source to map from. The name is case-sensitive.
- /// </summary>
- string SourceColumn
- {
- get;
- set;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IColumnMappingCollection.cs b/mcs/class/System.Data/System.Data/IColumnMappingCollection.cs
deleted file mode 100644
index a23a2ae6056..00000000000
--- a/mcs/class/System.Data/System.Data/IColumnMappingCollection.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Data.IColumnMappingCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System.Collections;
-
-namespace System.Data
-{
- /// <summary>
- /// Contains a collection of ColumnMapping objects, and is implemented by the DataColumnMappingCollection, which is used in common by .NET data providers.
- /// </summary>
- public interface IColumnMappingCollection : IList, ICollection, IEnumerable
- {
- IColumnMapping Add(string sourceColumnName, string dataSetColumnName);
-
- bool Contains(string sourceColumnName);
-
- IColumnMapping GetByDataSetColumn(string dataSetColumnName);
-
- int IndexOf(string sourceColumnName);
-
- void RemoveAt(string sourceColumnName);
-
- object this[string index]
- {
- get;
- set;
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/IDataAdapter.cs b/mcs/class/System.Data/System.Data/IDataAdapter.cs
deleted file mode 100644
index be6f09036b0..00000000000
--- a/mcs/class/System.Data/System.Data/IDataAdapter.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Data.IDataAdapter.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Allows an object to implement a DataAdapter, and represents a set of methods and mapping action-related properties used to fill and refresh a DataSet and update a data source.
- /// </summary>
- public interface IDataAdapter
- {
- int Fill(DataSet dataSet);
-
- DataTable[] FillSchema(DataSet dataSet, SchemaType schemaType);
-
- IDataParameter[] GetFillParameters();
-
- int Update(DataSet dataSet);
-
- MissingMappingAction MissingMappingAction{get;set;}
-
- MissingSchemaAction MissingSchemaAction{get;set;}
-
- ITableMappingCollection TableMappings{get;}
-
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDataParameter.cs b/mcs/class/System.Data/System.Data/IDataParameter.cs
deleted file mode 100644
index 1cfdbafcbec..00000000000
--- a/mcs/class/System.Data/System.Data/IDataParameter.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Data.IDataParameter.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a parameter to a Command object, and optionally, its mapping to DataSet columns; and is implemented by .NET data providers that access data sources.
- /// </summary>
- public interface IDataParameter
- {
-
- DbType DbType{get;set;}
-
- ParameterDirection Direction{get;set;}
-
- bool IsNullable{get;}
-
- string ParameterName{get;set;}
-
- string SourceColumn{get;set;}
-
- DataRowVersion SourceVersion {get;set;}
-
- object Value {get;set;}
-
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDataParameterCollection.cs b/mcs/class/System.Data/System.Data/IDataParameterCollection.cs
deleted file mode 100644
index 0e77604550d..00000000000
--- a/mcs/class/System.Data/System.Data/IDataParameterCollection.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Data.IDataParameterCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System.Collections;
-
-namespace System.Data
-{
- /// <summary>
- /// Collects all parameters relevant to a Command object and their mappings to DataSet columns, and is implemented by .NET data providers that access data sources.
- /// </summary>
- public interface IDataParameterCollection : IList, ICollection, IEnumerable
- {
- void RemoveAt(string parameterName);
-
- int IndexOf(string parameterName);
-
- bool Contains(string parameterName);
-
- object this[string parameterName]{get; set;}
- }
-}
diff --git a/mcs/class/System.Data/System.Data/IDataReader.cs b/mcs/class/System.Data/System.Data/IDataReader.cs
deleted file mode 100644
index 746d0d72ed6..00000000000
--- a/mcs/class/System.Data/System.Data/IDataReader.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Data.IDataReader.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Provides a means of reading one or more forward-only streams of result sets obtained by executing a command at a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDataReader : IDisposable, IDataRecord
- {
- void Close();
-
- DataTable GetSchemaTable();
-
- bool NextResult();
-
- bool Read();
-
- int Depth{get;}
-
- bool IsClosed{get;}
-
- int RecordsAffected{get;}
-
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDataRecord.cs b/mcs/class/System.Data/System.Data/IDataRecord.cs
deleted file mode 100644
index 7221603ae38..00000000000
--- a/mcs/class/System.Data/System.Data/IDataRecord.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// System.Data.IDataRecord.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Provides access to the column values within each row for a DataReader, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDataRecord
- {
- bool GetBoolean(int i);
-
- byte GetByte(int i);
-
- long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferOffset, int length);
-
- char GetChar(int i);
-
- long GetChars(int i, long fieldOffset, char[] buffer, int bufferOffset, int length);
-
- IDataReader GetData(int i);
-
- string GetDataTypeName(int i);
-
- DateTime GetDateTime(int i);
-
- decimal GetDecimal(int i);
-
- double GetDouble(int i);
-
- Type GetFieldType(int i);
-
- float GetFloat(int i);
-
- Guid GetGuid(int i);
-
- short GetInt16(int i);
-
- int GetInt32(int i);
-
- long GetInt64(int i);
-
- string GetName(int i);
-
- int GetOrdinal(string name);
-
- string GetString(int i);
-
- object GetValue(int i);
-
- int GetValues(object[] values);
-
- bool IsDBNull(int i);
-
- int FieldCount{get;}
-
- object this[string name]{get;}
-
- object this[int i]{get;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDbCommand.cs b/mcs/class/System.Data/System.Data/IDbCommand.cs
deleted file mode 100644
index 203fc8f60e5..00000000000
--- a/mcs/class/System.Data/System.Data/IDbCommand.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Data.IDBCommand.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a SQL statement that is executed while connected to a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDBCommand
- {
- void Cancel();
-
- IDbDataParameter CreateParameter();
-
- int ExecuteNonQuery();
-
- IDataReader ExecuteReader();
-
- IDataReader ExecuteReader(CommandBehavior behavior);
-
- object ExecuteScalar();
-
- void Prepare();
-
-
- string CommandText{get; set;}
-
- int CommandTimeout{get; set;}
-
- CommandType CommandType{get; set;}
-
- IDbConnection Connection{get; set;}
-
- IDataParameterCollection Parameters{get;}
-
- IDbTransaction Transaction{get; set;}
-
- UpdateRowSource UpdatedRowSource{get; set;}
- }
-}
diff --git a/mcs/class/System.Data/System.Data/IDbConnection.cs b/mcs/class/System.Data/System.Data/IDbConnection.cs
deleted file mode 100644
index b439251df6f..00000000000
--- a/mcs/class/System.Data/System.Data/IDbConnection.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Data.IDBConnection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents an open connection to a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDBConnection
- {
- IDbTransaction BeginTransaction();
-
- IDbTransaction BeginTransaction(IsolationLevel il);
-
- void ChangeDatabase(string databaseName);
-
- void Close();
-
- IDbCommand CreateCommand();
-
- void Open();
-
-
- string ConnectionString{get; set;}
-
- int ConnectionTimeout{get;}
-
- string Database{get;}
-
- ConnectionState State{get;}
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDbDataAdapter.cs b/mcs/class/System.Data/System.Data/IDbDataAdapter.cs
deleted file mode 100644
index 78c1173da09..00000000000
--- a/mcs/class/System.Data/System.Data/IDbDataAdapter.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.IDbDataAdapter.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a set of command-related properties that are used to fill the DataSet and update a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDbDataAdapter : IDataAdapter
- {
- IDbCommand DeleteCommand{get; set;}
-
- IDbCommand InsertCommand{get; set;}
-
- IDbCommand SelectCommand{get; set;}
-
- IDbCommand UpdateCommand{get; set;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDbDataParameter.cs b/mcs/class/System.Data/System.Data/IDbDataParameter.cs
deleted file mode 100644
index 91705098707..00000000000
--- a/mcs/class/System.Data/System.Data/IDbDataParameter.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Data.IDbDataParameter.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Used by the Visual Basic .NET Data Designers to represent a parameter to a Command object, and optionally, its mapping to DataSet columns.
- /// </summary>
- public interface IDbDataParameter
- {
- byte Precision{get; set;}
-
- byte Scale{get; set;}
-
- int Size{get; set;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDbTransaction.cs b/mcs/class/System.Data/System.Data/IDbTransaction.cs
deleted file mode 100644
index 5eef2933469..00000000000
--- a/mcs/class/System.Data/System.Data/IDbTransaction.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.IDbTransaction.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a transaction to be performed at a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDbTransaction
- {
- void Commit();
-
- void Rollback();
-
- IDbConnection Connection{get;}
-
- IsolationLevel IsolationLevel{get;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/ITableMapping.cs b/mcs/class/System.Data/System.Data/ITableMapping.cs
deleted file mode 100644
index 82f5329b083..00000000000
--- a/mcs/class/System.Data/System.Data/ITableMapping.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Data.ITableMapping.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Associates a source table with a table in a DataSet, and is implemented by the DataTableMapping class, which is used in common by .NET data providers.
- /// </summary>
- public interface ITableMapping
- {
- IColumnMappingCollection ColumnMappings{get;}
-
- string DataSetTable{get; set;}
-
- string SourceTable{get; set;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/ITableMappingCollection.cs b/mcs/class/System.Data/System.Data/ITableMappingCollection.cs
deleted file mode 100644
index 5ca052f94ab..00000000000
--- a/mcs/class/System.Data/System.Data/ITableMappingCollection.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Data.ITableMappingCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System.Collections;
-
-namespace System.Data
-{
- /// <summary>
- /// Contains a collection of TableMapping objects, and is implemented by the DataTableMappingCollection, which is used in common by .NET data providers.
- /// </summary>
- public interface ITableMappingCollection : IList, ICollection, IEnumerable
- {
- ITableMapping Add(string sourceTableName, string dataSetTableName);
-
- bool Contains(string sourceTableName);
-
- ITableMapping GetByDataSetTable(string dataSetTableName);
-
- int IndexOf(string sourceTableName);
-
- void RemoveAt(string sourceTableName);
-
- object this[string index]{get; set;}
- }
-}
diff --git a/mcs/class/System.Data/System.Data/IsolationLevel.cs b/mcs/class/System.Data/System.Data/IsolationLevel.cs
deleted file mode 100644
index 3a25ef9cc0e..00000000000
--- a/mcs/class/System.Data/System.Data/IsolationLevel.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Data.IsolationLevel.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies the transaction locking behavior for the connection.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum IsolationLevel
- {
- Unspecified = -1,
- Chaos = 16,
- ReadUncommitted = 256,
- ReadCommitted = 4096,
- RepeatableRead = 65536,
- Serializable = 1048576
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MappingType.cs b/mcs/class/System.Data/System.Data/MappingType.cs
deleted file mode 100644
index 0a4d3a4870f..00000000000
--- a/mcs/class/System.Data/System.Data/MappingType.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Data.MappingType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies how a DataColumn is mapped.
- /// </summary>
- [Serializable]
- public enum MappingType
- {
- Element = 1,
- Attribute = 2,
- SimpleContent = 3,
- Hidden = 4
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs b/mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs
deleted file mode 100644
index 3ec7962496a..00000000000
--- a/mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.MergeFailedEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the MergeFailed event.
- /// </summary>
- [Serializable]
- public delegate void MergeFailedEventHandler(object sender, MergeFailedEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MissingMappingAction.cs b/mcs/class/System.Data/System.Data/MissingMappingAction.cs
deleted file mode 100644
index 75cc7ed87ed..00000000000
--- a/mcs/class/System.Data/System.Data/MissingMappingAction.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Data.MissingMappingAction.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Determines the action that occurs when a mapping is missing from a source table or a source column.
- /// </summary>
- [Serializable]
- public enum MissingMappingAction
- {
- Passthrough = 1,
- Ignore = 2,
- Error = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MissingSchemaAction.cs b/mcs/class/System.Data/System.Data/MissingSchemaAction.cs
deleted file mode 100644
index c0b8f301398..00000000000
--- a/mcs/class/System.Data/System.Data/MissingSchemaAction.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.MissingSchemaAction.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies the action to take when adding data to the DataSet and the required DataTable or DataColumn is missing.
- /// </summary>
- [Serializable]
- public enum MissingSchemaAction
- {
- Add = 1,
- Ignore = 2,
- Error = 3,
- AddWithKey = 4
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/ParameterDirection.cs b/mcs/class/System.Data/System.Data/ParameterDirection.cs
deleted file mode 100644
index 1f24d6c3791..00000000000
--- a/mcs/class/System.Data/System.Data/ParameterDirection.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.ParameterDirection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies the type of a parameter within a query relative to the DataSet.
- /// </summary>
- [Serializable]
- public enum ParameterDirection
- {
- Input = 1,
- Output = 2,
- InputOutput = 3,
- ReturnValue = 6
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/PropertyAttributes.cs b/mcs/class/System.Data/System.Data/PropertyAttributes.cs
deleted file mode 100644
index 171771a485b..00000000000
--- a/mcs/class/System.Data/System.Data/PropertyAttributes.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Data.PropertyAttributes.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies the attributes of a property.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values
- /// </summary>
- [Flags]
- [Serializable]
- public enum PropertyAttributes
- {
- NotSupported = 0,
- Required = 1,
- Optional = 2,
- Read = 512,
- Write = 1024
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/Rule.cs b/mcs/class/System.Data/System.Data/Rule.cs
deleted file mode 100644
index 7895c915e61..00000000000
--- a/mcs/class/System.Data/System.Data/Rule.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.Rule.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Indicates the action that occurs when a ForeignKeyConstraint is enforced.
- /// </summary>
- [Serializable]
- public enum Rule
- {
- None = 0,
- Cascade = 1,
- SetNull = 2,
- SetDefault = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/SchemaType.cs b/mcs/class/System.Data/System.Data/SchemaType.cs
deleted file mode 100644
index a1e4c6dbce9..00000000000
--- a/mcs/class/System.Data/System.Data/SchemaType.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Data.SchemaType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies how to handle existing schema mappings when performing a FillSchema operation.
- /// </summary>
- [Serializable]
- public enum SchemaType
- {
- Source = 1,
- Mapped = 2
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/SqlDbType.cs b/mcs/class/System.Data/System.Data/SqlDbType.cs
deleted file mode 100644
index 2cd9008b2a7..00000000000
--- a/mcs/class/System.Data/System.Data/SqlDbType.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Data.SqlDbType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies SQL Server data types.
- /// </summary>
- [Serializable]
- public enum SqlDbType
- {
- BigInt = 0,
- Binary = 1,
- Bit = 2,
- Char = 3,
- DateTime = 4,
- Decimal = 5,
- Float = 6,
- Image = 7,
- Int = 8,
- Money = 9,
- NChar = 10,
- NText = 11,
- NVarChar = 12,
- Real = 13,
- UniqueIdentifier = 14,
- SmallDateTime = 15,
- SmallInt = 16,
- SmallMoney = 17,
- Text = 18,
- Timestamp = 19,
- TinyInt = 20,
- VarBinary = 21,
- VarChar = 22,
- Variant = 23
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/StateChangeEventHandler.cs b/mcs/class/System.Data/System.Data/StateChangeEventHandler.cs
deleted file mode 100644
index 29ad7703030..00000000000
--- a/mcs/class/System.Data/System.Data/StateChangeEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.StateChangeEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the StateChange event.
- /// </summary>
- [Serializable]
- public delegate void StateChangeEventHandler(object sender, StateChangeEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/StatementType.cs b/mcs/class/System.Data/System.Data/StatementType.cs
deleted file mode 100644
index ac307b13e54..00000000000
--- a/mcs/class/System.Data/System.Data/StatementType.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.StatementType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies the type of SQL query to be used by the OleDbRowUpdatedEventArgs, OleDbRowUpdatingEventArgs, SqlRowUpdatedEventArgs, or SqlRowUpdatingEventArgs class.
- /// </summary>
- [Serializable]
- public enum StatementType
- {
- Select = 0,
- Insert = 1,
- Update = 2,
- Delete = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/UpdateRowSource.cs b/mcs/class/System.Data/System.Data/UpdateRowSource.cs
deleted file mode 100644
index 5ebd297aad1..00000000000
--- a/mcs/class/System.Data/System.Data/UpdateRowSource.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.UpdateRowSource.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies how query command results are applied to the row being updated.
- /// </summary>
- [Serializable]
- public enum UpdateRowSource
- {
- None = 0,
- OutputParameters = 1,
- FirstReturnedRecord = 2,
- Both = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/UpdateStatus.cs b/mcs/class/System.Data/System.Data/UpdateStatus.cs
deleted file mode 100644
index b82b187d85d..00000000000
--- a/mcs/class/System.Data/System.Data/UpdateStatus.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.UpdateStatus.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies the action to take with regard to the current and remaining rows during an Update.
- /// </summary>
- [Serializable]
- public enum UpdateStatus
- {
- Continue = 0,
- ErrorsOccurred = 1,
- SkipCurrentRow = 2,
- SkipAllRemainingRows = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/XmlReadMode.cs b/mcs/class/System.Data/System.Data/XmlReadMode.cs
deleted file mode 100644
index dad273758c8..00000000000
--- a/mcs/class/System.Data/System.Data/XmlReadMode.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Data.XmlReadMode.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Specifies how to read XML data and a relational schema into a DataSet.
- /// </summary>
- [Serializable]
- public enum XmlReadMode
- {
- Auto = 0,
- ReadSchema = 1,
- IgnoreSchema = 2,
- InferSchema = 3,
- DiffGram = 4,
- Fragment = 5
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/XmlWriteMode.cs b/mcs/class/System.Data/System.Data/XmlWriteMode.cs
deleted file mode 100644
index e1877dae362..00000000000
--- a/mcs/class/System.Data/System.Data/XmlWriteMode.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Data.XmlWriteMode.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace mono.System.Data
-{
- /// <summary>
- /// Use the members of this enumeration when setting the WriteMode parameter of the WriteXml method.
- /// </summary>
- [Serializable]
- public enum XmlWriteMode
- {
- WriteSchema = 0,
- IgnoreSchema = 1,
- DiffGram = 2
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog
deleted file mode 100644
index cf74d68dffe..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog
+++ /dev/null
@@ -1,7 +0,0 @@
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * ChangeLog : Add.
-
- * Matrix.cs : MonoTODO everywhere.
-
- * TODOAttribute.cs : Add here too. \ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Enums.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/Enums.cs
deleted file mode 100644
index 3ba9f61892e..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Enums.cs
+++ /dev/null
@@ -1,258 +0,0 @@
-//
-// System.Drawing.Drawing2D.Matrix.cs
-//
-// Author:
-// Stefan Maierhofer <sm@cg.tuwien.ac.at>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Drawing.Drawing2D
-{
-
- public enum CombineMode
- {
- Complement,
- Exclude,
- Intersect,
- Replace,
- Union,
- Xor
- }
-
- public enum CompositingMode
- {
- SourceCopy,
- SourceOver
- }
-
- public enum CompositingQuality
- {
- AssumeLinear,
- Default,
- GammaCorrected,
- HighQuality,
- HighSpeed,
- Invalid
- }
-
- public enum CoordinateSpace
- {
- Device,
- Page,
- World
- }
-
- public enum DashCap
- {
- Flat,
- Round,
- Triangle
- }
-
- public enum DashStyle
- {
- Custom,
- Dash,
- DashDot,
- DashDotDot,
- Dot,
- Solid
- }
-
- public enum FillMode
- {
- Alternate,
- Winding
- }
-
- public enum FlushIntention
- {
- Flush,
- Sync
- }
-
- public enum HatchStyle
- {
- BackwardDiagonal,
- Cross,
- DarkDownwardDiagonal,
- DarkHorizontal,
- DarkUpwardDiagonal,
- DarkVertical,
- DashedDownwardDiagonal,
- DashedHorizontal,
- DashedUpwardDiagonal,
- DashedVertical,
- DiagonalBrick,
- DiagonalCross,
- Divot,
- DottedDiamond,
- DottedGrid,
- ForwardDiagonal,
- Horizontal,
- HorizontalBrick,
- LargeCheckerBoard,
- LargeConfetti,
- LargeGrid,
- LightDownwardDiagonal,
- LightHorizontal,
- LightUpwardDiagonal,
- LightVertical,
- Max,
- Min,
- NarrowHorizontal,
- NarrowVertical,
- OutlinedDiamond,
- Percent05,
- Percent10,
- Percent20,
- Percent25,
- Percent30,
- Percent40,
- Percent50,
- Percent60,
- Percent70,
- Percent75,
- Percent80,
- Percent90,
- Plaid,
- Shingle,
- SmallCheckerBoard,
- SmallConfetti,
- SmallGrid,
- SolidDiamond,
- Sphere,
- Trellis,
- Vertical,
- Wave,
- Weave,
- WideDownwardDiagonal,
- WideUpwardDiagonal,
- ZigZag
- }
-
- public enum InterpolationMode
- {
- Bicubic,
- Bilinear,
- Default,
- High,
- HighQualityBicubic,
- HighQualityBilinear,
- Invalid,
- Low,
- NearestNeighbour
- }
-
- public enum LinearGradientMode
- {
- BackwardDiagonal,
- ForwardDiagonal,
- Horizontal,
- Vertical
- }
-
- public enum LineCap
- {
- AnchorMask,
- ArrowAnchor,
- Custom,
- DiamondAnchor,
- Flat,
- NoAnchor,
- Round,
- RoundAnchor,
- Square,
- SquareAnchor,
- Triangle
- }
-
- public enum LineJoin
- {
- Bevel,
- Miter,
- MiterClipped,
- Round
- }
-
- public enum MatrixOrder
- {
- Append,
- Prepend
- }
-
- public enum PathPointType
- {
- Bezier,
- Bezier3,
- CloseSubpath,
- DashMode,
- Line,
- PathMarker,
- PathTypeMask,
- Start
- }
-
- public enum PenAlignment
- {
- Center,
- Inset,
- Left,
- Outset,
- Right
- }
-
- public enum PenType
- {
- HatchFill,
- LinearGradient,
- PathGradient,
- SolidColor,
- TextureFill
- }
-
- public enum PixelOffsetMode
- {
- Default,
- Half,
- HighQuality,
- HighSpeed,
- Invalid,
- None
- }
-
- public enum QualityMode
- {
- Default,
- Hight,
- Invalid,
- Low
- }
-
- public enum SmoothingMode
- {
- AntiAlias,
- Default,
- HighQuality,
- HighSpeed,
- Invalid,
- None
- }
-
- public enum WarpMode
- {
- Bilinear,
- Perspective
- }
-
- public enum WrapMode
- {
- Clamp,
- Tile,
- TileFlipX,
- TileFlipXY,
- TileFlipY
- }
-
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.cs
deleted file mode 100644
index 2163ac94984..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.cs
+++ /dev/null
@@ -1,453 +0,0 @@
-//
-// System.Drawing.Drawing2D.Matrix.cs
-//
-// Author:
-// Stefan Maierhofer <sm@cg.tuwien.ac.at>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Drawing;
-using System.Runtime.InteropServices;
-
-namespace System.Drawing.Drawing2D
-{
- public sealed class Matrix : MarshalByRefObject, IDisposable
- {
- // initialize to identity
- private float[] m = {1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f};
-
- // constructors
- public Matrix() { }
-
- /* TODO: depends on System.Drawing.Drawing2D.Rectangle
- public Matrix(Rectangle rect , Point[] plgpts)
- {
- // TODO
- }
- */
-
- /* TODO: depends on System.Drawing.Drawing2D.RectangleF
- public Matrix(RectangleF rect , PointF[] pa)
- {
- // TODO
- }
- */
- public Matrix(float m11, float m12,
- float m21, float m22,
- float dx, float dy)
- {
- m[0] = m11; m[1] = m12;
- m[2] = m21; m[3] = m22;
- m[4] = dx; m[5] = dy;
- }
-
- // properties
- public float[] Elements
- {
- get { return m; }
- }
-
- public bool IsIdentity
- {
- get
- {
- if ( (m[0] == 1.0f) && (m[1] == 0.0f) &&
- (m[2] == 0.0f) && (m[3] == 1.0f) &&
- (m[4] == 0.0f) && (m[5] == 0.0f) )
- return true;
- else
- return false;
- }
- }
-
- public bool IsInvertible
- {
- get
- {
- // matrix M is invertible if det(M) != 0
- float det = m[0] * m[3] - m[2] * m[1];
- if (det != 0.0f) return true;
- else return false;
- }
- }
-
- public float OffsetX
- {
- get { return m[4]; }
- }
-
- public float OffsetY
- {
- get { return m[5]; }
- }
-
- // methods
- public Matrix Clone()
- {
- return new Matrix(m[0], m[1], m[2], m[3], m[4], m[5]);
- }
-
- public void Dispose() { }
-
- public override bool Equals(object obj)
- {
- if (obj is Matrix)
- {
- float[] a = ((Matrix)obj).Elements;
- if ( m[0] == a[0] && m[1] == a[1] &&
- m[2] == a[2] && m[3] == a[3] &&
- m[4] == a[4] && m[5] == a[5] )
- return true;
- else
- return false;
- }
- else
- {
- return false;
- }
- }
-
- ~Matrix() {}
-
- [StructLayout(LayoutKind.Explicit)]
- internal struct BitConverter
- {
- [FieldOffset(0)] public float f;
- [FieldOffset(0)] public int i;
- }
-
- public override int GetHashCode()
- {
- BitConverter b;
- // compiler is not smart
- b.i = 0;
- int h = 0;
- for (int i = 0; i < 6; i++)
- {
- b.f = m[i];
- h ^= b.i >> i;
- }
- return h;
- }
-
- public void Invert()
- {
- float det = m[0] * m[3] - m[2] * m[1];
- if (det != 0.0f) // if invertible
- {
- float[] r =
- {
- m[3] / det,
- -m[1] / det,
- -m[2] / det,
- m[0] / det,
- (-m[3] * m[4] + m[1] * m[5]) / det,
- (m[2] * m[4] - m[0] * m[5]) / det
- };
- m = r;
- }
- }
-
- public void Multiply(Matrix matrix)
- {
- Multiply(matrix, MatrixOrder.Prepend);
- }
-
- public void Multiply(Matrix matrix, MatrixOrder order)
- {
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = matrix * this
- float[] p = matrix.Elements;
- float[] r0 =
- {
- p[0] * m[0] + p[1] * m[2],
- p[0] * m[1] + p[1] * m[3],
- p[2] * m[0] + p[3] * m[2],
- p[2] * m[1] + p[3] * m[3],
- p[4] * m[0] + p[5] * m[2] + m[4],
- p[4] * m[1] + p[5] * m[3] + m[5]
- };
- m = r0;
- break;
- case MatrixOrder.Append:
- // this = this * matrix
- float[] a = matrix.Elements;
- float[] r1 =
- {
- m[0] * a[0] + m[1] * a[2],
- m[0] * a[1] + m[1] * a[3],
- m[2] * a[0] + m[3] * a[2],
- m[2] * a[1] + m[3] * a[3],
- m[4] * a[0] + m[5] * a[2] + a[4],
- m[4] * a[1] + m[5] * a[3] + a[5]
- };
- m = r1;
- break;
- }
- }
-
- public void Reset()
- {
- m[0] = 1.0f; m[1] = 0.0f;
- m[2] = 0.0f; m[3] = 1.0f;
- m[4] = 0.0f; m[5] = 0.0f;
- }
-
- public void Rotate(float angle)
- {
- Rotate(angle, MatrixOrder.Prepend);
- }
-
- public void Rotate(float angle, MatrixOrder order)
- {
- angle *= (float)(Math.PI / 180.0); // degrees to randians
- float cos = (float)Math.Cos(angle);
- float sin = (float)Math.Sin(angle);
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = rotation * this
- float[] r0 =
- {
- cos * m[0] + sin * m[2],
- cos * m[1] + sin * m[3],
- -sin * m[0] + cos * m[2],
- -sin * m[1] + cos * m[3],
- m[4],
- m[5]
- };
- m = r0;
- break;
- case MatrixOrder.Append:
- // this = this * rotation
- float[] r1 =
- {
- m[0] * cos + m[1] * -sin,
- m[0] * sin + m[1] * cos,
- m[2] * cos + m[3] * -sin,
- m[2] * sin + m[3] * cos,
- m[4] * cos + m[5] * -sin,
- m[4] * sin + m[5] * cos
- };
- m = r1;
- break;
- }
- }
-
- public void RotateAt(float angle, PointF point)
- {
- RotateAt(angle, point, MatrixOrder.Prepend);
- }
-
- public void RotateAt(float angle, PointF point, MatrixOrder order)
- {
- angle *= (float)(Math.PI / 180.0); // degrees to randians
- float cos = (float)Math.Cos(angle);
- float sin = (float)Math.Sin(angle);
- float e4 = -point.X * cos + point.Y * sin + point.X;
- float e5 = -point.X * sin - point.Y * cos + point.Y;
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = rotation * this
- float[] r0 =
- {
- cos * m[0] + sin * m[2],
- cos * m[1] + sin * m[3],
- -sin * m[0] + cos * m[2],
- -sin * m[1] + cos * m[3],
- e4 * m[0] + e5 * m[2] + m[4],
- e4 * m[1] + e5 * m[3] + m[5]
- };
- m = r0;
- break;
- case MatrixOrder.Append:
- // this = this * rotation
- float[] r1 =
- {
- m[0] * cos + m[1] * -sin,
- m[0] * sin + m[1] * cos,
- m[2] * cos + m[3] * -sin,
- m[2] * sin + m[3] * cos,
- m[4] * cos + m[5] * -sin + e4,
- m[4] * sin + m[5] * cos + e5
- };
- m = r1;
- break;
- }
- }
-
- public void Scale(float scaleX, float scaleY)
- {
- Scale(scaleX, scaleY, MatrixOrder.Prepend);
- }
-
- public void Scale(float scaleX, float scaleY, MatrixOrder order)
- {
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = scale * this
- m[0] *= scaleX; m[1] *= scaleX;
- m[2] *= scaleY; m[3] *= scaleY;
- break;
- case MatrixOrder.Append:
- // this = this * scale
- m[0] *= scaleX; m[1] *= scaleY;
- m[2] *= scaleX; m[3] *= scaleY;
- m[4] *= scaleX; m[5] *= scaleY;
- break;
- }
- }
-
- public void Shear(float shearX, float shearY)
- {
- Shear(shearX, shearY, MatrixOrder.Prepend);
- }
-
- // LAMESPEC: quote from beta 2 sdk docs: "[To be supplied!]"
- //
- // assuming transformation matrix:
- //
- // (1 shearY 0)
- // (shearX 1 0)
- // (0 0 1)
- //
- public void Shear(float shearX, float shearY, MatrixOrder order)
- {
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = shear * this
- float[] r0 =
- {
- m[0] + shearY * m[2],
- m[1] + shearY * m[3],
- shearX * m[0] + m[2],
- shearX * m[1] + m[3],
- m[4],
- m[5]
- };
- m = r0;
- break;
- case MatrixOrder.Append:
- // this = this * shear
- float[] r1 =
- {
- m[0] + m[1] * shearX,
- m[0] * shearY + m[1],
- m[2] + m[3] * shearX,
- m[2] * shearY + m[3],
- m[4] + m[5] * shearX ,
- m[4] * shearY + m[5]
- };
- m = r1;
- break;
- }
- }
-
- public void TransformPoints(Point[] pts)
- {
- for (int i = 0; i < pts.Length; i++)
- {
- float x = (float)pts[i].X;
- float y = (float)pts[i].Y;
- pts[i].X = (int)(x * m[0] + y * m[2] + m[4]);
- pts[i].Y = (int)(x * m[1] + y * m[3] + m[5]);
- }
- }
-
- public void TransformPoints(PointF[] pts)
- {
- for (int i = 0; i < pts.Length; i++)
- {
- float x = pts[i].X;
- float y = pts[i].Y;
- pts[i].X = x * m[0] + y * m[2] + m[4];
- pts[i].Y = x * m[1] + y * m[3] + m[5];
- }
- }
-
- public void TransformVectors(Point[] pts)
- {
- for (int i = 0; i < pts.Length; i++)
- {
- float x = (float)pts[i].X;
- float y = (float)pts[i].Y;
- pts[i].X = (int)(x * m[0] + y * m[2]);
- pts[i].Y = (int)(x * m[1] + y * m[3]);
- }
- }
-
- public void TransformVectors(PointF[] pts)
- {
- for (int i = 0; i < pts.Length; i++)
- {
- float x = pts[i].X;
- float y = pts[i].Y;
- pts[i].X = x * m[0] + y * m[2];
- pts[i].Y = x * m[1] + y * m[3];
- }
- }
-
- public void Translate(float offsetX, float offsetY)
- {
- Translate(offsetX, offsetY, MatrixOrder.Prepend);
- }
-
- public void Translate(float offsetX, float offsetY, MatrixOrder order)
- {
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = translation * this
- m[4] = offsetX * m[0] + offsetY * m[2] + m[4];
- m[5] = offsetX * m[1] + offsetY * m[3] + m[5];
- break;
- case MatrixOrder.Append:
- // this = this * translation
- m[4] += offsetX;
- m[5] += offsetY;
- break;
- }
- }
-
- // LAMESPEC: quote from beta 2 sdk docs: "[To be supplied!]"
- [MonoTODO]
- public void VectorTransformPoints(Point[] pts)
- {
- // TODO
- }
-
- // some simple test (TODO: remove)
- /*
- public static void Main()
- {
- PointF[] p = {new PointF(1.0f, 2.0f)};
- Console.WriteLine("(" + p[0].X + " " + p[0].Y + ")");
- Matrix m = new Matrix();
-
- m.Translate(1.0f, 1.0f);
- m.Scale(2.0f, 2.0f);
- m.Rotate(180.0f);
-
- m.TransformPoints(p);
- Console.WriteLine("(" + p[0].X + " " + p[0].Y + ")");
- m.Invert();
- m.TransformPoints(p);
- Console.WriteLine("(" + p[0].X + " " + p[0].Y + ")");
-
- Matrix a = new Matrix(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f);
- Matrix b = new Matrix(2.0f, 0.0f, 0.0f, 2.0f, 0.0f, 0.0f);
-
- Console.WriteLine("h(a) = " + a.GetHashCode());
- Console.WriteLine("h(b) = " + b.GetHashCode());
- }
- */
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/PenAlignment.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/PenAlignment.cs
deleted file mode 100755
index e5f49323e96..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/PenAlignment.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Drawing.Drawing2D.PenAlignment.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Drawing {
-
- public enum PenAlignment {
- Center = 0,
- Inset = 1,
- Outset = 2,
- Left = 3,
- Right =4
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/TODOAttribute.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/TODOAttribute.cs
deleted file mode 100644
index 0920ce8f92d..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/TODOAttribute.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
- public class MonoTODOAttribute : Attribute {
-
- private string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment
- {
- get { return comment; }
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/FrameDimension.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/FrameDimension.cs
deleted file mode 100644
index cc431619f31..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/FrameDimension.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-// created on 21.02.2002 at 17:06
-//
-// FrameDimension.cs
-//
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-//
-
-namespace System.Drawing.Imaging {
-
-using System;
-
-public sealed class FrameDimension {
-
- // constructor
- public FrameDimension (Guid guid) {}
-
- //properties
- public Guid Guid {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public static FrameDimension Page {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public static FrameDimension Resolution {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public static FrameDimension Time {
- get {
- throw new NotImplementedException ();
- }
- }
-
- //methods
- public override bool Equals (object o) {
- throw new NotImplementedException ();
- }
-
- public override int GetHashCode () {
- throw new NotImplementedException ();
- }
-
- public override string ToString() {
- throw new NotImplementedException ();
- }
-
- //destructor
- ~FrameDimension () {}
-}
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/PixelFormat.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/PixelFormat.cs
deleted file mode 100644
index b0d2b78411f..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/PixelFormat.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// created on 20.02.2002 at 21:18
-//
-// Image.cs
-//
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-//
-//
-namespace System.Drawing.Imaging {
-
- public enum PixelFormat {
- Alpha,
- Canonical,
- DontCare,
- Extended,
- Format16bppArgb1555,
- Format16bppGrayScale,
- Format16bppRgb555,
- Format16bppRgb565,
- Format1bppIndexed,
- Format24bppRgb,
- Format32bppArgb,
- Format32bppPArgb,
- Format32bppRgb,
- Format48bppRgb,
- Format4bppIndexed,
- Format64bppArgb,
- Format64bppPArgb,
- Format8bppIndexed,
- Gdi,
- Indexed,
- Max,
- PAlpha,
- Undefined
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.build b/mcs/class/System.Drawing/System.Drawing.build
deleted file mode 100644
index b05d3180001..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.build
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for SystemDrawing.dll -->
-
-<project name="System" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <csc target="library" output="../lib/System.Drawing.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/unsafe"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- </sources>
- <references>
- <includes name="../lib/corlib.dll"/>
- </references>
- </csc>
- </target>
-</project>
diff --git a/mcs/class/System.Drawing/System.Drawing/Bitmap.cs b/mcs/class/System.Drawing/System.Drawing/Bitmap.cs
deleted file mode 100755
index a07bbe64bc0..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Bitmap.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-// created on 25.02.2002 at 22:43
-//
-// Bitmap.cs
-//
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-//
-// No implementation has been done yet. I first want to write the method
-// headers of every System.Drawing.
-//
-using System;
-using System.Drawing;
-using System.Drawing.Imaging;
-
-namespace System.Drawing {
-
- public sealed class Bitmap : Image {
-
- // constructors
- public Bitmap (Image origial) {
- this.original = original;
- }
-
-/* public Bitmap (Stream stream) {
- this.stream = stream;
- }
-*/
- public Bitmap (string filename) {
- this.filename = filename;
- }
-
- public Bitmap (Image original, Size newSize) {
- this.original = original;
- this.newSize = newSize;
- }
-
- public Bitmap (int width, int heigth) {
- this.width = width;
- this.heigth = heigth;
- }
-
-/* public Bitmap (Stream stream, bool useIcm) {
- this.stream = stream;
- this.useIcm = useIcm;
- }
-*/
- public Bitmap (string filename, bool useIcm) {
- this.filename = filename;
- this.useIcm = useIcm;
- }
-
- public Bitmap (Type type, string resource) {
- this.type = type;
- this.resource = resource;
- }
-
- public Bitmap (Image original, int width, int heigth) {
- this.original = original;
- this.width = width;
- this.heigth = heigth;
- }
-
- public Bitmap (int width, int heigth, Graphics g) {
- this.width = width;
- this.heigth = heigth;
- this.g = g;
- }
-/*
- public Bitmap (int width, int heigth, PixelFormat format) {
- this.width = width;
- this.heigth = heigth;
- this.format = format;
- }
-
- public Bitmap (int width, int height, int stride,
- PixelFormat format, IntPtr scan0) {
- this.width = width;
- this.heigth = heigth;
- this.stride = stride;
- this.format = format;
- this.scan0 = scan0;
- }
-
- // methods
- public Bitmap Clone (Rectangle rect,PixelFormat format) {
- throw new NotImplementedException ();
- }
-
- public Bitmap Clone (RectangleF rect, PixelFormat format) {
- throw new NotImplementedException ();
- }
-*/
- public static Bitmap FromHicon (IntPtr hicon) {
- throw new NotImplementedException ();
- }
-
- public static Bitmap FromResource (IntPtr hinstance,
- string bitmapName) {
- throw new NotImplementedException ();
- }
-
- public IntPtr GetHbitmap () {
- throw new NotImplementedException ();
- }
-
- public IntPtr GetHbitmap (Color background) {
- throw new NotImplementedException ();
- }
-
- public IntPtr GetHicon () {
- throw new NotImplementedException ();
- }
-
- public Color GetPixel (int x, int y) {
- throw new NotImplementedException ();
- }
-
-/* public BitmapData LockBits (Rectangle rect, ImageLockMode flags,
- PixelFormat format) {
- throw new NotImplementedException ();
- } */
-
- public void MakeTransparent () {
- throw new NotImplementedException ();
- }
-
- public void MakeTransparent (Color transparentColor) {
- throw new NotImplementedException ();
- }
-
- public void SetPixel (int x, int y, Color color) {
- throw new NotImplementedException ();
- }
-
- public void SetResolution (float xDpi, float yDpi) {
- throw new NotImplementedException ();
- }
-
-/* public void UnlockBits (BitmapData bitmapdata) {
- throw new NotImplementedException ();
- } */
-
- // properties
- // needs to be done ###FIXME###
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Brush.cs b/mcs/class/System.Drawing/System.Drawing/Brush.cs
deleted file mode 100755
index 731f2d55408..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Brush.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Drawing.Brush.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Drawing {
-
- public abstract class Brush : MarshalByRefObject, ICloneable, IDisposable {
-
- abstract public object Clone ();
-
- public void Dispose ()
- {
- Dispose (true);
- System.GC.SuppressFinalize (this);
- }
-
- void Dispose (bool disposing)
- {
- // Nothing for now.
- }
-
- ~Brush ()
- {
- Dispose (false);
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/ChangeLog b/mcs/class/System.Drawing/System.Drawing/ChangeLog
deleted file mode 100644
index 5e3be07e20b..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/ChangeLog
+++ /dev/null
@@ -1,25 +0,0 @@
-2002-02-26 Christian Meyer <Christian.Meyer@cs.tum.edu>
-
- * Bitmap.cs: Added method headers.
-
-2002-02-25 Christian Meyer <Christian.Meyer@cs.tum.edu>
-
- * Bitmap.cs: Added, no implementation's done, yet.
-
-2001-12-15 Mike Kestner <mkestner@speakeasy.net>
-
- * Rectangle.cs : Add a doc comment.
- * RectangleF.cs : New struct implementation.
-
-2001-12-15 Mike Kestner <mkestner@speakeasy.net>
-
- * Rectangle.cs : New struct implementation.
-
-2001-08-17 Mike Kestner <mkestner@speakeasy.net>
-
- * PointF.cs, Size.cs, SizeF.cs : New struct implementations.
-
-2001-08-16 Mike Kestner <mkestner@speakeasy.net>
-
- * Point.cs : New. Implementation of System.Drawing.Point struct.
-
diff --git a/mcs/class/System.Drawing/System.Drawing/Image.cs b/mcs/class/System.Drawing/System.Drawing/Image.cs
deleted file mode 100644
index 19da5571086..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Image.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-// created on 20.02.2002 at 21:18
-//
-// Image.cs
-//
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-//
-// Many methods are still commented. I'll care about them when all necessary
-// classes are implemented.
-//
-namespace System.Drawing {
-
-using System;
-using System.Runtime.Remoting;
-using System.Runtime.Serialization;
-using System.Drawing.Imaging;
-
-//[Serializable]
-//[ComVisible(true)]
-
-public abstract class Image : MarshalByRefObject, ICloneable, IDisposable /*, ISerializable */ {
-
- // constructor
- public Image () {}
-
- // public methods
- // static
- public static Image FromFile (string filename)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static Image FromFile (string filename, bool useEmbeddedColorManagement)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static Bitmap FromHbitmap (IntPtr hbitmap)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static Bitmap FromHbitmap (IntPtr hbitmap, IntPtr hpalette)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static int GetPixelFormatSize (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static bool IsAlphaPixelFormat (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static bool IsCanonicalPixelFormat (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static bool IsExtendedPixelFormat (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- // non-static
- public object Clone ()
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public void Dispose ()
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- protected virtual void Dispose (bool disposing)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public RectangleF GetBounds (ref GraphicsUnit pageUnit)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- //public EncoderParameters GetEncoderParameterList(Guid encoder);
- //public int GetFrameCount(FrameDimension dimension);
- //public PropertyItem GetPropertyItem(int propid);
- /*
- public Image GetThumbnailImage(int thumbWidth, int thumbHeight,
- Image.GetThumbnailImageAbort callback,
- IntPtr callbackData);
- */
-
- public void RemovePropertyItem (int propid)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public void RotateFlip (RotateFlipType rotateFlipType)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public void Save (string filename)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- //public void Save(Stream stream, ImageFormat format);
- //public void Save(string filename, ImageFormat format);
- //public void Save(Stream stream, ImageCodecInfo encoder,
- // EncoderParameters encoderParams);
- //public void Save(string filename, ImageCodecInfo encoder,
- // EncoderParameters encoderParams);
- //public void SaveAdd(EncoderParameters_ encoderParams);
- //public void SaveAdd(Image image, EncoderParameters_ encoderParams);
- //public int SelectActiveFrame(FrameDimension dimension, int frameIndex);
- //public void SetPropertyItem(PropertyItem propitem);
-
- // destructor
- ~Image() {}
-
- // properties
- public int Flags {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public Guid[] FrameDimensionsList {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public int Height {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public float HorizontalResolution {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public ColorPalette Palette {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public SizeF PhysicalDimension {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public PixelFormat PixelFormat {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public int[] PropertyIdList {
- get {
- throw new NotImplementedException ();
- }
- }
-
- //public PropertyItem[] PropertyItems {get;}
- //public ImageFormat RawFormat {get;}
-
- public Size Size {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public float VerticalResolution {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public int Width {
- get {
- throw new NotImplementedException ();
- }
- }
-
-}
-
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Pen.cs b/mcs/class/System.Drawing/System.Drawing/Pen.cs
deleted file mode 100755
index 16c6263b049..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Pen.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// System.Drawing.Pen.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Drawing.Drawing2D;
-
-namespace System.Drawing {
-
- public sealed class Pen : MarshalByRefObject, ICloneable, IDisposable {
- Brush brush;
- Color color;
- float width;
- PenAlignment alignment;
-
- public Pen (Brush brush)
- {
- this.brush = brush;
- width = 1;
- }
-
- public Pen (Color color)
- {
- this.color = color;
- width = 1;
- }
-
- public Pen (Brush brush, float width)
- {
- this.width = width;
- this.brush = brush;
- }
-
- public Pen (Color color, float width)
- {
- this.width = width;
- this.color = color;
- }
-
- //
- // Properties
- //
- public PenAlignment Alignment {
- get {
- return alignment;
- }
-
- set {
- alignment = value;
- }
- }
-
- public Brush Brush {
- get {
- return brush;
- }
-
- set {
- brush = value;
- }
- }
-
- public Color Color {
- get {
- return color;
- }
-
- set {
- color = value;
- }
- }
-
- public float Width {
- get {
- return width;
- }
- set {
- width = value;
- }
- }
-
- public object Clone ()
- {
- Pen p = new Pen (brush, width);
-
- p.color = color;
- p.alignment = alignment;
-
- return p;
- }
-
- public void Dispose ()
- {
- Dispose (true);
- System.GC.SuppressFinalize (this);
- }
-
- void Dispose (bool disposing)
- {
- // Nothing for now.
- }
-
- ~Pen ()
- {
- Dispose (false);
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Point.cs b/mcs/class/System.Drawing/System.Drawing/Point.cs
deleted file mode 100644
index fa0db9abc9b..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Point.cs
+++ /dev/null
@@ -1,339 +0,0 @@
-//
-// System.Drawing.Point.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct Point {
-
- // Private x and y coordinate fields.
- int cx, cy;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized Point Structure.
- /// </remarks>
-
- public static readonly Point Empty;
-
- /// <summary>
- /// Ceiling Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Point structure from a PointF structure by
- /// taking the ceiling of the X and Y properties.
- /// </remarks>
-
- public static Point Ceiling (PointF value)
- {
- int x, y;
- checked {
- x = (int) Math.Ceiling (value.X);
- y = (int) Math.Ceiling (value.Y);
- }
-
- return new Point (x, y);
- }
-
- /// <summary>
- /// Round Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Point structure from a PointF structure by
- /// rounding the X and Y properties.
- /// </remarks>
-
- public static Point Round (PointF value)
- {
- int x, y;
- checked {
- x = (int) Math.Round (value.X);
- y = (int) Math.Round (value.Y);
- }
-
- return new Point (x, y);
- }
-
- /// <summary>
- /// Truncate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Point structure from a PointF structure by
- /// truncating the X and Y properties.
- /// </remarks>
-
- // LAMESPEC: Should this be floor, or a pure cast to int?
-
- public static Point Truncate (PointF value)
- {
- int x, y;
- checked {
- x = (int) value.X;
- y = (int) value.Y;
- }
-
- return new Point (x, y);
- }
-
- /// <summary>
- /// Addition Operator
- /// </summary>
- ///
- /// <remarks>
- /// Translates a Point using the Width and Height
- /// properties of the given <typeref>Size</typeref>.
- /// </remarks>
-
- public static Point operator + (Point pt, Size sz)
- {
- return new Point (pt.X + sz.Width, pt.Y + sz.Height);
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Point objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- /// </remarks>
-
- public static bool operator == (Point pt_a, Point pt_b)
- {
- return ((pt_a.X == pt_b.X) && (pt_a.Y == pt_b.Y));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Point objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- /// </remarks>
-
- public static bool operator != (Point pt_a, Point pt_b)
- {
- return ((pt_a.X != pt_b.X) || (pt_a.Y != pt_b.Y));
- }
-
- /// <summary>
- /// Subtraction Operator
- /// </summary>
- ///
- /// <remarks>
- /// Translates a Point using the negation of the Width
- /// and Height properties of the given Size.
- /// </remarks>
-
- public static Point operator - (Point pt, Size sz)
- {
- return new Point (pt.X - sz.Width, pt.Y - sz.Height);
- }
-
- /// <summary>
- /// Point to Size Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Returns a Size based on the Coordinates of a given
- /// Point. Requires explicit cast.
- /// </remarks>
-
- public static explicit operator Size (Point pt)
- {
- return new Size (pt.X, pt.Y);
- }
-
- /// <summary>
- /// Point to PointF Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Creates a PointF based on the coordinates of a given
- /// Point. No explicit cast is required.
- /// </remarks>
-
- public static implicit operator PointF (Point pt)
- {
- return new PointF (pt.X, pt.Y);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// Point Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Point from an integer which holds the X
- /// coordinate in the high order 16 bits and the Y
- /// coordinate in the low order 16 bits.
- /// </remarks>
-
- public Point (int dw)
- {
- cx = dw >> 16;
- cy = dw & 0xffff;
- }
-
- /// <summary>
- /// Point Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Point from a Size value.
- /// </remarks>
-
- public Point (Size sz)
- {
- cx = sz.Width;
- cy = sz.Height;
- }
-
- /// <summary>
- /// Point Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Point from a specified x,y coordinate pair.
- /// </remarks>
-
- public Point (int x, int y)
- {
- cx = x;
- cy = y;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if both X and Y are zero.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((cx == 0) && (cy == 0));
- }
- }
-
- /// <summary>
- /// X Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the Point.
- /// </remarks>
-
- public int X {
- get {
- return cx;
- }
- set {
- cx = value;
- }
- }
-
- /// <summary>
- /// Y Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the Point.
- /// </remarks>
-
- public int Y {
- get {
- return cy;
- }
- set {
- cy = value;
- }
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this Point and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is Point))
- return false;
-
- return (this == (Point) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return cx^cy;
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the Point a specified distance.
- /// </remarks>
-
- public void Offset (int dx, int dy)
- {
- cx += dx;
- cy += dy;
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the Point as a string in coordinate notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", cx, cy);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/PointF.cs b/mcs/class/System.Drawing/System.Drawing/PointF.cs
deleted file mode 100644
index 42895bdac4a..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/PointF.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// System.Drawing.PointF.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct PointF {
-
- // Private x and y coordinate fields.
- float cx, cy;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized PointF Structure.
- /// </remarks>
-
- public static readonly PointF Empty;
-
- /// <summary>
- /// Addition Operator
- /// </summary>
- ///
- /// <remarks>
- /// Translates a PointF using the Width and Height
- /// properties of the given Size.
- /// </remarks>
-
- public static PointF operator + (PointF pt, Size sz)
- {
- return new PointF (pt.X + sz.Width, pt.Y + sz.Height);
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two PointF objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- /// </remarks>
-
- public static bool operator == (PointF pt_a, PointF pt_b)
- {
- return ((pt_a.X == pt_b.X) && (pt_a.Y == pt_b.Y));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two PointF objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- /// </remarks>
-
- public static bool operator != (PointF pt_a, PointF pt_b)
- {
- return ((pt_a.X != pt_b.X) || (pt_a.Y != pt_b.Y));
- }
-
- /// <summary>
- /// Subtraction Operator
- /// </summary>
- ///
- /// <remarks>
- /// Translates a PointF using the negation of the Width
- /// and Height properties of the given Size.
- /// </remarks>
-
- public static PointF operator - (PointF pt, Size sz)
- {
- return new PointF (pt.X - sz.Width, pt.Y - sz.Height);
- }
-
- // -----------------------
- // Public Constructor
- // -----------------------
-
- /// <summary>
- /// PointF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a PointF from a specified x,y coordinate pair.
- /// </remarks>
-
- public PointF (float x, float y)
- {
- cx = x;
- cy = y;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if both X and Y are zero.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((cx == 0.0) && (cy == 0.0));
- }
- }
-
- /// <summary>
- /// X Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the PointF.
- /// </remarks>
-
- public float X {
- get {
- return cx;
- }
- set {
- cx = value;
- }
- }
-
- /// <summary>
- /// Y Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the PointF.
- /// </remarks>
-
- public float Y {
- get {
- return cy;
- }
- set {
- cy = value;
- }
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this PointF and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is PointF))
- return false;
-
- return (this == (PointF) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return (int) cx ^ (int) cy;
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the PointF as a string in coordinate notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", cx, cy);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Rectangle.cs b/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
deleted file mode 100644
index 45f28755102..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
+++ /dev/null
@@ -1,584 +0,0 @@
-//
-// System.Drawing.Rectangle.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct Rectangle {
-
- // Private position and size fields.
- private Point loc;
- private Size sz;
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized Rectangle Structure.
- /// </remarks>
-
- public static readonly Rectangle Empty;
-
- /// <summary>
- /// Ceiling Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Rectangle structure from a RectangleF
- /// structure by taking the ceiling of the X, Y, Width,
- /// and Height properties.
- /// </remarks>
-
- public static Rectangle Ceiling (RectangleF value)
- {
- int x, y, w, h;
- checked {
- x = (int) Math.Ceiling (value.X);
- y = (int) Math.Ceiling (value.Y);
- w = (int) Math.Ceiling (value.Width);
- h = (int) Math.Ceiling (value.Height);
- }
-
- return new Rectangle (x, y, w, h);
- }
-
- /// <summary>
- /// FromLTRB Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Rectangle structure from left, top, right,
- /// and bottom coordinates.
- /// </remarks>
-
- public static Rectangle FromLTRB (int left, int top,
- int right, int bottom)
- {
- return new Rectangle (left, top, right - left,
- bottom - top);
- }
-
- /// <summary>
- /// Inflate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new Rectangle by inflating an existing
- /// Rectangle by the specified coordinate values.
- /// </remarks>
-
- public static Rectangle Inflate (Rectangle rect, int x, int y)
- {
- Rectangle r = new Rectangle (rect.Location, rect.Size);
- r.Inflate (x, y);
- return r;
- }
-
- /// <summary>
- /// Inflate Method
- /// </summary>
- ///
- /// <remarks>
- /// Inflates the Rectangle by a specified width and height.
- /// </remarks>
-
- public void Inflate (int width, int height)
- {
- Inflate (new Size (width, height));
- }
-
- /// <summary>
- /// Inflate Method
- /// </summary>
- ///
- /// <remarks>
- /// Inflates the Rectangle by a specified Size.
- /// </remarks>
-
- public void Inflate (Size sz)
- {
- loc -= sz;
- Size ds = new Size (sz.Width * 2, sz.Height * 2);
- this.sz += ds;
- }
-
- /// <summary>
- /// Intersect Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new Rectangle by intersecting 2 existing
- /// Rectangles. Returns null if there is no intersection.
- /// </remarks>
-
- public static Rectangle Intersect (Rectangle r1, Rectangle r2)
- {
- Rectangle r = new Rectangle (r1.Location, r1.Size);
- r.Intersect (r2);
- return r;
- }
-
- /// <summary>
- /// Intersect Method
- /// </summary>
- ///
- /// <remarks>
- /// Replaces the Rectangle with the intersection of itself
- /// and another Rectangle.
- /// </remarks>
-
- public void Intersect (Rectangle r)
- {
- if (!IntersectsWith (r)) {
- loc = Point.Empty;
- sz = Size.Empty;
- }
-
- X = Math.Max (Left, r.Left);
- Y = Math.Max (Top, r.Top);
- Width = Math.Min (Right, r.Right) - X;
- Height = Math.Min (Bottom, r.Bottom) - Y;
- }
-
- /// <summary>
- /// Round Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Rectangle structure from a RectangleF by
- /// rounding the X, Y, Width, and Height properties.
- /// </remarks>
-
- public static Rectangle Round (RectangleF value)
- {
- int x, y, w, h;
- checked {
- x = (int) Math.Round (value.X);
- y = (int) Math.Round (value.Y);
- w = (int) Math.Round (value.Width);
- h = (int) Math.Round (value.Height);
- }
-
- return new Rectangle (x, y, w, h);
- }
-
- /// <summary>
- /// Truncate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Rectangle structure from a RectangleF by
- /// truncating the X, Y, Width, and Height properties.
- /// </remarks>
-
- // LAMESPEC: Should this be floor, or a pure cast to int?
-
- public static Rectangle Truncate (RectangleF value)
- {
- int x, y, w, h;
- checked {
- x = (int) value.X;
- y = (int) value.Y;
- w = (int) value.Width;
- h = (int) value.Height;
- }
-
- return new Rectangle (x, y, w, h);
- }
-
- /// <summary>
- /// Union Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new Rectangle from the union of 2 existing
- /// Rectangles.
- /// </remarks>
-
- public static Rectangle Union (Rectangle r1, Rectangle r2)
- {
- return FromLTRB (Math.Min (r1.Left, r2.Left),
- Math.Min (r1.Top, r2.Top),
- Math.Max (r1.Right, r2.Right),
- Math.Max (r1.Bottom, r2.Bottom));
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Rectangle objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two Rectangles.
- /// </remarks>
-
- public static bool operator == (Rectangle r1, Rectangle r2)
- {
- return ((r1.Location == r2.Location) &&
- (r1.Size == r2.Size));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Rectangle objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two Rectangles.
- /// </remarks>
-
- public static bool operator != (Rectangle r1, Rectangle r2)
- {
- return ((r1.Location != r2.Location) ||
- (r1.Size != r2.Size));
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// Rectangle Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Rectangle from Point and Size values.
- /// </remarks>
-
- public Rectangle (Point loc, Size sz)
- {
- this.loc = loc;
- this.sz = sz;
- }
-
- /// <summary>
- /// Rectangle Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Rectangle from a specified x,y location and
- /// width and height values.
- /// </remarks>
-
- public Rectangle (int x, int y, int width, int height)
- {
- loc = new Point (x, y);
- sz = new Size (width, height);
- }
-
-
-
- /// <summary>
- /// Bottom Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the bottom edge of the Rectangle.
- /// Read only.
- /// </remarks>
-
- public int Bottom {
- get {
- return Y + Height;
- }
- }
-
- /// <summary>
- /// Height Property
- /// </summary>
- ///
- /// <remarks>
- /// The Height of the Rectangle.
- /// </remarks>
-
- public int Height {
- get {
- return sz.Height;
- }
- set {
- sz.Height = value;
- }
- }
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if the width or height are zero. Read only.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((sz.Width == 0) || (sz.Height == 0));
- }
- }
-
- /// <summary>
- /// Left Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the left edge of the Rectangle.
- /// Read only.
- /// </remarks>
-
- public int Left {
- get {
- return X;
- }
- }
-
- /// <summary>
- /// Location Property
- /// </summary>
- ///
- /// <remarks>
- /// The Location of the top-left corner of the Rectangle.
- /// </remarks>
-
- public Point Location {
- get {
- return loc;
- }
- set {
- loc = value;
- }
- }
-
- /// <summary>
- /// Right Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the right edge of the Rectangle.
- /// Read only.
- /// </remarks>
-
- public int Right {
- get {
- return X + Width;
- }
- }
-
- /// <summary>
- /// Size Property
- /// </summary>
- ///
- /// <remarks>
- /// The Size of the Rectangle.
- /// </remarks>
-
- public Size Size {
- get {
- return sz;
- }
- set {
- sz = value;
- }
- }
-
- /// <summary>
- /// Top Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the top edge of the Rectangle.
- /// Read only.
- /// </remarks>
-
- public int Top {
- get {
- return Y;
- }
- }
-
- /// <summary>
- /// Width Property
- /// </summary>
- ///
- /// <remarks>
- /// The Width of the Rectangle.
- /// </remarks>
-
- public int Width {
- get {
- return sz.Width;
- }
- set {
- sz.Width = value;
- }
- }
-
- /// <summary>
- /// X Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the Rectangle.
- /// </remarks>
-
- public int X {
- get {
- return loc.X;
- }
- set {
- loc.X = value;
- }
- }
-
- /// <summary>
- /// Y Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the Rectangle.
- /// </remarks>
-
- public int Y {
- get {
- return loc.Y;
- }
- set {
- loc.Y = value;
- }
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if an x,y coordinate lies within this Rectangle.
- /// </remarks>
-
- public bool Contains (int x, int y)
- {
- return ((x >= Left) && (x <= Right) &&
- (y >= Top) && (y <= Bottom));
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a Point lies within this Rectangle.
- /// </remarks>
-
- public bool Contains (Point pt)
- {
- return Contains (pt.X, pt.Y);
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a Rectangle lies entirely within this
- /// Rectangle.
- /// </remarks>
-
- public bool Contains (Rectangle rect)
- {
- return (rect == Intersect (this, rect));
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this Rectangle and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is Rectangle))
- return false;
-
- return (this == (Rectangle) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return loc.GetHashCode()^sz.GetHashCode();
- }
-
- /// <summary>
- /// IntersectsWith Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a Rectangle intersects with this one.
- /// </remarks>
-
- public bool IntersectsWith (Rectangle r)
- {
- return !((Left > r.Right) || (Right < r.Left) ||
- (Top > r.Bottom) || (Bottom < r.Top));
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the Rectangle a specified distance.
- /// </remarks>
-
- public void Offset (int dx, int dy)
- {
- X += dx;
- Y += dy;
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the Rectangle a specified distance.
- /// </remarks>
-
- public void Offset (Point pt)
- {
- loc.Offset(pt.X, pt.Y);
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the Rectangle as a string in (x,y,w,h) notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1},{2},{3}]",
- X, Y, Width, Height);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/RectangleF.cs b/mcs/class/System.Drawing/System.Drawing/RectangleF.cs
deleted file mode 100644
index cfe4a7313ed..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/RectangleF.cs
+++ /dev/null
@@ -1,531 +0,0 @@
-//
-// System.Drawing.RectangleF.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct RectangleF {
-
- // Private position and size fields.
- private PointF loc;
- private SizeF sz;
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized RectangleF Structure.
- /// </remarks>
-
- public static readonly RectangleF Empty;
-
-
- /// <summary>
- /// FromLTRB Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a RectangleF structure from left, top, right,
- /// and bottom coordinates.
- /// </remarks>
-
- public static RectangleF FromLTRB (float left, float top,
- float right, float bottom)
- {
- return new RectangleF (left, top, right - left,
- bottom - top);
- }
-
- /// <summary>
- /// Inflate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new RectangleF by inflating an existing
- /// RectangleF by the specified coordinate values.
- /// </remarks>
-
- public static RectangleF Inflate (RectangleF r,
- float x, float y)
- {
- RectangleF ir = new RectangleF (r.Location, r.Size);
- ir.Inflate (x, y);
- return ir;
- }
-
- /// <summary>
- /// Inflate Method
- /// </summary>
- ///
- /// <remarks>
- /// Inflates the RectangleF by a specified width and height.
- /// </remarks>
-
- public void Inflate (float width, float height)
- {
- Inflate (new SizeF (width, height));
- }
-
- /// <summary>
- /// Inflate Method
- /// </summary>
- ///
- /// <remarks>
- /// Inflates the RectangleF by a specified Size.
- /// </remarks>
-
- public void Inflate (SizeF sz)
- {
- Offset(sz.Width, sz.Height);
- SizeF ds = new SizeF (sz.Width * 2, sz.Height * 2);
- this.sz += ds;
- }
-
- /// <summary>
- /// Intersect Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new RectangleF by intersecting 2 existing
- /// RectangleFs. Returns null if there is no intersection.
- /// </remarks>
-
- public static RectangleF Intersect (RectangleF r1,
- RectangleF r2)
- {
- RectangleF r = new RectangleF (r1.Location, r1.Size);
- r.Intersect (r2);
- return r;
- }
-
- /// <summary>
- /// Intersect Method
- /// </summary>
- ///
- /// <remarks>
- /// Replaces the RectangleF with the intersection of itself
- /// and another RectangleF.
- /// </remarks>
-
- public void Intersect (RectangleF r)
- {
- if (!IntersectsWith (r)) {
- loc = PointF.Empty;
- sz = SizeF.Empty;
- }
-
- X = Math.Max (Left, r.Left);
- Y = Math.Max (Top, r.Top);
- Width = Math.Min (Right, r.Right) - X;
- Height = Math.Min (Bottom, r.Bottom) - Y;
- }
-
- /// <summary>
- /// Union Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new RectangleF from the union of 2 existing
- /// RectangleFs.
- /// </remarks>
-
- public static RectangleF Union (RectangleF r1, RectangleF r2)
- {
- return FromLTRB (Math.Min (r1.Left, r2.Left),
- Math.Min (r1.Top, r2.Top),
- Math.Max (r1.Right, r2.Right),
- Math.Max (r1.Bottom, r2.Bottom));
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two RectangleF objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two RectangleFs.
- /// </remarks>
-
- public static bool operator == (RectangleF r1, RectangleF r2)
- {
- return ((r1.Location == r2.Location) &&
- (r1.Size == r2.Size));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two RectangleF objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two RectangleFs.
- /// </remarks>
-
- public static bool operator != (RectangleF r1, RectangleF r2)
- {
- return ((r1.Location != r2.Location) ||
- (r1.Size != r2.Size));
- }
-
- /// <summary>
- /// Rectangle to RectangleF Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Converts a Rectangle object to a RectangleF.
- /// </remarks>
-
- public static implicit operator RectangleF (Rectangle r)
- {
- return new RectangleF (r.Location, r.Size);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// RectangleF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a RectangleF from PointF and SizeF values.
- /// </remarks>
-
- public RectangleF (PointF loc, SizeF sz)
- {
- this.loc = loc;
- this.sz = sz;
- }
-
- /// <summary>
- /// RectangleF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a RectangleF from a specified x,y location and
- /// width and height values.
- /// </remarks>
-
- public RectangleF (float x, float y, float width, float height)
- {
- loc = new PointF (x, y);
- sz = new SizeF (width, height);
- }
-
-
-
- /// <summary>
- /// Bottom Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the bottom edge of the RectangleF.
- /// Read only.
- /// </remarks>
-
- public float Bottom {
- get {
- return Y + Height;
- }
- }
-
- /// <summary>
- /// Height Property
- /// </summary>
- ///
- /// <remarks>
- /// The Height of the RectangleF.
- /// </remarks>
-
- public float Height {
- get {
- return sz.Height;
- }
- set {
- sz.Height = value;
- }
- }
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if the width or height are zero. Read only.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((sz.Width == 0) || (sz.Height == 0));
- }
- }
-
- /// <summary>
- /// Left Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the left edge of the RectangleF.
- /// Read only.
- /// </remarks>
-
- public float Left {
- get {
- return X;
- }
- }
-
- /// <summary>
- /// Location Property
- /// </summary>
- ///
- /// <remarks>
- /// The Location of the top-left corner of the RectangleF.
- /// </remarks>
-
- public PointF Location {
- get {
- return loc;
- }
- set {
- loc = value;
- }
- }
-
- /// <summary>
- /// Right Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the right edge of the RectangleF.
- /// Read only.
- /// </remarks>
-
- public float Right {
- get {
- return X + Width;
- }
- }
-
- /// <summary>
- /// Size Property
- /// </summary>
- ///
- /// <remarks>
- /// The Size of the RectangleF.
- /// </remarks>
-
- public SizeF Size {
- get {
- return sz;
- }
- set {
- sz = value;
- }
- }
-
- /// <summary>
- /// Top Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the top edge of the RectangleF.
- /// Read only.
- /// </remarks>
-
- public float Top {
- get {
- return Y;
- }
- }
-
- /// <summary>
- /// Width Property
- /// </summary>
- ///
- /// <remarks>
- /// The Width of the RectangleF.
- /// </remarks>
-
- public float Width {
- get {
- return sz.Width;
- }
- set {
- sz.Width = value;
- }
- }
-
- /// <summary>
- /// X Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the RectangleF.
- /// </remarks>
-
- public float X {
- get {
- return loc.X;
- }
- set {
- loc.X = value;
- }
- }
-
- /// <summary>
- /// Y Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the RectangleF.
- /// </remarks>
-
- public float Y {
- get {
- return loc.Y;
- }
- set {
- loc.Y = value;
- }
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if an x,y coordinate lies within this RectangleF.
- /// </remarks>
-
- public bool Contains (float x, float y)
- {
- return ((x >= Left) && (x <= Right) &&
- (y >= Top) && (y <= Bottom));
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a Point lies within this RectangleF.
- /// </remarks>
-
- public bool Contains (PointF pt)
- {
- return Contains (pt.X, pt.Y);
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a RectangleF lies entirely within this
- /// RectangleF.
- /// </remarks>
-
- public bool Contains (RectangleF rect)
- {
- return (rect == Intersect (this, rect));
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this RectangleF and an object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is RectangleF))
- return false;
-
- return (this == (RectangleF) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return loc.GetHashCode()^sz.GetHashCode();
- }
-
- /// <summary>
- /// IntersectsWith Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a RectangleF intersects with this one.
- /// </remarks>
-
- public bool IntersectsWith (RectangleF r)
- {
- return !((Left > r.Right) || (Right < r.Left) ||
- (Top > r.Bottom) || (Bottom < r.Top));
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the RectangleF a specified distance.
- /// </remarks>
-
- public void Offset (float dx, float dy)
- {
- X += dx;
- Y += dy;
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the RectangleF a specified distance.
- /// </remarks>
-
- public void Offset (PointF pt)
- {
- Offset(pt.X, pt.Y);
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the RectangleF in (x,y,w,h) notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1},{2},{3}]",
- X, Y, Width, Height);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Size.cs b/mcs/class/System.Drawing/System.Drawing/Size.cs
deleted file mode 100644
index d5b56d3a453..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Size.cs
+++ /dev/null
@@ -1,309 +0,0 @@
-//
-// System.Drawing.Size.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct Size {
-
- // Private height and width fields.
- int wd, ht;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized Size Structure.
- /// </remarks>
-
- public static readonly Size Empty;
-
- /// <summary>
- /// Ceiling Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Size structure from a SizeF structure by
- /// taking the ceiling of the Width and Height properties.
- /// </remarks>
-
- public static Size Ceiling (SizeF value)
- {
- int w, h;
- checked {
- w = (int) Math.Ceiling (value.Width);
- h = (int) Math.Ceiling (value.Height);
- }
-
- return new Size (w, h);
- }
-
- /// <summary>
- /// Round Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Size structure from a SizeF structure by
- /// rounding the Width and Height properties.
- /// </remarks>
-
- public static Size Round (SizeF value)
- {
- int w, h;
- checked {
- w = (int) Math.Round (value.Width);
- h = (int) Math.Round (value.Height);
- }
-
- return new Size (w, h);
- }
-
- /// <summary>
- /// Truncate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Size structure from a SizeF structure by
- /// truncating the Width and Height properties.
- /// </remarks>
-
- public static Size Truncate (SizeF value)
- {
- int w, h;
- checked {
- w = (int) value.Width;
- h = (int) value.Height;
- }
-
- return new Size (w, h);
- }
-
- /// <summary>
- /// Addition Operator
- /// </summary>
- ///
- /// <remarks>
- /// Addition of two Size structures.
- /// </remarks>
-
- public static Size operator + (Size sz1, Size sz2)
- {
- return new Size (sz1.Width + sz2.Width,
- sz1.Height + sz2.Height);
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Size objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- /// </remarks>
-
- public static bool operator == (Size sz_a, Size sz_b)
- {
- return ((sz_a.Width == sz_b.Width) &&
- (sz_a.Height == sz_b.Height));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Size objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- /// </remarks>
-
- public static bool operator != (Size sz_a, Size sz_b)
- {
- return ((sz_a.Width != sz_b.Width) ||
- (sz_a.Height != sz_b.Height));
- }
-
- /// <summary>
- /// Subtraction Operator
- /// </summary>
- ///
- /// <remarks>
- /// Subtracts two Size structures.
- /// </remarks>
-
- public static Size operator - (Size sz1, Size sz2)
- {
- return new Size (sz1.Width - sz2.Width,
- sz1.Height - sz2.Height);
- }
-
- /// <summary>
- /// Size to Point Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Returns a Point based on the dimensions of a given
- /// Size. Requires explicit cast.
- /// </remarks>
-
- public static explicit operator Point (Size sz)
- {
- return new Point (sz.Width, sz.Height);
- }
-
- /// <summary>
- /// Size to SizeF Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Creates a SizeF based on the dimensions of a given
- /// Size. No explicit cast is required.
- /// </remarks>
-
- public static implicit operator SizeF (Size sz)
- {
- return new SizeF (sz.Width, sz.Height);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// Size Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Size from a Point value.
- /// </remarks>
-
- public Size (Point pt)
- {
- wd = pt.X;
- ht = pt.Y;
- }
-
- /// <summary>
- /// Size Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Size from specified dimensions.
- /// </remarks>
-
- public Size (int width, int height)
- {
- wd = width;
- ht = height;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if both Width and Height are zero.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((wd == 0) && (ht == 0));
- }
- }
-
- /// <summary>
- /// Width Property
- /// </summary>
- ///
- /// <remarks>
- /// The Width coordinate of the Size.
- /// </remarks>
-
- public int Width {
- get {
- return wd;
- }
- set {
- wd = value;
- }
- }
-
- /// <summary>
- /// Height Property
- /// </summary>
- ///
- /// <remarks>
- /// The Height coordinate of the Size.
- /// </remarks>
-
- public int Height {
- get {
- return ht;
- }
- set {
- ht = value;
- }
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this Size and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is Size))
- return false;
-
- return (this == (Size) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return wd^ht;
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the Size as a string in coordinate notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", wd, ht);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/SizeF.cs b/mcs/class/System.Drawing/System.Drawing/SizeF.cs
deleted file mode 100644
index 1aa0155c56d..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/SizeF.cs
+++ /dev/null
@@ -1,249 +0,0 @@
-//
-// System.Drawing.SizeF.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct SizeF {
-
- // Private height and width fields.
- float wd, ht;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized SizeF Structure.
- /// </remarks>
-
- public static readonly SizeF Empty;
-
- /// <summary>
- /// Addition Operator
- /// </summary>
- ///
- /// <remarks>
- /// Addition of two SizeF structures.
- /// </remarks>
-
- public static SizeF operator + (SizeF sz1, SizeF sz2)
- {
- return new SizeF (sz1.Width + sz2.Width,
- sz1.Height + sz2.Height);
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two SizeF objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- /// </remarks>
-
- public static bool operator == (SizeF sz_a, SizeF sz_b)
- {
- return ((sz_a.Width == sz_b.Width) &&
- (sz_a.Height == sz_b.Height));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two SizeF objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- /// </remarks>
-
- public static bool operator != (SizeF sz_a, SizeF sz_b)
- {
- return ((sz_a.Width != sz_b.Width) ||
- (sz_a.Height != sz_b.Height));
- }
-
- /// <summary>
- /// Subtraction Operator
- /// </summary>
- ///
- /// <remarks>
- /// Subtracts two SizeF structures.
- /// </remarks>
-
- public static SizeF operator - (SizeF sz1, SizeF sz2)
- {
- return new SizeF (sz1.Width - sz2.Width,
- sz1.Height - sz2.Height);
- }
-
- /// <summary>
- /// SizeF to PointF Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Returns a PointF based on the dimensions of a given
- /// SizeF. Requires explicit cast.
- /// </remarks>
-
- public static explicit operator PointF (SizeF sz)
- {
- return new PointF (sz.Width, sz.Height);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// SizeF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a SizeF from a PointF value.
- /// </remarks>
-
- public SizeF (PointF pt)
- {
- wd = pt.X;
- ht = pt.Y;
- }
-
- /// <summary>
- /// SizeF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a SizeF from an existing SizeF value.
- /// </remarks>
-
- public SizeF (SizeF sz)
- {
- wd = sz.Width;
- ht = sz.Height;
- }
-
- /// <summary>
- /// SizeF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a SizeF from specified dimensions.
- /// </remarks>
-
- public SizeF (float width, float height)
- {
- wd = width;
- ht = height;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if both Width and Height are zero.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((wd == 0.0) && (ht == 0.0));
- }
- }
-
- /// <summary>
- /// Width Property
- /// </summary>
- ///
- /// <remarks>
- /// The Width coordinate of the SizeF.
- /// </remarks>
-
- public float Width {
- get {
- return wd;
- }
- set {
- wd = value;
- }
- }
-
- /// <summary>
- /// Height Property
- /// </summary>
- ///
- /// <remarks>
- /// The Height coordinate of the SizeF.
- /// </remarks>
-
- public float Height {
- get {
- return ht;
- }
- set {
- ht = value;
- }
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this SizeF and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is SizeF))
- return false;
-
- return (this == (SizeF) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return (int) wd ^ (int) ht;
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the SizeF as a string in coordinate notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", wd, ht);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog b/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
deleted file mode 100644
index 62c04eb1808..00000000000
--- a/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2001-10-31 Mike Kestner <mkestner@speakeasy.net>
-
- * TestPoint.cs : Tests I've had in my node forever.
-
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestPoint.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestPoint.cs
deleted file mode 100644
index 01de794dc02..00000000000
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestPoint.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-// Tests for System.Drawing.Point.cs
-//
-// Author: Mike Kestner (mkestner@speakeasy.net)
-//
-// Copyright (c) 2001 Ximian, Inc.
-
-using NUnit.Framework;
-using System;
-using System.Drawing;
-
-public class PointTest : TestCase {
- Point pt1_1;
- Point pt1_0;
- Point pt0_1;
-
- protected override void SetUp ()
- {
- pt1_1 = new Point (1, 1);
- pt1_0 = new Point (1, 0);
- pt0_1 = new Point (0, 1);
- }
-
- public PointTest(String name) : base (name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (new PointTest ("EqualsTest"));
- suite.AddTest (new PointTest ("EqualityOpTest"));
- suite.AddTest (new PointTest ("InequalityOpTest"));
- suite.AddTest (new PointTest ("CeilingTest"));
- suite.AddTest (new PointTest ("RoundTest"));
- suite.AddTest (new PointTest ("TruncateTest"));
- suite.AddTest (new PointTest ("NullTest"));
- suite.AddTest (new PointTest ("AdditionTest"));
- suite.AddTest (new PointTest ("SubtractionTest"));
- suite.AddTest (new PointTest ("Point2SizeTest"));
- suite.AddTest (new PointTest ("Point2PointFTest"));
- suite.AddTest (new PointTest ("ConstructorTest"));
- suite.AddTest (new PointTest ("PropertyTest"));
- suite.AddTest (new PointTest ("OffsetTest"));
- return suite;
- }
- }
-
- public void EqualsTest ()
- {
- AssertEquals (pt1_1, pt1_1);
- AssertEquals (pt1_1, new Point (1, 1));
- Assert (!pt1_1.Equals (pt1_0));
- Assert (!pt1_1.Equals (pt0_1));
- Assert (!pt1_0.Equals (pt0_1));
- }
-
- public void EqualityOpTest ()
- {
- Assert (pt1_1 == pt1_1);
- Assert (pt1_1 == new Point (1, 1));
- Assert (!(pt1_1 == pt1_0));
- Assert (!(pt1_1 == pt0_1));
- Assert (!(pt1_0 == pt0_1));
- }
-
- public void InequalityOpTest ()
- {
- Assert (!(pt1_1 != pt1_1));
- Assert (!(pt1_1 != new Point (1, 1)));
- Assert (pt1_1 != pt1_0);
- Assert (pt1_1 != pt0_1);
- Assert (pt1_0 != pt0_1);
- }
-
- public void CeilingTest ()
- {
- PointF ptf = new PointF (0.8f, 0.3f);
- AssertEquals (pt1_1, Point.Ceiling (ptf));
- }
-
- public void RoundTest ()
- {
- PointF ptf = new PointF (0.8f, 1.3f);
- AssertEquals (pt1_1, Point.Round (ptf));
- }
-
- public void TruncateTest ()
- {
- PointF ptf = new PointF (0.8f, 1.3f);
- AssertEquals (pt0_1, Point.Truncate (ptf));
- }
-
- public void NullTest ()
- {
- Point pt = new Point (0, 0);
- AssertEquals (pt, Point.Empty);
- }
-
- public void AdditionTest ()
- {
- AssertEquals (pt1_1, pt1_0 + new Size (0, 1));
- AssertEquals (pt1_1, pt0_1 + new Size (1, 0));
- }
-
- public void SubtractionTest ()
- {
- AssertEquals (pt1_0, pt1_1 - new Size (0, 1));
- AssertEquals (pt0_1, pt1_1 - new Size (1, 0));
- }
-
- public void Point2SizeTest ()
- {
- Size sz1 = new Size (1, 1);
- Size sz2 = (Size) pt1_1;
-
- AssertEquals (sz1, sz2);
- }
-
- public void Point2PointFTest ()
- {
- PointF ptf1 = new PointF (1, 1);
- PointF ptf2 = pt1_1;
-
- AssertEquals (ptf1, ptf2);
- }
-
- public void ConstructorTest ()
- {
- int i = (1 << 16) + 1;
- Size sz = new Size (1, 1);
- Point pt_i = new Point (i);
- Point pt_sz = new Point (sz);
-
- AssertEquals (pt_i, pt_sz);
- AssertEquals (pt_i, pt1_1);
- AssertEquals (pt_sz, pt1_1);
- }
-
- public void PropertyTest ()
- {
- Point pt = new Point (0, 0);
-
- Assert (pt.IsEmpty);
- Assert (!pt1_1.IsEmpty);
- AssertEquals (1, pt1_0.X);
- AssertEquals (1, pt0_1.Y);
- }
-
- public void OffsetTest ()
- {
- Point pt = new Point (0, 0);
- pt.Offset (0, 1);
- AssertEquals (pt, pt0_1);
- pt.Offset (1, 0);
- AssertEquals (pt, pt1_1);
- pt.Offset (0, -1);
- AssertEquals (pt, pt1_0);
- }
-}
-
-
diff --git a/mcs/class/System.Web/.cvsignore b/mcs/class/System.Web/.cvsignore
deleted file mode 100644
index d57b205f4e1..00000000000
--- a/mcs/class/System.Web/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-Temp.build
-*.dll
-lib
-makefile
diff --git a/mcs/class/System.Web/ChangeLog b/mcs/class/System.Web/ChangeLog
deleted file mode 100644
index 9f669c740a0..00000000000
--- a/mcs/class/System.Web/ChangeLog
+++ /dev/null
@@ -1,29 +0,0 @@
-2001-12-20 Gaurav Vaish <gvaish@iitk.ac.in>
-
- Did first successful build of System.Web.dll that included System.Web.UI.WebControls namespace. Though, not updating the System.Web.build file, since with the changes that followed, the build again fails :(
-
-2001-11-30 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * System.Web.WebUtils: Removed
- * System.Web.Utils : Added --- replacement of WebUtils
-
-2001-11-08 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * System.Web.WebUtils: Added directory
-
-2001-08-22 Bob Smith <bob@thestuff.net>
-
- * Added directory: System.Web.UI.HtmlControls
- * Added directory: Test
-
-2001-08-17 Bob Smith <bob@thestuff.net>
-
- * Added directory: System.Web.UI
-
-2001-08-09 Bob Smith <bob@thestuff.net>
-
- * Added directory: System.Web
-
-2001-07-20 Patrik Torstensson (Patrik.Torstensson@labs2.com)
-
- * Added directory: System.Web.Caching
diff --git a/mcs/class/System.Web/System.Web.Caching/Cache.cs b/mcs/class/System.Web/System.Web.Caching/Cache.cs
deleted file mode 100644
index 5e331aa43c4..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/Cache.cs
+++ /dev/null
@@ -1,520 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Implements a cache for Web applications and other. The difference from the MS.NET implementation is that we
- /// support to use the Cache object as cache in our applications.
- /// </summary>
- /// <remarks>
- /// The Singleton cache is created per application domain, and it remains valid as long as the application domain remains active.
- /// </remarks>
- /// <example>
- /// Usage of the singleton cache:
- ///
- /// Cache objManager = Cache.SingletonCache;
- ///
- /// String obj = "tobecached";
- /// objManager.Add("kalle", obj);
- /// </example>
- public class Cache : System.Collections.IEnumerable, System.IDisposable
- {
- // Declarations
-
- // MS.NET Does only have the cache connected to the HttpRuntime and we don't have the HttpRuntime (yet)
- static Cache objSingletonCache = new Cache();
-
- private bool _boolDisposed;
-
- // Helper objects
- private CacheExpires _objExpires;
-
- // The data storage
- // Todo: Make a specialized storage for the cache entries?
- // todo: allow system to replace the storage?
- private System.Collections.Hashtable _arrEntries;
- private System.Threading.ReaderWriterLock _lockEntries;
-
- static private System.TimeSpan _datetimeOneYear = System.TimeSpan.FromDays(365);
-
- // Number of items in the cache
- private long _longItems;
-
- // Constructor
- public Cache()
- {
- _boolDisposed = false;
- _longItems = 0;
-
- _lockEntries = new System.Threading.ReaderWriterLock();
- _arrEntries = new System.Collections.Hashtable();
-
- _objExpires = new CacheExpires(this);
- }
-
- // Public methods and properties
-
- //
- /// <summary>
- /// Returns a static version of the cache. In MS.NET the cache is stored in the System.Web.HttpRuntime
- /// but we keep it here as a singleton (right now anyway).
- /// </summary>
- public static Cache SingletonCache
- {
- get
- {
- if (objSingletonCache == null)
- {
- throw new System.InvalidOperationException();
- }
-
- return objSingletonCache;
- }
- }
-
- /// <summary>
- /// Used in the absoluteExpiration parameter in an Insert method call to indicate the item should never expire. This field is read-only.
- /// </summary>
- public static readonly System.DateTime NoAbsoluteExpiration = System.DateTime.MaxValue;
-
- /// <summary>
- /// Used as the slidingExpiration parameter in an Insert method call to disable sliding expirations. This field is read-only.
- /// </summary>
- public static readonly System.TimeSpan NoSlidingExpiration = System.TimeSpan.Zero;
-
- /// <summary>
- /// Internal method to create a enumerator and over all public items in the cache and is used by GetEnumerator method.
- /// </summary>
- /// <returns>Returns IDictionaryEnumerator that contains all public items in the cache</returns>
- private System.Collections.IDictionaryEnumerator CreateEnumerator()
- {
- System.Collections.Hashtable objTable;
-
- _lockEntries.AcquireReaderLock(int.MaxValue);
- try
- {
- // Create a new hashtable to return as collection of public items
- objTable = new System.Collections.Hashtable(_arrEntries.Count);
-
- foreach(System.Collections.DictionaryEntry objEntry in _arrEntries)
- {
- if (objEntry.Key != null)
- {
- // Check if this is a public entry
- if (((CacheEntry) objEntry.Value).TestFlag(CacheEntry.Flags.Public))
- {
- // Add to the collection
- objTable.Add(objEntry.Key, ((CacheEntry) objEntry.Value).Item);
- }
- }
- }
- }
- finally
- {
- _lockEntries.ReleaseReaderLock();
- }
-
- return objTable.GetEnumerator();
- }
-
- /// <summary>
- /// Implementation of IEnumerable interface and calls the GetEnumerator that returns
- /// IDictionaryEnumerator.
- /// </summary>
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- /// <summary>
- /// Virtual override of the IEnumerable.GetEnumerator() method, returns a specialized enumerator.
- /// </summary>
- public virtual System.Collections.IDictionaryEnumerator GetEnumerator()
- {
- return CreateEnumerator();
- }
-
- /// <summary>
- /// Touches a object in the cache. Used to update expire time and hit count.
- /// </summary>
- /// <param name="strKey">The identifier for the cache item to retrieve.</param>
- public void Touch(string strKey)
- {
- // Just touch the object
- Get(strKey);
- }
-
- /// <summary>
- /// Adds the specified item to the Cache object with dependencies, expiration and priority policies, and a
- /// delegate you can use to notify your application when the inserted item is removed from the Cache.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- /// <param name="absolutExpiration">The time at which the added object expires and is removed from the cache. </param>
- /// <param name="slidingExpiration">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
- /// <param name="enumPriority">The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.</param>
- /// <param name="enumPriorityDecay">The rate at which an object in the cache decays in importance. Objects that decay quickly are more likely to be removed.</param>
- /// <param name="eventRemoveCallback">A delegate that, if provided, is called when an object is removed from the cache. You can use this to notify applications when their objects are deleted from the cache.</param>
- /// <returns>The Object item added to the Cache.</returns>
- public object Add(string strKey, object objItem, CacheDependency objDependency, System.DateTime absolutExpiration, System.TimeSpan slidingExpiration, CacheItemPriority enumPriority, CacheItemPriorityDecay enumPriorityDecay, CacheItemRemovedCallback eventRemoveCallback)
- {
- if (_boolDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.Cache");
- }
-
- if (strKey == null)
- {
- throw new System.ArgumentNullException("strKey");
- }
-
- if (objItem == null)
- {
- throw new System.ArgumentNullException("objItem");
- }
-
- if (slidingExpiration > _datetimeOneYear)
- {
- throw new System.ArgumentOutOfRangeException("slidingExpiration");
- }
-
- CacheEntry objEntry;
- CacheEntry objNewEntry;
-
- long longHitRange = 10000;
-
- // todo: check decay and make up the minHit range
-
- objEntry = new CacheEntry(this, strKey, objItem, objDependency, eventRemoveCallback, absolutExpiration, slidingExpiration, longHitRange, true, enumPriority);
-
- System.Threading.Interlocked.Increment(ref _longItems);
-
- // If we have any kind of expiration add into the CacheExpires class
- if (objEntry.HasSlidingExpiration || objEntry.HasAbsoluteExpiration)
- {
- // Add it to CacheExpires
- _objExpires.Add(objEntry);
- }
-
- // Check and get the new item..
- objNewEntry = UpdateCache(strKey, objEntry, true, CacheItemRemovedReason.Removed);
-
- if (objNewEntry != null)
- {
- // Return added item
- return objEntry.Item;
- }
- else
- {
- return null;
- }
- }
-
- /// <summary>
- /// Inserts an item into the Cache object with a cache key to reference its location and using default values
- /// provided by the CacheItemPriority and CacheItemPriorityDecay enumerations.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- public void Insert(string strKey, object objItem)
- {
- Add(strKey, objItem, null, System.DateTime.MaxValue, System.TimeSpan.Zero, CacheItemPriority.Default, CacheItemPriorityDecay.Default, null);
- }
-
- /// <summary>
- /// Inserts an object into the Cache that has file or key dependencies.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- public void Insert(string strKey, object objItem, CacheDependency objDependency)
- {
- Add(strKey, objItem, objDependency, System.DateTime.MaxValue, System.TimeSpan.Zero, CacheItemPriority.Default, CacheItemPriorityDecay.Default, null);
- }
-
- /// <summary>
- /// Inserts an object into the Cache with dependencies and expiration policies.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- /// <param name="absolutExpiration">The time at which the added object expires and is removed from the cache. </param>
- /// <param name="slidingExpiration">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
- public void Insert(string strKey, object objItem, CacheDependency objDependency, System.DateTime absolutExpiration, System.TimeSpan slidingExpiration)
- {
- Add(strKey, objItem, objDependency, absolutExpiration, slidingExpiration, CacheItemPriority.Default, CacheItemPriorityDecay.Default, null);
- }
-
- /// <summary>
- /// Inserts an object into the Cache object with dependencies, expiration and priority policies, and a delegate
- /// you can use to notify your application when the inserted item is removed from the Cache.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- /// <param name="absolutExpiration">The time at which the added object expires and is removed from the cache. </param>
- /// <param name="slidingExpiration">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
- /// <param name="enumPriority">The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.</param>
- /// <param name="enumPriorityDecay">The rate at which an object in the cache decays in importance. Objects that decay quickly are more likely to be removed.</param>
- /// <param name="eventRemoveCallback">A delegate that, if provided, is called when an object is removed from the cache. You can use this to notify applications when their objects are deleted from the cache.</param>
- public void Insert(string strKey, object objItem, CacheDependency objDependency, System.DateTime absolutExpiration, System.TimeSpan slidingExpiration, CacheItemPriority enumPriority, CacheItemPriorityDecay enumPriorityDecay, CacheItemRemovedCallback eventRemoveCallback)
- {
- Add(strKey, objItem, objDependency, absolutExpiration, slidingExpiration, enumPriority, enumPriorityDecay, eventRemoveCallback);
- }
-
- /// <summary>
- /// Removes the specified item from the Cache object.
- /// </summary>
- /// <param name="strKey">The cache key for the cache item to remove.</param>
- /// <returns>The item removed from the Cache. If the value in the key parameter is not found, returns a null reference.</returns>
- public object Remove(string strKey)
- {
- return Remove(strKey, CacheItemRemovedReason.Removed);
- }
-
- /// <summary>
- /// Internal method that updates the cache, decremenents the number of existing items and call close on the cache entry. This method
- /// is also used from the ExpiresBuckets class to remove an item during GC flush.
- /// </summary>
- /// <param name="strKey">The cache key for the cache item to remove.</param>
- /// <param name="enumReason">Reason why the item is removed.</param>
- /// <returns>The item removed from the Cache. If the value in the key parameter is not found, returns a null reference.</returns>
- internal object Remove(string strKey, CacheItemRemovedReason enumReason)
- {
- CacheEntry objEntry = UpdateCache(strKey, null, true, enumReason);
-
- if (objEntry != null)
- {
- System.Threading.Interlocked.Decrement(ref _longItems);
-
- // Close the cache entry (calls the remove delegate)
- objEntry.Close(enumReason);
-
- return objEntry.Item;
- } else
- {
- return null;
- }
- }
-
- /// <summary>
- /// Retrieves the specified item from the Cache object.
- /// </summary>
- /// <param name="strKey">The identifier for the cache item to retrieve.</param>
- /// <returns>The retrieved cache item, or a null reference.</returns>
- public object Get(string strKey)
- {
- CacheEntry objEntry = UpdateCache(strKey, null, false, CacheItemRemovedReason.Expired);
-
- if (objEntry == null)
- {
- return null;
- } else
- {
- return objEntry.Item;
- }
- }
-
- /// <summary>
- /// Internal method used for removing, updating and adding CacheEntries into the cache.
- /// </summary>
- /// <param name="strKey">The identifier for the cache item to modify</param>
- /// <param name="objEntry">CacheEntry to use for overwrite operation, if this parameter is null and overwrite true the item is going to be removed</param>
- /// <param name="boolOverwrite">If true the objEntry parameter is used to overwrite the strKey entry</param>
- /// <param name="enumReason">Reason why an item was removed</param>
- /// <returns></returns>
- private CacheEntry UpdateCache(string strKey, CacheEntry objEntry, bool boolOverwrite, CacheItemRemovedReason enumReason)
- {
- if (_boolDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.Cache", "Can't update item(s) in a disposed cache");
- }
-
- if (strKey == null)
- {
- throw new System.ArgumentNullException("System.Web.Cache");
- }
-
- long ticksNow = System.DateTime.Now.Ticks;
- long ticksExpires = long.MaxValue;
-
- bool boolGetItem = false;
- bool boolExpiried = false;
- bool boolWrite = false;
- bool boolRemoved = false;
-
- // Are we getting the item from the hashtable
- if (boolOverwrite == false && strKey.Length > 0 && objEntry == null)
- {
- boolGetItem = true;
- }
-
- // TODO: Optimize this method, move out functionality outside the lock
- _lockEntries.AcquireReaderLock(int.MaxValue);
- try
- {
- if (boolGetItem)
- {
- objEntry = (CacheEntry) _arrEntries[strKey];
- if (objEntry == null)
- {
- return null;
- }
- }
-
- if (objEntry != null)
- {
- // Check if we have expired
- if (objEntry.HasSlidingExpiration || objEntry.HasAbsoluteExpiration)
- {
- if (objEntry.Expires < ticksNow)
- {
- // We have expired, remove the item from the cache
- boolWrite = true;
- boolExpiried = true;
- }
- }
- }
-
- // Check if we going to modify the hashtable
- if (boolWrite || (boolOverwrite && !boolExpiried))
- {
- // Upgrade our lock to write
- System.Threading.LockCookie objCookie = _lockEntries.UpgradeToWriterLock(int.MaxValue);
- try
- {
- // Check if we going to just modify an existing entry (or add)
- if (boolOverwrite && objEntry != null)
- {
- _arrEntries[strKey] = objEntry;
- }
- else
- {
- // We need to remove the item, fetch the item first
- objEntry = (CacheEntry) _arrEntries[strKey];
- if (objEntry != null)
- {
- _arrEntries.Remove(strKey);
- }
-
- boolRemoved = true;
- }
- }
- finally
- {
- _lockEntries.DowngradeFromWriterLock(ref objCookie);
- }
- }
-
- // If the entry haven't expired or been removed update the info
- if (!boolExpiried && !boolRemoved)
- {
- // Update that we got a hit
- objEntry.Hits++;
- if (objEntry.HasSlidingExpiration)
- {
- ticksExpires = ticksNow + objEntry.SlidingExpiration;
- }
- }
- }
- finally
- {
- _lockEntries.ReleaseLock();
-
- }
-
- // If the item was removed we need to remove it from the CacheExpired class also
- if (boolRemoved)
- {
- if (objEntry != null)
- {
- if (objEntry.HasAbsoluteExpiration || objEntry.HasSlidingExpiration)
- {
- _objExpires.Remove(objEntry);
- }
- }
-
- // Return the entry, it's not up to the UpdateCache to call Close on the entry
- return objEntry;
- }
-
- // If we have sliding expiration and we have a correct hit, update the expiration manager
- if (objEntry.HasSlidingExpiration)
- {
- _objExpires.Update(objEntry, ticksExpires);
- }
-
- // Return the cache entry
- return objEntry;
- }
-
- /// <summary>
- /// Gets the number of items stored in the cache.
- /// </summary>
- long Count
- {
- get
- {
- return _longItems;
- }
- }
-
- /// <summary>
- /// Gets or sets the cache item at the specified key.
- /// </summary>
- public object this[string strKey]
- {
- get
- {
- return Get(strKey);
- }
-
- set
- {
- Insert(strKey, value);
- }
- }
-
- /// <summary>
- /// Called to close the cache when the AppDomain is closing down or the GC has decided it's time to destroy the object.
- /// </summary>
- public void Dispose()
- {
- _boolDisposed = true;
-
- _lockEntries.AcquireReaderLock(int.MaxValue);
- try
- {
- foreach(System.Collections.DictionaryEntry objEntry in _arrEntries)
- {
- if (objEntry.Key != null)
- {
- // Check if this is active
- if ( ((CacheEntry) objEntry.Value).TestFlag(CacheEntry.Flags.Removed) )
- {
- try
- {
- ((CacheEntry) objEntry.Value).Close(CacheItemRemovedReason.Removed);
- }
- catch (System.Exception objException)
- {
- System.Diagnostics.Debug.Fail("System.Web.Cache.Dispose() Exception when closing cache entry", "Message: " + objException.Message + " Stack: " + objException.StackTrace + " Source:" + objException.Source);
- }
- }
- }
- }
- }
- finally
- {
- _lockEntries.ReleaseReaderLock();
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheDefinitions.cs b/mcs/class/System.Web/System.Web.Caching/CacheDefinitions.cs
deleted file mode 100644
index d59afadc184..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/CacheDefinitions.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Specifies the relative priority of items stored in the Cache.
- /// </summary>
- public enum CacheItemPriority {
- AboveNormal,
- BelowNormal,
- Default,
- High,
- Low,
- Normal,
- NotRemovable
- }
-
- /// <summary>
- /// Specifies the rate at which the priority of items stored in the Cache are downgraded when not accessed frequently.
- /// </summary>
- public enum CacheItemPriorityDecay {
- Default,
- Fast,
- Medium,
- Never,
- Slow
- }
-
- /// <summary>
- /// Specifies the reason an item was removed from the Cache.
- /// </summary>
- public enum CacheItemRemovedReason {
- DependencyChanged,
- Expired,
- Removed,
- Underused
- }
-
- /// <summary>
- /// Defines a callback method for notifying applications when a cached item is removed from the Cache.
- /// </summary>
- /// <param name="key">The index location for the item removed from the cache. </param>
- /// <param name="value">The Object item removed from the cache. </param>
- /// <param name="reason">The reason the item was removed from the cache, as specified by the CacheItemRemovedReason enumeration.</param>
- public delegate void CacheItemRemovedCallback(string key, object value, CacheItemRemovedReason reason);
-
- }
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs b/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs
deleted file mode 100644
index 3d0f722f098..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Class to handle cache dependency, right now this class is only a mookup
- /// </summary>
- public class CacheDependency : System.IDisposable
- {
- private bool _boolDisposed;
-
- public CacheDependency()
- {
- _boolDisposed = false;
- }
-
- /// <remarks>
- /// Added by gvaish@iitk.ac.in
- /// </remarks>
- [MonoTODO("Constrcutor")]
- public CacheDependency(string filename)
- {
- throw new NotImplementedException();
- }
-
- /// <remarks>
- /// Added by gvaish@iitk.ac.in
- /// </remarks>
- [MonoTODO("Constrcutor")]
- public CacheDependency(string[] filenames, string[] cachekeys)
- {
- throw new NotImplementedException();
- }
-
- public delegate void CacheDependencyCallback(CacheDependency objDependency);
-
- public event CacheDependencyCallback Changed;
-
- public void OnChanged()
- {
- if (_boolDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.CacheDependency");
- }
-
- if (Changed != null)
- {
- Changed(this);
- }
- }
-
- public bool IsDisposed
- {
- get
- {
- return _boolDisposed;
- }
- }
-
- public bool HasEvents
- {
- get
- {
- if (_boolDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.CacheDependency");
- }
-
- if (Changed != null)
- {
- return true;
- }
-
- return false;
- }
- }
-
- public void Dispose()
- {
- _boolDisposed = true;
- }
-
- /// <summary>
- /// Used in testing.
- /// </summary>
- public void Signal()
- {
- OnChanged();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs b/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs
deleted file mode 100644
index 0943be5db30..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs
+++ /dev/null
@@ -1,363 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Class responsible for representing a cache entry.
- /// </summary>
- public class CacheEntry
- {
- /// <summary>
- /// Defines the status of the current cache entry
- /// </summary>
- public enum Flags
- {
- Removed = 0,
- Public = 1
- }
-
- private CacheItemPriority _enumPriority;
-
- private long _longHits;
-
- private byte _byteExpiresBucket;
- private int _intExpiresIndex;
-
- private long _ticksExpires;
- private long _ticksSlidingExpiration;
-
- private string _strKey;
- private object _objItem;
-
- private long _longMinHits;
-
- private Flags _enumFlags;
-
- private CacheDependency _objDependency;
- private Cache _objCache;
-
- /// <summary>
- /// Constructs a new cache entry
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- /// <param name="dtExpires">The time at which the added object expires and is removed from the cache. </param>
- /// <param name="tsSpan">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
- /// <param name="longMinHits">Used to detect and control if the item should be flushed due to under usage</param>
- /// <param name="boolPublic">Defines if the item is public or not</param>
- /// <param name="enumPriority">The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.</param>
- public CacheEntry( Cache objManager, string strKey, object objItem, CacheDependency objDependency, CacheItemRemovedCallback eventRemove,
- System.DateTime dtExpires, System.TimeSpan tsSpan, long longMinHits, bool boolPublic, CacheItemPriority enumPriority )
- {
- if (boolPublic)
- {
- SetFlag(Flags.Public);
- }
-
- _strKey = strKey;
- _objItem = objItem;
- _objCache = objManager;
-
- _onRemoved += eventRemove;
-
- _enumPriority = enumPriority;
-
- _ticksExpires = dtExpires.Ticks;
-
- _ticksSlidingExpiration = tsSpan.Ticks;
-
- // If we have a sliding expiration it overrides the absolute expiration (MS behavior)
- if (tsSpan.Ticks != System.TimeSpan.Zero.Ticks)
- {
- _ticksExpires = System.DateTime.Now.AddTicks(_ticksSlidingExpiration).Ticks;
- }
-
- _objDependency = objDependency;
- if (_objDependency != null)
- {
- if (_objDependency.IsDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.CacheDependency");
- }
-
- // Add the entry to the cache dependency handler (we support multiple entries per handler)
- _objDependency.Changed += new CacheDependency.CacheDependencyCallback(OnChanged);
- }
-
- _longMinHits = longMinHits;
- }
-
- private event CacheItemRemovedCallback _onRemoved;
-
- public void OnChanged(CacheDependency objDependency)
- {
- _objCache.Remove(_strKey, CacheItemRemovedReason.DependencyChanged);
- }
-
- /// <summary>
- /// Cleans up the cache entry, removes the cache dependency and calls the remove delegate.
- /// </summary>
- /// <param name="enumReason">The reason why the cache entry are going to be removed</param>
- public void Close(CacheItemRemovedReason enumReason)
- {
- lock(this)
- {
- // Check if the item already is removed
- if (TestFlag(Flags.Removed))
- {
- return;
- }
-
- SetFlag(Flags.Removed);
-
- if (_onRemoved != null)
- {
- // Call the delegate to tell that we are now removing the entry
- try
- {
- _onRemoved(_strKey, _objItem, enumReason);
- }
- catch (System.Exception objException)
- {
- System.Diagnostics.Debug.Fail("System.Web.CacheEntry.Close() Exception when calling remove delegate", "Message: " + objException.Message + " Stack: " + objException.StackTrace + " Source:" + objException.Source);
- }
- }
-
- // If we have a dependency, remove the entry
- if (_objDependency != null)
- {
- _objDependency.Changed -= new CacheDependency.CacheDependencyCallback(OnChanged);
- if (!_objDependency.HasEvents)
- {
- _objDependency.Dispose();
- }
- }
- }
- }
-
- /// <summary>
- /// Tests a specific flag is set or not.
- /// </summary>
- /// <param name="oFlag">Flag to test agains</param>
- /// <returns>Returns true if the flag is set.</returns>
- public bool TestFlag(Flags oFlag)
- {
- lock(this)
- {
- if ((_enumFlags & oFlag) != 0)
- {
- return true;
- }
-
- return false;
- }
- }
-
- /// <summary>
- /// Sets a specific flag.
- /// </summary>
- /// <param name="oFlag">Flag to set.</param>
- public void SetFlag(Flags oFlag)
- {
- lock (this)
- {
- _enumFlags |= oFlag;
- }
- }
-
- /// <summary>
- /// Returns true if the object has minimum hit usage flushing enabled.
- /// </summary>
- public bool HasUsage
- {
- get {
- if (_longMinHits == System.Int64.MaxValue)
- {
- return false;
- }
-
- return true;
- }
- }
-
- /// <summary>
- /// Returns true if the entry has absolute expiration.
- /// </summary>
- public bool HasAbsoluteExpiration
- {
- get
- {
- if (_ticksExpires == System.DateTime.MaxValue.Ticks)
- {
- return false;
- }
-
- return true;
- }
- }
-
- /// <summary>
- /// Returns true if the entry has sliding expiration enabled.
- /// </summary>
- public bool HasSlidingExpiration
- {
- get
- {
- if (_ticksSlidingExpiration == System.TimeSpan.Zero.Ticks)
- {
- return false;
- }
-
- return true;
- }
- }
-
- /// <summary>
- /// Gets and sets the current expires bucket the entry is active in.
- /// </summary>
- public byte ExpiresBucket
- {
- get
- {
- lock (this)
- {
- return _byteExpiresBucket;
- }
- }
- set
- {
- lock (this)
- {
- _byteExpiresBucket = ExpiresBucket;
- }
- }
- }
-
- /// <summary>
- /// Gets and sets the current index in the expires bucket of the current cache entry.
- /// </summary>
- public int ExpiresIndex
- {
- get
- {
- lock (this)
- {
- return _intExpiresIndex;
- }
- }
-
- set
- {
- lock (this)
- {
- _intExpiresIndex = ExpiresIndex;
- }
- }
- }
-
- /// <summary>
- /// Gets and sets the expiration of the cache entry.
- /// </summary>
- public long Expires
- {
- get
- {
- lock (this)
- {
- return _ticksExpires;
- }
- }
- set
- {
- lock (this)
- {
- _ticksExpires = Expires;
- }
- }
- }
-
- /// <summary>
- /// Gets the sliding expiration value. The return value is in ticks (since 0/0-01 in 100nanosec)
- /// </summary>
- public long SlidingExpiration
- {
- get
- {
- return _ticksSlidingExpiration;
- }
- }
-
- /// <summary>
- /// Returns the current cached item.
- /// </summary>
- public object Item
- {
- get
- {
- return _objItem;
- }
- }
-
- /// <summary>
- /// Returns the current cache identifier.
- /// </summary>
- public string Key
- {
- get
- {
- return _strKey;
- }
- }
-
- /// <summary>
- /// Gets and sets the current number of hits on the cache entry.
- /// </summary>
- public long Hits
- {
- // todo: Could be optimized by using interlocked methods..
- get
- {
- lock (this)
- {
- return _longHits;
- }
- }
- set
- {
- lock (this)
- {
- _longHits = Hits;
- }
- }
- }
-
- /// <summary>
- /// Returns minimum hits for the usage flushing rutine.
- /// </summary>
- public long MinimumHits
- {
- get
- {
- return _longMinHits;
- }
- }
-
- /// <summary>
- /// Returns the priority of the cache entry.
- /// </summary>
- public CacheItemPriority Priority
- {
- get
- {
- return _enumPriority;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs b/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs
deleted file mode 100644
index a58eb5c1e69..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Class responsible for handling time based flushing of entries in the cache. The class creates
- /// and manages 60 buckets each holding every item that expires that minute. The bucket calculated
- /// for an entry is one minute more than the timeout just to make sure that the item end up in the
- /// bucket where it should be flushed.
- /// </summary>
- public class CacheExpires : System.IDisposable
- {
- static int _intFlush;
- static long _ticksPerBucket = 600000000;
- static long _ticksPerCycle = _ticksPerBucket * 60;
-
- private ExpiresBucket[] _arrBuckets;
- private System.Threading.Timer _objTimer;
- private Cache _objManager;
-
- /// <summary>
- /// Constructor
- /// </summary>
- /// <param name="objManager">The cache manager, used when flushing items in a bucket.</param>
- public CacheExpires(Cache objManager)
- {
- _objManager = objManager;
- Initialize();
- }
-
- /// <summary>
- /// Initializes the class.
- /// </summary>
- private void Initialize()
- {
- // Create one bucket per minute
- _arrBuckets = new ExpiresBucket[60];
-
- byte bytePos = 0;
- do
- {
- _arrBuckets[bytePos] = new ExpiresBucket(bytePos, _objManager);
- bytePos++;
- } while (bytePos < 60);
-
- // GC Bucket controller
- _intFlush = System.DateTime.Now.Minute - 1;
- _objTimer = new System.Threading.Timer(new System.Threading.TimerCallback(GarbageCleanup), null, 10000, 60000);
- }
-
- /// <summary>
- /// Adds a Cache entry to the correct flush bucket.
- /// </summary>
- /// <param name="objEntry">Cache entry to add.</param>
- public void Add(CacheEntry objEntry)
- {
- long ticksNow = System.DateTime.Now.Ticks;
-
- lock(this)
- {
- // If the entry doesn't have a expires time we assume that the entry is due to expire now.
- if (objEntry.Expires == 0)
- {
- objEntry.Expires = ticksNow;
- }
-
- _arrBuckets[GetHashBucket(objEntry.Expires)].Add(objEntry);
- }
- }
-
- public void Remove(CacheEntry objEntry)
- {
- long ticksNow = System.DateTime.Now.Ticks;
-
- lock(this)
- {
- // If the entry doesn't have a expires time we assume that the entry is due to expire now.
- if (objEntry.Expires == 0)
- {
- objEntry.Expires = ticksNow;
- }
-
- _arrBuckets[GetHashBucket(objEntry.Expires)].Remove(objEntry);
- }
- }
-
- public void Update(CacheEntry objEntry, long ticksExpires)
- {
- long ticksNow = System.DateTime.Now.Ticks;
-
- lock(this)
- {
- // If the entry doesn't have a expires time we assume that the entry is due to expire now.
- if (objEntry.Expires == 0)
- {
- objEntry.Expires = ticksNow;
- }
-
- _arrBuckets[GetHashBucket(objEntry.Expires)].Update(objEntry, ticksExpires);
- }
- }
-
- public void GarbageCleanup(object State)
- {
- ExpiresBucket objBucket;
-
- lock(this)
- {
- // Do cleanup of the bucket
- objBucket = _arrBuckets[(++_intFlush) % 60];
- }
-
- // Flush expired items in the current bucket (defined by _intFlush)
- objBucket.FlushExpiredItems();
- }
-
- private int GetHashBucket(long ticks)
- {
- // Get bucket to add expire item into, add one minute to the bucket just to make sure that we get it in the bucket gc
- return (int) (((((ticks + 60000) % _ticksPerCycle) / _ticksPerBucket) + 1) % 60);
- }
-
- /// <summary>
- /// Called by the cache for cleanup.
- /// </summary>
- public void Dispose()
- {
- lock(this)
- {
- // Cleanup the internal timer
- if (_objTimer != null)
- {
- _objTimer.Dispose();
- _objTimer = null;
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Caching/ChangeLog b/mcs/class/System.Web/System.Web.Caching/ChangeLog
deleted file mode 100644
index 616d7b40f9c..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/ChangeLog
+++ /dev/null
@@ -1,12 +0,0 @@
-2001-12-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * CacheDependency.cs: Some unimplemented methods to make build
-
-2001-07-20 Patrik Torstensson (Patrik.Torstensson@labs2.com)
-
- * Cache.cs: Implemented. (90% ready)
- * CacheDefinitions.cs: Implemented.
- * CacheDependency.cs: Added. (20% ready)
- * CacheExpires: Implemented.
- * CacheEntry.cs: Implemented. (95% ready, going to be changed due to CacheDependecy support)
- * ExpiresBuckets.cs: Implemented.
diff --git a/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs b/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs
deleted file mode 100644
index b5b877d455d..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs
+++ /dev/null
@@ -1,253 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Responsible for holding a cache entry in the linked list bucket.
- /// </summary>
- public struct ExpiresEntry
- {
- public CacheEntry _objEntry;
- public long _ticksExpires;
- public int _intNext;
- }
-
- /// <summary>
- /// Holds cache entries that has a expiration in a bucket list.
- /// </summary>
- public class ExpiresBucket
- {
- private static int MIN_ENTRIES = 16;
-
- private byte _byteID;
- private int _intSize;
- private int _intCount;
- private int _intNext;
-
- private Cache _objManager;
-
- private ExpiresEntry [] _arrEntries;
-
- /// <summary>
- /// Constructs a new bucket.
- /// </summary>
- /// <param name="bucket">Current bucket ID.</param>
- /// <param name="objManager">Cache manager reponsible for the item(s) in the expires bucket.</param>
- public ExpiresBucket(byte bucket, Cache objManager)
- {
- _objManager = objManager;
- Initialize(bucket);
- }
-
- /// <summary>
- /// Initializes the expires bucket, creates a linked list of MIN_ENTRIES.
- /// </summary>
- /// <param name="bucket">Bucket ID.</param>
- private void Initialize(byte bucket)
- {
- _byteID = bucket;
- _intNext = 0;
- _intCount = 0;
-
- _arrEntries = new ExpiresEntry[MIN_ENTRIES];
- _intSize = MIN_ENTRIES;
-
- int intPos = 0;
- do
- {
- _arrEntries[intPos]._intNext = intPos + 1;
- _arrEntries[intPos]._ticksExpires = System.DateTime.MaxValue.Ticks;
-
- intPos++;
- } while (intPos < _intSize);
-
- _arrEntries[_intSize - 1]._intNext = -1;
- }
-
- /// <summary>
- /// Expands the bucket linked array list.
- /// </summary>
- private void Expand()
- {
- ExpiresEntry [] arrData;
- int intPos = 0;
- int intOldSize;
-
- lock(this)
- {
- intOldSize = _intSize;
- _intSize *= 2;
-
- // Create a new array and copy the old data into the new array
- arrData = new ExpiresEntry[_intSize];
- do
- {
- arrData[intPos] = _arrEntries[intPos];
- intPos++;
- } while (intPos < intOldSize);
-
- _intNext = intPos;
-
- // Initialize the "new" positions.
- do
- {
- arrData[intPos]._intNext = intPos + 1;
- intPos++;
- } while (intPos < _intSize);
-
- arrData[_intSize - 1]._intNext = -1;
-
- _arrEntries = arrData;
- }
- }
-
- /// <summary>
- /// Adds a cache entry into the expires bucket.
- /// </summary>
- /// <param name="objEntry">Cache Entry object to be added.</param>
- public void Add(CacheEntry objEntry)
- {
- if (_intNext == -1)
- {
- Expand();
- }
-
- lock(this)
- {
- _arrEntries[_intNext]._ticksExpires = objEntry.Expires;
- _arrEntries[_intNext]._objEntry = objEntry;
-
- _intNext = _arrEntries[_intNext]._intNext;
-
- _intCount++;
- }
- }
-
- /// <summary>
- /// Removes a cache entry from the expires bucket.
- /// </summary>
- /// <param name="objEntry">Cache entry to be removed.</param>
- public void Remove(CacheEntry objEntry)
- {
- lock(this)
- {
- // Check if this is our bucket
- if (objEntry.ExpiresIndex != _byteID) return;
- if (objEntry.ExpiresIndex == System.Int32.MaxValue) return;
- if (_arrEntries.Length < objEntry.ExpiresIndex) return;
-
- _intCount--;
-
- _arrEntries[objEntry.ExpiresIndex]._objEntry.ExpiresBucket = byte.MaxValue;
- _arrEntries[objEntry.ExpiresIndex]._objEntry.ExpiresIndex = int.MaxValue;
- _arrEntries[objEntry.ExpiresIndex]._objEntry = null;
- _intNext = _arrEntries[objEntry.ExpiresIndex]._intNext;
- }
- }
-
- /// <summary>
- /// Updates a cache entry in the expires bucket, this is called during a hit of an item if the
- /// cache item has a sliding expiration. The function is responsible for updating the cache
- /// entry.
- /// </summary>
- /// <param name="objEntry">Cache entry to update.</param>
- /// <param name="ticksExpires">New expiration value for the cache entry.</param>
- public void Update(CacheEntry objEntry, long ticksExpires)
- {
- lock(this)
- {
- // Check if this is our bucket
- if (objEntry.ExpiresIndex != _byteID) return;
- if (objEntry.ExpiresIndex == System.Int32.MaxValue) return;
- if (_arrEntries.Length < objEntry.ExpiresIndex) return;
-
- _arrEntries[objEntry.ExpiresIndex]._ticksExpires = ticksExpires;
- _arrEntries[objEntry.ExpiresIndex]._objEntry.Expires = ticksExpires;
- }
- }
-
- /// <summary>
- /// Flushes all cache entries that has expired and removes them from the cache manager.
- /// </summary>
- public void FlushExpiredItems()
- {
- ExpiresEntry objEntry;
- CacheEntry [] arrCacheEntries;
-
- int intCachePos;
- int intPos;
- long ticksNow;
-
- ticksNow = System.DateTime.Now.Ticks;
-
- intCachePos = 0;
-
- // Lookup all items that needs to be removed, this is done in a two part
- // operation to minimize the locking time.
- lock (this)
- {
- arrCacheEntries = new CacheEntry[_intSize];
-
- intPos = 0;
- do
- {
- objEntry = _arrEntries[intPos];
- if (objEntry._objEntry != null)
- {
- if (objEntry._ticksExpires < ticksNow)
- {
- arrCacheEntries[intCachePos++] = objEntry._objEntry;
-
- objEntry._objEntry.ExpiresBucket = byte.MaxValue;
- objEntry._objEntry.ExpiresIndex = int.MaxValue;
- objEntry._objEntry = null;
- _intNext = objEntry._intNext;
- }
- }
-
- intPos++;
- } while (intPos < _intSize);
- }
-
- // If we have any entries to remove, go ahead and call the cache manager remove.
- if (intCachePos > 0)
- {
- intPos = 0;
- do
- {
- _objManager.Remove(arrCacheEntries[intPos].Key, CacheItemRemovedReason.Expired);
-
- intPos++;
- } while (intPos < intCachePos);
- }
- }
-
- /// <summary>
- /// Returns the current size of the expires bucket.
- /// </summary>
- public int Size
- {
- get
- {
- return _arrEntries.Length;
- }
- }
-
- /// <summary>
- /// Returns number of items in the bucket.
- /// </summary>
- public int Count
- {
- get
- {
- return _intCount;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Configuration/AuthenticationMode.cs b/mcs/class/System.Web/System.Web.Configuration/AuthenticationMode.cs
deleted file mode 100755
index 1bc1d9e9a36..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/AuthenticationMode.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-/* System.Web.Configuration
- * Authors:
- * Leen Toelen (toelen@hotmail.com)
- * Copyright (C) 2001 Leen Toelen
-*/
-
-namespace System.Web.Configuration {
-
- /// <summary>
- /// Defines the AuthenticationMode for a Web Application.
- /// </summary>
- public enum AuthenticationMode{
- Forms,
- None,
- Passport,
- Windows
- }
-
-} //namespace System.Web.Configuration
diff --git a/mcs/class/System.Web/System.Web.Configuration/ClientTargetSectionHandler.cs b/mcs/class/System.Web/System.Web.Configuration/ClientTargetSectionHandler.cs
deleted file mode 100644
index d30affc8f2d..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/ClientTargetSectionHandler.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-/* System.Web.Configuration
- * Authors:
- * Leen Toelen (toelen@hotmail.com)
- * Copyright (C) 2001 Leen Toelen
-*/
-using System;
-using System.Configuration;
-
-namespace System.Web.Configuration
-{
- /// <summary>
- /// Summary description for ClientTargetSectionHandler.
- /// </summary>
- public class ClientTargetSectionHandler: NameValueSectionHandler
- {
- /// <summary>
- /// ClientTargetSectionHandler Constructor
- /// </summary>
- public ClientTargetSectionHandler(){}
-
- /// <summary>
- /// Gets the name of the key in the key-value pair.
- /// </summary>
- protected override string KeyAttributeName
- {
- get
- {
- return "alias";
- }
- }
-
- /// <summary>
- /// Gets the value for the key in the key-value pair.
- /// </summary>
- protected override string ValueAttributeName
- {
- get
- {
- return "userAgent";
- }
- }
-
- }
-} //namespace System.Web.Configuration
diff --git a/mcs/class/System.Web/System.Web.Configuration/FormsAuthPasswordFormat.cs b/mcs/class/System.Web/System.Web.Configuration/FormsAuthPasswordFormat.cs
deleted file mode 100755
index ff416bc6ebc..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/FormsAuthPasswordFormat.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-/* System.Web.Configuration
- * Authors:
- * Leen Toelen (toelen@hotmail.com)
- * Copyright (C) 2001 Leen Toelen
-*/
-
-namespace System.Web.Configuration {
-
- /// <summary>
- /// Defines the password encryption format.
- /// </summary>
- public enum FormsAuthPasswordFormat{
- Clear,
- MD5,
- SHA1
- }
-
-} //namespace System.Web.Configuration
diff --git a/mcs/class/System.Web/System.Web.Configuration/FormsProtectionEnum.cs b/mcs/class/System.Web/System.Web.Configuration/FormsProtectionEnum.cs
deleted file mode 100755
index e94950e067e..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/FormsProtectionEnum.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-/* System.Web.Configuration
- * Authors:
- * Leen Toelen (toelen@hotmail.com)
- * Copyright (C) 2001 Leen Toelen
-*/
-
-namespace System.Web.Configuration {
-
- /// <summary>
- /// Defines the method used for securing web forms.
- /// </summary>
- public enum FormsProtectionEnum{
- All,
- Encryption,
- None,
- Validation
- }
-
-} //namespace System.Web.Configuration
diff --git a/mcs/class/System.Web/System.Web.Hosting/AppDomainFactory.cs b/mcs/class/System.Web/System.Web.Hosting/AppDomainFactory.cs
deleted file mode 100644
index 7cf5b14a9c1..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/AppDomainFactory.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.Hosting.AppDomainFactory.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public sealed class AppDomainFactory : IAppDomainFactory
- {
- public AppDomainFactory();
- public object Create(string module, string typeName, string appId, string appPath, string strUrlOfAppOrigin, int iZone);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs b/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
deleted file mode 100644
index e4576fcd7eb..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Web.Hosting.ApplicationHost.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public sealed class ApplicationHost
- public static object CreateApplicationHost(Type hostType, string virtualDir, string physicalDir);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/ChangeLog b/mcs/class/System.Web/System.Web.Hosting/ChangeLog
deleted file mode 100644
index 8e393f2c434..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/ChangeLog
+++ /dev/null
@@ -1,8 +0,0 @@
-2001-08-30 Bob Smith <bob@thestuff.net>
-
- * AppDomainFactory.cs: Stubbed.
- * ApplicationHost.cs: Stubbed.
- * IAppDomainFactory.cs: Stubbed.
- * IISAPIRuntime.cs: Stubbed.
- * ISAPIRuntime.cs: Implemented.
- * SimpleWorkerRequest.cs: Implemented.
diff --git a/mcs/class/System.Web/System.Web.Hosting/IAppDomainFactory.cs b/mcs/class/System.Web/System.Web.Hosting/IAppDomainFactory.cs
deleted file mode 100644
index 1317ccc6c54..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/IAppDomainFactory.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Web.Hosting.IAppDomainFactory.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public interface IAppDomainFactory
- {
- object Create(in string module, in string typeName, in string appId, in string appPath, in string strUrlOfAppOrigin, in int iZone);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/IISAPIRuntime.cs b/mcs/class/System.Web/System.Web.Hosting/IISAPIRuntime.cs
deleted file mode 100644
index bad6cc4ef80..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/IISAPIRuntime.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Web.Hosting.IISAPIRuntime.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public interface IISAPIRuntime
- {
- void DoGCCollect();
- int ProcessRequest(in IntPtr ecb, in int useProcessModel);
- void StartProcessing();
- void StopProcessing();
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/ISAPIRuntime.cs b/mcs/class/System.Web/System.Web.Hosting/ISAPIRuntime.cs
deleted file mode 100644
index c419344ad25..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/ISAPIRuntime.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Web.Hosting.ISAPIRuntime.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public sealed class ISAPIRuntime : IISAPIRuntime
- {
- public ISAPIRuntime();
- public void DoGCCollect();
- public int ProcessRequest(IntPtr ecb, int iWRType);
- public void StartProcessing();
- public void StopProcessing();
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs b/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs
deleted file mode 100644
index 88311ed611b..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Web.Hosting.SimpleWorkerRequest.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public class SimpleWorkerRequest : HttpWorkerRequest
- {
- public SimpleWorkerRequest(string page, string query, TextWriter output);
- public SimpleWorkerRequest(string appVirtualDir, string appPhysicalDir, string page, string query, TextWriter output);
- public override string MachineConfigPath {get;}
- public override void EndOfRequest();
- public override void FlushResponse(bool finalFlush);
- public override string GetAppPath();
- public override string GetAppPathTranslated();
- public override string GetFilePath();
- public override string GetFilePathTranslated();
- public override string GetHttpVerbName();
- public override string GetHttpVersion();
- public override string GetLocalAddress();
- public override int GetLocalPort();
- public override string GetPathInfo();
- public override string GetQueryString();
- public override string GetRawUrl();
- public override string GetRemoteAddress();
- public override int GetRemotePort();
- public override string GetServerVariable(string name);
- public override string GetUriPath();
- public override IntPtr GetUserToken();
- public override string MapPath(string path);
- public override void SendKnownResponseHeader(int index, string value);
- public override void SendResponseFromFile(IntPtr handle, long offset, long length);
- public override void SendResponseFromFile(string filename, long offset, long length);
- public override void SendResponseFromMemory(byte[] data, int length);
- public virtual void SendResponseFromMemory(IntPtr data, int length);
- public override void SendStatus(int statusCode, string statusDescription);
- public override void SendUnknownResponseHeader(string name, string value);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
deleted file mode 100644
index dd2611fb84f..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
+++ /dev/null
@@ -1,10 +0,0 @@
-2001-09-03 Leen Toelen <toelen@hotmail.com>
-
- * HtmlAnchor.cs: Initial implementation.
- * HtmlTextArea.cs: Initial implementation.
-
-2001-08-22 Bob Smith <bob@thestuff.net>
-
- * HtmlContainerControl.cs: Initial implementation.
- * HtmlControl.cs: Initial implementation.
- * HtmlGenericControl.cs: Initial implementation.
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs
deleted file mode 100644
index 8d8a4787198..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlAnchor : HtmlContainerControl, IPostBackEventHandler{
-
- private static readonly object EventServerClick;
-
- static HtmlAnchor(){
- EventServerClick = new Object();
- }
-
- public HtmlAnchor(): base("a"){}
-
- protected virtual void OnServerClick(EventArgs e){
- EventHandler handler;
- handler = (EventHandler) Events[EventServerClick];
- if(handler != null) handler.Invoke(this, e);
- }
-
- protected new void RenderAttributes(HtmlTextWriter writer){
- if ( Events[EventServerClick] != null){
- Attributes.Remove("href");
- base.RenderAttributes(writer);
- writer.WriteAttribute("href", Page.GetPostBackClientHyperlink(this,String.Empty));
- }
- else{
- PreProcessRelativeReference(writer,"href");
- RenderAttributes(writer);
- }
- }
-
- void System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument){
- OnServerClick(EventArgs.Empty);
- }
-
- public event EventHandler ServerClick{
- add{
- Events.AddHandler(EventServerClick, value);
- }
- remove{
- Events.RemoveHandler(EventServerClick, value);
- }
- }
-
- public string HRef{
- get{
- string attr = Attributes["href"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["href"] = AttributeToString(value);
- }
- }
-
- public string Name{
- get{
- string attr = Attributes["name"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["name"] = AttributeToString(value);
- }
- }
-
- public string Target{
- get{
- string attr = Attributes["target"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["target"] = AttributeToString(value);
- }
- }
-
- public string Title{
- get{
- string attr = Attributes["title"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["title"] = AttributeToString(value);
- }
- }
-
- } // class HtmlAnchor
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs
deleted file mode 100644
index 640daf02fef..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlButton : HtmlContainerControl, IPostBackEventHandler{
-
- private static readonly object EventServerClick;
-
- //Checked
- static HtmlButton(){
- EventServerClick = new Object();
- }
- //Checked
- public HtmlButton(): base("button"){}
-
- //Checked
- protected virtual void OnServerClick(EventArgs e){
- EventHandler handler;
- handler = (EventHandler) Events[EventServerClick];
- if(handler != null){
- handler.Invoke(this, e);
- }
- }
-
- protected new void RenderAttributes(HtmlTextWriter writer){
- if (Page != null && Events[EventServerClick] != null){
- WriteOnClickAttribute(
- writer,
- false,
- true,
- CausesValidation == false? Page.Validators.Count > 0: false);
- }
- base.RenderAttributes(writer);
- }
-
- void System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument){
- if (CausesValidation){
- Page.Validate();
- }
- OnServerClick(EventArgs.Empty);
- }
-
- public event EventHandler ServerClick{
- add{
- Events.AddHandler(EventServerClick, value);
- }
- remove{
- Events.RemoveHandler(EventServerClick, value);
- }
- }
-
- public bool CausesValidation{
- get{
- object attr = ViewState["CausesValidation"];
- if (attr != null){
- return (Boolean) attr;
- }
- return true;
- }
- set{
- ViewState["CausesValidation"] = (Boolean) value;
- }
- }
-
- } // class HtmlButton
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs
deleted file mode 100644
index 41f3b8046c8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// System.Web.UI.HtmlControls.HtmlContainerControl.cs
-//
-// Author
- // Bob Smith <bob@thestuff.net>
- //
- // (C) Bob Smith
- //
-
- using System;
- using System.Web;
- using System.Web.UI;
-
- //LAMESPEC: The dox talk about HttpException but are very ambigious.
- //TODO: Check to see if Render really is overridden instead of a LiteralControl being added. It apears that this is the
- //case due to testing. Anything inside the block is overwritten by the content of this control, so it doesnt apear
- //to do anything with children.
- // a doc references this. add? protected override ControlCollection CreateControlCollection();
-
- //TODO: If Test.InnerText = Test.InnerHtml without ever assigning anything into InnerHtml, you get this:
- // Exception Details: System.Web.HttpException: Cannot get inner content of Message because the contents are not literal.
- //[HttpException (0x80004005): Cannot get inner content of Message because the contents are not literal.]
- // System.Web.UI.HtmlControls.HtmlContainerControl.get_InnerHtml() +278
- // ASP.test3_aspx.AnchorBtn_Click(Object Source, EventArgs E) in \\genfs2\www24\bobsmith11\test3.aspx:6
- // System.Web.UI.HtmlControls.HtmlAnchor.OnServerClick(EventArgs e) +108
- // System.Web.UI.HtmlControls.HtmlAnchor.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +26
- // System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
- // System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +149
- // System.Web.UI.Page.ProcessRequestMain() +660
-
-
- namespace System.Web.UI.HtmlControls
- {
- public abstract class HtmlContainerControl : HtmlControl{
-
- private string _innerHtml = String.Empty;
- private string _innerText = String.Empty;
- private bool _doText = false;
- private bool _doChildren = true;
- protected string _tagName;
-
- public HtmlContainerControl() : base(){}
-
- public HtmlContainerControl(string tag) : base(tag) {}
-
- public virtual string InnerHtml
- {
- get
- {
- return _innerHtml;
- }
- set
- {
- _innerHtml = value;
- _doText = false;
- _doChildren = false;
- }
- }
-
- public virtual string InnerText
- {
- get
- {
- return _innerText;
- }
- set
- {
- _innerText = value;
- _doText = true;
- _doChildren = false;
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- if(_doChildren) RenderChildren(writer);
- else if(_doText) Page.Server.HtmlEncode(_innerText, writer);
- else writer.Write(_innerHtml);
- }
-
- protected virtual void RenderEndTag(HtmlTextWriter writer){}
- }
- }
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs
deleted file mode 100644
index e188605050b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// System.Web.UI.HtmlControls.HtmlControl.cs
-//
-// Author
-// Bob Smith <bob@thestuff.net>
-//
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
-
- public abstract class HtmlControl : Control, IAttributeAccessor
- {
- private string _tagName = "span";
- //TODO: Is this correct, or is the StateBag really the ViewState?
- private AttributeCollection _attributes = new AttributeCollection(new StateBag(true));
- private bool _disabled = false;
-
- public HtmlControl(){}
-
- public HtmlControl(string tag)
- {
- if(tag != null && tag != String.Empty) _tagName = tag;
- }
-
- internal static string AttributeToString(int n){
- if (n != -1)return n.ToString(NumberFormatInfo.InvariantInfo);
- return null;
- }
-
- internal static string AttributeToString(string s){
- if (s != null && s.Length != 0) return s;
- return null;
- }
-
- internal void PreProcessRelativeReference(HtmlTextWriter writer, string attribName){
- string attr = Attributes[attribName];
- if (attr != null){
- if (attr.Length != 0){
- try{
- attr = ResolveUrl(attr);
- }
- catch (Exception e) {
- throw new HttpException(attribName + " property had malformed url");
- }
- writer.WriteAttribute(attribName, attr);
- Attributes.Remove(attribName);
- }
- }
- }
-
- string System.Web.UI.IAttributeAccessor.GetAttribute(string name){
- return Attributes[name];
- }
-
- void System.Web.UI.IAttributeAccessor.SetAttribute(string name, string value){
- Attributes[name] = value;
- }
-
- protected virtual void RenderAttributes(HtmlTextWriter writer){
- if (ID != null){
- writer.WriteAttribute("id",ClientID);
- }
- Attributes.Render(writer);
- }
-
- internal static void WriteOnClickAttribute(HtmlTextWriter writer, bool submitsAutomatically, bool submitsProgramatically, bool causesValidation) {
- string local1;
- string local2;
- string local3;
-
- AttributeCollection attr = Attributes;
- local1 = null;
- if (submitsAutomatically) {
- if ((causesValidation))
- local1 = System.Web.UI.Utils.GetClientValidateEvent(Page);
- }
- else if (submitsProgramatically) {
- if (causesValidation)
- local1 = System.Web.UI.Utils.GetClientValidatedPostback(this);
- else
- local1 = Page.GetPostBackClientEvent(this, String.Empty);
- }
- if (local1 != null) {
- local2 = attr["language"];
- if (local2 != null)
- attr.Remove("language");
- writer.WriteAttribute("language", "javascript");
- local3 = attr["onclick"];
- if (local3 != null) {
- attr.Remove("onclick");
- writer.WriteAttribute("onclick", local3 + " " + local1);
- return;
- }
- writer.WriteAttribute("onclick", local1);
- }
- }
-
- public AttributeCollection Attributes
- {
- get
- {
- return _attributes;
- }
- }
- public bool Disabled
- {
- get
- {
- return _disabled;
- }
- set
- {
- _disabled = value;
- }
- }
- public CssStyleCollection Style
- {
- get
- {
- return _attributes.CssStyle;
- }
- }
- public virtual string TagName
- {
- get
- {
- return _tagName;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs
deleted file mode 100644
index e4c1a817e17..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlForm : HtmlContainerControl{
-
- private static string SmartNavIncludeScriptKey = "SmartNavIncludeScript";
-
- public HtmlForm(): base("form"){}
-
- protected new void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("name",RenderedName);
- Attributes.Remove("name");
- writer.WriteAttribute("method",Method);
- Attributes.Remove("method");
- writer.WriteAttribute("action",Action,true);
- Attributes.Remove("action");
-
- string clientOnSubmit = Page.ClientOnSubmitEvent;
- if (clientOnSubmit != null && clientOnSubmit.Length > 0){
- if (Attributes["onsubmit"] != null){
- clientOnSubmit = String.Concat(clientOnSubmit,Attributes["onsubmit"]);
- Attributes.Remove("onsubmit");
- }
- writer.WriteAttribute("language","javascript");
- writer.WriteAttribute("onsubmit",clientOnSubmit);
- }
- if (ID == null){
- writer.WriteAttribute("id",ClientID);
- }
- base.RenderAttributes(writer);
- }
-
- //TODO: adapt code for non-IE browsers
- protected override void Render(HtmlTextWriter output){
- if (Page.SmartNavigation == true){
- IAttributeAccessor.SetAttribute("_smartNavigation","true");
- HttpBrowserCapabilities browserCap = Context.Request.Browser;
- if (browserCap.Browser.ToLower() != "ie" && browserCap.MajorVersion < 5){
- base.Render(output);
- return;
- }
- output.WriteLine("<IFRAME ID=_hifSmartNav NAME=_hifSmartNav STYLE=display:none ></IFRAME>");
-
- if (browserCap.MinorVersion < 0.5 && browserCap.MajorVersion != 5)
- Page.RegisterClientScriptFile("SmartNavIncludeScript","JScript","SmartNavIE5.js");
- else if (Page.IsPostBack) Page.RegisterClientScriptFile("SmartNavIncludeScript","JScript","SmartNav.js");
- base.Render(output);
- }
- }
-
- protected override void RenderChildren(HtmlTextWriter writer){
- Page.OnFormRender(writer,ClientID);
- base.RenderChildren(writer);
- Page.OnFormPostRender(writer,ClientID);
- }
-
- protected override void OnInit(EventArgs e){
- base.OnInit(e);
- Page.RegisterViewStateHandler();
- }
-
- internal string Action{
- get{
- string executionFilePath = Context.Request.CurrentExecutionFilePath;
- string filePath = Context.Request.FilePath;
- string attr;
- if (String.ReferenceEquals(executionFilePath, filePath) == true){
- attr = filePath;
- int lastSlash = attr.LastIndexOf('/');
- if (lastSlash >= 0)
- attr = attr.Substring(lastSlash + 1);
- }
- else{
- attr = Util.UrlPath.MakeRelative(filePath,executionFilePath);
- }
- string queryString = Context.Request.QueryStringText;
- if (queryString != null && queryString.Length > 0)
- attr = String.Concat(attr, '?', queryString);
- return attr;
- }
- }
-
- public string EncType{
- get{
- string attr = Attributes["enctype"];
- if (attr != null){
- return attr;
- }
- return null;
- }
- set{
- Attributes["enctype"] = AttributeToString(value);
- }
- }
-
- public string Method{
- get{
- string attr = Attributes["method"];
- if (attr != null){
- return attr;
- }
- return "post";
- }
- set{
- Attributes["method"] = AttributeToString(value);
- }
- }
-
- public string Target{
- get{
- string attr = Attributes["target"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["target"] = AttributeToString(value);
- }
- }
-
- public string Name{
- get{
- string attr = Attributes["name"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- }
-
- internal string RenderedName{
- get{
- string attr = Name;
- if (attr.Length > 0){
- return attr;
- }
- return UniqueID;
- }
- }
-
- } // class HtmlForm
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
deleted file mode 100644
index 2583de6190b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Web.UI.HtmlControls.HtmlGenericControl.cs
-//
-// Author:
- // Bob Smith <bob@thestuff.net>
- //
- // (C) Bob Smith
- //
-
- using System;
- using System.Web;
- using System.Web.UI;
-
- namespace System.Web.UI.HtmlControls{
-
- public class HtmlGenericControl : HtmlContainerControl {
-
- public HtmlGenericControl(){}
-
- public HtmlGenericControl(string tag): base(tag){}
-
- public new string TagName {
- get
- {
- return _tagName;
- }
- set{
- _tagName = value;
- }
- }
- }
- }
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
deleted file mode 100755
index 62135016d4c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlImage : HtmlControl{
-
- public HtmlImage(): base("img"){}
-
- protected new void RenderAttributes(HtmlTextWriter writer){
- PreProcessRelativeReference(writer,"src");
- RenderAttributes(writer);
- writer.Write(" /");
- }
-
- public string Align{
- get{
- string attr = Attributes["align"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string Alt{
- get{
- string attr = Attributes["alt"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["alt"] = AttributeToString(value);
- }
- }
-
- public int Border{
- get{
- string attr = Attributes["border"];
- if (attr != null){
- return Int32.Parse(attr,CultureInfo.InvariantCulture);
- }
- return -1;
- }
- set{
- Attributes["border"] = AttributeToString(value);
- }
- }
-
- public string Src{
- get{
- string attr = Attributes["src"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["src"] = AttributeToString(value);
- }
- }
-
- public int Width{
- get{
- string attr = Attributes["width"];
- if (attr != null){
- return Int32.Parse(attr,CultureInfo.InvariantCulture);
- }
- return -1;
- }
- set{
- Attributes["width"] = AttributeToString(value);
- }
- }
-
- } // class HtmlImage
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
deleted file mode 100755
index 3f1a75c4133..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputButton : HtmlInputControl, IPostBackEventHandler{
-
- private static readonly object EventServerClick;
-
- public HtmlInputButton(string type): base(type){}
-
- protected void OnServerClick(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerClick];
- if (handler != null){
- handler.Invoke(this, e);
- }
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- string attrType = Type;
- bool ofTypeSubmit = (String.Compare(attrType, "submit", true) == 0);
- bool events;
- if (ofTypeSubmit != true){
- events = (Events[EventServerClick] != null);
- }
- else{
- events = false;
- }
- if (Page != null){
- if (ofTypeSubmit != true){
- WriteOnClickAttribute(
- writer,
- false,
- true,
- CausesValidation == false? Page.Validators.Count > 0: false);
- }
- else{
- if (events != true && String.Compare(attrType,"button", true) != 0){
- WriteOnClickAttribute(
- writer,
- false,
- true,
- CausesValidation == false? Page.Validators.Count > 0: false);
- }
- }
- }
- base.RenderAttributes(writer);
- }
-
- public void RaisePostBackEvent(string eventArgument){
- if(CausesValidation == true){
- Page.Validate();
- }
- OnServerClick(EventArgs.Empty);
- }
-
- public event EventHandler ServerClick{
- add{
- Events.AddHandler(EventServerClick, value);
- }
- remove{
- Events.RemoveHandler(EventServerClick, value);
- }
- }
-
- public bool CausesValidation{
- get{
- object causesVal = ViewState["CausesValidation"];
- if (causesVal != null){
- return (Boolean) causesVal;
- }
- return true;
- }
- set{
- ViewState["CausesValidation"] = (Boolean) value;
- }
- }
-
- } // end of System.Web.UI.HtmlControls.HtmlInputButton
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
deleted file mode 100755
index c73915abc15..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputCheckBox : HtmlInputControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlInputCheckBox(): base("checkbox"){}
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postValue = postCollection[postDataKey];
- bool postChecked = false;
- if (postValue != null)
- postChecked = postValue.Length > 0;
- Checked = postChecked;
- return (postChecked == Checked == false);
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- protected void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null) handler.Invoke(this, e);
- }
-
- protected override void OnPreRender(EventArgs e){
- if (Page != null && !Disabled)
- Page.RegisterRequiresPostBack(this);
- if (Events[EventServerChange] != null && !Disabled)
- ViewState.SetItemDirty("checkbox",false);
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- public bool Checked{
- get{
- string attr = Attributes["checked"];
- if (attr != null)
- return attr.Equals("checked");
- return false;
- }
- set{
- Attributes["checked"] = (value == true)? "checked": null;
- }
- }
-
- } // class HtmlInputCheckBox
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs
deleted file mode 100755
index 5c5010d4451..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputControl : HtmlControl{
-
- public HtmlInputControl(string type):base("type"){
- Attributes["type"] = type;
- }
-
- protected virtual new void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("name",RenderedName);
- Attributes.Remove("name");
- base.RenderAttributes(writer);
- writer.Write(" /");
- }
-
- public string Name{
- get{
- return UniqueID;
- }
- set{}
- }
-
- protected virtual string RenderedName{
- get{
- return Name;
- }
- }
-
- public string Type{
- get{
- string attr = Attributes["type"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- }
-
- public virtual string Value{
- get{
- string attr = Attributes["value"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["value"] = AttributeToString(value);
- }
- }
- } // class HtmlInputControl
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs
deleted file mode 100755
index b0e4710db6a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputFile : HtmlInputControl, IPostBackDataHandler{
-
- public HtmlInputFile():base("file"){}
-
- public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postValue = postCollection[postDataKey];
- if (postValue != null)
- Value = postValue;
- return false;
- }
-
- public virtual void RaisePostDataChangedEvent(){}
-
- public string Accept{
- get{
- string attr = Attributes["accept"];
- if (attr != null)
- return attr;
- return String.Empty;
- }
- set{
- Attributes["accept"] = AttributeToString(value);
- }
- }
-
- public int MaxLength{
- get{
- string attr = Attributes["maxlength"];
- if (attr != null)
- return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["accept"] = AttributeToString(value);
- }
- }
-
- public int Size{
- get{
- string attr = Attributes["size"];
- if (attr != null)
- return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["size"] = AttributeToString(value);
- }
- }
-
- public HttpPostedFile PostedFile{
- get{
- return Context.Request.Files[RenderedName];
- }
- }
-
- } // class HtmlInputFile
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
deleted file mode 100755
index daf2a326831..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputHidden : HtmlInputControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlInputHidden(string type):base("hidden"){}
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postValue = postCollection[postDataKey];
- if (postValue != null)
- Value = postValue;
- return false;
- }
-
- public virtual void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- protected void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null) handler.Invoke(this, e);
- }
-
- protected override void OnPreRender(EventArgs e){
- if (Events[EventServerChange] != null && !Disabled)
- ViewState.SetItemDirty("value",false);
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- } // class HtmlInputFile
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
deleted file mode 100755
index 3ac74919160..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputImage : HtmlInputControl, IPostBackEventHandler, IPostBackDataHandler{
-
- private static readonly object EventServerClick;
- private int _x, _y;
-
- public HtmlInputImage(): base("image"){}
-
- protected override void OnPreRender(EventArgs e){
- if (Page != null && !Disabled){
- Page.RegisterRequiresPostBack(this);
- }
- }
-
- protected void OnServerClick(ImageClickEventArgs e){
- ImageClickEventHandler handler = (ImageClickEventHandler) Events[EventServerClick];
- if (handler != null) handler.Invoke(this, e);
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- PreProcessRelativeReference(writer,"src");
- if (Page != null && !CausesValidation){
- WriteOnClickAttribute(
- writer,
- false,
- true,
- CausesValidation == false? Page.Validators.Count > 0: false);
- }
- RenderAttributes(writer);
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postX = postCollection[String.Concat(RenderedName,".x")];
- string postY = postCollection[String.Concat(RenderedName,".y")];
- if (postX != null && postY != null && postX.Length >= 0 && postY.Length >= 0){
- _x = Int32.Parse(postX, CultureInfo.InvariantCulture);
- _y = Int32.Parse(postY, CultureInfo.InvariantCulture);
- Page.RegisterRequiresRaiseEvent(this);
- }
- return false;
- }
-
- public void RaisePostBackEvent(string eventArgument){
- if (CausesValidation){
- Page.Validate();
- }
- OnServerClick(new ImageClickEventArgs(_x,_y));
- }
-
- public void RaisePostDataChangedEvent(){}
-
- public event EventHandler ServerClick{
- add{
- Events.AddHandler(EventServerClick, value);
- }
- remove{
- Events.RemoveHandler(EventServerClick, value);
- }
- }
-
- public string Align{
- get{
- string attr = Attributes["align"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string Alt{
- get{
- string attr = Attributes["alt"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["alt"] = AttributeToString(value);
- }
- }
-
- public int Border{
- get{
- string attr = Attributes["border"];
- if (attr != null) return Int32.Parse(attr,CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["border"] = AttributeToString(value);
- }
- }
-
- public bool CausesValidation{
- get{
- object causesVal = ViewState["CausesValidation"];
- if (causesVal != null) return (Boolean) causesVal;
- return true;
- }
- set{
- ViewState["CausesValidation"] = (Boolean) value;
- }
- }
-
- public string Src{
- get{
- string attr = Attributes["src"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["src"] = AttributeToString(value);
- }
- }
- } // class HtmlInputImage
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
deleted file mode 100755
index 62f2de3f506..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputRadioButton : HtmlInputControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlInputRadioButton(): base("radio"){}
-
- protected override void OnPreRender(EventArgs e){
- if (Page != null && !Disabled){
- Page.RegisterRequiresPostBack(this);
- }
- if (Events[EventServerChange] != null && !Disabled){
- ViewState.SetItemDirty("checked", false);
- }
- }
-
- protected void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null){
- handler.Invoke(this, e);
- }
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("value", Value);
- Attributes.Remove("value");
- RenderAttributes(writer);
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postValue = postCollection[postDataKey];
- bool myBool = false;
- if (postValue != null && postValue.Equals(Value)){
- if (!Checked){
- Checked = true;
- myBool = true;
- }
- }
- else{
- if (Checked){
- Checked = false;
- myBool = false;
- }
- }
- return myBool;
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- public bool Checked{
- get{
- string attr = Attributes["checked"];
- if (attr != null){
- return attr.Equals("checked");
- }
- return false;
- }
- set{
- if (value != true){
- Attributes["checked"] = null;
- }
- Attributes["checked"] = "checked";
- }
- }
- public new string Name{
- get{
- string attr = Attributes["name"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["name"] = AttributeToString(value);
- }
- }
-
- private new string RenderedName{
- get{
- string attr = base.RenderedName;
- string id = UniqueID;
- int indexOfX = id.LastIndexOf('X');
- if (indexOfX != 0 && indexOfX >= 0){
- attr = String.Concat(attr, id.Substring(0,indexOfX+1));
- }
- return attr;
- }
- }
-
- } // class HtmlInputRadioButton
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
deleted file mode 100755
index e2ac0471d46..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputText : HtmlInputControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlInputText(string type):base(type){}
- public HtmlInputText():base("text"){}
-
- protected override void OnPreRender(EventArgs e){
- if (Events[EventServerChange] != null && !Disabled){
- ViewState.SetItemDirty("value",false);
- }
- }
-
- protected void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null) handler.Invoke(this, e);
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- //hide value when password box
- if (String.Compare(Type, "password") != 0){
- ViewState.Remove("value");
- }
- RenderAttributes(writer);
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string currentValue = Value;
- string[] postedValue = postCollection.GetValues(postDataKey);
- if (!currentValue.Equals(postedValue)){
- Value = postedValue[0];
- return true;
- }
- return false;
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- public int MaxLength{
- get{
- string attr = (String) ViewState["maxlength"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["maxlength"] = AttributeToString(value);
- }
- }
-
- public int Size{
- get{
- string attr = (String) ViewState["size"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["size"] = AttributeToString(value);
- }
- }
-
- public override string Value{
- get{
- string attr = Attributes["value"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["value"] = AttributeToString(value);
- }
- }
-
- } // class HtmlInputText
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
deleted file mode 100755
index 5b58abda3d0..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
+++ /dev/null
@@ -1,402 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using System.Globalization;
-using System.ComponentModel;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlSelect : HtmlContainerControl, IPostBackDataHandler{
-
-
- private int _cachedSelectedIndex;
- private object _dataSource;
- private static readonly object EventServerChange;
- private ListItemCollection _items;
-
- public HtmlSelect():base("select"){
- _cachedSelectedIndex = -1;
- }
-
- protected override void AddParsedSubObject(object obj){
- if (obj as ListItem != null) {
- this.Items.Add((ListItem) obj);
- return;
- }
- throw new HttpException("HtmlSelect cannot have children of Type " + obj.GetType().Name);
- }
-
- protected virtual void ClearSelection(){
- for (int i =0; i<= Items.Count; i++){
- Items[i].Selected = false;
- }
- }
-
- protected override ControlCollection CreateControlCollection(){
- return new EmptyControlCollection(this);
- }
-
- protected override void LoadViewState(object savedState){
- if (savedState != null){
- Triplet state = (Triplet) savedState;
- LoadViewState(state.First);
- Items.LoadViewState(state.Second);
- object thirdState = state.Third;
- if (thirdState != null) Select((int[]) thirdState);
- }
- }
-
- protected override void OnDataBinding(EventArgs e){
- base.OnDataBinding(e);
- IEnumerable resolvedDataSource = System.Web.Utils.DataSourceHelper.GetResolvedDataSource(DataSource, DataMember);
- if ( resolvedDataSource != null){
- string text = DataTextField;
- string value = DataValueField;
- Items.Clear();
- ICollection rdsCollection = resolvedDataSource as ICollection;
- if (rdsCollection != null){
- Items.Capacity = rdsCollection.Count;
- }
- bool valid = false;
- if (text.Length >= 0 && value.Length >= 0)
- valid = true;
- ListItem li = new ListItem();
- IEnumerator current = resolvedDataSource.GetEnumerator();
- while(current.MoveNext()){
- if (valid == true){
- if (text.Length >= 0)
- li.Text = DataBinder.GetPropertyValue(current, text, null);
- if (value.Length >= 0)
- li.Value = DataBinder.GetPropertyValue(current, value, null);
- }
- else{
- li.Value = li.Text = current.ToString();
- }
- }
- Items.Add(li);
- }
- if ( _cachedSelectedIndex != -1){
- SelectedIndex = _cachedSelectedIndex;
- _cachedSelectedIndex = -1;
- }
- }
-
- protected override void OnPreRender(EventArgs e){
- if (Page != null && Size >= 0 && !Disabled){
- Page.RegisterRequiresPostBack(this);
- }
- }
-
- protected virtual void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null)
- handler.Invoke(this,e);
- }
-
- protected new void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("name", Name);
- Attributes.Remove("name");
- Attributes.Remove("DataValueField");
- Attributes.Remove("DataTextField");
- Attributes.Remove("DataMember");
- RenderAttributes(writer);
- }
-
- protected override void RenderChildren(HtmlTextWriter writer){
- //flush output
- writer.WriteLine();
- // increase indent level, improves readability
- writer.Indent = writer.Indent + 1;
- if (Items.Count >= 0){
- // display all options, and set the selected option
- foreach (ListItem option in Items){
- //write begin tag with attributes
- writer.WriteBeginTag("option");
- if (option.Selected == true){
- writer.WriteAttribute("selected","selected");
- }
- writer.WriteAttribute("value",option.Value,true);
- option.Attributes.Remove("text");
- option.Attributes.Remove("value");
- option.Attributes.Remove("selected");
- option.Attributes.Render(writer);
- writer.Write('>');
- //write the option text
- HttpUtility.HtmlEncode(option.Text, writer);
- //close the current option tag
- writer.WriteEndTag("option");
- //flush output
- writer.WriteLine();
- }
- }
- // set the indent level back to normal
- writer.Indent = writer.Indent - 1;
- }
-
- protected override object SaveViewState(){
- object itemsViewState = SaveViewState();
- object third = null;
- if (Events[EventServerChange] != null && !Disabled && Visible){
- third = SelectedIndices;
- }
- if (third != null && base.SaveViewState() != null && itemsViewState != null){
- return new Triplet(itemsViewState, base.SaveViewState(), third);
- }
- return null;
- }
-
- protected virtual void Select(int[] selectedIndices){
- // unselect all options
- ClearSelection();
- // iterate through options, and set when selected
- foreach (int current in selectedIndices){
- if (current >= 0 && current < Items.Count){
- Items[current].Selected = true;
- }
- }
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- //get the posted selectedIndices[]
- string[] postedValueColl = postCollection.GetValues(postDataKey);
- bool valid = false;
- if (postedValueColl != null){
- if (!Multiple){
- //single selection
- //int postedValue = Items.FindIndexByValue(postedValueColl[0]);
- int postedValue = Items.IndexOf(Items.FindByValue(postedValueColl[0]));
- if (postedValue != SelectedIndex){
- //set the SelectedIndex
- SelectedIndex = postedValue;
- valid = true;
- }
- }
- else{
- //multiple selection
- int postedValueCount = postedValueColl.Length;
- int[] arr= new int[postedValueCount];
- //fill an array with the posted Values
- for (int i = 0; i <= postedValueCount; i++)
- arr[i] = Items.IndexOf(Items.FindByValue(postedValueColl[i]));
- //test if everything went fine
- if( postedValueCount == SelectedIndices.Length)
- for (int i = 0; i <= postedValueCount; i++)
- if(arr[i] == SelectedIndices[i])
- valid = true;
- else
- valid = true;
- //commit the posted Values
- if(valid)
- Select(arr);
- }
- }
- else if (SelectedIndex != -1){
- SelectedIndex = -1;
- valid = true;
- }
- return valid;
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- //starts tracking changes to the viewstate
- protected internal virtual void TrackViewState(){
- TrackViewState();
- Items.TrackViewState();
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- public virtual string DataMember{
- get{
- object viewStateDataMember = ViewState["DataMember"];
- if ( viewStateDataMember != null) return (String) viewStateDataMember;
- return String.Empty;
- }
- set{
- Attributes["DataMember"] = HtmlControl.AttributeToString(value);
- }
- }
-
- public virtual object DataSource{
- get{
- return _dataSource;
- }
- set{
- if (value != null && value is IListSource){
- if (value is IEnumerable){
- _dataSource = value;
- }
- else{
- throw new ArgumentException("Invalid dataSource type");
- }
- }
- }
- }
-
- public virtual string DataTextField{
- get{
- string attr = Attributes["DataTextField"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["DataTextField"] = AttributeToString(value);
- }
- }
-
- public virtual string DataValueField{
- get{
- string attr = Attributes["DataValueField"];
- if (attr != null)return attr;
- return String.Empty;
- }
- set{
- Attributes["DataValueField"] = AttributeToString(value);
- }
- }
-
- public override string InnerHtml{
- get{
- throw new NotSupportedException("InnerHtml is not supported by " + this.GetType().Name);
- }
- set{
- throw new NotSupportedException("InnerHtml is not supported by " + this.GetType().Name);
- }
- }
-
- public override string InnerText{
- get{
- throw new NotSupportedException("InnerText is not supported by " + this.GetType().Name);
- }
- set{
- throw new NotSupportedException("InnerText is not supported by " + this.GetType().Name);
- }
- }
-
- public ListItemCollection Items{
- get{
- if (_items == null){
- _items = new ListItemCollection();
- if (IsTrackingViewState) _items.TrackViewState();
- }
- return _items;
- }
- }
-
- public bool Multiple{
- get{
- string attr = Attributes["multiple"];
- if (attr != null) return attr.Equals("multiple");
- return false;
- }
- set{
- if (value == true) Attributes["multiple"] = "multiple";
- else Attributes["multiple"] = null;
- }
- }
-
- public string Name{
- get{
- return UniqueID;
- }
- set{
- //LAMESPEC
- return;
- }
- }
-
- public virtual int SelectedIndex {
- get{
- for (int i=0; i<=Items.Count; i++){
- if (Items[i].Selected == true) return i;
- }
- if (Size<=1 && !Multiple){
- if(Items.Count > 0) Items[0].Selected = true;
- return 0;
- }
- return -1;
- }
- set{
- if(Items.Count == 0){
- _cachedSelectedIndex = value;
- return;
- }
- else if (value < -1 || value >= Items.Count)
- throw new ArgumentOutOfRangeException();
- ClearSelection();
- if (value >= 0)
- Items[value].Selected = true;
- }
- }
-
- protected virtual int[] SelectedIndices {
- get{
- int[] indices = new int[3];
- int indicesCount = 0;
- for(int i=0; i <= Items.Count; i++){
- if(Items[i].Selected){
- if( indicesCount == (int) indices.Length){
- int[] temp = new int[indicesCount + indicesCount];
- indices.CopyTo(temp,0);
- indices = temp;
- }
- indicesCount++;
- indices[indicesCount] = i;
- }
- }
- int[] arr = new int[indicesCount];
- System.Array.Copy(indices,0,arr,0,indicesCount);
- return arr;
- }
- }
-
- public int Size{
- get{
- string attr = Attributes["size"];
- if (attr != null){
- return Int32.Parse(attr, CultureInfo.InvariantCulture);;
- }
- return -1;
- }
- set{
- Attributes["size"] = AttributeToString(value);
- }
- }
-
- public string Value{
- get{
- int selectedIndex = SelectedIndex;
- if (selectedIndex >=0 && selectedIndex <= Items.Count){
- return Items[selectedIndex].Value;
- }
- return String.Empty;
- }
- set{
- int findValue = Items.IndexOf(Items.FindByValue(value));
- if (findValue >= 0) SelectedIndex = findValue;
- }
- }
-
- } // class HtmlSelect
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
deleted file mode 100755
index db057fd16ff..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlTable : HtmlContainerControl {
- private HtmlTableRowCollection _rows;
-
- public HtmlTable():base("table"){}
-
- protected override ControlCollection CreateControlCollection(){
- return new HtmlTableRowControlCollection(this);
- }
-
- protected override void RenderChildren(HtmlTextWriter writer){
- writer.WriteLine();
- writer.Indent = writer.Indent + 1;
- base.RenderChildren(writer);
- writer.Indent = writer.Indent - 1;
- }
-
- protected new void RenderEndTag(HtmlTextWriter writer){
- base.RenderEndTag(writer);
- writer.WriteLine();
- }
-
- public string Align {
- get{
- string attr = Attributes["align"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string BgColor {
- get{
- string attr = Attributes["bgcolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bgcolor"] = AttributeToString(value);
- }
- }
-
- public int Border {
- get{
- string attr = Attributes["border"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["border"] = AttributeToString(value);
- }
- }
-
- public string BorderColor {
- get{
- string attr = Attributes["bordercolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bordercolor"] = AttributeToString(value);
- }
- }
-
- public int CellPadding {
- get{
- string attr = Attributes["cellpadding"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["cellpadding"] = AttributeToString(value);
- }
- }
-
- public int CellSpacing {
- get{
- string attr = Attributes["cellspacing"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["cellspacing"] = AttributeToString(value);
- }
- }
-
- public string Height {
- get{
- string attr = Attributes["height"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["height"] = AttributeToString(value);
- }
- }
-
- public override string InnerHtml {
- get{
- throw new NotSupportedException("InnerHtml property not supported by HtmlTable");
- }
- set{
- throw new NotSupportedException("InnerHtml property not supported by HtmlTable");
- }
- }
-
- public override string InnerText {
- get{
- throw new NotSupportedException("InnerText property not supported by HtmlTable");
- }
- set{
- throw new NotSupportedException("InnerText property not supported by HtmlTable");
- }
- }
-
- public virtual HtmlTableRowCollection Rows {
- get{
- if (_rows == null) _rows = new HtmlTableRowCollection(this);
- return _rows;
- }
- }
-
- public string Width {
- get{
- string attr = Attributes["width"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["width"] = AttributeToString(value);
- }
- }
-
- protected class HtmlTableRowControlCollection : ControlCollection {
-
- internal HtmlTableRowControlCollection(Control owner): base(owner){}
-
- public override void Add(Control child){
- if ((child as HtmlTableCell) != null){
- base.Add(child);
- }
- else{
- throw new ArgumentException("HtmlTableRow cannot have children of type" + child.GetType().Name);
- }
- }
-
- public override void AddAt(int index, Control child){
- if ((child as HtmlTableCell) != null){
- base.AddAt(index,child);
- }
- else{
- throw new ArgumentException("HtmlTableRow cannot have children of type" + child.GetType().Name);
- }
- }
- } // end of HtmlTableRowControlCollection
- }
- // end of System.Web.UI.HtmlControl
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs
deleted file mode 100755
index 6815acf909a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
- public class HtmlTableCell : HtmlContainerControl {
- public HtmlTableCell(): base("td"){}
-
- public HtmlTableCell(string tagName): base(tagName){}
-
- protected new void RenderEndTag(HtmlTextWriter writer){
- base.RenderEndTag(writer);
- writer.WriteLine();
- }
-
- public string Align {
- get{
- string attr = Attributes["align"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string BgColor {
- get{
- string attr = Attributes["bgcolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bgcolor"] = AttributeToString(value);
- }
- }
-
- public string BorderColor {
- get{
- string attr = Attributes["bordercolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bordercolor"] = AttributeToString(value);
- }
- }
-
- public int ColSpan {
- get{
- string attr = Attributes["colspan"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["colspan"] = AttributeToString(value);
- }
- }
-
- public string Height {
- get{
- string attr = Attributes["height"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["height"] = AttributeToString(value);
- }
- }
-
- public bool NoWrap {
- get{
- string attr = Attributes["colspan"];
- if (attr != null) return attr.Equals("nowrap");
- return false;
- }
- set{
- if (value == true){
- Attributes["nowrap"] = "nowrap";
- }
- else{
- Attributes["nowrap"] = null;
- }
- }
- }
-
- public int RowSpan {
- get{
- string attr = Attributes["rowspan"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["rowspan"] = AttributeToString(value);
- }
- }
-
- public string VAlign {
- get{
- string attr = Attributes["valign"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["valign"] = AttributeToString(value);
- }
- }
-
- public string Width {
- get{
- string attr = Attributes["width"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["width"] = AttributeToString(value);
- }
- }
-
- }
- // System.Web.UI.HtmlControls.HtmlTableCell
-
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCellCollection.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCellCollection.cs
deleted file mode 100755
index 9deaf2f0584..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCellCollection.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Collections;
-
-namespace System.Web.UI.HtmlControls{
- public sealed class HtmlTableCellCollection : ICollection {
- private HtmlTableRow _owner;
-
- internal HtmlTableCellCollection(HtmlTableRow owner){
- _owner = owner;
- }
-
- public void Add(HtmlTableCell cell){
- Insert(-1, cell);
- }
-
- public void Clear(){
- if (_owner.HasControls()) _owner.Controls.Clear();
- }
-
- public void CopyTo(Array array, int index){
- IEnumerator tablecell = this.GetEnumerator();
- while(tablecell.MoveNext()){
- index = index + 1;
- array.SetValue(tablecell.Current, index);
- }
- }
-
- public IEnumerator GetEnumerator(){
- return _owner.Controls.GetEnumerator();
- }
-
- public void Insert(int index, HtmlTableCell cell){
- _owner.Controls.AddAt(index,cell);
- }
-
- public void Remove(HtmlTableCell cell){
- _owner.Controls.Remove(cell);
- }
-
- public void RemoveAt(int index){
- _owner.Controls.RemoveAt(index);
- }
-
- public int Count {
- get{
- if (_owner.HasControls()) return _owner.Controls.Count;
- return 0;
- }
- }
-
- public bool IsReadOnly {
- get{
- return false;
- }
- }
-
- public bool IsSynchronized {
- get{
- return false;
- }
- }
-
- public HtmlTableRow this[int index] {
- get{
- return (HtmlTableRow) _owner.Controls[index];
- }
- }
-
- public object SyncRoot {
- get{
- return null;
- }
- }
-
- } // end of System.Web.UI.HtmlControls.HtmlTableCellCollection
-
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRow.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRow.cs
deleted file mode 100755
index 378e149d835..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRow.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
- public class HtmlTableRow : HtmlContainerControl {
- private HtmlTableCellCollection _cells;
- public HtmlTableRow():base("tr"){}
-
- protected override ControlCollection CreateControlCollection(){
- return new HtmlTableCellControlCollection(this);
- }
-
- protected override void RenderChildren(HtmlTextWriter writer){
- writer.WriteLine();
- writer.Indent = writer.Indent + 1;
- this.RenderChildren(writer);
- writer.Indent = writer.Indent - 1;
- }
-
- protected new void RenderEndTag(HtmlTextWriter writer){
- base.RenderEndTag(writer);
- writer.WriteLine();
- }
-
- public string Align {
- get{
- string attr = Attributes["align"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string BgColor {
- get{
- string attr = Attributes["bgcolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bgcolor"] = AttributeToString(value);
- }
- }
-
- public string BorderColor {
- get{
- string attr = Attributes["bordercolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bordercolor"] = AttributeToString(value);
- }
- }
-
- public virtual HtmlTableCellCollection Cells {
- get{
- if (_cells == null) _cells = new HtmlTableCellCollection(this);
- return _cells;
- }
- }
-
- public string Height {
- get{
- string attr = Attributes["height"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["height"] = AttributeToString(value);
- }
- }
-
- public override string InnerHtml {
- get{
- throw new NotSupportedException("InnerHtml is not supported by HtmlTableRow");
- }
- set{
- throw new NotSupportedException("InnerHtml is not supported by HtmlTableRow");
- }
- }
-
- public override string InnerText {
- get{
- throw new NotSupportedException("InnerText is not supported by HtmlTableRow");
- }
- set{
- throw new NotSupportedException("InnerText is not supported by HtmlTableRow");
- }
- }
-
- public string VAlign {
- get{
- string attr = Attributes["valign"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["valign"] = AttributeToString(value);
- }
- }
-
-
-
- protected class HtmlTableCellControlCollection : ControlCollection {
-
- internal HtmlTableCellControlCollection(Control owner): base(owner){}
-
- public override void Add(Control child){
- if (child is HtmlTableCell){
- base.Add(child);
- }
- else{
- throw new ArgumentException("HtmlTableRow cannot have children of Type " + child.GetType().Name);
- }
- }
-
- public override void AddAt(int index, Control child){
- if (child is HtmlTableCell){
- base.AddAt(index,child);
- }
- else{
- throw new ArgumentException("HtmlTableRow cannot have children of Type " + child.GetType().Name);
- }
- }
- }
- } // end of System.Web.UI.HtmlControls.HtmlTableRow+HtmlTableCellControlCollection
- // end of System.Web.UI.HtmlControls.HtmlTableRow
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRowCollection.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRowCollection.cs
deleted file mode 100755
index 987c8aed674..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRowCollection.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Collections;
-
-namespace System.Web.UI.HtmlControls{
- public sealed class HtmlTableRowCollection : ICollection {
-
- private HtmlTable _owner;
-
- internal HtmlTableRowCollection(HtmlTable owner){
- _owner = owner;
- }
-
- public void Add(HtmlTableRow row){
- Insert(-1, row);
- }
-
- public void Clear(){
- if (_owner.HasControls()) _owner.Controls.Clear();
- }
-
- public void CopyTo(Array array, int index){
- IEnumerator tablerow = this.GetEnumerator();
- while (tablerow.MoveNext()){
- index = index + 1;
- array.SetValue(tablerow.Current, index);
- }
- }
-
- public IEnumerator GetEnumerator(){
- return _owner.Controls.GetEnumerator();
- }
-
- public void Insert(int index, HtmlTableRow row){
- _owner.Controls.AddAt(index,row);
- }
-
- public void Remove(HtmlTableRow row){
- _owner.Controls.Remove(row);
- }
-
- public void RemoveAt(int index){
- _owner.Controls.RemoveAt(index);
- }
-
- public int Count {
- get{
- if (_owner.HasControls()) return _owner.Controls.Count;
- return 0;
- }
- }
-
- public bool IsReadOnly {
- get{
- return false;
- }
- }
-
- public bool IsSynchronized {
- get{
- return false;
- }
- }
-
- public HtmlTableRow this[int index] {
- get{
- return (HtmlTableRow) _owner.Controls[index];
- }
- }
-
- public object SyncRoot {
- get{
- return this;
- }
- }
- }//System.Web.UI.HtmlControls.HtmlTableRowCollection
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
deleted file mode 100644
index f5652958241..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlTextArea : HtmlContainerControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlTextArea(): base("textarea"){}
-
- public int Cols{
- get{
- string attr = Attributes["cols"];
- if (attr != null){
- return Int32.Parse(attr, CultureInfo.InvariantCulture);
- }
- return -1;
- }
- set{
- Attributes["cols"] = AttributeToString(value);
- }
- }
-
- public int Rows{
- get{
- string attr = Attributes["rows"];
- if (attr != null){
- return Int32.Parse(attr, CultureInfo.InvariantCulture);;
- }
- return -1;
- }
- set{
- Attributes["rows"] = AttributeToString(value);
- }
- }
-
- public string Value{
- get{
- return InnerHtml;
- }
- set{
- InnerHtml = value;
- }
- }
-
- public virtual string Name{
- get{
- if (UniqueID != null){
- return UniqueID;
- }
- return String.Empty;
- }
- set{}
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- protected virtual void OnServerChange(EventArgs e){
- EventHandler handler;
- handler = (EventHandler) Events[EventServerChange];
- if(handler != null){
- handler.Invoke(this, e);
- }
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string currentValue = Value;
- string postedValue = postCollection[postDataKey];
- if (!currentValue.Equals(postedValue) && currentValue != null){
- Value = HttpUtility.HtmlEncode(postedValue);
- return true;
- }
- return false;
- }
-
- protected new void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("name", Name);
- Attributes.Remove("name");
- base.RenderAttributes(writer);
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- protected override void OnPreRender(EventArgs e){
- if(Events[EventServerChange]==null || Disabled){
- ViewState.SetItemDirty("value",false);
- }
- }
-
- protected override void AddParsedSubObject(object obj){
- if (obj is LiteralControl || obj is DataBoundLiteralControl)
- AddParsedSubObject(obj);
- else
- throw new NotSupportedException("HtmlTextArea cannot have children of Type " + obj.GetType().Name);
- }
-
- } // class HtmlTextArea
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventArgs.cs
deleted file mode 100755
index d0e94b87f88..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventArgs.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: AdCreatedEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class AdCreatedEventArgs: EventArgs
- {
-
- private IDictionary adProperties;
- private string alternateText;
- private string imageUrl;
- private string navigateUrl;
-
- public AdCreatedEventArgs(IDictionary adProperties): base()
- {
- Initialize();
- this.adProperties = adProperties;
- if(adProperties!=null)
- {
- imageUrl = (string)adProperties["ImageUrl"];
- navigateUrl = (string)adProperties["NavigateUrl"];
- alternateText = (string)adProperties["AlternateText"];
- }
- }
-
- private void Initialize()
- {
- alternateText = string.Empty;
- imageUrl = string.Empty;
- navigateUrl = string.Empty;
- }
-
- public IDictionary AdProperties
- {
- get
- {
- return adProperties;
- }
- }
-
- public string AlternateText
- {
- get
- {
- return alternateText;
- }
- set
- {
- alternateText = value;
- }
- }
-
- public string ImageUrl
- {
- get
- {
- return imageUrl;
- }
- set
- {
- imageUrl = value;
- }
- }
-
- public string NavigateUrl
- {
- get
- {
- return navigateUrl;
- }
- set
- {
- navigateUrl = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs
deleted file mode 100755
index 57359aa5b30..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: AdCreatedEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void AdCreatedEventHandler(object sender, AdCreatedEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs
deleted file mode 100755
index f93f710f37b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs
+++ /dev/null
@@ -1,328 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: AdRotator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Web;
-using System.Web.Caching;
-using System.Web.UI;
-using System.Xml;
-using System.Web.Utils;
-
-namespace System.Web.UI.WebControls
-{
- public class AdRotator: WebControl
- {
-
- private string advertisementFile;
- private static readonly object AdCreatedEvent = new object();
-
- // Will be set values during (On)PreRender-ing
- private string alternateText;
- private string imageUrl;
- private string navigateUrl;
-
- private string fileDirectory;
-
- private class AdRecord
- {
- public IDictionary adProps;
- public int hits; // or impressions or clicks
- public string keyword;
-
- public AdRecord(IDictionary adProps)
- {
- this.adProps = adProps;
- hits = 0;
- keyword = String.Empty;
- }
- }
-
-/*
- * Loading / Saving data from/to ad file and all the manipulations wrt to the URL...
- * are incorporated by the following functions.
- * GetData(string)
- * LoadAdFile(string)
- * IsAdMatching(AdRecord)
- * ResolveAdUrl(string)
- * SelectAd()
- * The exact control flow will be detailed. Let me first write the functions
- */
-
- private AdRecord[] LoadAdFile(string file)
- {
- Stream fStream;
- ArrayList list;
- XmlReader reader;
- XmlDocument document;
- XmlNode topNode, innerNode;
- IDictionary hybridDict = null;
- AdRecord[] adsArray = null;
- try
- {
- fStream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read);
- } catch(Exception e)
- {
- throw new HttpException("AdRotator: Unable to open file");
- }
- try
- {
- list = new ArrayList();
- reader = new XmlTextReader(fStream);
- document = new XmlDocument();
- document.Load(reader);
- if(document.DocumentElement!=null)
- {
- if(document.DocumentElement.LocalName=="Advertisements")
- {
- topNode = document.DocumentElement.FirstChild;
- while(topNode!=null)
- {
- if(topNode.LocalName=="Ad")
- {
- innerNode = topNode.FirstChild;
- while(innerNode!=null)
- {
- if(innerNode.NodeType==XmlNodeType.Element)
- {
- if(hybridDict==null)
- {
- hybridDict = new HybridDictionary();
- }
- hybridDict.Add(innerNode.LocalName, innerNode.InnerText);
- }
- innerNode = innerNode.NextSibling;
- }
- if(hybridDict!=null)
- list.Add(hybridDict);
- }
- topNode = topNode.NextSibling;
- }
- }
- }
- if(list.Count>0)
- {
- adsArray = new AdRecord[list.Count];
- for(int i=0; i < list.Count; i++)
- {
- adsArray[i] = new AdRecord((IDictionary)list[i]);
- }
- }
- } catch(Exception e)
- {
- throw new HttpException("AdRotator_Parse_Error" + file);
- } finally
- {
- fStream.Close();
- }
- if(adsArray == null)
- {
- throw new HttpException("AdRotator_No_Advertisements_Found");
- }
- return adsArray;
- }
-
- private AdRecord[] GetData(string file)
- {
- string physPath = MapPathSecure(file);
- string AdKey = "AdRotatorCache: " + physPath;
- fileDirectory = UrlUtils.GetDirectory(UrlUtils.Combine(TemplateSourceDirectory, file));
- Cache cache = HttpRuntime.Cache;
- AdRecord[] records = (AdRecord[])cache[AdKey];
- if(records==null)
- {
- records = LoadAdFile(physPath);
- if(records==null)
- {
- return null;
- }
- cache.Insert(AdKey, records, new CacheDependency(physPath));
- }
- return records;
- }
-
- private IDictionary SelectAd()
- {
- AdRecord[] records = GetData(AdvertisementFile);
- if(records!=null && records.Length!=0)
- {
- int impressions = 0;
- for(int i=0 ; i < records.Length; i++)
- {
- if(IsAdMatching(records[i]))
- impressions += records[1].hits;
- }
- if(impressions!=0)
- {
- int rnd = (new Random()).Next(impressions) + 1;
- int counter = 0;
- int index = 0;
- for(int i=0; i < records.Length; i++)
- {
- if(IsAdMatching(records[i]))
- {
- if(rnd <= (counter + records[i].hits))
- {
- index = i;
- break;
- }
- counter += records[i].hits;
- }
- }
- return records[index].adProps;
- }
- }
- return null;
- }
-
- private bool IsAdMatching(AdRecord currAd)
- {
- if(KeywordFilter!=String.Empty)
- {
- if(currAd.keyword.ToLower() == KeywordFilter.ToLower())
- return false;
- }
- return true;
- }
-
- private string ResolveAdUrl(string relativeUrl)
- {
- if(relativeUrl.Length==0 || !UrlUtils.IsRelativeUrl(relativeUrl))
- return relativeUrl;
- string fullUrl = String.Empty;
- if(fileDirectory != null)
- fullUrl = fileDirectory;
- if(fullUrl.Length == 0)
- fullUrl = TemplateSourceDirectory;
- if(fullUrl.Length == 0)
- return relativeUrl;
- return (fullUrl + relativeUrl);
- }
-
- public event AdCreatedEventHandler AdCreated
- {
- add
- {
- Events.AddHandler(AdCreatedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(AdCreatedEvent, value);
- }
- }
-
- public AdRotator(): base()
- {
- advertisementFile = string.Empty;
- fileDirectory = null;
- }
-
- public string AdvertisementFile
- {
- get
- {
- return advertisementFile;
- }
- set
- {
- advertisementFile = value;
- }
- }
-
- public string KeywordFilter
- {
- get
- {
- object o = ViewState["KeywordFilter"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- if(value!=null)
- ViewState["KeywordFilter"] = value.Trim();
- }
- }
-
- public string Target
- {
- get
- {
- object o = ViewState["Target"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Target"] = value;
- }
- }
-
- protected override ControlCollection CreateControlCollection()
- {
- return new EmptyControlCollection(this);
- }
-
- protected virtual void OnAdCreated(AdCreatedEventArgs e)
- {
- if(Events!=null)
- {
- AdCreatedEventHandler aceh = (AdCreatedEventHandler)(Events[AdCreatedEvent]);
- if(aceh!=null)
- aceh(this, e);
- }
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- if(AdvertisementFile!=String.Empty)
- {
- AdCreatedEventArgs acea = new AdCreatedEventArgs(SelectAd());
- imageUrl = acea.ImageUrl;
- navigateUrl = acea.NavigateUrl;
- alternateText = acea.AlternateText;
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- HyperLink hLink = new HyperLink();
- Image adImage = new Image();
- foreach(IEnumerable current in Attributes.Keys)
- {
- hLink.Attributes[(string)current] = Attributes[(string)current];
- }
- if(ID != null && ID.Length > 0)
- hLink.ID = ID;
- hLink.Target = Target;
- hLink.AccessKey = AccessKey;
- hLink.Enabled = Enabled;
- hLink.TabIndex = TabIndex;
- hLink.RenderBeginTag(writer);
- if(ControlStyleCreated)
- {
- adImage.ApplyStyle(ControlStyle);
- }
- if(imageUrl!=null && imageUrl.Length > 0)
- adImage.ImageUrl = ResolveAdUrl(imageUrl);
- adImage.AlternateText = alternateText;
- adImage.ToolTip = ToolTip;
- adImage.RenderControl(writer);
- hLink.RenderEndTag(writer);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
deleted file mode 100755
index 84cc6a796e3..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
+++ /dev/null
@@ -1,307 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: BaseCompareValidator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public abstract class BaseCompareValidator: BaseValidator
- {
- protected BaseCompareValidator(): base()
- {
- }
-
- public static bool CanConvert(string text, ValidationDataType type)
- {
- object o = null;
- return Convert(text, type, out o);
- }
-
- public ValidationDataType Type
- {
- get
- {
- object o = ViewState["Type"];
- if(o!=null)
- return (ValidationDataType)o;
- return ValidationDataType.String;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(ValidationDataType), value))
- throw new ArgumentException();
- ViewState["Type"] = value;
- }
- }
-
- protected static int CutoffYear
- {
- get
- {
- return DateTimeFormatInfo.CurrentInfo.Calendar.TwoDigitYearMax;
- }
- }
-
- protected static int GetFullYear(int shortYear)
- {
- int century = DateTime.Today.Year - (DateTime.Today.Year % 100);
- if(century < CutoffYear)
- {
- return (shortYear + century);
- }
- return (shortYear + century - 100);
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(RenderUplevel)
- {
- writer.AddAttribute("type", PropertyConverter.EnumToString(typeof(ValidationDataType), Type));
- NumberFormatInfo currInfo = NumberFormatInfo.CurrentInfo;
- if(Type == ValidationDataType.Double)
- {
- writer.AddAttribute("decimalchar", currInfo.NumberDecimalSeparator);
- return;
- }
- if(Type == ValidationDataType.Currency)
- {
- writer.AddAttribute("decimalchar", currInfo.CurrencyDecimalSeparator);
- string grpSep = currInfo.CurrencyGroupSeparator;
- if(grpSep[0] == 0xA0)
- {
- grpSep = " ";
- }
- writer.AddAttribute("groupchar", grpSep);
- writer.AddAttribute("digits", currInfo.CurrencyDecimalDigits.ToString(NumberFormatInfo.InvariantInfo));
- return;
- }
- if(Type == ValidationDataType.Date)
- {
- writer.AddAttribute("cutoffyear", CutoffYear.ToString());
- writer.AddAttribute("century", ( DateTime.Today.Year - (DateTime.Today.Year % 100) ).ToString());
- return;
- }
- }
- }
-
- protected override bool DetermineRenderUplevel()
- {
- if(Type == ValidationDataType.Date && DateTimeFormatInfo.CurrentInfo.Calendar.GetType() != typeof(GregorianCalendar))
- {
- return false;
- }
- return base.DetermineRenderUplevel();
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- protected static bool Compare(string leftText, string rightText, ValidationCompareOperator op, ValidationDataType type)
- {
- object left = null, right = null;
- if(!Convert(leftText, type, out left))
- {
- return false;
- }
- if(op == ValidationCompareOperator.DataTypeCheck)
- {
- return true;
- }
- if(!Convert(rightText, type, out right))
- {
- return true;
- }
- int compareResult = 0;
- switch(type)
- {
- case ValidationDataType.String:
- compareResult = ((String)left).CompareTo(right);
- break;
- case ValidationDataType.Integer:
- compareResult = ((int)left).CompareTo(right);
- break;
- case ValidationDataType.Double:
- compareResult = ((Double)left).CompareTo(right);
- break;
- case ValidationDataType.Date:
- compareResult = ((DateTime)left).CompareTo(right);
- break;
- case ValidationDataType.Currency:
- compareResult = ((Decimal)left).CompareTo(right);
- break;
- }
- switch(op)
- {
- case ValidationCompareOperator.Equal:
- return (compareResult == 0);
- case ValidationCompareOperator.NotEqual:
- return (compareResult != 0);
- case ValidationCompareOperator.GreaterThan:
- return (compareResult > 0);
- case ValidationCompareOperator.GreaterThanEqual:
- return (compareResult >= 0);
- case ValidationCompareOperator.LessThan:
- return (compareResult < 0);
- case ValidationCompareOperator.LessThanEqual:
- return (compareResult == 0);
- }
- return false;
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- protected static string GetDateElementOrder()
- {
- string pattern = DateTimeFormatInfo.CurrentInfo.ShortDatePattern;
-
- //TODO: What are the various possibilities?
- // I can think of only y*/M*/d*, d*/M*/y*, M*/d*/y*
- if(pattern.IndexOf('y') < pattern.IndexOf('M'))
- {
- return "ymd";
- }
- if(pattern.IndexOf('M') < pattern.IndexOf('d'))
- {
- return "mdy";
- }
- return "dmy";
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- protected static bool Convert(string text, ValidationDataType type, out object convertedValue)
- {
- convertedValue = null;
- try
- {
- switch(type)
- {
- case ValidationDataType.String: convertedValue = text;
- break;
- case ValidationDataType.Integer: convertedValue = Int32.Parse(text, CultureInfo.InvariantCulture);
- break;
- case ValidationDataType.Double:
- Match matchDouble = Regex.Match(text, @"^\s*([-\+])?(\d+)?(\"
- + NumberFormatInfo.CurrentInfo.NumberDecimalSeparator
- + @"(\d+))?\s*$");
- if(matchDouble.Success)
- {
- string sign = (matchDouble.Groups[1].Success ? matchDouble.Groups[1].Value : "+");
- string decPart = (matchDouble.Groups[2].Success ? matchDouble.Groups[2].Value : "0");
- string mantissa = (matchDouble.Groups[4].Success ? matchDouble.Groups[4].Value : "0");
- convertedValue = Double.Parse(sign + decPart + "." + mantissa, CultureInfo.InvariantCulture);
- }
- break;
- case ValidationDataType.Date:
- if(DateTimeFormatInfo.CurrentInfo.Calendar.GetType() != typeof(GregorianCalendar))
- {
- convertedValue = DateTime.Parse(text);
- break;
- }
- string order = GetDateElementOrder();
- int date = 0, mth = 0, year = 0;
- Match matchDate = Regex.Match(text, @"^\s*((\d{4})|(\d{2}))([\.\/-])(\d{1,2})\4(\d{1,2})\s*$");
- if(matchDate.Success && order == "ymd")
- {
- date = Int32.Parse(matchDate.Groups[6].Value, CultureInfo.InvariantCulture);
- mth = Int32.Parse(matchDate.Groups[5].Value, CultureInfo.InvariantCulture);
- year = Int32.Parse((matchDate.Groups[2].Success ? matchDate.Groups[2].Value : matchDate.Groups[3].Value), CultureInfo.InvariantCulture);
- } else
- {
- matchDate = Regex.Match(text, @"^\s*(\d{1,2})([\.\/-])(\d{1,2})\2((\d{4}|\d{2}))\s*$");
- if(matchDate.Success)
- {
- if(order == "dmy")
- {
- date = Int32.Parse(matchDate.Groups[1].Value, CultureInfo.InvariantCulture);
- mth = Int32.Parse(matchDate.Groups[3].Value, CultureInfo.InvariantCulture);
- year = Int32.Parse((matchDate.Groups[5].Success ? matchDate.Groups[5].Value : matchDate.Groups[6].Value), CultureInfo.InvariantCulture);
- }
- if(order == "mdy")
- {
- date = Int32.Parse(matchDate.Groups[3].Value, CultureInfo.InvariantCulture);
- mth = Int32.Parse(matchDate.Groups[1].Value, CultureInfo.InvariantCulture);
- year = Int32.Parse((matchDate.Groups[5].Success ? matchDate.Groups[5].Value : matchDate.Groups[6].Value), CultureInfo.InvariantCulture);
- }
- }
- }
- year = (year < 100 ? GetFullYear(year) : year);
- if(matchDate.Success && date!=0 && mth!=0 && year!=0)
- {
- convertedValue = new DateTime(year, mth, date);
- }
- break;
- case ValidationDataType.Currency:
- string decSep = NumberFormatInfo.CurrentInfo.CurrencyDecimalSeparator;
- string grpSep = NumberFormatInfo.CurrentInfo.CurrencyGroupSeparator;
- int decDig = NumberFormatInfo.CurrentInfo.CurrencyDecimalDigits;
- if(grpSep[0] == 0xA0)
- {
- grpSep = " ";
- }
- string[] patternArray = new string[5];
- patternArray[0] = "^\\s*([-\\+])?(((\\d+)\\";
- patternArray[1] = grpSep;
- patternArray[2] = @")*)(\d+)";
- if(decDig > 0)
- {
- string[] decPattern = new string[5];
- decPattern[0] = "(\\";
- decPattern[1] = decSep;
- decPattern[2] = @"(\d{1,";
- decPattern[3] = decDig.ToString(NumberFormatInfo.InvariantInfo);
- decPattern[4] = @"}))";
- patternArray[3] = String.Concat(decPattern);
-
- } else
- {
- patternArray[3] = String.Empty;
- }
- patternArray[4] = @"?\s*$";
- Match matchCurrency = Regex.Match(text, String.Concat(patternArray));
- if(matchCurrency.Success)
- {
- StringBuilder sb = new StringBuilder();
- sb.Append(matchCurrency.Groups[1]);
- CaptureCollection cc = matchCurrency.Groups[4].Captures;
- foreach(IEnumerable current in cc)
- {
- sb.Append((Capture)current);
- }
- sb.Append(matchCurrency.Groups[5]);
- if(decDig > 0)
- {
- sb.Append(".");
- sb.Append(matchCurrency.Groups[7]);
- }
- convertedValue = Decimal.Parse(sb.ToString(), CultureInfo.InvariantCulture);
- }
- break;
- }
- } catch(Exception e)
- {
- convertedValue = null;
- }
- return (convertedValue != null);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataList.cs
deleted file mode 100755
index 41cff8814d2..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataList.cs
+++ /dev/null
@@ -1,231 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: BaseDataList
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public abstract class BaseDataList: WebControl
- {
- private static readonly object SelectedIndexChangedEvent = new object();
- internal static string ItemCountViewStateKey = "_!ItemCount";
-
- private DataKeyCollection dataKeys;
- private object dataSource;
-
- public BaseDataList() : base()
- {
- }
-
- public static bool IsBindableType(Type type)
- {
- if(type.IsPrimitive || type == typeof(string) || type == typeof(DateTime) || type == typeof(Decimal))
- return true;
- return false;
- }
-
- public override void DataBind()
- {
- OnDataBinding(EventArgs.Empty);
- }
-
- public event EventHandler SelectedIndexChanged
- {
- add
- {
- Events.AddHandler(SelectedIndexChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(SelectedIndexChangedEvent, value);
- }
- }
-
- public virtual int CellPadding
- {
- get
- {
- if(!ControlStyleCreated)
- return -1;
- return ((TableStyle)ControlStyle).CellPadding;
- }
- set
- {
- ((TableStyle)ControlStyle).CellPadding = value;
- }
- }
-
- public virtual int CellSpacing
- {
- get
- {
- if(!ControlStyleCreated)
- return -1;
- return ((TableStyle)ControlStyle).CellSpacing;
- }
- set
- {
- ((TableStyle)ControlStyle).CellSpacing = value;
- }
- }
-
- public virtual string DataKeyField
- {
- get
- {
- object o = ViewState["DataKeyField"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataKeyField"] = value;
- }
- }
-
- public DataKeyCollection DataKeys
- {
- get
- {
- if( dataKeys==null )
- dataKeys = new DataKeyCollection(DataKeysArray);
- return dataKeys;
-
- }
- }
-
- public string DataMember
- {
- get
- {
- object o = ViewState["DataMember"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataMember"] = value;
- }
- }
-
- public virtual object DataSource
- {
- get
- {
- return dataSource;
- }
- set
- {
- if( (value!=null) && ( value is IListSource || value is IEnumerable) )
- {
- dataSource = value;
- } else
- {
- throw new ArgumentException(HttpRuntime.FormatResourceString("Invalid_DataSource_Type", ID));
- }
- }
- }
-
- public virtual GridLines GridLines
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableStyle)ControlStyle).GridLines;
- return GridLines.Both;
- }
- set
- {
- ((TableStyle)ControlStyle).GridLines = value;
- }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableStyle)ControlStyle).HorizontalAlign;
- return HorizontalAlign.NotSet;
- }
- set
- {
- ((TableStyle)ControlStyle).HorizontalAlign = value;
- }
- }
-
- protected ArrayList DataKeysArray
- {
- get
- {
- object o = ViewState["DataKeys"];
- if(o == null)
- {
- o = new ArrayList();
- ViewState["DataKeys"] = o;
- }
- return (ArrayList)o;
- }
- }
-
- protected override void AddParsedSubObject(object o)
- {
- // Preventing literal controls from being added as children.
- }
-
- protected override void CreateChildControls()
- {
- Controls.Clear();
- if(ViewState[ItemCountViewStateKey]!=null)
- {
- CreateControlHierarchy(true);
- ClearChildViewState();
- }
- }
-
- protected override void OnDataBinding(EventArgs e)
- {
- base.OnDataBinding(e);
- Controls.Clear();
- ClearChildViewState();
- CreateControlHierarchy(true);
- ChildControlsCreated = true;
- TrackViewState();
- }
-
- protected virtual void OnSelectedIndexChanged(EventArgs e)
- {
- if(Events != null)
- {
- EventHandler eh = (EventHandler)(Events[SelectedIndexChangedEvent]);
- if(eh!=null)
- eh(this, e);
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- PrepareControlHierarchy();
- base.RenderContents(writer);
- }
-
- protected abstract void PrepareControlHierarchy();
- protected abstract void CreateControlHierarchy(bool useDataSource);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
deleted file mode 100755
index 307375658e8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: BaseValidator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 20%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-using System.Drawing;
-
-namespace System.Web.UI.WebControls
-{
- public abstract class BaseValidator: Label, IValidator
- {
- //
- private PropertyDescriptor pDesc;
- private string ctValid = String.Empty;
- private ValidatorDisplay vDisp = ValidatorDisplay.Static;
- private bool enableClientScript; //TODO: check the default value := false;
- private bool enabled = true;
- private string errorMessage = String.Empty;
- private Color foreColor = Color.Red;
- private bool isValid = true;
- private bool propertiesValid;
- private bool renderUplevel;
-
- public static PropertyDescriptor GetValidationProperty(object component)
- {
- //TODO: Have to workout this one!
- return null;
- }
-
- public string ControlToValidate
- {
- get
- {
- return ctValid;
- }
- set
- {
- ctValid = value;
- }
- }
-
- public ValidatorDisplay Display
- {
- get
- {
- return vDisp;
- }
- set
- {
- //TODO: Throw new exception ArgumentException("....") if the value is not valid
- vDisp = value;
- }
- }
-
- public bool EnableClientScript
- {
- get
- {
- return enableClientScript;
- }
- set
- {
- enableClientScript = value;
- }
- }
-
- public override bool Enabled
- {
- get
- {
- return enabled;
- }
- set
- {
- enabled = value;
- }
- }
-
- public string ErrorMessage
- {
- get
- {
- return errorMessage;
- }
- set
- {
- errorMessage = value;
- }
- }
-
- public override Color ForeColor
- {
- get
- {
- return foreColor;
- }
- set
- {
- foreColor = value;
- }
- }
-
- public bool IsValid
- {
- get
- {
- return isValid;
- }
- set
- {
- isValid = value;
- }
- }
-
- public void Validate()
- {
- // TODO: write the validation code
- // TODO: update the value of isValid
- }
-
- protected BaseValidator()
- {
- // Dummy Constructor
- }
-
- protected bool PropertiesValid
- {
- get
- {
- // TODO: throw HttpException, but when? How do I know about all the controls?
- return propertiesValid;
- }
- }
-
- protected bool RenderUplevel
- {
- get
- {
- //TODO: To set the value of renderUplevel. Problem: when, how?
- return renderUplevel;
- }
- }
-
- protected void CheckControlValidationProperty(string name, string propertyName)
- {
- //TODO: I think it needs to be overridden. I may be wrong!
- //TODO: When to throw HttpException(...)
- }
-
- protected virtual bool ControlPropertiesValid()
- {
- // Do I need to do anything? But what?
- // What do I do with ControlToValidate?
- return true;
- }
-
- protected virtual bool DetermineRenderUplevel()
- {
- // From where?
- return true;
- }
-
- protected abstract bool EvaluateIsValid();
-
- [MonoTODO]
- protected string GetControlRenderID(string name)
- {
- // TODO: What value? What is it?
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- protected string GetControlValidationValue(string name)
- {
- throw new NotImplementedException();
- // TODO: What value? What is it?
- }
-
- [MonoTODO]
- protected void RegisterValidatorCommonScript()
- {
- throw new NotImplementedException();
- // TODO: Still wondering!
- // Note: This method is primarily used by control developers
- }
-
- [MonoTODO]
- protected void RegisterValidatorDeclaration()
- {
- // TODO: Still wondering!
- // Note: This method is primarily used by control developers
- // The documentation in M$ refers to: Page_Validators array
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs
deleted file mode 100755
index a6be720c7ae..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: BorderStyle
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI
-{
- public enum BorderStyle
- {
- NotSet,
- None,
- Dotted,
- Dashed,
- Solid,
- Double,
- Groove,
- Ridge,
- Inset,
- Outset
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BoundColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BoundColumn.cs
deleted file mode 100755
index 13bcb75f8db..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BoundColumn.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: BoundColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 60%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class BoundColumn : DataGridColumn
- {
- public static readonly string thisExpr = "!";
-
- private string dataField;
- private string dataFormatString;
- private bool readOnly;
-
- private PropertyDescriptor desc;
-
- public BoundColumn(): base()
- {
- //TODO: The start work
- Initialize();
- }
-
- public override void Initialize()
- {
- base.Initialize();
- dataField = String.Empty;
- dataFormatString = String.Empty;
- readOnly = false;
- desc = null;
- }
-
- [MonoTODO]
- public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
- {
- //TODO: What to do?
- InitializeCell(cell, columnIndex, itemType);
-// switch(itemType)
-// {
-// case
-// }
- throw new NotImplementedException();
- }
-
- public virtual string DataField
- {
- get
- {
- return dataField;
- }
- set
- {
- dataField = value;
- }
- }
-
- public virtual string DataFormatString
- {
- get
- {
- return dataFormatString;
- }
- set
- {
- dataFormatString = value;
- }
- }
-
- public virtual bool ReadOnly
- {
- get
- {
- return readOnly;
- }
- set
- {
- readOnly = value;
- }
- }
-
- [MonoTODO]
- protected virtual string FormatDataValue(Object dataValue)
- {
- // TODO: How to extract the value from the object?
- // TODO: Then format the value. Here's a possible solution
- if(dataFormatString == null || dataFormatString.Equals(String.Empty))
- return dataValue.ToString();
- if(dataValue is DateTime)
- return ((DateTime)dataValue).ToString(dataFormatString);
- throw new NotImplementedException();
- // and so on for int, String, double..
- // something's wrong here. there must be some shorter method!
- //string val = dataValue.toString(dataFormatString);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Button.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Button.cs
deleted file mode 100755
index d23a6720638..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Button.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Button
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class Button : WebControl, IPostBackEventHandler
- {
- private static readonly object ClickEvent = new object();
- private static readonly object CommandEvent = new object();
-
- //private EventHandlerList ehList;
-
- public Button(): base(HtmlTextWriterTag.Button)
- {
- }
-
- public bool CausesValidation
- {
- get
- {
- Object cv = ViewState["CausesValidation"];
- if(cv!=null)
- return (Boolean)cv;
- return true;
- }
- set
- {
- ViewState["CausesValidation"] = value;
- }
- }
-
- public string CommandArgument
- {
- get
- {
- string ca = (string) ViewState["CommandArgument"];
- if(ca!=null)
- return ca;
- return String.Empty;
- }
- set
- {
- ViewState["CommandArgument"] = value;
- }
- }
-
- public string CommandName
- {
- get
- {
- string cn = (string)ViewState["CommandName"];
- if(cn!=null)
- return cn;
- return String.Empty;
- }
- set
- {
- ViewState["CommandName"] = value;
- }
- }
-
- public string Text
- {
- get
- {
- string text = (string)ViewState["Text"];
- if(text!=null)
- return text;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- public event EventHandler Click
- {
- add
- {
- Events.AddHandler(ClickEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ClickEvent, value);
- }
- }
-
- public event CommandEventHandler Command
- {
- add
- {
- Events.AddHandler(CommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(CommandEvent, value);
- }
- }
-
- protected virtual void OnClick(EventArgs e)
- {
- if(Events != null)
- {
- EventHandler eh = (EventHandler)(Events[ClickEvent]);
- if(eh!= null)
- eh(this,e);
- }
- }
-
- protected virtual void OnCommand(CommandEventArgs e)
- {
- if(Events != null)
- {
- EventHandler eh = (EventHandler)(Events[CommandEvent]);
- if(eh!= null)
- eh(this,e);
- }
- }
-
- void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
- {
- if(CausesValidation)
- {
- Page.Validate();
- OnClick(new EventArgs());
- OnCommand(new CommandEventArgs(CommandName, CommandArgument));
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Type,"submit");
- writer.AddAttribute(HtmlTextWriterAttribute.Name,base.UniqueID);
- writer.AddAttribute(HtmlTextWriterAttribute.Value,Text);
- if(Page!=null && CausesValidation && Page.Validators.Count > 0)
- {
- writer.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Onclick, Utils.GetClientValidatedEvent());
- writer.AddAttribute("language", "javascript");
- }
- AddAttributesToRender(writer);
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- // Preventing subclasses to do anything
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumn.cs
deleted file mode 100755
index 23db52724d6..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumn.cs
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ButtonColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ButtonColumn : DataGridColumn
- {
- private PropertyDescriptor textFieldDescriptor;
-
- public ButtonColumn(): base()
- {
- }
-
- public override void Initialize()
- {
- Initialize();
- textFieldDescriptor = null;
- }
-
- public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
- {
- InitializeCell(cell, columnIndex, itemType);
- if(Enum.IsDefined(typeof(ListItemType), itemType) && itemType != ListItemType.Footer)
- {
- WebControl toDisplay = null;
- if(ButtonType == ButtonColumnType.PushButton)
- {
- Button b = new Button();
- b.Text = Text;
- b.CommandName = CommandName;
- b.CausesValidation = false;
- toDisplay = b;
- } else
- {
- LinkButton lb = new LinkButton();
- lb.Text = Text;
- lb.CommandName = CommandName;
- lb.CausesValidation = false;
- toDisplay = lb;
- }
- if(DataTextField.Length > 0)
- {
- toDisplay.DataBinding += new EventHandler(OnDataBindButtonColumn);
- }
- cell.Controls.Add(toDisplay);
- }
- }
-
- private void OnDataBindButtonColumn(object sender, EventArgs e)
- {
- Control ctrl = (Control)sender;
- object item = ((DataGridItem)ctrl.NamingContainer).DataItem;
- if(textFieldDescriptor == null)
- {
- textFieldDescriptor = TypeDescriptor.GetProperties(item).Find(DataTextField, true);
- if(textFieldDescriptor == null && !DesignMode)
- throw new HttpException(HttpRuntime.FormatResourceString("Field_Not_Found", DataTextField));
- }
- string text;
- if(textFieldDescriptor != null)
- {
- text = FormatDataTextValue(textFieldDescriptor.GetValue(item));
- } else
- {
- text = "Sample_DataBound_Text";
- }
- if(ctrl is LinkButton)
- {
- ((LinkButton)ctrl).Text = text;
- }
- else
- {
- ((Button)ctrl).Text = text;
- }
- }
-
- protected virtual string FormatDataTextValue(object dataTextValue)
- {
- string retVal = null;
- if(dataTextValue != null)
- {
- if(DataTextFormatString.Length > 0)
- {
- retVal = String.Format((string)dataTextValue, DataTextFormatString);
- }
- else
- {
- retVal = dataTextValue.ToString();
- }
- }
- return retVal;
- }
-
- public virtual ButtonColumnType ButtonType
- {
- get
- {
- object o = ViewState["ButtonType"];
- if(o!=null)
- return (ButtonColumnType)o;
- return ButtonColumnType.LinkButton;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(ButtonColumnType), value))
- throw new ArgumentException();
- ViewState["ButtonType"] = value;
- }
- }
-
- public virtual string CommandName
- {
- get
- {
- string cn = (string)ViewState["CommandName"];
- if(cn!=null)
- return cn;
- return String.Empty;
- }
- set
- {
- ViewState["CommandName"] = value;
- }
- }
-
- public virtual string DataTextField
- {
- get
- {
- string dtf = (string)ViewState["DataTextField"];
- if(dtf!=null)
- return dtf;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextField"] = value;
- }
- }
-
- public virtual string DataTextFormatString
- {
- get
- {
- string dtfs = (string)ViewState["DataTextFormatString"];
- if(dtfs!=null)
- return dtfs;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextFormatString"] = value;
- }
- }
-
- public virtual string Text
- {
- get
- {
- string text = (string)ViewState["Text"];
- if(text!=null)
- return text;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs
deleted file mode 100755
index ed59eba315b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ButtonColumnType
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ButtonColumnType
- {
- LinkButton,
- PushButton
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs
deleted file mode 100755
index 3e8fc6ce7f2..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs
+++ /dev/null
@@ -1,1098 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Calendar
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 98%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Globalization;
-using System.Text;
-using System.Web;
-using System.Web.UI;
-using System.Drawing;
-
-namespace System.Web.UI.WebControls
-{
- public class Calendar : WebControl, IPostBackEventHandler
- {
- //
-
- private TableItemStyle dayHeaderStyle;
- private TableItemStyle dayStyle;
- private TableItemStyle nextPrevStyle;
- private TableItemStyle otherMonthDayStyle;
- private SelectedDatesCollection selectedDates;
- private ArrayList selectedDatesList;
- private TableItemStyle selectedDayStyle;
- private TableItemStyle selectorStyle;
- private TableItemStyle titleStyle;
- private TableItemStyle todayDayStyle;
- private TableItemStyle weekendDayStyle;
-
- private static readonly object DayRenderEvent = new object();
- private static readonly object SelectionChangedEvent = new object();
- private static readonly object VisibleMonthChangedEvent = new object();
-
- private Color defaultTextColor;
- private System.Globalization.Calendar globCal;
-
- private static int MASK_WEEKEND = (0x01 << 0);
- private static int MASK_OMONTH = (0x01 << 1);
- private static int MASK_TODAY = (0x01 << 2);
- private static int MASK_SELECTED = (0x01 << 3);
- private static int MASK_DAY = (0x01 << 4);
- private static int MASK_UNIQUE = MASK_WEEKEND | MASK_OMONTH | MASK_TODAY | MASK_SELECTED;
-
- public Calendar(): base()
- {
- //TODO: Initialization
- }
-
- public int CellPadding
- {
- get
- {
- object o = ViewState["CellPadding"];
- if(o!=null)
- return (int)o;
- return 2;
- }
- set
- {
- ViewState["CellPadding"] = value;
- }
- }
-
- public int CellSpacing
- {
- get
- {
- object o = ViewState["CellSpacing"];
- if(o!=null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value<-1)
- throw new ArgumentOutOfRangeException();
- ViewState["CellSpacing"] = value;
- }
- }
-
- public TableItemStyle DayHeaderStyle
- {
- get
- {
- if(dayHeaderStyle==null)
- dayHeaderStyle = new TableItemStyle();
- if(IsTrackingViewState)
- dayHeaderStyle.TrackViewState();
- return dayHeaderStyle;
- }
- }
-
- public DayNameFormat DayNameFormat
- {
- get
- {
- object o = ViewState["DayNameFormat"];
- if(o!=null)
- return (DayNameFormat)o;
- return DayNameFormat.Short;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(DayNameFormat),value))
- throw new ArgumentException();
- ViewState["DayNameFormat"] = value;
- }
- }
-
- public TableItemStyle DayStyle
- {
- get
- {
- if(dayStyle==null)
- dayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- dayStyle.TrackViewState();
- return dayStyle;
- }
- }
-
- public FirstDayOfWeek FirstDayOfWeek
- {
- get
- {
- object o = ViewState["FirstDayOfWeek"];
- if(o!=null)
- return (FirstDayOfWeek)o;
- return FirstDayOfWeek.Default;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(FirstDayOfWeek), value))
- throw new ArgumentException();
- ViewState["FirstDayOfWeek"] = value;
- }
- }
-
- public string NextMonthText
- {
- get
- {
- object o = ViewState["NextMonthText"];
- if(o!=null)
- return (string)o;
- return "&gt;";
- }
- set
- {
- ViewState["NextMonthText"] = value;
- }
- }
-
- public NextPrevFormat NextPrevFormat
- {
- get
- {
- object o = ViewState["NextPrevFormat"];
- if(o!=null)
- return (NextPrevFormat)o;
- return NextPrevFormat.CustomText;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(NextPrevFormat), value))
- throw new ArgumentException();
- ViewState["NextPrevFormat"] = value;
- }
- }
-
- public TableItemStyle NextPrevStyle
- {
- get
- {
- if(nextPrevStyle == null)
- nextPrevStyle = new TableItemStyle();
- if(IsTrackingViewState)
- nextPrevStyle.TrackViewState();
- return nextPrevStyle;
- }
- }
-
- public TableItemStyle OtherMonthDayStyle
- {
- get
- {
- if(otherMonthDayStyle == null)
- otherMonthDayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- otherMonthDayStyle.TrackViewState();
- return otherMonthDayStyle;
- }
- }
-
- public string PrevMonthText
- {
- get
- {
- object o = ViewState["PrevMonthText"];
- if(o!=null)
- return (string)o;
- return "&lt;";
- }
- set
- {
- ViewState["PrevMonthText"] = value;
- }
- }
-
- public DateTime SelectedDate
- {
- get
- {
- if(SelectedDates.Count > 0)
- {
- return SelectedDates[0];
- }
- return DateTime.MinValue;
- }
- set
- {
- if(value == DateTime.MinValue)
- {
- SelectedDates.Clear();
- } else
- {
- SelectedDates.SelectRange(value, value);
- }
- }
- }
-
- public SelectedDatesCollection SelectedDates
- {
- get
- {
- if(selectedDates==null)
- {
- if(selectedDatesList == null)
- selectedDatesList = new ArrayList();
- selectedDates = new SelectedDatesCollection(selectedDatesList);
- }
- return selectedDates;
- }
- }
-
- public TableItemStyle SelectedDayStyle
- {
- get
- {
- if(selectedDayStyle==null)
- selectedDayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- selectedDayDtyle.TrackViewState();
- return selectedDayStyle;
- }
- }
-
- public CalendarSelectionMode SelectionMode
- {
- get
- {
- object o = ViewState["SelectionMode"];
- if(o!=null)
- return (CalendarSelectionMode)o;
- return CalendarSelectionMode.Day;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(CalendarSelectionMode), value))
- throw new ArgumentException();
- ViewState["SelectionMode"] = value;
- }
- }
-
- public string SelectedMonthText
- {
- get
- {
- object o = ViewState["SelectedMonthText"];
- if(o!=null)
- return (string)o;
- return "&gt;&gt;";
- }
- set
- {
- ViewState["SelectedMonthText"] = value;
- }
- }
-
- public TableItemStyle SelectorStyle
- {
- get
- {
- if(selectorStyle==null)
- selectorStyle = new TableItemStyle();
- return selectorStyle;
- }
- }
-
- public string SelectWeekText
- {
- get
- {
- object o = ViewState["SelectWeekText"];
- if(o!=null)
- return (string)o;
- return "&gt;";
- }
- set
- {
- ViewState["SelectWeekText"] = value;
- }
- }
-
- public bool ShowDayHeader
- {
- get
- {
- object o = ViewState["ShowDayHeader"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowDayHeader"] = value;
- }
- }
-
- public bool ShowGridLines
- {
- get
- {
- object o = ViewState["ShowGridLines"];
- if(o!=null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["ShowGridLines"] = value;
- }
- }
-
- public bool ShowNextPrevMonth
- {
- get
- {
- object o = ViewState["ShowNextPrevMonth"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowNextPrevMonth"] = value;
- }
- }
-
- public bool ShowTitle
- {
- get
- {
- object o = ViewState["ShowTitle"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowTitle"] = value;
- }
- }
-
- public TitleFormat TitleFormat
- {
- get
- {
- object o = ViewState["TitleFormat"];
- if(o!=null)
- return (TitleFormat)o;
- return TitleFormat.MonthYear;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(TitleFormat), value))
- throw new ArgumentException();
- ViewState["TitleFormat"] = value;
- }
- }
-
- public TableItemStyle TitleStyle
- {
- get
- {
- if(titleStyle==null)
- titleStyle = new TableItemStyle();
- if(IsTrackingViewState)
- titleStyle.TrackViewState();
- return titleStyle;
- }
- }
-
- public TableItemStyle TodayDayStyle
- {
- get
- {
- if(todayDayStyle==null)
- todayDayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- todayDayStyle.TrackViewState();
- return todayDayStyle;
- }
- }
-
- public DateTime TodaysDate
- {
- get
- {
- object o = ViewState["TodaysDate"];
- if(o!=null)
- return (DateTime)o;
- return DateTime.Today;
- }
- set
- {
- ViewState["TodaysDate"] = value;
- }
- }
-
- public DateTime VisibleDate
- {
- get
- {
- object o = ViewState["VisibleDate"];
- if(o!=null)
- return (DateTime)o;
- return DateTime.MinValue;
- }
- set
- {
- ViewState["VisibleDate"] = value;
- }
- }
-
- public TableItemStyle WeekendDayStyle
- {
- get
- {
- if(weekendDayStyle == null)
- weekendDayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- weekendDayStyle.TrackViewState();
- }
- return weekendDayStyle;
- }
- }
-
- public event DayRenderEventHandler DayRender
- {
- add
- {
- Events.AddHandler(DayRenderEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DayRenderEvent, value);
- }
- }
-
- public event EventHandler SelectionChanged
- {
- add
- {
- Events.AddHandler(SelectionChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(SelectionChangedEvent, value);
- }
- }
-
- public event MonthChangedEventHandler VisibleMonthChanged
- {
- add
- {
- Events.AddHandler(VisibleMonthChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(VisibleMonthChangedEvent, value);
- }
- }
-
- protected virtual void OnDayRender(TableCell cell, CalendarDay day)
- {
- if(Events!=null)
- {
- DayRenderEventHandler dreh = (DayRenderEventHandler)(Events[DayRenderEvent]);
- if(dreh!=null)
- dreh(this, new DayRenderEventArgs(cell, day));
- }
- }
-
- protected virtual void OnSelectionChanged()
- {
- if(Events!=null)
- {
- EventHandler eh = (EventHandler)(Events[SelectionChangedEvent]);
- if(eh!=null)
- eh(this, new EventArgs());
- }
- }
-
- protected virtual void OnVisibleMonthChanged(DateTime newDate, DateTime prevDate)
- {
- if(Events!=null)
- {
- MonthChangedEventHandler mceh = (MonthChangedEventHandler)(Events[VisibleMonthChangedEvent]);
- if(mceh!=null)
- mceh(this, new MonthChangedEventArgs(newDate, prevDate));
- }
- }
-
- /// <remarks>
- /// See test6.aspx in Tests directory for verification
- /// </remarks>
- void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
- {
- globCal = DateTimeFormatInfo.CurrentInfo.Calendar;
- DateTime visDate = GetEffectiveVisibleDate();
- //FIXME: Should it be String.Compare(eventArgument, "nextMonth", false);
- if(eventArgument == "nextMonth")
- {
- VisibleDate = globCal.AddMonths(visDate, 1);
- OnVisibleDateChanged(VisibleDate, visDate);
- return;
- }
- if(eventArgument == "prevMonth")
- {
- VisibleDate = globCal.AddMonths(visDate, -1);
- OnVisibleDateChanged(VisibleDate, visDate);
- return;
- }
- if(eventArgument == "selectMonth")
- {
- DateTime oldDate = new DateTime(globCal.GetYear(visDate), globCal.GetMonth(visDate), 1, globCal);
- SelectRangeInternal(oldDate, globCal.AddDays(gloCal.AddMonths(oldDate, 1), -1), visDate);
- return;
- }
- if(String.Compare(eventArgument, 0, "selectWeek", 0, "selectWeek".Length)==0)
- {
- int week = -1;
- try
- {
- week = Int32.Parse(eventArgument.Substring("selectWeek".Length));
- } catch(Exception e)
- {
- }
- if(week >= 0 && week <= 5)
- {
- DateTime weekStart = globCal.AddDays(GetFirstCalendarDay(visDate), week * 7);
- SelectRangeInternal(weekStart, globCal.AddDays(weekStart, 6), visDate);
- }
- return;
- }
- if(String.Compare(eventArgument, 0, "selectDay", 0, "selectDay".Length)==0)
- {
- int day = -1;
- try
- {
- day = Int32.Parse(eventArgument.Substring("selectDay".Length);
- } catch(Exception e)
- {
- }
- if(day >= 0 && day <= 42)
- {
- DateTime dayStart = globCal.AddDays(GetFirstCalendarDay(visDate), day);
- SelectRangeInternal(dayStart, dayStart, visDate);
- }
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- //TODO: Implement me
- globCal = DateTimeFormatInfo.CurrentInfo.Calendar;
- DateTime visDate = GetEffectiveVisibleDate()
- DateTime firstDate = GetFirstCalendarDay(visDate);
-
- bool isEnabled = false;
- bool isHtmlTextWriter = false;
- if(Page == null || Site == null || Site.DesignMode == null )
- {
- isEnabled = false;
- isHtmlTextWriter = false;
- } else
- {
- isEnabled = Enabled;
- isHtmlTextWriter = (writer.GetType() != typeof(HtmlTextWriter));
- }
- defaultTextColor = ForeColor;
- if(defaultTextColor == Color.Empty)
- defaultTextColor = Color.Black;
-
- Table calTable = new Table();
- calTable.ID = ID;
- calTable.CopyBaseAttributes(this);
- if(ControlStyleCreated)
- ApplyStyle(ControlStyle);
- calTable.Width = Width;
- calTable.Height = Height;
- calTable.CellSpacing = CellSpacing;
- calTable.CellPadding = CellPadding;
-
- if(ControlStyleCreated && ControlStyle.IsSet(Style.BORDERWIDTH) && BorderWidth != Unit.Empty)
- {
- calTable.BorderWidth = BorderWidth;
- } else
- {
- calTable.BorderWidth = Unit.Pixel(1);
- }
-
- if(ShowGridLines)
- calTable.GridLines = GridLines.Both;
- else
- calTable.GridLines = GridLines.None;
-
- calTable.RenderBeginTag(writer);
- if(ShowTitle)
- RenderTitle(writer, visDate, SelectionMode, isEnabled);
- if(ShowDayHeader)
- RenderHeader(writer, firstDate, SelectionMode, isEnabled, isHtmlTextWriter);
- RenderAllDays(writer, firstDate, visDate, SelectionMode, isEnabled, isHtmlTextWriter);
-
- calTable.RenderEndTag(writer);
- }
-
- protected override ControlCollection CreateControlCollection()
- {
- return new EmptyControlCollection(this);
- }
-
- protected override void LoadViewState(object savedState)
- {
- if(savedState!=null)
- {
- if(ViewState["_CalendarSelectedDates"] != null)
- SelectedDates = (SelectedDatesCollection)ViewState["_CalendarSelectedDates"];
-
- object[] states = (object[]) savedState;
- if(states[0] != null)
- base.LoadViewState(states[0]);
- if(states[1] != null)
- DayHeaderStyle.LoadViewState(states[1]);
- if(states[2] != null)
- DayStyle.LoadViewState(states[2]);
- if(states[3] != null)
- NextPrevStyle.LoadViewState(states[3]);
- if(states[4] != null)
- OtherMonthStyle.LoadViewState(states[4]);
- if(states[5] != null)
- SelectedDayStyle.LoadViewState(states[5]);
- if(states[6] != null)
- SelectorStyle.LoadViewState(states[6]);
- if(states[7] != null)
- TitleStyle.LoadViewState(states[7]);
- if(states[8] != null)
- TodayDayStyle.LoadViewState(states[8]);
- if(states[9] != null)
- WeekendDayStyle.LoadViewState(states[9]);
- }
- }
-
- protected override object SaveViewState()
- {
- ViewState["_CalendarSelectedDates"] = (SelectedDates.Count > 0 ? selectedDates : null);
- object[] states = new object[11];
- states[0] = base.SaveViewState();
- states[1] = (dayHeaderStyle == null ? null : dayHeaderStyle.SaveViewStyle());
- states[2] = (dayStyle == null ? null : dayStyle.SaveViewStyle());
- states[3] = (nextPrevStyle == null ? null : nextPrevStyle.SaveViewStyle());
- states[4] = (otherMonthDayStyle == null ? null : otherMonthDayStyle.SaveViewStyle());
- states[5] = (selectedDayStyle == null ? null : selectedDayStyle.SaveViewStyle());
- states[6] = (selectorStyle == null ? null : selectorStyle.SaveViewStyle());
- states[7] = (titleStyle == null ? null : titleStyle.SaveViewStyle());
- states[8] = (todayDayStyle == null ? null : todayDayStyle.SaveViewStyle());
- states[9] = (weekendDayStyle == null ? null : weekendDayStyle.SaveViewStyle());
- for(int i=0; i < states.Length)
- {
- if(states[i]!=null)
- return states;
- }
- return null;
- }
-
- protected override void TrackViewState(): TrackViewState()
- {
- if(titleStyle!=null)
- {
- titleStyle.TrackViewState();
- }
- if(nextPrevStyle!=null)
- {
- nextPrevStyle.TrackViewState();
- }
- if(dayStyle!=null)
- {
- dayStyle.TrackViewState();
- }
- if(dayHeaderStyle!=null)
- {
- dayHeaderStyle.TrackViewState();
- }
- if(todayDayStyle!=null)
- {
- todayDayStyle.TrackViewState();
- }
- if(weekendDayStyle!=null)
- {
- weekendDayStyle.TrackViewState();
- }
- if(otherMonthDayStyle!=null)
- {
- otherMonthDayStyle.TrackViewState();
- }
- if(selectedDayStyle!=null)
- {
- selectedDayStyle.TrackViewState();
- }
- if(selectorStyle!=null)
- {
- selectorStyle.TrackViewState();
- }
- }
-
- [MonoTODO("Individual_Day_Rendering_Part_Left")]
- private void RenderAllDays(HtmlTextWriter writer, DateTime firstDay, DateTime activeDate, CalendarSelectionMode mode, bool isActive, bool isDownLevel)
- {
- TableCell weeksCell;
- string weeksCellData;
- bool isWeekMode = (mode == CalendarSelectionMode.DayWeek || mode == CalendarSelectionMode.DayWeekMonth);
- if(isWeekMode)
- {
- weeksCell = new TableCell();
- weeksCell.Width = Unit.Percentage(12);
- weeksCell.HorizontalAlign = HorizontalAlign.Center;
- weeksCell.ApplyStyle(SelectorStyle);
- if(!isDownLevel)
- weeksCellData = GetHtmlForCell(weeksCell, isActive);
- }
- bool dayRenderBool = false;
- if(GetType() != typeof(Calendar) || Events[DayRenderEvent] != null || !isDownLevel)
- dayRenderBool = true;
-
- string[] content = new string[0x01 << 4];
- int definedStyles = MASK_SELECTED;
- if(weekendStyle != null && !weekendStyle.IsEmpty)
- definedStyles |= MASK_WEEKEND;
- if(otherMonthStyle != null && !otherMonthStyle.IsEmpty)
- definedStyles |= MASK_OMONTH;
- if(todayDayStyle != null && todayDayStyle.IsEmpty)
- definedStyles |= MASK_TODAY;
- if(dayStyle != null && !dayStyle.IsEmpty)
- definedStyles |= MASK_DAY;
-
- bool selectDayBool = false;
- if(isActive && mode != CalendarSelectionMode.None)
- {
- selectDayBool = true;
- }
-
- for(int crr = 0; crr < 6; crr++)
- {
- writer.Write("<tr>");
- if(isWeekMode)
- {
- if(isDownLevel)
- {
- string cellText = GetCalendarLinkText("selectWeek" + crr.ToString(), SelectWeekText, isActive, weeksCell.ForeColor);
- weeksCell.Text = cellText;
- RenderCalendarCell(writer, weeksCell, cellText);
- } else
- {
- if(isActive)
- {
- writer.Write(String.Format(weeksCellData, "selectWeek" + crr.ToString(), SelectWeekText));
- } else
- {
- writer.Write(String.Format(weeksCellData, "selectWeek" + crr.ToString()));
- }
- }
- }
- for(int crc = 0; crc < 7; crc++)
- {
- // have to display for each day in the week.
- throw new NotImplementedException();
- }
- }
-
- throw new NotImplementedException();
- }
-
- private int GetMask(CalendarDay day)
- {
- int retVal = MASK_DAY;
- if(day.IsSelected)
- retVal |= MASK_SELECTED;
- if(day.IsToday)
- retVal |= MASK_TODAY;
- if(day.IsOtherMonth)
- retVal |= MASK_OMONTH;
- if(day.IsWeekend)
- retVal |= MASK_WEEKEND;
- return retVal;
- }
-
- /// <remarks>
- /// Refers to the second line of the calendar, that contains a link
- /// to select whole month, and weekdays as defined by DayNameFormat
- /// </remarks>
- private void RenderHeader(HtmlTextWriter writer, DateTime firstDay, CalendarSelectionMode mode, bool isActive, bool isDownLevel)
- {
- writer.Write("<tr>");
- bool isWeekMode = (mode == CalendarSelectionMode.DayWeek || mode == CalendarSelectionMode.DayWeekMonth);
- TableCell headerCell = new TableCell();
- headerCell.HorizontalAlign = HorizontalAlign.Center;
- string selMthText = String.Empty;
- if(isWeekMode)
- {
- headerCell.ApplyStyle(SelectorStyle);
- selMthText = GetCalendarLinkText("selectMonth", SelectMonthText, isActive, SelectorStyle.ForeColor);
- } else
- {
- headerCell.ApplyStyle(DayHeaderStyle);
- }
- RenderCalendarCell(writer, headerCell, selMthText);
-
- TableCell dayHeaderCell = new TableCell();
- dayHeaderCell.HorizontalAlign = HorizontalAlign.Center;
- string content = null;
- if(!isDownLevel)
- {
- content = GetHtmlForCell(dayHeaderCell, isActive);
- }
- int dayOfWeek = (int)globCal.GetDayOfWeek(firstDay);
- for(int currDay = dayOfWeek; currDay < dayOfWeek + 7; currDay++)
- {
- int effDay = (currDay % 7);
- string currDayContent = String.Empty;
- switch(DayNameFormat)
- {
- DayNameFormat.Full: currDayContent = DateTimeFormatInfo.GetDayName(effDay);
- break;
- DayNameFormat.FirstLetter: currDayContent = DateTimeFormatInfo.GetDayName(effDay).Substring(0,1);
- break;
- DayNameFormat.FirstTwoLetters: currDayContent = DateTimeFormatInfo.GetDayName(effDay).Substring(0,2);
- break;
- DayNameFormat.Short:
- default: currDayContent = DateTimeFormatInfo.GetAbbreviatedDayName(effDay);
- break;
- }
- if(isDownLevel)
- {
- RenderCalendarCell(writer, dayHeaderCell, currDayContent);
- } else
- {
- writer.Write(String.Format(content, currDayContent);
- }
- }
- writer.Write("</tr>");
- }
-
- private void RenderTitle(HtmlTextWriter writer, DateTime visibleDate, CalendarSelectionMode mode, bool isActive)
- {
- writer.Write("<tr>");
- Table innerTable = new Table();
- TableCell titleCell = new TableCell();
- bool isWeekMode = (mode == CalendarSelectionMode.DayWeek || mode == CalendarSelectionMode.DayWeekMonth);
- titleCell.ColumnSpan = (isWeekMode ? 8 : 7);
- titleCell.BackColor = "Silver";
-
- innerTable.GridLines = GridLine.None;
- innerTable.Width = Unit.Percentage(100);
- innerTable.CellSpacing = 0;
- ApplyTitleStyle(innerTable, titleCell, TitleStyle);
-
- innerTable.RenderBeginTag(writer);
- titleCell.RenderBeginTag(writer);
-
- writer.Write("<tr>");
- string prevContent = String.Empty;
- if(ShowNextPrevMonth)
- {
- TableCell prevCell = new TableCell();
- prevCell.Width = Unit.Percentage(15);
- prevCell.HorizontalAlign = HorizontalAlign.Left;
- if(NextPrevFormat == NextPrevFormat.CustomText)
- {
- prevContent = PrevMonthText;
- } else
- {
- int pMthInt = globCal.GetMonth(globCal.AddMonths(visibleDate, -1));
- if(NextPrevFormat == NextPrevFormat.FullText)
- prevContent = DateTimeFormatInfo.CurrentInfo.GetMonthName(pMthInt);
- else
- prevContent = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(pMthInt);
- }
- prevCell.ApplyStyle(NextPrevStyle);
- RenderCalendarCell(writer, prevCell, GetCalendarLinkText("prevMonth", prevContent, isActive, NextPrevStyle.ForeColor));
- }
- TableCell currCell = new TableCell();
- currCell.Width = Unit.Percentage(70);
- if(TitleStyle.HorizontalAlign == HorizontalAlign.NotSet)
- currCell.HorizontalAlign = HorizontalAlign.Center;
- else
- currCell.HorizontalAlign = TitleStyle.HorizontalAlign;
- currCell.Wrap = TitleStyle.Wrap;
- string currMonthContent = String.Empty;
- if(TitleFormat == TitleFormat.Month)
- {
- currMonthContent = visibleDate.ToString("MMMM");
- } else
- {
- string cmcFmt = DateTimeFormatInfo.CurrentInfo.YearMonthPattern;
- if(cmcFmt.IndexOf(',') >= 0)
- {
- cmcFmt = "MMMM yyyy";
- }
- currMonthContent = visibleDate.ToString(cmcFmt);
- }
- string nextContent = String.Empty;
- if(ShowNextPrevMonth)
- {
- TableCell nextCell = new TableCell();
- nextCell.Width = Unit.Percentage(15);
- nextCell.HorizontalAlign = HorizontalAlign.Left;
- if(NextPrevFormat == NextPrevFormat.CustomText)
- {
- nextContent = PrevMonthText;
- } else
- {
- int nMthInt = globCal.GetMonth(globCal.AddMonths(visibleDate, 1));
- if(NextPrevFormat == NextPrevFormat.FullText)
- nextContent = DateTimeFormatInfo.CurrentInfo.GetMonthName(nMthInt);
- else
- nextContent = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(nMthInt);
- }
- nextCell.ApplyStyle(NextPrevStyle);
- RenderCalendarCell(writer, nextCell, GetCalendarLinkText("nextMonth", nextContent, isActive, NextPrevStyle.ForeColor));
- }
-
- writer.Write("</tr>");
- titleCell.RenderEndTag(writer);
- innerTable.RenderEndTag(writer);
-
- writer.Write("</tr>");
- }
-
- private void ApplyTitleStyle(Table table, TableCell cell, TableItemStyle style)
- {
- if(style.BackColor != Color.Empty)
- {
- cell.BackColor = style.BackColor;
- }
- if(style.BorderStyle != BorderStyle.NotSet)
- {
- cell.BorderStyle = style.BorderStyle;
- }
- if(style.BorderColor != Color.Empty)
- {
- cell.BorderColor = style.BorderColor;
- }
- if(style.BorderWidth != Unit.Empty)
- {
- cell.BorderWidth = style.BorderWidth;
- }
- if(style.Height != Unit.Empty)
- {
- cell.Height = style.Height;
- }
- if(style.VerticalAlign != VerticalAlign.NotSet)
- {
- cell.VerticalAlign = style.VerticalAlign;
- }
-
- if(style.ForeColor != Color.Empty)
- {
- table.ForeColor = style.ForeColor;
- } else if(ForeColor != Color.Empty)
- {
- table.ForeColor = ForeColor;
- }
-
- table.Font.CopyFrom(style.Font);
- table.Font.MergeWith(Font);
- }
-
- private void RenderCalendarCell(HtmlTextWriter writer, TableCell cell, string text)
- {
- cell.RenderBeginTag(writer);
- writer.Write(text);
- cell.RenderEndTag(writer);
- }
-
- private DateTime GetFirstCalendarDay(DateTime visibleDate)
- {
- DayOfWeek firstDay = ( FirstDayOfWeek == FirstDayOfWeek.Default ? DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek : FirstDayOfWeek);
- //FIXME: is (int)(Enum) correct?
- int days = (int)globCal.GetDayOfWeek(visibleDate) - (int)firstDay;
- if(days < 0)
- {
- days += 7;
- }
- return globCal.AddDays(visibleDate, -days);
- }
-
- private DateTime GetEffectiveVisibleDate()
- {
- DateTime dt = VisibleDate;
- if(dt.Equals(DateTime.MinValue))
- {
- dt = TodaysDate;
- }
- return new DateTime(globCal.GetYear(dt), globCal.GetMonth(dt), globCal.GetDayOfMonth(dt), globCal);
- }
-
- /// <summary>
- /// Creates text to be displayed, with all attributes if to be
- /// shown as a hyperlink
- /// </summary>
- private string GetCalendarLinkText(string eventArg, string text, Color foreground, bool isLink)
- {
- if(isLink)
- {
- StringBuilder dispVal = new StringBuilder();
- dispVal.Append("<a href=\"");
- dispVal.Append(Page.GetPostBackClientHyperlink(this, eventArg));
- dispVal.Append("\" style=\"color: ");
- if(foreground.IsEmpty)
- {
- dispVal.Append(ColorTranslator.ToHtml(defaultTextColor));
- } else
- {
- dispVal.Append(ColorTranslator.ToHtml(foreground));
- }
- dispVal.Append("\">");
- dispVal.Append(text);
- dispVal.Append("</a>");
- return dispVal.ToString();
- }
- return text;
- }
-
- private string GetHtmlForCell(TableCell cell, bool showLinks)
- {
- StringWriter sw = new StringWriter();
- HtmlTextWriter htw = new HtmlTextWriter(sw);
- cell.RenderBeginTag(htw);
- if(showLinks)
- {
- htw.Write(GetCalendarLinkText("{0}", "{1}", cell.ForeColor, showLinks));
- } else
- {
- htw.Write("{0}");
- }
- cell.RenderEndTag(htw);
- return sw.ToString();
- }
-
- internal DateTime SelectRangeInternal(DateTime fromDate, DateTime toDate, DateTime visibleDate)
- {
- TimeSpan span = fromDate - toDate;
- if(SelectedDates.Count != span.Days || SelectedDates[SelectedDate.Count - 1]!= toDate)
- {
- SelectedDates.SelectRange(fromDate, toDate);
- OnSelectionChanged();
- }
- if(globCal.GetMonth(fromDate) == globCal.GetMonth(fromDate) && globCal.GetMonth(fromDate) != globCal.GetMonth(visibleDate)
- {
- VisibleDate = new DateTime(globCal.GetYear(fromDate), globCal.getMonth(fromDate), 1, globCal);
- OnVisibleMonthChanged(VisibleDate, visibleDate);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarDay.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CalendarDay.cs
deleted file mode 100644
index 4d60dc1c544..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarDay.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: CalendarDay
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class CalendarDay
- {
- private DateTime date;
- private bool isWeekend;
- private bool isToday;
- private bool isSelected;
- private bool isOtherMonth;
- private bool isSelectable;
- private string dayNumberText;
-
- public CalendarDay(DateTime date, bool isWeekend, bool isToday, bool isSelected, bool isOtherMonth, string dayNumberText)
- {
- this.date = date;
- this.isWeekend = isWeekend;
- this.isToday = isToday;
- this.isSelected = isSelected;
- this.isOtherMonth = isOtherMonth;
- this.dayNumberText = dayNumberText;
- }
-
- public DateTime Date
- {
- get
- {
- return date;
- }
- }
-
- public string DayNumberText
- {
- get
- {
- return dayNumberText;
- }
- }
-
- public bool IsOtherMonth
- {
- get
- {
- return isOtherMonth;
- }
- }
-
- public bool IsSelectable
- {
- get
- {
- return isSelectable;
- }
- set
- {
- isSelectable = value;
- }
- }
-
- public bool IsSelected
- {
- get
- {
- return isSelected;
- }
- set
- {
- isSelected = value;
- }
- }
-
- public bool IsToday
- {
- get
- {
- return isToday;
- }
- set
- {
- isToday = value;
- }
- }
-
- public bool IsWeekend
- {
- get
- {
- return isWeekend;
- }
- set
- {
- isWeekend = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs
deleted file mode 100755
index 54dd298f2e4..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: CalendarSelectionMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum CalendarSelectionMode
- {
- None,
- Day,
- DayWeek,
- DayWeekMonth
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
deleted file mode 100644
index 4190f4d2686..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
+++ /dev/null
@@ -1,273 +0,0 @@
-2002-02-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * DataGrid.cs - Following methods implemented:
- TrackViewState(), LoadViewState(object), SaveViewState(),
- On* -- The event raisers.
- OnBubbleEvent(object, EventArgs) is still incomplete.
- * DataGridItem.cs - Initial Implementation
- * DataGridItemCollection.cs - Completed.
-
-2002-02-08 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * DataGrid.cs - Initial Implementation. Worked primarily
- with some properties.
-
-2002-02-07 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * ListBox.cs - Completed. Implemented
- LoadPostData(string, NameValueCollection)
- * RequiredFieldValidator.cs - Completed. Pretty simple class.
-
-2002-02-06 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * ListBox.cs - Implemented the following:
- RaisePostDataChangedEvent()
-
-2002-02-02 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * ListBox.cs - Supports the following properties:
- BorderColor, BorderStyle, BorderWidth, Rows, SelectionMode, ToolTip,
- Methods:
- AddAttributesToRender(HtmlTextWriter), OnPreRender(EventArgs),
- RenderContents(HtmlTextWriter)
-
-
-2002-02-01 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * TargetConverter.cs - Completed
- * TemplateColumn.cs - Completed
- * DataList.cs - Corrected the get-er methods for the *Style objects.
- Corrected the get/set-er methods for ViewState related objects.
- Addded support for properties:
- GridLines, HeaderStyle, HeaderTemplate, ItemStyle, ItemTemplate,
- RepeatColumns, RepeatDirection, RepeatLayout, SelectedIndex, SelectedItem,
- SelectedItemStyle, SelectedItemTemplate, SeparatorStyle, SeparatorItemTemplate.
- Events:
- CancelCommand, DeleteCommand, EditCommand, ItemCommand, ItemCreated,
- ItemDataBound, UpdateCommand.
- Methods:
- CreateControlStyle(), LoadViewState(object), SaveViewState(), TrackViewState
- Event handlers:
- OnBubbleEvent, OnCancelCommand, OnDeleteCommand, OnEditCommand, OnItemCommand,
- OnItemCreated, OnItemDataBound, OnUpdateCommand
- Added dummy methods for some undocumented methods:
- CreateControlHierarchy(bool), CreateItem(int, ListItemType),
- CreateItem(int, ListItemType, bool, object), PrepareControlHierarchy(),
- InitializeItem(DataListItem)
- * ListBox.cs - Started working.
-
-
-
-2002-01-31 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * RepeaterInfo.cs - Initial Implementation. Done all
- except for RepeatDirection.Vertical
- * TableStyle.cs - Completed
-
-2002-01-30 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * DropDownList.cs - Completed
- * ListItemCollection.cs - Added method FindByValueInternal to
- assist in the derived classes.
- Discovered bug in FindByValue. Removed
- * UnitConverter.cs - Completed
- * PlaceHolder.cs - What can be simpler than this?
- * PlaceHolderControlBuilder.cs
- - Uh! Damn cool one.
- * RadioButtonList.cs - Initial Implementation. All is done
- except for the implementation of
- method IRepeatInfoUser.RenderItem(...)
- * ValidatedControlConverter.cs
- ^^^^^^^^^^^^^^^^^^^^^^^^^ - Looks complete. Doubtful though !!
- * ValidationSummary.cs - Initial Implementation.
- * WebColorConverter.cs - Initial Implementation
-
-2002-01-27 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * FontNamesConverter.cs - Completed
- * FontUnitConverter.cs - Partial Implementation
- * ListItemControlBuilder.cs - Completed
-
-2002-01-27 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * TextBox.cs - All done except *Render* methods
- * TextBoxControlBuilder.cs - Completed
- * Xml.cs - Partial Implementation
-
-2002-01-26 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * RadioButton.cs - Completed
- * TextBox.cs - Partial Implementation
-
-2002-01-25 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * Panel.cs - Completed
- * TableItemStyle.cs - Completed
-
-2002-01-18 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * TableCellCollection.cs - Completed
- * TableRowCollection.cs - Completed
- * TableHeaderCell.cs - Completed
- * TableRow.cs - Completed
-
-2002-01-09 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * TableCellControlBuilder.cs - Completed
- * Table.cs - Completed
- * TableCell.cs - Completed
-
-2002-01-07 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * CheckBoxList.cs - Completed
- * ButtonColumn.cs - Completed
- * Button.cs - Completed
-
-2001-12-28 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * HyperLink.cs - Completed
- * Image.cs - Completed
- * ImageButton.cs - Completed
- * Label.cs - Completed
- * LabelControlBuilder.cs - Completed
- * LinkButton.cs - Completed
- * LinkButtonControlBuilder.cs - Completed
- * Literal.cs - Completed
- * LieteralControlBuilder.cs - Completed
- * FontUnit.cs - Completed
-
-
-2001-12-27 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * Calendar.cs - Completed the functions of Render*,
- ViewStates (Track/View/Save),
- RaisePostBackEvent.
- Left: RenderAllDays (partially)
-
-2001-12-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * Calendar.cs - Added some more functions
- * Style.cs - Completed
- * ListItem.cs - Completed
- * ListItemCollection.cs - Completed
-
- Made the first successful build of System.Web.dll that included System.Web.UI.WebControls!
-
-2001-12-20 Gaurav Vaish <gvaish@iitk.ac.in>
-
- FontInfo.cs - Complete revamp. Completed
-
-2001-12-19 Gaurav Vaish <gvaish@iitk.ac.in>
-
- ListItemCollection.cs - Completed
- ListItem.cs - Initial Implementation
- Style.cs - Initial Implementation
-
- Right now I am in a total mood to do a successful build. Creating so many classes, completing classes in System.Web System.Web.UI namespaces.
-
-2001-12-18 Gaurav Vaish <gvaish@iitk.ac.in>
-
- TODO - Properly added
- CheckBox.cs - Completed
- BaseDataList.cs - Completed
- DayRenderEventArgs.cs - Completed
- RepeaterItem.cs - Initial implementation
-
-2001-12-17 Gaurav Vaish <gvaish@iitk.ac.in>
-
- BaseCompareValidator.cs - Completed
- AdRotator.cs - Completed
-
-2001-12-15 Gaurav Vaish <gvaish@iitk.ac.in>
-
- CommandEventArgs.cs - Completed
- DataGridCommandEventArgs.cs - Completed
- RepeaterCommandEventArgs.cs - Completed
- DataListCommandEventArgs.cs - Completed
- CompareValidator.cs - Partial Implementation
-
-2001-12-02 Gaurav Vaish <gvaish@iitk.ac.in>
-
- CheckBoxList.cs - Partial Implementation.
- All except "Render"
-
-2001-12-01 Gaurav Vaish <gvaish@iitk.ac.in>
-
- ListControl.cs - Completed
-
-2001-11-30 Gaurav Vaish <gvaish@iitk.ac.in>
-
- CheckBox.cs - Completed
- ListControl.cs - Initial Implementation
- CheckBoxList.cs - Started with it, but first needed
- ListControl. Left it.
-
-2001-11-29 Gaurav Vaish <gvaish@iitk.ac.in>
-
- CalendarDay.cs - Making a note that this
- has been implemented
- Calendar.cs - Making a note that have made some changes.
- Unimplmented functions throw
- NotImplementedException
- CheckBox.cs - Can now "Render" and "LoadPostData"
-
-
-2001-11-08 Gaurav Vaish <gvaish@iitk.ac.in>
- WebControl.cs - Total Revamp, Partial Implementation
- AdRotator.cs - Able to load files
- AdCreatedEventArgs.cs - Implemented
-
-2001-11-05 Gaurav Vaish <gvaish@iitk.ac.in>
- Calendar.cs - Initial Implementation
- ButtonColumn.cs - Initial Implementation
- Button.cs - Initial Implementation
- BoundColumn.cs - Initial Implementation
- BaseCompareValidator.cs - Minor Changes
- DataList.cs, BaseValidator.cs, BaseDataList.cs
- - Added more functions, other changes
-
-2001-10-28 Gaurav Vaish <gvaish@iitk.ac.in>
- WebControl.cs - Initial Implementation
- DataList.cs - Initial Implementation
- BaseValidator.cs - Initial Implementation
- BaseDataList.cs - Initial Implementation
-
-2001-10-27 Gaurav Vaish <gvaish@iitk.ac.in>
-
- AdCreatedEventArgs.cs - Initial Implementation
- AdCratedEventHandler.cs - Implemented
- AdRotator.cs - Initial Implementation
- BorderStyle.cs - Implemented
- ButtonColumnStyle.cs - Implemented
- CalendarSelectionMode.cs - Implemented
- DayNameFormat.cs - Implemented
- FirstDayOfWeek - Implemented
- FontInfo.cs - Partial Implementation
- FontSize.cs - Implemented
- GridLines.cs - Implemented
- HorizontalAlign.cs - Implemented
- HyperLink.cs - Initial Implementation
- ImageAlign.cs - Implemented
- IRepeatInfoUser.cs - Implemented
- ListItemType.cs - Implemented
- ListSelectionMode.cs - Implemented
- NextPrevFormat.cs - Implemented
- PagerMode.cs - Implemented
- PagerPosition.cs - Implemented
- RepeatDirection.cs - Implemented
- RepeatLayout.cs - Implemented
- TextAlign.cs - Implemented
- TextBoxMode.cs - Implemented
- TitleFormat.cs - Implemented
- UnitType.cs - Implemented
- ValidationCompareOperator.cs
- - Implemented
- ValidationDataType.cs - Implemented
- ValidationSummaryDisplayMode.cs
- - Implemented
- ValidatorDisplay.cs - Implemented
- VerticalAlign.cs - Implemented
-
-
-
-// File Created 2001:11:13
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
deleted file mode 100644
index d73c8332c36..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: CheckBox
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- * Thanks to Leen Toelen (toelen@hotmail.com)'s classes that helped me
- * to write the contents of the function LoadPostData(...)
- */
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class CheckBox : WebControl, IPostBackDataHandler
- {
- private static readonly object CheckedChangedEvent = new object();
-
- public CheckBox(): base(HtmlTextWriterTag.Input)
- {
- }
-
- public virtual bool AutoPostBack
- {
- get
- {
- object o = ViewState["AutoPostBack"];
- if(o!=null)
- return (bool)AutoPostBack;
- return false;
- }
- set
- {
- ViewState["AutoPostBack"] = value;
- }
- }
-
- public virtual bool Checked
- {
- get
- {
- object o = ViewState["Checked"];
- if(o!=null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["Checked"] = value;
- }
- }
-
- public virtual string Text
- {
- get
- {
- object o = ViewState["Text"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- private bool SaveCheckedViewState
- {
- get
- {
- if(Events[CheckedChangedEvent] != null)
- {
- if(!Enabled)
- return true;
- if(GetType() == typeof(CheckBox))
- {
- return false;
- }
- if(GetType() == typeof(RadioButton))
- {
- return false;
- }
- }
- return true;
-
- }
- }
-
- public virtual TextAlign TextAlign
- {
- get
- {
- object o = ViewState["TextAlign"];
- if(o!=null)
- return (TextAlign)o;
- return TextAlign.Right;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(TextAlign), value))
- throw new ArgumentException();
- ViewState["TextAlign"] = value;
- }
- }
-
- public event EventHandler CheckedChanged
- {
- add
- {
- Events.AddHandler(CheckedChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(CheckedChangedEvent, value);
- }
- }
-
- protected virtual void OnCheckedChanged(EventArgs e)
- {
- if(Events!=null)
- {
- EventHandler eh = (EventHandler)(Events[CheckedChangedEvent]);
- if(eh!=null)
- eh(this, e);
- }
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- if(Page!=null)
- {
- if(Enabled)
- {
- Page.RegisterRequiresPostBack(this);
- }
- }
- if(SaveCheckedViewState)
- {
- ViewState.SetItemDirty("checked", false);
- }
- }
-
- [MonoTODO("Internal_Call_Requirements")]
- protected override void Render(HtmlTextWriter writer)
- {
- bool hasBeginRendering = false;
- if(ControlStyleCreated)
- {
- //TODO: Uncomment this in final version
- /*
- if(!ControlStyle.IsEmpty)
- {
- hasBeginRendering = true;
- ControlStyle.AddAttributesToRender(writer, this);
- }
- */
- }
- if(!Enabled)
- {
- hasBeginRendering = true;
- writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled");
- }
- if(ToolTip.Length > 0)
- {
- hasBeginRendering = true;
- writer.AddAttribute(HtmlTextWriterAttribute.Title, ToolTip);
- }
- if(Attributes.Count > 0)
- {
- hasBeginRendering = true;
- Attributes.AddAttributes(writer);
- }
- if(hasBeginRendering)
- writer.RenderBeginTag(HtmlTextWriterTag.Span);
- if(Text.Length > 0)
- {
- if(TextAlign == TextAlign.Right)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.For, ClientID);
- writer.RenderBeginTag(HtmlTextWriterTag.Label);
- writer.Write(Text);
- writer.RenderEndTag();
- RenderInputTag(writer, ClientID);
- } else
- {
- RenderInputTag(writer, ClientID);
- writer.AddAttribute(HtmlTextWriterAttribute.For, ClientID);
- writer.RenderBeginTag(HtmlTextWriterTag.Label);
- writer.Write(Text);
- }
- }
- if(hasBeginRendering)
- writer.RenderEndTag();
- throw new NotImplementedException("Calling some internal functions");
- }
-
- internal virtual void RenderInputTag(HtmlTextWriter writer, string clientId)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Id, clientId);
- writer.AddAttribute(HtmlTextWriterAttribute.Type, "checkbox");
- writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID);
- if(Checked)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked");
- }
- if(AutoPostBack)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Onclick,Page.GetPostBackClientEvent(this, String.Empty));
- writer.AddAttribute("language", "javascript");
- }
- if(AccessKey.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, AccessKey);
- }
- if(TabIndex != 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Tabindex, TabIndex.ToString(NumberFormatInfo.InvariantInfo));
- }
- writer.RenderBeginTag(HtmlTextWriterTag.Input);
- writer.RenderEndTag();
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- string postedVal = postCollection[postDataKey];
- bool postChecked = false;
- if(postedVal != null)
- {
- postChecked = postedVal.Length > 0;
- }
- Checked = postChecked;
- return (postChecked == Checked == false);
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- OnCheckedChanged(EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs
deleted file mode 100644
index d9b412ebcb1..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: CheckBoxList
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Contact: <gvaish@iitk.ac.in>
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class CheckBoxList: ListControl, IRepeatInfoUser, INamingContainer, IPostBackDataHandler
- {
- CheckBox checkBoxRepeater;
- bool isChangeNotified;
-
- public CheckBoxList()
- {
- checkBoxRepeater = new CheckBox();
- checkBoxRepeater.ID = "0";
- checkBoxRepeater.EnableViewState = false;
- checkBoxRepeater.Controls.Add(this);
- isChangeNotified = false;
- }
-
- public virtual int CellPadding
- {
- get
- {
- return (ControlStyleCreated ? ((TableStyle)ControlStyle).CellPadding : -1);
- }
- set
- {
- ((TableStyle)ControlStyle).CellPadding = value;
- }
- }
-
- public virtual int CellSpacing
- {
- get
- {
- return (ControlStyleCreated ? ((TableStyle)ControlStyle).CellSpacing : -1);
- }
- set
- {
- ((TableStyle)ControlStyle).CellSpacing = value;
- }
- }
-
- public virtual int RepeatColumns
- {
- get
- {
- object o = ViewState["RepeatColumns"];
- if(o!=null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException();
- ViewState["RepeatColumns"] = value;
- }
- }
-
- public virtual RepeatDirection RepeatDirection
- {
- get
- {
- object o = ViewState["RepeatDirection"];
- if(o!=null)
- return (RepeatDirection)o;
- return RepeatDirection.Vertical;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(RepeatDirection),value))
- throw new ArgumentException();
- ViewState["RepeatDirection"] = value;
- }
- }
-
- public virtual RepeatLayout RepeatLayout
- {
- get
- {
- object o = ViewState["RepeatLayout"];
- if(o!=null)
- return (RepeatLayout)o;
- return RepeatLayout.Table;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(RepeatLayout), value))
- throw new ArgumentException();
- ViewState["RepeatLayout"] = value;
- }
- }
-
- public virtual TextAlign TextAlign
- {
- get
- {
- object o = ViewState["TextAlign"];
- if(o!=null)
- return (TextAlign)o;
- return TextAlign.Right;
- }
- set
- {
- if(!Enum.IsDefined(typeof(TextAlign), value))
- throw new ArgumentException();
- ViewState["TextAlign"] = value;
- }
- }
-
- protected override Style CreateControlStyle()
- {
- return new TableStyle(ViewState);
- }
-
- protected override Control FindControl(string id, int pathOffset)
- {
- return this;
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- checkBoxRepeater.AutoPostBack = AutoPostBack;
- if(Page!=null)
- {
- for(int i=0; i < Items.Count; i++)
- {
- if(Items[i].Selected)
- {
- checkBoxRepeater.ID = i.ToString(NumberFormatInfo.InvariantInfo);
- Page.RegisterRequiresPostBack(checkBoxRepeater);
- }
- }
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- RepeatInfo ri = new RepeatInfo();
- checkBoxRepeater.TabIndex = TabIndex;
- bool dirtyFlag = false;
- int tTabIndex = TabIndex;
- Style s = (ControlStyleCreated ? ControlStyle : null);
- if(TabIndex > 0)
- {
- if(!ViewState.IsItemDirty("TabIndex"))
- dirtyFlag = true;
- TabIndex = 0;
- }
- ri.RepeatColumns = RepeatColumns;
- ri.RepeatLayout = RepeatLayout;
- ri.RepeatDirection = RepeatDirection;
- ri.RenderRepeater(writer, this, s, this);
- if(tTabIndex > 0)
- {
- TabInde = tTabIndex;
- }
- if(dirtyFlag)
- {
- ViewState.SetItemDirty("TabIndex", false);
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- int index = Int32.Parse(postDataKey.Substring(UniqueID.Length + 1));
- if(index >= 0 && index < Items.Count)
- {
- bool exists = (postCollection[postDataKey]!=null);
- if(Items[index].Selected != exists)
- {
- Items[index].Selected = exists;
- if(!isChangeNotified)
- {
- isChangeNotified = true;
- return true;
- }
- }
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- OnSelectedIndexChanged(EventArgs.Empty);
- }
-
- bool IRepeatInfoUser.HasFooter
- {
- get
- {
- return false;
- }
- }
-
- bool IRepeatInfoUser.HasHeader
- {
- get
- {
- return false;
- }
- }
-
- bool IRepeatInfoUser.HasSeparators
- {
- get
- {
- return false;
- }
- }
-
- int IRepeatInfoUser.RepeatedItemCount
- {
- get
- {
- return Items.Count;
- }
- }
-
- Style IRepeatInfoUser.GetItemStyle(ListItemType itemType, int repeatIndex)
- {
- return null;
- }
-
- void IRepeatInfoUser.RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
- {
- checkBoxRepeater.ID = repeatIndex.ToString(NumberFormatInfo.InvariantInfo);
- checkBoxRepeater.Text = Items[repeatIndex].Text;
- checkBoxRepeater.TextAlign = TextAlign;
- checkBoxRepeater.Checked = Items[repeatIndex].Selected;
- checkBoxRepeater.RenderControl(writer);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs
deleted file mode 100644
index 145280eb7e3..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: CommandEventArgs
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class CommandEventArgs : EventArgs
- {
- private string cmdName;
- private object cmdArg;
-
- public CommandEventArgs(CommandEventArgs e) : this(e.CommandName, e.CommandArgument)
- {
- }
-
- public CommandEventArgs(string commandName, object argument)
- {
- cmdName = commandName;
- cmdArg = argument;
- }
-
- public string CommandName
- {
- get
- {
- return cmdName;
- }
- }
-
- public object CommandArgument
- {
- get
- {
- return cmdArg;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs
deleted file mode 100644
index e806b1e952c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: CommandEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void CommandEventHandler(object sender, CommandEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs
deleted file mode 100644
index 0f57ef3fd16..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: CompareValidator
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 80%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class CompareValidator: BaseCompareValidator
- {
- public CompareValidator()
- {
- // Intitalize();
- }
-
- public string ControlToCompare
- {
- get
- {
- object o = ViewState["ControlToCompare"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
-
- set
- {
- ViewState["ControlToCompare"] = value;
- }
- }
-
- public ValidationCompareOperator Operator
- {
- get
- {
- object o = ViewState["Operator"];
- if(o!=null)
- return (ValidationCompareOperator)o;
- return ValidationCompareOperator.Equal;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(ValidationCompareOperator), value))
- throw new ArgumentException();
- ViewState["Operator"] = value;
- }
- }
-
- public string ValueToCompare
- {
- get
- {
- object o = ViewState["ValueToCompare"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["ValueToCompare"] = value;
- }
- }
-
- [MonoTODO]
- protected override bool EvaluateIsValid()
- {
- string ctrl = GetControlValidationValue(ControlToValidate);
- throw new NotImplementedException();
- if(ctrl!=null && ctrl.Length > 0)
- {
- //string
- return false;
- }
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs
deleted file mode 100644
index 62c089f1116..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs
+++ /dev/null
@@ -1,741 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGrid
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 95%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class DataGrid : BaseDataList, INamingContainer
- {
- public const string CancelCommandName = "Cancel";
- public const string DeleteCommandName = "Delete";
- public const string EditCommandName = "Edit";
- public const string NextPageCommandName = "Next";
- public const string PageCommandName = "Page";
- public const string PrevPageCommandName = "Prev";
- public const string SelectCommandName = "Select";
- public const string SortCommandName = "Sort";
- public const string UpdateCommandName = "Update";
-
- private TableItemStyle alternatingItemStyle;
- private TableItemStyle editItemStyle;
- private TableItemStyle headerStyle;
- private TableItemStyle footerStyle;
- private TableItemStyle itemStyle;
- private TableItemStyle selectedItemStyle;
- private DataGridPagerStyle pagerStyle;
-
- private DataGridColumnCollection columns;
- private ArrayList columnsArrayList;
- private DataGridColumnCollection items;
- private ArrayList itemsArrayList;
-
- private static readonly object CancelCommandEvent = new object();
- private static readonly object DeleteCommandEvent = new object();
- private static readonly object EditCommandEvent = new object();
- private static readonly object ItemCommandEvent = new object();
- private static readonly object ItemCreatedEvent = new object();
- private static readonly object ItemDataBoundEvent = new object();
- private static readonly object PageIndexChangedEvent = new object();
- private static readonly object SortCommandEvent = new object();
- private static readonly object UpdateCommandEvent = new object();
-
- public DataGrid(): base()
- {
- }
-
- public virtual bool AllowCustomPaging
- {
- get
- {
- object o = ViewState["AllowCustomPaging"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AllowCustomPaging"] = value;
- }
- }
-
- public virtual bool AllowPaging
- {
- get
- {
- object o = ViewState["AllowPaging"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AllowPaging"] = value;
- }
- }
-
- public virtual bool AllowSorting
- {
- get
- {
- object o = ViewState["AllowSorting"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AllowSorting"] = value;
- }
- }
-
- public virtual TableItemStyle AlternatingItemStyle
- {
- get
- {
- if(alternatingItemStyle == null)
- alternatingItemStyle = new TableItemStyle();
- if(IsTrackingViewState())
- alternatingItemStyle.TrackViewState();
- return alternatingItemStyle;
- }
- }
-
- public virtual bool AutoGenerateColumns
- {
- get
- {
- object o = ViewState["AutoGenerateColumns"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AutoGenerateColumns"] = value;
- }
- }
-
- public virtual string BackImageUrl
- {
- get
- {
- object o = ViewState["BackImageUrl"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["BackImageUrl"] = value;
- }
- }
-
- public virtual DataGridColumnCollection Columns
- {
- get
- {
- if(columns == null)
- {
- columnsArrayList = new ArrayList();
- columns = new DataGridColumnCollection(columnsArrayList);
- if(IsTrackingViewState)
- {
- columns.TrackViewState();
- }
- return columns;
- }
- }
- }
-
- public int CurrentPageIndex
- {
- get
- {
- object o = ViewState["CurrentPageIndex"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException();
- ViewState["CurrentPageIndex"] = value;
- }
- }
-
- public virtual int EditItemIndex
- {
- get
- {
- object o = ViewState["EditItemIndex"];
- if(o != null)
- return (int)o;
- return -1;
- }
- set
- {
- if(value < -1)
- throw ArgumentOutOfRangeException();
- ViewState["EditItemIndex"] = value;
- }
- }
-
- public virtual TableItemStyle EditItemStyle
- {
- get
- {
- if(editItemStyle == null)
- {
- editItemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- editItemStyle.TrackViewState();
- }
- }
- }
- }
-
- public virtual TableItemStyle FooterStyle
- {
- get
- {
- if(footerStyle == null)
- {
- footerStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- footerStyle.TrackViewState();
- }
- }
- }
- }
-
- public virtual TableItemStyle HeaderStyle
- {
- get
- {
- if(headerStyle == null)
- {
- headerStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- headerStyle.TrackViewState();
- }
- }
- }
- }
-
- public virtual DataGridItemCollection Items
- {
- get
- {
- if(items == null)
- {
- if(itemsArrayList == null)
- EnsureChildControls();
- if(itemsArrayList == null)
- {
- itemsArrayList = new ArrayList();
- }
- items = new DataGridItemCollection(itemsArrayList);
- }
- return items;
- }
- }
-
- public virtual TableItemStyle ItemStyle
- {
- get
- {
- if(itemStyle == null)
- {
- itemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- itemStyle.TrackViewState();
- }
- }
- return itemStyle;
- }
- }
-
- public int PageCount
- {
- get
- {
- if(pagedDataSource != null)
- {
- return pagedDataSource.PageCount;
- }
- object o = ViewState["PageCount"];
- if(o != null)
- return (int)o;
- return 0;
- }
- }
-
- public virtual DataGridPagerStyle PagerStyle
- {
- get
- {
- if(pagerStyle == null)
- {
- pagerStyle = new DataGridPageStyle(this);
- if(IsTrackingViewState)
- {
- pagerStyle.TrackViewState();
- }
- }
- return pagerStyle;
- }
- }
-
- public virtual int PageSize
- {
- get
- {
- object o = ViewState["PageSize"];
- if(o != null)
- return (int)o;
- return 10;
- }
- set
- {
- if(value < 1)
- throw new ArgumentOutOfRangeException();
- ViewState["PageSize"] = value;
- }
- }
-
- public virtual int SelectedIndex
- {
- get
- {
- object o = ViewState["SelectedIndex"];
- if(o != null)
- return (int)o;
- return -1;
- }
- set
- {
- if(value < -1)
- throw new ArgumentOutOfRangeException();
- int prevVal = SelectedIndex;
- ViewState["SelectedIndex"] = value;
- if(items != null)
- {
- if(prevVal !=-1 && prevVal < items.Count)
- {
- DataGridItem prev = (DataGridItem)items[prevVal];
- if(prev.ListItemType != ListItemType.EditItem)
- {
- ListItemType newType = ListItemType.Item;
- if( (prevVal % 2) != 0)
- {
- newType = ListItemType.AlternatingItem;
- }
- prev.SetItemType(newType);
- }
- }
- }
- }
- }
-
- public virtual DataGridItem SelectedItem
- {
- get
- {
- if(SelectedIndex == -1)
- return null;
- return Items[SelectedIndex];
- }
- }
-
- public virtual TableItemStyle SelectedItemStyle
- {
- get
- {
- if(selectedItemStyle == null)
- {
- selectedItemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- selectedItemStyle.TrackViewState();
- }
- }
- }
- }
-
- public virtual bool ShowFooter
- {
- get
- {
- object o = ViewState["ShowFooter"];
- if(o != null)
- retur (bool)o;
- return false;
- }
- set
- {
- ViewState["ShowFooter"] = value;
- }
- }
-
- public virtual bool ShowHeader
- {
- get
- {
- object o = ViewState["ShowHeader"];
- if(o != null)
- retur (bool)o;
- return false;
- }
- set
- {
- ViewState["ShowHeader"] = value;
- }
- }
-
- public virtual int VirtualItemCount
- {
- get
- {
- object o = ViewState["VirtualItemCount"];
- if(o != null)
- retur (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException();
- ViewState["VirtualItemCount"] = value;
- }
- }
-
- public event DataGridCommandEventHandler CancelCommand
- {
- add
- {
- Events.AddHandler(CancelCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(CancelCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler DeleteCommand
- {
- add
- {
- Events.AddHandler(DeleteCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DeleteCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler EditCommand
- {
- add
- {
- Events.AddHandler(EditCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(EditCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler ItemCommand
- {
- add
- {
- Events.AddHandler(ItemCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler ItemCreated
- {
- add
- {
- Events.AddHandler(ItemCreatedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCreatedEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler ItemDataBound
- {
- add
- {
- Events.AddHandler(ItemDataBoundEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemDataBoundEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler PageIndexChanged
- {
- add
- {
- Events.AddHandler(PageIndexChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(PageIndexChangedEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler SortCommand
- {
- add
- {
- Events.AddHandler(SortCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(SortCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler UpdateCommand
- {
- add
- {
- Events.AddHandler(UpdateCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(UpdateCommandEvent, value);
- }
- }
-
- protected override Style CreateControlStyle()
- {
- TableStyle style = new TableStyle(ViewState);
- style.GridLines = GridLines.Both;
- style.CellSpacing = 0;
- }
-
- protected override void LoadViewState(object savedState)
- {
- if(states != null)
- {
- object[] states = (object[])savedState;
- if(states != null)
- {
- LoadViewState(states[0]);
- if(columns != null)
- columns.LoadViewState(states[1]);
- if(pagerStyle != null)
- pagerStyle.LoadViewState(states[2]);
- if(headerStyle != null)
- headerStyle.LoadViewState(states[3]);
- if(footerStyle != null)
- footerStyle.LoadViewState(states[4]);
- if(itemStyle != null)
- itemStyle.LoadViewState(states[5]);
- if(alternatingItemStyle != null)
- alternatingItemStyle.LoadViewState(states[6]);
- if(selectedItemStyle != null)
- selectedItemStyle.LoadViewState(states[7]);
- if(editItemStyle != null)
- editItemStyle.LoadViewState(states[8]);
- }
- }
- }
-
- protected override object SaveViewState()
- {
- object[] states = new object[9];
- states[0] = SaveViewState();
- states[1] = (columns == null ? null : columns.SaveViewState());
- states[2] = (pagerStyle == null ? null : pagerStyle.SaveViewState());
- states[3] = (headerStyle == null ? null : headerStyle.SaveViewState());
- states[4] = (footerStyle == null ? null : footerStyle.SaveViewState());
- states[5] = (itemStyle == null ? null : itemStyle.SaveViewState());
- states[6] = (alternatingItemStyle == null ? null : alternatingItemStyle.SaveViewState());
- states[7] = (selectedItemStyle == null ? null : selectedItemStyle.SaveViewState());
- states[8] = (editItemStyle == null ? null : editItemStyle.SaveViewState());
- return states;
- }
-
- protected override void TrackViewState()
- {
- TrackViewState();
- if(alternatingItemStyle != null)
- {
- alternatingItemStyle.TrackViewState();
- }
- if(editItemStyle != null)
- {
- editItemStyle.TrackViewState();
- }
- if(headerStyle != null)
- {
- headerStyle.TrackViewState();
- }
- if(footerStyle != null)
- {
- footerStyle.TrackViewState();
- }
- if(itemStyle != null)
- {
- itemStyle.TrackViewState();
- }
- if(selectedItemStyle != null)
- {
- selectedItemStyle.TrackViewState();
- }
- if(pagerStyle != null)
- {
- pagerStyle.TrackViewState();
- }
-
- if(columns != null)
- {
- columns.TrackViewState();
- }
- }
-
- [MonoTODO]
- protected override bool OnBubbleEvent(object source, EventArgs e)
- {
- bool retVal = false;
- if(e is DataGridCommandEventArgs)
- {
- DataGridCommandEventArgs ea = (DataGridCommandEventArgs)e;
- retVal = true;
- OnItemCommand(ea);
- string cmd = ea.CommandName;
- if(cmd == "Select")
- {
- SelectedIndex = ea.Item.SelectedIndex;
- OnSelectedIndexChanged(EventArgs.Empty);
- } else if(cmd == "Page")
- {
- throw new NotImplementedException();
- // Next; Prev; Sort etc
- }
- }
- throw new NotImplementedException();
- //return retVal;
- }
-
- protected virtual void OnCancelCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[CancelCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnDeleteCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[DeleteCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnEditCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[EditCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnItemCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[ItemCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnItemCreated(DataGridItemEventArgs e)
- {
- if(Events != null)
- {
- DataGridItemEventHandler dceh = (DataGridItemEventHandler)(Events[ItemCreatedEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnItemDataBound(DataGridItemEventArgs e)
- {
- if(Events != null)
- {
- DataGridItemEventHandler dceh = (DataGridItemEventHandler)(Events[ItemDataBoundEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnPageIndexChanged(DataGridPageChangedEventArgs e)
- {
- if(Events != null)
- {
- DataGridPageChangedEventHandler dceh = (DataGridPageChangedEventHandler)(Events[PageIndexChangedEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnSortCommand(DataGridSortCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridSortCommandEventHandler dceh = (DataGridSortCommandEventHandler)(Events[SortCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnUpdateCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[UpdateCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs
deleted file mode 100644
index e5850371123..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: DataGridCommandEventArgs
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataGridCommandEventArgs : CommandEventArgs
- {
- DataGridItem dgItem;
- object cmdSrc;
-
- public DataGridCommandEventArgs(DataGridItem item, object commandSource, CommandEventArgs originalArgs): base(originalArgs)
- {
- dgItem = item;
- cmdSrc = originalArgs;
- }
-
- public object CommandSource
- {
- get
- {
- return cmdSrc;
- }
- }
-
- public DataGridItem Item
- {
- get
- {
- return dgItem;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs
deleted file mode 100644
index bd06eed39f4..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: DataGridCommandEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataGridCommandEventHandler(object sender, DataGridCommandEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs
deleted file mode 100644
index bd6d8090d10..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridItem
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class DataGridItem : TableRow, INamingContainer
- {
- private int itemIndex;
- private int dataSetIndex;
- private ListItemType itemType;
- private object dataItem;
-
- public DataGridItem(int itemIndex, int dataSetIndex, ListItemType itemType): base()
- {
- this.itemIndex = itemIndex;
- this.dataSetIndex = dataSetIndex;
- this.itemType = itemType;
- }
-
- public virtual object DataItem
- {
- get
- {
- return dataItem;
- }
- set
- {
- dataItem = value;
- }
- }
-
- public virtual int DataSetIndex
- {
- get
- {
- return dataSetIndex;
- }
- }
-
- public virtual int ItemIndex
- {
- get
- {
- return itemIndex;
- }
- }
-
- public virtual ListItemType ItemType
- {
- get
- {
- return itemType;
- }
- }
-
- protected override bool OnBubbleEvent(object source, EventArgs e)
- {
- if(e is CommandEventArgs)
- {
- DataGridCommandEventArgs args = new DataGridCommandEventArgs(this, source, (CommandEventArgs)e);
- RaiseBubbleEvent(this, args);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemCollection.cs
deleted file mode 100644
index 8f73b541336..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemCollection.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridItemCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class DataGridItemCollection : ICollection, IEnumerable
- {
- private ArrayList items;
-
- public DataGridItemCollection(ArrayList items)
- {
- this.items = items;
- }
-
- public int Count
- {
- get
- {
- return items.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public DataGridItem this[int index]
- {
- get
- {
- return (DataGridItem)(items[index]);
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(DataGridItem current in this)
- {
- array.SetValue(current, index++);
- }
- }
-
- public IEnumerator GetEnumerator()
- {
- return items.GetEnumerator();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs
deleted file mode 100644
index de0f92cfa30..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: DataGridItemEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataGridItemEventHandler(object sender, DataGridItemEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs
deleted file mode 100644
index 83dfc6d0dde..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataGridPageChangedEventHandler(object sender, DataGridPageChangedEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs
deleted file mode 100644
index b9a1d2653b7..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataGridSortCommandEventHandler(object sender, DataGridSortCommandEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs
deleted file mode 100755
index 7636e4b0f2b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs
+++ /dev/null
@@ -1,807 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataList
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 70%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class DataList: BaseDataList, INamingContainer, IRepeatInfoUser
- {
- //
- public const string CancelCommandName = "Cancel";
- public const string DeleteCommandName = "Delete";
- public const string EditCommandName = "Edit";
- public const string SelectCommandName = "Select";
- public const string UpdateCommandName = "Update";
-
- private static readonly object CancelCommandEvent = new object();
- private static readonly object DeleteCommandEvent = new object();
- private static readonly object EditCommandEvent = new object();
- private static readonly object ItemCommandEvent = new object();
- private static readonly object ItemCreatedEvent = new object();
- private static readonly object ItemDataBoundEvent = new object();
- private static readonly object UpdateCommandEvent = new object();
-
- private TableItemStyle alternatingItemStyle;
- private TableItemStyle editItemStyle;
- private TableItemStyle footerStyle;
- private TableItemStyle headerStyle;
- private TableItemStyle itemStyle;
- private TableItemStyle selectedItemStyle;
- private TableItemStyle separatorStyle;
-
- private ITemplate alternatingItemTemplate;
- private ITemplate editItemTemplate;
- private ITemplate footerTemplate;
- private ITemplate headerTemplate;
- private ITemplate separatorTemplate;
-
- private ArrayList itemsArray;
- private DataListItemCollection items;
-
- public DataList(): base()
- {
- }
-
- public virtual TableItemStyle AlternatingItemStyle
- {
- get
- {
- if(alternatingItemStyle == null)
- {
- alternatingItemStyle = new TableItemStyle();
- if(IsTrackingViewState())
- alternatingItemStyle.TrackViewState();
- }
- return alternatingItemStyle;
- }
- }
-
- public virtual ITemplate AlternatingItemTemplate
- {
- get
- {
- return alternatingItemTemplate;
- }
- set
- {
- alternatingItemTemplate = value;
- }
- }
-
- public virtual int EditItemIndex
- {
- get
- {
- object o = ViewState["EditItemIndex"];
- if(o != null)
- return (int)o;
- return -1;
- }
- set
- {
- ViewState["EditItemIndex"] = value;
- }
- }
-
- public virtual TableItemStyle EditItemStyle
- {
- get
- {
- if(editItemStyle == null)
- {
- editItemStyle = new TableItemStyle();
- if(IsTrackingViewState())
- editItemStyle.TrackViewState();
- }
- return editItemStyle;
- }
- }
-
- public virtual ITemplate EditItemTemplate
- {
- get
- {
- return editItemTemplate;
- }
- set
- {
- editItemTemplate = value;
- }
- }
-
- public virtual bool ExtractTemplateRows
- {
- get
- {
- object o = ViewState["ExtractTemplateRows"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["ExtractTemplateRows"] = value;
- }
- }
-
- public virtual TableItemStyle FooterStyle
- {
- get
- {
- if(footerStyle == null)
- {
- footerStyle = new TableItemStyle();
- if(IsTrackingViewState())
- footerItemStyle.TrackViewState();
- }
- return footerItemStyle;
- }
- }
-
- public virtual ITemplate FooterTemplate
- {
- get
- {
- return footerTemplate;
- }
- set
- {
- footerTemplate = value;
- }
- }
-
- public override GridLines GridLines
- {
- get
- {
- return GridLines;
- }
- set
- {
- GridLines = value;
- }
- }
-
- public virtual TableItemStyle HeaderStyle
- {
- get
- {
- if(headerStyle == null)
- {
- headerStyle = new TableItemStyle();
- if(IsTrackingViewState())
- headerStyle.TrackViewState();
- }
- return headerStyle;
- }
- }
-
- public virtual ITemplate HeaderTemplate
- {
- get
- {
- return headerTemplate;
- }
- set
- {
- headerTemplate = value;
- }
- }
-
- public virtual DataListItemCollection Items
- {
- get
- {
- if(items == null)
- {
- if(itemsArray = null)
- {
- EnsureChildControls();
- itemsArray = new ArrayList();
- }
- items = new DataListItemCollection(itemsArray);
- }
- return items;
- }
- }
-
- public virtual TableItemStyle ItemStyle
- {
- get
- {
- if(itemStyle == null)
- {
- itemStyle = new TableItemStyle();
- if(IsTrackingViewState())
- itemStyle.TrackViewState();
- }
- return itemStyle;
- }
- }
-
- public virtual ITemplate ItemTemplate
- {
- get
- {
- return itemTemplate;
- }
- set
- {
- itemTemplate = value;
- }
- }
-
- public virtual int RepeatColumns
- {
- get
- {
- object o = ViewState["RepeatColumns"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException("value");
- ViewState["RepeatColumns"] = value;
- }
- }
-
- public virtual RepeatDirection RepeatDirection
- {
- get
- {
- object o = ViewState["RepeatDirection"];
- if(o != null)
- return (RepeatDirection)o;
- return RepeatDirection.Vertical;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatDirection), value))
- throw new ArgumentException();
- ViewState["RepeatDirection"] = value;
- }
- }
-
- public virtual RepeatLayout RepeatLayout
- {
- get
- {
- object o = ViewState["RepeatLayout"];
- if(o != null)
- return (RepeatLayout)o;
- return RepeatLayout.Table;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatLayout), value))
- throw new ArgumentException();
- ViewState["RepeatLayout"] = value;
- }
- }
-
- public virtual int SelectedIndex
- {
- get
- {
- object o = ViewState["SelectedIndex"];
- if(o != null)
- return (int)o;
- return -1;
- }
- set
- {
- //FIXME: Looks like a bug in Microsoft's specs.
- // Exception is missing in document. I haven't tested the case
- // But I think exception should follow
- if(value < -1)
- throw ArgumentOutOfRangeException("value");
- int prevSel = SelectedIndex;
- ViewState["SelectedIndex"] = value;
- DataListItem prevSelItem;
- ListItemType liType;
- if(itemsArray != null)
- {
- if(prevSel >= 0 && prevSel < itemsArray.Count)
- {
- prevSelItem = (DataListItem)itemsArray[prevSel];
- if(prevSelItem.ItemType != ListItemType.EditItem)
- {
- liType = ( (prevSel % 2) == 0 ? ListItemType.AlternatingItem : ListItemType.Item );
- prevSelItem.SetItemType(liType);
- }
- }
- if(value >= 0 && value < itemsArray.Count)
- {
- prevSelItem = (DataListItem) iteamArray[value];
- if(prevSelItem.ItemType != ListItemType.EditItem)
- {
- prevSelItem.SetItemType(ListItemType.SelectedItem);
- }
- }
- }
- }
- }
-
- public virtual DataListItem SelectedItem
- {
- get
- {
- if(SelectedIndex == -1)
- return null;
- return Items[SelectedIndex];
- }
- }
-
- public virtual TableItemStyle SelectedItemStyle
- {
- get
- {
- if(selectedItemStyle == null)
- {
- selectedItemStyle = new TableItemStyle();
- if(IsTrackingViewState())
- selectedItemStyle.TrackViewState();
- }
- return selectedItemStyle;
- }
- }
-
- public virtual ITemplate SelectedItemTemplate
- {
- get
- {
- return selectedItemTemplate;
- }
- set
- {
- selectedItemTemplate = value;
- }
- }
-
- public virtual TableItemStyle SeparatorStyle
- {
- get
- {
- if(separatorStyle == null)
- {
- separatorStyle = new TableItemStyle();
- if(IsTrackingViewState())
- separatorStyle.TrackViewState();
- }
- return separatorStyle;
- }
- }
-
- public virtual ITemplate SeparatorItemTemplate
- {
- get
- {
- return separatorItemTemplate;
- }
- set
- {
- separatorItemTemplate = value;
- }
- }
-
- public virtual bool ShowHeader
- {
- get
- {
- object o = ViewState["ShowHeader"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowHeader"] = value;
- }
- }
-
- public virtual bool ShowFooter
- {
- get
- {
- object o = ViewState["ShowFooter"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowFooter"] = value;
- }
- }
-
- public event DataListCommandEventHandler CancelCommand
- {
- add
- {
- Events.AddHandler(CancelCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(CancelCommandEvent, value);
- }
- }
-
- public event DataListCommandEventHandler DeleteCommand
- {
- add
- {
- Events.AddHandler(DeleteCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DeleteCommandEvent, value);
- }
- }
-
- public event DataListCommandEventHandler EditCommand
- {
- add
- {
- Events.AddHandler(EditCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(EditCommandEvent, value);
- }
- }
-
- public event DataListCommandEventHandler ItemCommand
- {
- add
- {
- Events.AddHandler(ItemCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCommandEvent, value);
- }
- }
-
- public event DataListCommandEventHandler ItemCreated
- {
- add
- {
- Events.AddHandler(ItemCreatedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCreatedEvent, value);
- }
- }
-
- public event DataListCommandEventHandler ItemDataBound
- {
- add
- {
- Events.AddHandler(ItemDataBoundEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemDataBoundEvent, value);
- }
- }
-
- public event DataListCommandEventHandler UpdateCommand
- {
- add
- {
- Events.AddHandler(UpdateCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(UpdateCommandEvent, value);
- }
- }
-
- protected override Style CreateControlStyle()
- {
- TableStyle retVal = new TableStyle(StateBag);
- retVal.CellSpacing = 0;
- return retVal;
- }
-
- protected override void LoadViewState(object savedState)
- {
- object[] states;
- if(savedState != null && (states = (object[])savedState) != null)
- {
- if(states[0] != null)
- LoadViewState(states[0]);
- if(states[1] != null)
- alternatingItemStyle.LoadViewState(states[1]);
- if(states[2] != null)
- editItemStyle.LoadViewState(states[2]);
- if(states[3] != null)
- footerStyle.LoadViewState(states[3]);
- if(states[4] != null)
- headerStyle.LoadViewState(states[4]);
- if(states[5] != null)
- itemStyle.LoadViewState(states[5]);
- if(states[6] != null)
- selectedItemStyle.LoadViewState(states[6]);
- if(states[7] != null)
- separatorStyle.LoadViewState(states[7]);
- }
- }
- protected override object SaveViewState()
- {
- object[] states = new object[8];
- states[0] = SaveViewState();
- states[1] = (alternatingItemStyle == null ? null : alternatingItemStyle.SaveViewState());
- states[2] = (editItemStyle == null ? null : editItemStyle.SaveViewState());
- states[3] = (footerStyle == null ? null : footerStyle.SaveViewState());
- states[4] = (headerStyle == null ? null : headerStyle.SaveViewState());
- states[5] = (itemStyle == null ? null : itemStyle.SaveViewState());
- states[6] = (selectedItemStyle == null ? null : selectedItemStyle.SaveViewState());
- states[7] = (separatorStyle == null ? null : separatorStyle.SaveViewState());
- return states;
- }
-
- protected override void TrackViewState()
- {
- TrackViewState();
- if(alternatingItemStyle != null)
- alternatingItemStyle.TrackViewState();
- if(editItemStyle != null)
- editItemStyle.TrackViewState();
- if(footerStyle != null)
- footerStyle.TrackViewState();
- if(headerStyle != null)
- headerStyle.TrackViewState();
- if(itemStyle != null)
- itemStyle.TrackViewState();
- if(selectedItemStyle != null)
- selectedItemStyle.TrackViewState();
- if(separatorStyle != null)
- separatorStyle.TrackViewState();
- }
-
- protected override bool OnBubbleEvent(object source, EventArgs e)
- {
- bool retVal;
- if(e is DataListCommandEventArgs)
- {
- DataListCommandEventArgs dlcea = (DataListCommandEventArgs)e;
- OnItemCommand(dlcea);
- retVal = true;
- if(String.Compare(dlcea.CommandName, "Cancel") == 0)
- {
- OnCancelCommand(dlcea);
- }
- if(String.Compare(dlcea.CommandName, "Delete") == 0)
- {
- OnDeleteCommand(dlcea);
- }
- if(String.Compare(dlcea.CommandName, "Edit") == 0)
- {
- OnEditCommand(dlcea);
- }
- if(String.Compare(dlcea.CommandName, "Select") == 0)
- {
- OnSelectCommand(dlcea);
- }
- if(String.Compare(dlcea.CommandName, "Update") == 0)
- {
- OnUpdateCommand(dlcea);
- }
- }
- return retVal;
- }
-
- protected virtual void OnCancelCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[CancelCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnDeleteCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[DeleteCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnEditCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[EditCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnItemCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[ItemCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnItemCreated(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[ItemCreatedEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnItemDataBound(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[ItemDataBoundEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnUpdateCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[UpdateCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- [MonoTODO]
- protected override void RenderContents(HtmlTextWriter writer)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- private DataListItem GetItem(ListItemType itemType, int repeatIndex)
- {
- DataListItem retVal = null;
- switch(itemType)
- {
- case ListItemType.Header: retVal = (DataListitem)Controls[0];
- break;
- case ListItemType.Footer: retVal = (DataListItem)Controls[Controls.Count - 1];
- break;
- case ListItemType.Item: goto case ListItemType.EditItem;
- case ListItemType.AlternatingItem: goto case ListItemType.EditItem;
- case ListItemType.SelectedItem: goto case ListItemType.EditItem;
- case ListItemType.EditItem: retVal = (DataListItem)Controls[repeatIndex];
- break;
- case ListItemType.Separator: int index = 2 * repeatIndex + 1;
- if(headerTemplate != null)
- index ++;
- retVal = (DataListItem)Controls[index];
- }
- return retVal;
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- [MonoTODO]
- protected override void CreateControlHierarchy(bool create)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- [MonoTODO]
- protected DataListItem CreateItem(int itemIndex, ListItemType itemType)
- {
-
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- [MonoTODO]
- protected DataListItem CreateItem(int itemIndex, ListItemType itemType, bool dataBind, object dataItem)
- {
-
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- [MonoTODO]
- protected override void PrepareControlHierarchy()
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- [MonoTODO]
- protected void InitializeItem(DataListItem item)
- {
- throw new NotImplementedException();
- }
-
- bool IRepeatInfoUser.HasFooter
- {
- get
- {
- return !(ShowFooter && footerTemplate!=null);
- }
- }
-
- bool IRepeatInfoUser.HasHeader
- {
- get
- {
- return !(ShowHeader && headerTemplate!=null);
- }
- }
-
- bool IRepeatInfoUser.HasSeparators
- {
- get
- {
- return (separatorTemplate!=null);
- }
- }
-
- int IRepeatInfoUser.RepeatedItemCount
- {
- get
- {
- if(itemsArray!=null)
- return itemsArray.Count;
- return 0;
- }
- }
-
- void IRepeatInfoUser.RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
- {
- DataListItem item = GetItem(itemType, repeatIndex);
- if(item!=null)
- {
- item.RenderItem(writer, extractTemplateRows, repeatInfo.RepeatLayout == RepeatLayout.Table);
- }
- }
-
- Style IRepeatInfoUser.GetItemStyle(ListItemType itemType, int repeatIndex)
- {
- if(GetItem(itemType, repeatIndex)!=null && ControlStyleCreated)
- return ControlStyle;
- return null;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs
deleted file mode 100644
index 93511a27730..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: DataListCommandEventArgs
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataListCommandEventArgs: CommandEventArgs
- {
- private DataListItem dlItem;
- private object cmdSrc;
-
- public DataListCommandEventArgs(DataListItem item, object commandSource, CommandEventArgs originalArgs): base(originalArgs)
- {
- dlItem = item;
- cmdSrc = commandSource;
- }
-
- public object CommandSource
- {
- get
- {
- return cmdSrc;
- }
- }
-
- public DataListItem Item
- {
- get
- {
- return dlItem;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs
deleted file mode 100644
index 59df1b2fe50..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataListCommandEventHandler(object sender, DataListCommandEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs
deleted file mode 100644
index 3310857658d..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataListItemEventHandler(object sender, DataListItemEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs
deleted file mode 100755
index 39aaffb4b83..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: DayNameFormat
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum DayNameFormat
- {
- Full,
- Short,
- FirstLetter,
- FirstTwoLetters
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventArgs.cs
deleted file mode 100644
index a7e50cf9cdd..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: DayRenderEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DayRenderEventArgs
- {
- private TableCell cell;
- private CalendarDay day;
-
- public DayRenderEventArgs(TableCell cell, CalendarDay day)
- {
- this.cell = cell;
- this.day = day;
- }
-
- public TableCell Cell
- {
- get
- {
- return cell;
- }
- }
-
- public CalendarDay Day
- {
- get
- {
- return day;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs
deleted file mode 100644
index 1501321ffb9..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: DayRenderEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DayRenderEventHandler(object sender, DayRenderEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs
deleted file mode 100644
index 5e2fca986e6..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DropDownList
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections.Specialized;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class DropDownList : ListControl, IPostBackDataHandler
- {
- public DropDownList(): base()
- {
- }
-
- public override Color BorderColor
- {
- get
- {
- return BorderColor;
- }
- set
- {
- BorderColor = value;
- }
- }
-
- public override BorderStyle BorderStyle
- {
- get
- {
- return BorderStyle;
- }
- set
- {
- BorderStyle = value;
- }
- }
-
- public override Unit BorderWidth
- {
- get
- {
- return BorderWidth;
- }
- set
- {
- BorderWidth = value;
- }
- }
-
- public override int SelectedIndex
- {
- get
- {
- return SelectedIndex;
- }
- set
- {
- SelectedIndex = value;
- }
- }
-
- public override string ToolTip
- {
- get
- {
- return ToolTip;
- }
- set
- {
- ToolTip = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- if(Page != null)
- {
- Page.VerifyRenderingInServerForm(this);
- }
- writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID);
- AddAttributesToRender(writer);
-
- if(AutoPostBack && Page != null)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Onchange, Page.GetPostBackClientEvent(this,""));
- writer.AddAttribute("language", "javascript");
- }
- }
-
- protected override ControlCollection CreateControlCollection()
- {
- return new EmptyControlCollection(this);
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- if(Items != null)
- {
- bool selected = false;
- foreach(ListItem current in Items)
- {
- writer.WriteBeginTag("option");
- if(Selected)
- {
- if(selected)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Cannot_Multiselect_In_DropDownList"));
- }
- selected = true;
- writer.WriteAttribute("selected", "selected", false);
- }
- writer.WriteAttribute("value", current.Value, true);
- writer.Write('>');
- HttpUtility.Encode(current.Text, writer);
- writer.WriteEndTag("option");
- writer.WriteLine();
- }
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- string[] vals = postCollection.GetValues();
- if(vals != null)
- {
- int index = Items.FindByValueInternal(vals[0]);
- if(index != SelectedIndex)
- {
- SelectedIndex = index;
- return true;
- }
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- OnSelectedIndexChanged(EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs
deleted file mode 100755
index 3b618c7acbf..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: FirstDayOfWeek
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum FirstDayOfWeek
- {
- Sunday,
- Monday,
- Tuesday,
- Wednesday,
- Thursday,
- Friday,
- Saturday,
- Default
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs
deleted file mode 100755
index 702afb4b261..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: FontInfo
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Text;
-using System.Reflection;
-using System.Web;
-using System.Web.UI;
-using System.Drawing;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class FontInfo
- {
- private Style infoOwner;
-
- internal FontInfo(Style owner)
- {
- infoOwner = owner;
- }
-
- /// <summary>
- /// Default constructor
- /// <remarks>
- /// The default constructor is made private to prevent any instances being made.
- /// </remarks>
- /// </summary>
- private FontInfo()
- {
- }
-
- public bool Bold
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_BOLD))
- return (bool)(infoOwner.ViewState["FontInfoBold"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoBold"] = value;
- infoOwner.Set(Style.FONT_BOLD);
- }
- }
-
- public bool Italic
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_ITALIC))
- return (bool)(infoOwner.ViewState["FontInfoItalic"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoItalic"] = value;
- infoOwner.Set(Style.FONT_ITALIC);
- }
- }
-
- public bool Overline
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_OLINE))
- return (bool)(infoOwner.ViewState["FontInfoOverline"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoOverline"] = value;
- infoOwner.Set(Style.FONT_OLINE);
- }
- }
-
- public bool Strikeout
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_STRIKE))
- return (bool)(infoOwner.ViewState["FontInfoStrikeout"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoStrikeout"] = value;
- infoOwner.Set(Style.FONT_STRIKE);
- }
- }
-
- public bool Underline
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_ULINE))
- return (bool)(infoOwner.ViewState["FontInfoUnderline"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoUnderline"] = value;
- infoOwner.Set(Style.FONT_ULINE);
- }
- }
-
- //TODO: How do I check if the value is negative. FontUnit is struct not enum
- public FontUnit Size
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_SIZE))
- return (FontUnit)(infoOwner.ViewState["FontInfoSize"]);
- return FontUnit.Empty;
- }
- set
- {
- infoOwner.ViewState["FontInfoSize"] = value;
- infoOwner.Set(Style.FONT_SIZE);
- }
- }
-
- public string Name
- {
- get
- {
- if(Names!=null)
- return Names[0];
- return String.Empty;
- }
- set
- {
- if(value == null)
- throw new ArgumentException();
- string[] strArray = null;
- if(value.Length > 0)
- {
- strArray = new string[1];
- strArray[0] = value;
- }
- Names = strArray;
- }
- }
-
- public string[] Names
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_NAMES))
- return (string[])(infoOwner.ViewState["FontInfoNames"]);
- return (new string[0]);
- }
- set
- {
- if(value!=null)
- {
- infoOwner.ViewState["FontInfoNames"] = value;
- infoOwner.Set(Style.FONT_NAMES);
- }
- }
- }
-
- internal void Reset()
- {
- if(infoOwner.IsSet(Style.FONT_NAMES))
- infoOwner.ViewState.Remove("FontInfoNames");
- if(infoOwner.IsSet(Style.FONT_BOLD))
- infoOwner.ViewState.Remove("FontInfoBold");
- if(infoOwner.IsSet(Style.FONT_ITALIC))
- infoOwner.ViewState.Remove("FontInfoItalic");
- if(infoOwner.IsSet(Style.FONT_STRIKE))
- infoOwner.ViewState.Remove("FontInfoStrikeout");
- if(infoOwner.IsSet(Style.FONT_OLINE))
- infoOwner.ViewState.Remove("FontInfoOverline");
- if(infoOwner.IsSet(Style.FONT_ULINE))
- infoOwner.ViewState.Remove("FontInfoUnderline");
- if(infoOwner.IsSet(Style.FONT_SIZE) && infoOwner.Font.Size != FontUnit.Empty)
- infoOwner.ViewState.Remove("FontInfoSize");
- }
-
- internal Style Owner
- {
- get
- {
- return infoOwner;
- }
- }
-
- public void CopyFrom(FontInfo source)
- {
- if(source!=null)
- {
- if(source.Owner.IsSet(Style.FONT_NAMES))
- Names = source.Names;
- if(source.Owner.IsSet(Style.FONT_BOLD))
- Bold = source.Bold;
- if(source.Owner.IsSet(Style.FONT_ITALIC))
- Italic = source.Italic;
- if(source.Owner.IsSet(Style.FONT_STRIKE))
- Strikeout = source.Strikeout;
- if(source.Owner.IsSet(Style.FONT_OLINE))
- Overline = source.Overline;
- if(source.Owner.IsSet(Style.FONT_ULINE))
- Underline = source.Underline;
- if(source.Owner.IsSet(Style.FONT_SIZE) && source.Size != FontUnit.Empty)
- Size = source.Size;
- }
- }
-
- public void MergeWith(FontInfo with)
- {
- if(with!=null)
- {
- if(with.Owner.IsSet(Style.FONT_NAMES) && !infoOwner.IsSet(Style.FONT_NAMES))
- Names = with.Names;
- if(with.Owner.IsSet(Style.FONT_BOLD) && !infoOwner.IsSet(Style.FONT_BOLD))
- Bold = with.Bold;
- if(with.Owner.IsSet(Style.FONT_ITALIC) && !infoOwner.IsSet(Style.FONT_ITALIC))
- Italic = with.Italic;
- if(with.Owner.IsSet(Style.FONT_STRIKE) && !infoOwner.IsSet(Style.FONT_STRIKE))
- Strikeout = with.Strikeout;
- if(with.Owner.IsSet(Style.FONT_OLINE) && !infoOwner.IsSet(Style.FONT_OLINE))
- Overline = with.Overline;
- if(with.Owner.IsSet(Style.FONT_ULINE) && !infoOwner.IsSet(Style.FONT_ULINE))
- Underline = with.Underline;
- if(with.Owner.IsSet(Style.FONT_SIZE) && with.Size != FontUnit.Empty && !infoOwner.IsSet(Style.FONT_SIZE))
- Size = with.Size;
- }
- }
-
- public bool ShouldSerializeNames()
- {
- return (Names.Length > 0);
- }
-
- public override string ToString()
- {
- return ( (Name.Length > 0) ? (Name.ToString() + ", " + Size.ToString()) : Size.ToString() );
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontNamesConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontNamesConverter.cs
deleted file mode 100644
index f0b4d17d6ca..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontNamesConverter.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: FontNamesConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class FontNamesConverter : TypeConverter
- {
- public FontNamesConverter(): base()
- {
- }
-
- public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
- {
- return (sourceType == typeof(string));
- }
-
- public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if(value is string)
- {
- string fontNames = (string)value;
- if(fontNames.Length == 0)
- {
- return (new string[0]);
- }
- string[] names = fontNames.Split(new char[] { ','});
- foreach(string current in names)
- {
- current = current.Trim();
- }
- return names;
- }
- throw GetConvertFromException(value);
- }
-
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if(destinationType is typeof(string))
- {
- if(value == null || ((string[])value) == null)
- return String.Empty;
- return String.Join(",", (string[])value);
- }
- throw GetConvertToException(value, destinationType);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs
deleted file mode 100755
index f72e3d455aa..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: FontSize
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum FontSize
- {
- NotSet,
- AsUnit,
- Smaller,
- Larger,
- XXSmall,
- XSmall,
- Small,
- Medium,
- Large,
- XLarge,
- XXLarge
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs
deleted file mode 100644
index 901839a04c3..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs
+++ /dev/null
@@ -1,209 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Struct: FontUnit
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public struct FontUnit
- {
- public static readonly FontUnit Empty = new FontUnit();
- public static readonly FontUnit Large = new FontUnit(FontSize.Large);
- public static readonly FontUnit Larger = new FontUnit(FontSize.Larger);
- public static readonly FontUnit Medium = new FontUnit(FontSize.Medium);
- public static readonly FontUnit Small = new FontUnit(FontSize.Small);
- public static readonly FontUnit Smaller = new FontUnit(FontSize.Smaller);
- public static readonly FontUnit XLarge = new FontUnit(FontSize.XLarge);
- public static readonly FontUnit XSmall = new FontUnit(FontSize.XSmall);
- public static readonly FontUnit XXLarge = new FontUnit(FontSize.XXLarge);
- public static readonly FontUnit XXSmall = new FontUnit(FontSize.XXSmall);
-
- private FontSize type;
- private Unit val;
-
- public FontUnit(FontSize type)
- {
- if(!Enum.IsDefined(typeof(FontSize), type))
- throw new ArgumentException();
- this.type = type;
- if(this.type == FontSize.AsUnit)
- {
- val = Unit.Point(10);
- } else
- {
- val = Unit.Empty;
- }
- }
-
- public FontUnit(int value)
- {
- type = FontSize.AsUnit;
- val = Unit.Point(value);
- }
-
- public FontUnit(string value): this(value, CultureInfo.CurrentCulture)
- {
- }
-
- public FontUnit(Unit value)
- {
- if(val.IsEmpty)
- {
- type = FontSize.NotSet;
- val = Unit.Empty;
- } else
- {
- type = FontSize.AsUnit;
- val = value;
- }
- }
-
- public FontUnit(string value, CultureInfo culture)
- {
- type = FontSize.NotSet;
- val = Unit.Empty;
- if(value != null && value != String.Empty)
- {
- string low = value.ToLower(culture);
- int index = GetTypeFromString(low);
- if( index != -1)
- {
- type = (FontSize)fs;
- return;
- } else
- {
- val = new Unit(value, culture, UnitType.Point);
- type = FontSize.AsUnit;
- }
- }
- }
-
- private int GetTypeFromString(string strVal)
- {
- string[] values = {
- "smaller",
- "larger",
- "xx-small",
- "x-small",
- "small",
- "medium",
- "large",
- "xlarge",
- "xxlarge"
- }
- int i = 0;
- foreach(string valType in values)
- {
- if(strVal == valType)
- {
- return (i + 2);
- }
- i++;
- }
- return -1;
- }
-
- public static FontUnit Parse(string s): Parse(s, CultureInfo.CurrentCulture)
- {
- }
-
- public static FontUnit Parse(string s, CultureInfo culture)
- {
- return new FontUnit(s, culture);
- }
-
- public static FontUnit Point(int n)
- {
- return new FontUnit(n);
- }
-
- public static bool operator ==(FontUnit left, FontUnit right)
- {
- return (left.type == right.type && left.val == right.val);
- }
-
- public static bool operator !=(FontUnit left, FontUnit right)
- {
- return !(left == right);
- }
-
- public static implicit operator FontUnit(int n)
- {
- return FontUnit.Point(n);
- }
-
- public override bool Equals(object obj)
- {
- if(obj!= null && obj is FontUnit)
- {
- FontUnit that = (FontUnit)obj;
- return (this.type == that.type && this.val == that.val);
- }
- return false;
- }
-
- public override int GetHashCode()
- {
- return ( (type.GetHashCode() << 2) | val.GetHashCode() );
- }
-
- public override string ToString(): ToString(CultureInfo.CurrentCulture)
- {
- }
-
- public override string ToString(CultureInfo culture)
- {
- if(IsEmpty)
- {
- return String.Empty;
- }
- //string strRepr = String.Empty;
- switch(type)
- {
- case FontSize.AsUnit: return val.ToString(culture);
- case FontSize.XXSmall: return "XX-Small";
- case FontSize.XSmall: return "X-Small";
- case FontSize.XLarge: return "X-Large";
- case FontSize.XXLarge: return "XX-Large";
- default: return PropertyConverter.EnumToString(typeof(FontSize), type);
- }
- }
-
- public bool IsEmpty
- {
- get
- {
- return (type == FontSize.NotSet);
- }
- }
-
- public FontSize Type
- {
- get
- {
- return type;
- }
- }
-
- public Unit Unit
- {
- get
- {
- return val;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs
deleted file mode 100644
index 09c76565648..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: FontUnitConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 60%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class FontUnitConverter : TypeConverter
- {
- public FontUnitConverter(): base()
- {
- }
-
- public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
- {
- if(sourceType == typeof(string))
- return true;
- return base.CanConvertFrom(context, sourceType);
- }
-
- public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if(value == null)
- return null;
- if(value is string)
- {
- string val = ((string)value).Trim();
- if(val.Length == 0)
- {
- return FontUnit.Empty;
- }
- return FontUnit.Parse(val, culture);
- }
- return base.ConvertFrom(context, culture, value);
- }
-
- [MonoTODO("ConvertTo")]
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if(value == null || !(value is FontUnit))
- return String.Empty;
- FontUnit val = (FontUnit)value;
- if(val == FontUnit.NotSet)
- {
- return String.Empty;
- }
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs
deleted file mode 100755
index b013b5a1779..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: GridLines
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum GridLines
- {
- None,
- Horizontal,
- Vertical,
- Both
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs
deleted file mode 100755
index 079e26419c1..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: HorizontalAlign
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum HorizontalAlign
- {
- NotSet,
- Left,
- Center,
- Right,
- Justify
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLink.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HyperLink.cs
deleted file mode 100755
index 43866b2ef7f..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLink.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: HyperLink
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: gvaish@iitk.ac.in, myscripts_2001@yahoo.com
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public class HyperLink: WebControl
- {
- public HyperLink(): base()
- {
- }
-
- public virtual string ImageUrl
- {
- get
- {
- object o = ViewState["ImageUrl"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["ImageUrl"] = value;
- }
- }
-
- public string NavigateUrl
- {
- get
- {
- object o = ViewState["NavigateUrl"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["NavigateUrl"] = value;
- }
- }
-
- public string Target
- {
- get
- {
- object o = ViewState["Target"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Target"] = value;
- }
- }
-
- public virtual string Text
- {
- get
- {
- object o = ViewState["Text"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer) : AddAttributesToRender(writer)
- {
- if(NavigateUrl.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Href, NavigateUrl);
- }
- if(Target.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Target, Target);
- }
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(HasControls())
- {
- base.AddParsedSubObject(obj);
- return;
- }
- if(obj is LiteralConrol)
- {
- Text = ((LiteralControl)obj).Text;
- return;
- }
- if(Text.Length > 0)
- {
- base.AddParsedSubObject(Text);
- Text = String.Empty;
- }
- AddParsedSubObject(obj);
- }
-
- protected override void LoadViewState(object savedState)
- {
- if(savedState != null)
- {
- base.LoadViewState(savedState);
- object o = ViewState["Text"];
- if(o!=null)
- Text = (string)o;
- }
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- if(ImageUrl.Length > 0)
- {
- Image img = new Image();
- img.ImageUrl = ResolveUrl(ImageUrl);
- if(ToolTip.Length > 0)
- img.ToolTip = ToolTip;
- if(Text.Length > 0)
- img.AlternateText = Text;
- img.RenderControl(writer);
- return;
- }
- if(HasControls())
- {
- base.RenderControl(writer);
- return;
- }
- writer.Write(Text);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs
deleted file mode 100644
index a74409bac97..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: HyperLinkColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 5%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class HyperLinkColumn: DataGridColumn
- {
- PropertyDescriptor textFieldDescriptor;
- PropertyDescriptor urlFieldDescriptor;
-
- public HyperLinkColumn(): base()
- {
- }
-
- public virtual string DataNavigateUrlField
- {
- get
- {
- object o = ViewState["DataNavigateUrlField"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataNavigateUrlField"] = value;
- }
- }
-
- public virtual string DataNavigateUrlFormatString
- {
- get
- {
- object o = ViewState["DataNavigateUrlFormatString"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataNavigateUrlFormatString"] = value;
- }
- }
-
- public virtual string DataTextField
- {
- get
- {
- object o = ViewState["DataTextField"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextField"] = value;
- }
- }
-
- public virtual string DataTextFormatString
- {
- get
- {
- object o = ViewState["DataTextFormatString"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextFormatString"] = value;
- }
- }
-
- public virtual string NavigateUrl
- {
- get
- {
- object o = ViewState["NavigateUrl"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["NavigateUrl"] = value;
- }
- }
-
- public virtual string Target
- {
- get
- {
- object o = ViewState["Target"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Target"] = value;
- }
- }
-
- public virtual string Text
- {
- get
- {
- object o = ViewState["Text"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- public override void Initialize()
- {
- textFieldDescriptor = null;
- urlFieldDescriptor = null;
- }
-
- public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType):
- InitializeCell(cell, columnIndex, itemType)
- {
- if(Enum.IsDefined(ListItemType, itemType) && itemType != ListItemType.Footer)
- {
- HyperLink toDisplay = new HyperLink();
- toDisplay.Text = Text;
- toDisplay.NavigateUrl = NavigateUrl;
- toDisplay.DataNavigateUrlField = DataNavigateUrlField;
- toDisplay.Target = Target;
- if(DataTextField.Length > 0)
- {
- toDisplay.DataBinding += new EventHandler(OnDataBindHyperLinkColumn);
- }
- cell.Controls.Add(toDisplay);
- }
- }
-
- private void OnDataBindHyperLinkColumn(object sender, EventArgs e)
- {
- HyperLink link = (HyperLink)sender;
- object item = ((DataGridItem)link.NamingContainer).DataItem;
- if(textFieldDescriptor == null && urlFieldDescriptor == null)
- {
- textFieldDescriptor = TypeDescriptor.GetProperties(item).Find(DataTextField, true);
- if(textFieldDescriptor == null && !DesignMode)
- throw new HttpException(HttpRuntime.FormatResourceString("Field_Not_Found", DataTextField));
- urlFieldDescriptor = TypeDescriptor.GetProperties(item).Find(DataNavigateUrlField, true);
- if(urlFieldDescriptor == null && !DesignMode)
- throw new HttpException(HttpRuntime.FormatResourceString("Field_Not_Found", DataNavigateUrlField));
- }
-
- if(textFieldDescritor != null)
- {
- link.Text = FormatDataTextValue(textFieldDescritor.GetValue(item));
- } else
- {
- link.Text = "Sample_DataBound_Text";
- }
-
- if(urlFieldDescriptor != null)
- {
- link.NavigateUrl = FormatDataNavigateUrlValue(urlFieldDescriptor.GetValue(item));
- } else
- {
- link.NavigateUrl = "url";
- }
- }
-
- protected virtual string FormatDataNavigateUrlValue(object dataUrlValue)
- {
- string retVal = String.Empty;
- if(dataUrlValue != null)
- {
- if(DataNavigateUrlFormatString.Length > 0)
- {
- retVal = String.Format(DataNavigateUrlFormatString, dataUrlValue);
- } else
- {
- retVal = dataUrlValue.ToString();
- }
- }
- return retVal;
- }
-
- protected virtual string FormatDataTextValue(object dataTextValue)
- {
- string retVal = String.Empty;
- if(dataUrlValue != null)
- {
- if(DataTextFormatString.Length > 0)
- {
- retVal = String.Format(DataTextFormatString, dataTextValue);
- } else
- {
- retVal = dataTextValue.ToString();
- }
- }
- return retVal;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkControlBuilder.cs
deleted file mode 100644
index cca04d06622..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkControlBuilder.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: HyperLinkControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-namespace System.Web.UI.WebControls
-{
- public class HyperLinkControlBuilder : ControlBuilder
- {
- public HyperLinkControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs
deleted file mode 100755
index 47526f80d8e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Interface: IRepeatInfoUser
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public interface IRepeatInfoUser
- {
- bool HasFooter { get; }
- bool HasHeader { get; }
- bool HasSeparators { get; }
- int RepeatedItemCount { get; }
- void RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer);
- Style GetItemStyle(ListItemType itemType, int repeatIndex);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Image.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Image.cs
deleted file mode 100644
index e3eafde6514..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Image.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Image
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class Image : WebControl
- {
- public Image(): base(HtmlTextWriterTag.Img)
- {
- }
-
- public virtual string AlternateText
- {
- get
- {
- object o = ViewState["AlternateText"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["AlternateText"] = value;
- }
- }
-
- public override bool Enabled
- {
- get
- {
- return base.Enabled;
- }
- set
- {
- base.Enabled = value;
- }
- }
-
- public override FontInfo Font
- {
- get
- {
- return base.Font;
- }
- }
-
- public virtual ImageAlign ImageAlign
- {
- get
- {
- object o = ViewState["ImageAlign"];
- if(o!=null)
- return (ImageAlign)o;
- return ImageAlign.NotSet;
- }
- set
- {
- ViewState["ImageAlign"] = value;
- }
- }
-
- public virtual string ImageUrl
- {
- get
- {
- object o = ViewState["ImageUrl"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["ImageUrl"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer): AddAttributesToRender(writer)
- {
- if(ImageUrl.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Src, ResolveUrl(ImageUrl));
- }
- if(AlternateText.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Alt, AlternateText);
- }
- if(BorderWidth.IsEmpty)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
- }
- if(ImageAlign != ImageAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Align, Enum.Format(typeof(ImageAlign), ImageAling, "G"));
- }
- }
-
- protected override void RenderContents(HtmlTextWriterAttribute)
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs
deleted file mode 100755
index ef096f576cb..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ImageAlign
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ImageAlign
- {
- NotSet,
- Left,
- Right,
- BaseLine,
- Top,
- Middle,
- Bottom,
- AbsBottom,
- AbsMiddle,
- TextTop
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs
deleted file mode 100644
index 04c4dffd59c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs
+++ /dev/null
@@ -1,179 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ImageButton
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ImageButton: Image, IPostBackDataHandler, IPostBackEventHandler
- {
- private static readonly object ClickEvent = new object();
- private static readonly object CommandEvent = new object();
-
- private int x, y;
-
- public ImageButton(): base()
- {
- }
-
- public bool CausesValidation
- {
- get
- {
- object o = ViewState["CausesValidation"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["CausesValidation"] = value;
- }
- }
-
- public string CommandArgument
- {
- get
- {
- object o = ViewState["CommandArgument"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["CommandArgument"] = value;
- }
- }
-
- public string CommandName
- {
- get
- {
- object o = ViewState["CommandName"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["CommandName"] = value;
- }
- }
-
- protected override HtmlTextWriterTag TagKey
- {
- get
- {
- return HtmlTextWriterTag.Input;
- }
- }
-
- public event ImageClickEventHandler Click
- {
- add
- {
- Events.AddHandler(ClickEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ClickEvent, value);
- }
- }
-
- public event CommandEventHandler Command
- {
- add
- {
- Events.AddHandler(CommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(CommandEvent, value);
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Type, "image");
- writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID);
- if(Page != null && CausesValidation)
- {
- if(Page.Validators.Count > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.OnClick, Utils.GetClientValidatedEvent());
- writer.AddAttribute("language", "javascript");
- }
- }
- AddAttributesToRender(writer);
- }
-
- protected virtual void OnClick(ImageClickEventArgs e)
- {
- if(Events != null)
- {
- ImageClickEventHandler iceh = (ImageClickEventHandler)(Events[ImageClickEvent]);
- if(iceh != null)
- iceh(this, e);
- }
- }
-
- protected virtual void OnCommand(CommandEventArgs e)
- {
- if(Events != null)
- {
- CommandEventHandler ceh = (CommandEventHandler)(Events[CommandEvent]);
- if(ceh != null)
- ceh(this, e);
- RaiseBubbleEvent(this, e);
- }
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- if(Page != null)
- {
- Page.RequiresPostBack(this);
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- string xCoord = postCollection[UniqueID + ".x"];
- string yCoord = postCollection[UniqueID + ".y"];
- if(xCoord != null && yCoord != null && xCoord.Length > 0 && yCoord.Length > 0)
- {
- x = Int32.Parse(xCoord);
- y = Int32.Parse(yCoord);
- Page.RegisterRequiresRaiseEvent(this);
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- }
-
- void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
- {
- if(CausesValidation)
- Page.Validate();
- OnClick(new ImageClickEventArgs(x, y));
- OnCommand(new CommandEventArgs(CommandName, CommandArgument));
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Label.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Label.cs
deleted file mode 100644
index 9cc75abd663..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Label.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Label
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public class Label : WebControl
- {
- public Label(): base()
- {
- }
-
- internal Label(HtmlTextWriterTag tagKey): base(tagKey)
- {
- }
-
- public virtual string Text
- {
- get
- {
- object o = ViewState["Text"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(HasControls())
- {
- AddParsedSubObject(obj);
- return;
- }
- if(obj is LiteralControl)
- {
- Text = ((LiteralControl)obj).Text;
- return;
- }
- if(Text.Length > 0)
- {
- AddParsedSubObject(Text);
- Text = String.Empty;
- }
- AddParsedSubObject(obj);
- }
-
- protected override void LoadViewState(object savedState)
- {
- if(savedState != null)
- {
- base.LoadViewState(savedState);
- string savedText = (string)ViewState["Text"];
- if(savedText != null)
- Text = savedText;
- }
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- if(HasControls())
- {
- RenderContents(writer);
- } else
- {
- writer.Write(Text);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LabelControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LabelControlBuilder.cs
deleted file mode 100644
index 5ef512cd092..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/LabelControlBuilder.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: LabelControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public class LabelControlBuilder : ControlBuilder
- {
- public LabelControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs
deleted file mode 100644
index 23b93775ae8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: LinkButton
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class LinkButton : WebControl, IPostBackEventHandler
- {
- private static readonly object ClickEvent = new object();
- private static readonly object CommandEvent = new object();
-
- public LinkButton(): base(HtmlTextWriterTag.A)
- {
- }
-
- public bool CausesValidation
- {
- get
- {
- object o = ViewState["CausesValidation"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["CausesValidation"] = value;
- }
- }
-
- public string CommandArgument
- {
- get
- {
- object o = ViewState["CommandArgument"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["CommandArgument"] = value;
- }
- }
-
- public string CommandName
- {
- get
- {
- object o = ViewState["CommandName"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["CommandName"] = value;
- }
- }
-
- public event EventHandler Click
- {
- add
- {
- Events.AddHandler(ClickEvent, this);
- }
- remove
- {
- Events.RemoveHandler(ClickEvent, this);
- }
- }
-
- public event CommandEventHandler Command
- {
- add
- {
- Events.AddHandler(CommandEvent, this);
- }
- remove
- {
- Events.RemoveHandler(CommandEvent, this);
- }
- }
-
- protected virtual void OnClick(EventArgs e)
- {
- if(Events != null)
- {
- EventHandler eh = (EventHandler)(Events[ClickEvent]);
- if(eh != null)
- eh(this, e);
- }
- }
-
- protected virtual void OnCommand(CommandEventArgs e)
- {
- if(Events != null)
- {
- CommandEventHandler ceh = (CommandEventHandler)(Events[CommandEvent]);
- if(ceh != null)
- ceh(this, e);
- }
- }
-
- void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
- {
- if(CausesValidation)
- {
- Page.Validate();
- }
- OnClick(new EventArgs());
- OnCommand( new CommandEventArgs(CommandName, CommandArgument));
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(Enabled && Page != null)
- {
- if(CausesValidation && Page.Validators.Count > 0)
- {
- writer.Write(HtmlTextWriterAttribute.Href, "javscript:" + Utils.GetClientValidatedPostBack(this));
- return;
- }
- writer.Write(HtmlTextWriterAttribute.Href, GetPostBackClientHyperlink(this, ""));
- }
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(HasControls())
- {
- AddParsedSubObject(obj);
- return;
- }
- if(obj is LiteralControl)
- {
- Text = ((LiteralControl)obj).Text;
- return;
- }
- if(Text.Length > 0)
- {
- AddParsedSubObject(Text);
- Text = String.Empty;
- }
- AddParsedSubObject(obj);
- }
-
- protected override void LoadViewState(object savedState)
- {
- if(savedState != null)
- {
- base.LoadViewState(savedState);
- string savedText = (string)ViewState["Text"];
- if(savedText != null)
- Text = savedText;
- }
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- if(HasControls())
- {
- RenderContents(writer);
- return;
- }
- writer.Write(Text);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonControlBuilder.cs
deleted file mode 100644
index cfb8a69b986..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonControlBuilder.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: LinkButtonControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class LinkButtonControlBuilder : ControlBuilder
- {
- public LinkButtonControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs
deleted file mode 100644
index 0bea2ae0997..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListBox
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections.Specialized;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ListBox : ListControl, IPostBackDataHandler
- {
- public ListBox(): base()
- {
- }
-
- public override Color BorderColor
- {
- get
- {
- return BorderColor;
- }
- set
- {
- BorderColor = value;
- }
- }
-
- public override BorderStyle BorderStyle
- {
- get
- {
- return BorderStyle;
- }
- set
- {
- BorderStyle = value;
- }
- }
-
- public override Unit BorderWidth
- {
- get
- {
- return BorderWidth;
- }
- set
- {
- BorderWidth = value;
- }
- }
-
- public virtual int Rows
- {
- get
- {
- object o = ViewState["Rows"];
- if(o != null)
- return (int)o;
- return 4;
- }
- set
- {
- if(value < 1 || value > 2000)
- {
- throw new ArgumentOutOfRangeException();
- }
- ViewState["Rows"] = value;
- }
- }
-
- public virtual ListSelectionMode SelectionMode
- {
- get
- {
- object o = ViewState["SelectionMode"];
- if(o != null)
- return (ListSelectionMode)o;
- return ListSelectionMode.Single;
- }
- set
- {
- if(!Enum.IsDefined(typeof(ListSelectionMode), value))
- {
- throw new ArgumentException();
- }
- ViewState["SelectionMode"] = value;
- }
- }
-
- public override string ToolTip
- {
- get
- {
- return String.Empty;
- }
- set
- {
- // Don't do anything.
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- if(Page != null)
- {
- Page.VerifyRenderingInServerForm(this);
- }
- writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID);
- writer.AddAttribute(HtmlTextWriterAttribute.Size, Rows.ToString(NumberFormatInfo.InvariantInfo);
- writer.AddAttribute(HtmlTextWriterAttribute.Multiple, "multiple");
- if(AutoPostBack && Page != null)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Onchange, Page.GetPostBackClientEvent(""));
- writer.AddAttribute("language", "javascript");
- }
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- base.OnPreRender(e);
- if(Page != null && SelectionMode == ListSelectionMode.Multiple && Enabled)
- {
- Page.RegisterRequiresPostBack(this);
- }
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- bool isMultAllowed = (SelectionMode == ListSelectionMode.Multiple);
- bool selMade = false;
- foreach(ListItem current in Items)
- {
- writer.WriteBeginTag("option");
- if(current.Selected)
- {
- if(!isMultAllowed && selMade)
- {
- throw new HttpException("Cannnot_MutliSelect_In_Single_Mode");
- }
- selMade = true;
- writer.WriteAttribute("selected", "selected");
- }
- writer.WriteAttribute("value", current.Value, true);
- writer.Write('>');
- writer.Write(HttpUtility.Encode(Text));
- writer.WriteEndTag("option");
- writer.WriteLine();
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- string[] vals = postCollection.GetValues(postDataKey);
- bool updated = false;
- ArrayList selected = SelectedIndices;
- ArrayList final = new ArrayList(vals.Length);
- if(vals != null)
- {
- if(SelectionMode == ListSelectionMode.Single)
- {
- int index = Items.FindByValueInternal(vals[0]);
- if(SelectedIndex != index)
- {
- SelectedIndex = index;
- updated = true;
- }
- } else
- {
- foreach(string current in vals)
- {
- final.Add(Items.FindByValueInternal(current);
- }
- if(selected != null && selected.Count == vals.Length)
- {
- for(int ctr = 0; ctr < vals.Length; ctr++)
- {
- if(((int)final[ctr]) != ((int)selected[ctr]))
- {
- updated = true;
- break;
- }
- }
- } else
- {
- updated = true;
- }
- }
- if(!updated)
- {
- SelectInternal(final);
- }
- } else
- {
- if(SelectedIndex != -1)
- SelectedIndex = -1;
- updated = true;
- }
- return updated;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- OnSelectedIndexChanged(EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
deleted file mode 100644
index 70102bc9e37..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
+++ /dev/null
@@ -1,326 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListControl
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-using System.Web.Utils;
-
-namespace System.Web.UI.WebControls
-{
- public class ListControl: WebControl
- {
- private static readonly object SelectedIndexChangedEvent = new object();
-
- private object dataSource;
- private ListItemCollection items;
-
- private int cachedSelectedIndex = -1;
-
- public ListControl(): base(HtmlTextWriterTag.Select)
- {
- }
-
- public event EventHandler SelectedIndexChanged
- {
- add
- {
- Events.AddHandler(SelectedIndexChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(SelectedIndexChangedEvent, value);
- }
- }
-
- public virtual bool AutoPostBack
- {
- get
- {
- object o = ViewState["AutoPostBack"];
- if(o!=null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AutoPostBack"] = value;
- }
- }
-
- public virtual string DataMember
- {
- get
- {
- object o = ViewState["DataMember"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataMember"] = value;
- }
- }
-
- public virtual object DataSource
- {
- get
- {
- return dataSource;
- }
- set
- {
- if(value != null)
- {
- if(value is IListSource || value is IEnumerable)
- {
- dataSource = value;
- return;
- }
- }
- throw new ArgumentException(HttpRuntime.FormatResourceString(ID, "Invalid DataSource Type"));
- }
- }
-
- public virtual string DataTextField
- {
- get
- {
- object o = ViewState["DataTextField"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextField"] = value;
- }
- }
-
- public virtual string DataTextFormatString
- {
- get
- {
- object o = ViewState["DataTextFormatString"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextFormatString"] = value;
- }
- }
-
- public virtual string DataValueField
- {
- get
- {
- object o = ViewState["DataValueField"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataValueField"] = value;
- }
- }
-
- public virtual ListItemCollection Items
- {
- get
- {
- if(items==null)
- {
- items = new ListItemCollection();
- if(IsTrackingViewState)
- {
- items.TrackViewState();
- }
- }
- return items;
- }
- }
-
- public virtual int SelectedIndex
- {
- get
- {
- object o = ViewState["SelectedIndex"];
- if(o!=null)
- return (int)o;
- return -1;
- }
- set
- {
- if(value < -1 || value > Items.Count)
- throw new ArgumentOutOfRangeException();
- ViewState["SelectedIndex"] = value;
- }
- }
-
- public virtual ListItem SelectedItem
- {
- get
- {
- if(SelectedIndex > 0)
- {
- return Items[SelectedIndex];
- }
- return null;
- }
- }
-
- internal virtual ArrayList SelectedIndices
- {
- get
- {
- ArrayList si = new ArrayList();
- for(int i=0; i < Items.Count; i++)
- {
- if(Items[i].Selected)
- si.Add(i);
- }
- return si;
- }
- }
-
- internal void Select(ArrayList indices)
- {
- ClearSelection();
- foreach(object intObj in indices)
- {
- int index = (int)intObj;
- if(index >= 0 && index < Items.Count)
- Items[index].Selected = true;
- }
- }
-
- public virtual void ClearSelection()
- {
- for(int i=0; i < Items.Count; i++)
- {
- Items[i].Selected = false;
- }
- }
-
- protected override void LoadViewState(object savedState)
- {
- //Order: BaseClass, Items (Collection), Indices
- if(savedState != null && savedState is Triplet)
- {
- Triplet state = (Triplet)savedState;
- base.LoadViewState(state.First);
- Items.LoadViewState(state.Second);
- object indices = state.Third;
- if(indices != null)
- {
- Select((ArrayList)indices);
- }
- }
- }
-
- protected override void OnDataBinding(EventArgs e)
- {
- base.OnDataBinding(e);
- IEnumerable resolvedDataSource = DataSourceHelper.GetResolvedDataSource(DataSource, DataMember);
- if(resolvedDataSource != null)
- {
- string dataTextField = DataTextField;
- string dataValueField = DataValueField;
- Items.Clear();
- ICollection rdsCollection = (ICollection)resolvedDataSource;
- if(rdsCollection != null)
- {
- Items.Capacity = rdsCollection.Count;
- }
- bool valid = ( (dataTextField.Length >= 0) && (dataValueField.Length >=0) );
- foreach(IEnumerable current in resolvedDataSource)
- {
- ListItem li = new ListItem();
- if(valid)
- {
- if(dataTextField.Length >= 0)
- {
- li.Text = DataBinder.GetPropertyValue(current, dataTextField, null);
- }
- if(dataValueField.Length >= 0)
- {
- li.Value = DataBinder.GetPropertyValue(current, dataValueField, null);
- }
- } else
- {
- li.Text = dataTextField.ToString();
- li.Value = dataValueField.ToString();
- }
- Items.Add(li);
- }
- }
- if(cachedSelectedIndex != -1)
- {
- SelectedIndex = cachedSelectedIndex;
- cachedSelectedIndex = -1;
- }
- }
-
- protected virtual void OnSelectedIndexChanged(EventArgs e)
- {
- if(Events!=null)
- {
- EventHandler eh = (EventHandler)(Events[SelectedIndexChangedEvent]);
- if(eh!=null)
- eh(this, e);
- }
- }
-
- protected override object SaveViewState()
- {
- //Order: BaseClass, Items (Collection), Indices
- object vs = base.SaveViewState();
- object itemSvs = Items.SaveViewState();
- object indices = null;
- if(SaveSelectedIndicesViewState)
- indices = SelectedIndices;
- if(vs!= null && itemSvs != null && indices != null)
- {
- return new Triplet(vs, itemSvs, indices);
- }
- return null;
- }
-
- protected override void TrackViewState()
- {
- base.TrackViewState();
- Items.TrackViewState();
- }
-
- private bool SaveSelectedIndicesViewState
- {
- get
- {
- if( Events[SelectedIndexChangedEvent] != null && Enabled && Visible)
- {
- Type t = GetType();
- // If I am a derivative, let it take of storing the selected indices.
- if(t == typeof(DropDownList) || t == typeof(ListBox) || t == typeof(CheckBoxList) || t == typeof(RadioButtonList))
- return false;
- }
- return true;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs
deleted file mode 100644
index f5724127fca..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs
+++ /dev/null
@@ -1,249 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListItem
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class ListItem : IStateManager, IParserAccessor, IAttributeAccessor
- {
- private static int MARKED = (0x01 << 0);
- private static int SELECTED = (0x01 << 1);
- private static int DIRTY_T = (0x01 << 2);
- private static int DIRTY_V = (0x01 << 3);
-
- private static int selBits;
-
- private AttributeCollection attributes;
- private string text;
- private string val;
-
- public ListItem(string text, string value)
- {
- this.text = text;
- this.val = value;
- selBits = 0x00;
- attributes = null;
- }
-
- public ListItem(string text): this(text, null)
- {
- }
-
- public ListItem(): this(null, null)
- {
- }
-
- public static ListItem FromString(string text)
- {
- return new ListItem(text);
- }
-
- public AttributeCollection Attributes
- {
- get
- {
- if(attributes == null)
- attributes = new AttributeCollection(new StateBag(true));
- return attributes;
- }
- }
-
- public bool Selected
- {
- get
- {
- return IsSet(SELECTED);
- }
- set
- {
- Set(SELECTED);
- }
- }
-
- internal bool Dirty
- {
- get
- {
- return (IsSet(DIRTY_T) && IsSet(DIRTY_V));
- }
- set
- {
- Set(DIRTY_T);
- Set(DIRTY_V);
- }
- }
-
- private bool IsSet(int bit)
- {
- return ( (selBits & bit) != 0x00 );
- }
-
- private void Set(int bit)
- {
- selBits |= bit;
- }
-
- public string Text
- {
- get
- {
- if(text!=null)
- {
- return text;
- }
- if(val!=null)
- {
- return val;
- }
- return String.Empty;
- }
- set
- {
- text = value;
- if(IsTrackingViewState)
- {
- Set(DIRTY_T);
- }
- }
- }
-
- public string Value
- {
- get
- {
- if(val!=null)
- {
- return val;
- }
- if(text!=null)
- {
- return text;
- }
- return String.Empty;
- }
- set
- {
- val = value;
- if(IsTrackingViewState)
- {
- Set(DIRTY_V);
- }
- }
- }
-
- string IAttributeAccessor.GetAttribute(string key)
- {
- return attributes[key];
- }
-
- void IAttributeAccessor.SetAttribute(string key, string value)
- {
- attributes[key] = value;
- }
-
- /// <remarks>
- /// The data is parsed - object must be of type LiteralControl or DataBoundLiteralControl.
- /// In latter case, throw an exception telling that the data cannot be bind-ed.
- /// </remarks>
- void IParserAccessor.AddParsedSubObject(object obj)
- {
- if(obj is LiteralControl)
- {
- Text = ((LiteralControl)obj).Text;
- return;
- }
- if(obj is DataBoundLiteralControl)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Control_Cannot_DataBind","ListItem"));
- }
- throw new HttpException(HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "ListItem", obj.GetType().ToString()));
- }
-
- internal bool IsTrackingViewState
- {
- get
- {
- return IsSet(MARKED);
- }
- }
-
- internal void TrackViewState()
- {
- Set(MARKED);
- }
-
- internal void LoadViewState(object state)
- {
- if(state is Pair)
- {
- Pair tv = (Pair)state;
- if(tv.First!=null)
- {
- Text = (string)tv.First;
- }
- if(tv.Second!=null)
- {
- Value = (string)tv.Second;
- }
- }
- if(state is string)
- {
- Text = (string)state;
- }
- }
-
- internal object SaveViewState()
- {
- if(IsSet(DIRTY_T) && IsSet(DIRTY_V))
- {
- return new Pair(Text, Value);
- }
- if(IsSet(DIRTY_T))
- {
- return Text;
- }
- if(IsSet(DIRTY_V))
- {
- return new Pair(null, Value);
- }
- return null;
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get
- {
- return IsTrackingViewState;
- }
- }
-
- void IStateManager.TrackViewState()
- {
- TrackViewState();
- }
-
- object IStateManager.SaveViewState()
- {
- return SaveViewState();
- }
-
- void IStateManager.LoadViewState(object state)
- {
- LoadViewState(state);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListItemCollection.cs
deleted file mode 100644
index f171f736a82..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemCollection.cs
+++ /dev/null
@@ -1,362 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListItemCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ListItemCollection : IList, ICollection, IEnumerable, IStateManager
- {
- private ArrayList items;
- private bool saveAll;
- private bool marked;
-
- public ListItemCollection()
- {
- items = new ArrayList();
- saveAll = false;
- marked = false;
- }
-
- public int Capacity
- {
- get
- {
- return items.Capacity;
- }
- set
- {
- items.Capacity = value;
- }
- }
-
- public int Count
- {
- get
- {
- return items.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return items.IsReadOnly;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return items.IsSynchronized;
- }
- }
-
- public ListItem this[int index]
- {
- get
- {
- if(index < 0 || index >= Count)
- return null;
- return (ListItem)(items[index]);
- }
- set
- {
- if(index >= 0 && index < Count)
- items[index] = value;
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public void Add(ListItem item)
- {
- items.Add(item);
- if(marked)
- item.Dirty = true;
- }
-
- public void Add(string item)
- {
- Add(new ListItem(item));
- }
-
- public void AddRange(ListItem[] items)
- {
- foreach(ListItem item in items)
- {
- if(item!=null)
- Add(item);
- }
- }
-
- public void Clear()
- {
- items.Clear();
- if(marked)
- saveAll = true;
- }
-
- public bool Contains(ListItem item)
- {
- return items.Contains(item);
- }
-
- public void CopyTo(Array array, int index)
- {
- items.CopyTo(array, index);
- }
-
- public ListItem FindByText(string text)
- {
- int i=-1;
- foreach(object current in items)
- {
- i++;
- if(((ListItem)current).Text == text)
- break;
- }
- return (i==-1 ? null : (ListItem)items[i]);
- }
-
- public ListItem FindByValue(string value)
- {
- foreach(ListItem current in items)
- {
- if(current.Value == value)
- {
- return current;
- }
- }
- return null;
- }
-
- internal int FindByValueInternal(string value)
- {
- int i = -1;
- foreach(ListItem current in items)
- {
- i++;
- if(current.Value == value)
- {
- return i;
- }
- }
- return -1;
- }
-
- public IEnumerator GetEnumerator()
- {
- return items.GetEnumerator();
- }
-
- public int IndexOf(ListItem item)
- {
- return items.IndexOf(item);
- }
-
- public void Insert(int index, ListItem item)
- {
- items.Insert(index, item);
- if(marked)
- saveAll = true;
- }
-
- public void Insert(int index, string item)
- {
- Insert(index, new ListItem(item));
- }
-
- public void RemoveAt(int index)
- {
- if(index < 0 || index >= items.Count)
- return;
- items.RemoveAt(index);
- if(marked)
- saveAll = true;
- }
-
- public void Remove(ListItem item)
- {
- RemoveAt(IndexOf(item));
- }
-
- public void Remove(string item)
- {
- RemoveAt(IndexOf(ListItem.FromString(item)));
- }
-
- internal object SaveViewState()
- {
- if(saveAll)
- {
- string[] keys = new string[Count];
- string[] vals = new string[Count];
- for(int i=0; i < Count; i++)
- {
- keys[i] = this[i].Text;
- vals[i] = this[i].Value;
- }
- return new Triplet(Count, keys, vals);
- }
- ArrayList indices = new ArrayList();
- ArrayList states = new ArrayList();
- object o;
- for(int i=0; i < Count; i++)
- {
- o = this[i].SaveViewState();
- if(o!=null)
- {
- indices.Add(i);
- states.Add(o);
- }
- }
- if(indices.Count > 0)
- return new Pair(indices, states);
- return null;
- }
-
- internal void LoadViewState(object savedState)
- {
- if(savedState!=null)
- {
- if(savedState is Pair)
- {
- ArrayList indices = (ArrayList)(((Pair)savedState).First);
- ArrayList states = (ArrayList)(((Pair)savedState).Second);
- for(int i=0; i < indices.Count; i++)
- {
- if( (int)indices[i] < Count )
- this[i].LoadViewState(states[i]);
- else
- {
- ListItem temp = new ListItem();
- temp.LoadViewState(states[i]);
- Add(temp);
- }
- }
- }
- if(savedState is Triplet)
- {
- Triplet t = (Triplet)savedState;
- items = new ArrayList((int)t.First);
- saveAll = true;
- string[] text = (string[])t.Second;
- string[] vals = (string[])t.Third;
- for(int i=0; i < text.Length; i++)
- items.Add(new ListItem(text[i], vals[i]));
- }
- }
- }
-
- internal void TrackViewState()
- {
- marked = true;
- foreach(ListItem current in this)
- current.TrackViewState();
- }
-
- bool IList.IsFixedSize
- {
- get
- {
- return false;
- }
- }
-
- object IList.this[int index]
- {
- get
- {
- return this[index];
- }
- set
- {
- if(value is ListItem)
- {
- this[index] = (ListItem)value;
- }
- }
- }
-
- int IList.Add(object item)
- {
- int index = (item is ListItem ? items.Add((ListItem)item) : -1);
- if(index!=-1 && marked)
- ((ListItem)item).Dirty = true;
- return index;
- }
-
- bool IList.Contains(object item)
- {
- if(item is ListItem)
- return Contains((ListItem)item);
- return false;
- }
-
- int IList.IndexOf(object item)
- {
- if(item is ListItem)
- return IndexOf((ListItem)item);
- return -1;
- }
-
- void IList.Insert(int index, object item)
- {
- if(item is ListItem)
- Insert(index, (ListItem)item);
- }
-
- void IList.Remove(object item)
- {
- if(item is string)
- Remove((string)item);
- if(item is ListItem)
- Remove((ListItem)item);
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get
- {
- return marked;
- }
- }
-
- void IStateManager.LoadViewState(object state)
- {
- LoadViewState(state);
- }
-
- object IStateManager.SaveViewState()
- {
- return SaveViewState();
- }
-
- void IStateManager.TrackViewState()
- {
- TrackViewState();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListItemControlBuilder.cs
deleted file mode 100644
index 16c60a196a7..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemControlBuilder.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListItemControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ListItemControlBuilder : ControlBuilder
- {
- public ListItemControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
-
- public override bool HtmlDecodeLiterals()
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs
deleted file mode 100755
index 3d45e73693a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ListItemType
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ListItemType
- {
- Header,
- Footer,
- Item,
- AlternatingItem,
- SelectedItem,
- EditItem,
- Separator,
- Pager
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs
deleted file mode 100755
index f7c7967356c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ListSelectionMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ListSelectionMode
- {
- Single,
- Multiple
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Literal.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Literal.cs
deleted file mode 100644
index 49a7fad8a8f..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Literal.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Literal
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class Literal : Control
- {
- public Literal(): base()
- {
- }
-
- public string Text
- {
- get
- {
- object o = ViewState["Text"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- protected override ControlCollection CreateControlCollection()
- {
- return new EmptyControlCollection(this);
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(obj is LiteralControl)
- {
- Text = ((LiteralControl)obj).Text;
- return;
- }
- throw new HttpException(HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "Literal", obj.GetType().Name.ToString()));
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- if(Text.Length > 0)
- {
- writer.Write(Text);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LiteralControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LiteralControlBuilder.cs
deleted file mode 100644
index 75dcb77192a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/LiteralControlBuilder.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: LiteralControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class LiteralControlBuilder : ControlBuilder
- {
- public LiteralControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
-
- public override void AppendSubBuilder(ControlBuilder subBuilder)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Control_does_not_allow_children",(typeof(Literal)).ToString()));
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs
deleted file mode 100644
index 99a7a27157e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void MonthChangedEventHandler(object sender, MonthChangedEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs b/mcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs
deleted file mode 100755
index 91d6cf3003b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: NextPrevFormat
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum NextPrevFormat
- {
- CustomText,
- ShortMonth,
- FullMonth
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs
deleted file mode 100755
index 5f99cee5773..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: PagerMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum PagerMode
- {
- NextPrev,
- NumericPages
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs
deleted file mode 100755
index 2ad9b466413..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: PagerPosition
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum PagerPosition
- {
- Bottom,
- Top,
- TopAndBottom
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Panel.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Panel.cs
deleted file mode 100644
index 0a61d8802ce..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Panel.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Panel
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class Panel: WebControl
- {
- public Panel(): base(HtmlTextWriterTag.Div)
- {
- }
-
- public virtual string BackImageUrl
- {
- get
- {
- object o = ViewState["BackImageUrl"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["BackImageUrl"] = value;
- }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- object o = ViewState["HorizontalAlign"];
- if(o != null)
- return (HorizontalAlign)o;
- return HorizontalAlign.NotSet;
- }
- set
- {
- if(!Enum.IsDefined(typeof(HorizontalAlign), value))
- {
- throw new ArgumentException();
- }
- ViewState["HorizontalAlign"] = value;
- }
- }
-
- public virtual bool Wrap
- {
- get
- {
- object o = ViewState["Wrap"];
- if(o != null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["Wrap"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- AddAttributesToRender(writer);
- if(BackImageUrl.Length > 0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundImage, "url(" + ResolveUrl(BackImageUrl) + ")");
- }
- if(HorizontalAlign != HorizontalAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Align, TypeDescriptor.GetConverter(typeof(HorizontalAlign)).ConvertToString(HorizontalAlign));
- }
- if(Wrap)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.NoWrap, "nowrap");
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolder.cs
deleted file mode 100644
index c800f4a383e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolder.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: PlaceHolder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class PlaceHolder : Control
- {
- public PlaceHolder(): base()
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolderControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolderControlBuilder.cs
deleted file mode 100644
index 3bbd68c6d22..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolderControlBuilder.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: PlaceHolderControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class PlaceHolderControlBuilder : ControlBuilder
- {
- public PlaceHolderControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs
deleted file mode 100644
index 582729ff1f1..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RadioButton
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class RadioButton: CheckBox, IPostBackDataHandler
- {
- public RadioButton(): base()
- {
- }
-
- public virtual string GroupName
- {
- get
- {
- object o = ViewState["GroupName"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["GroupName"] = value;
- }
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- base.OnPreRender(e);
- if(Page != null && Enabled && !Checked)
- {
- Page.RegisterRequiresPostBack(this);
- }
- if(GroupName.Length == 0)
- {
- GroupName = UniqueID;
- }
- }
-
- internal override void RenderInputTag(HtmlTextWriter writer, string id)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Id, id);
- writer.AddAttribute(HtmlTextWriterAttribute.Type, "radio");
- writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueGroupNamePrivate);
- writer.AddAttribute(HtmlTextWriterAttribute.Value, ValueAttributePrivate);
-
- if(Checked)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked");
- }
- if(AutoPostBack)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.OnClick, Page.GetPostBackClientEvent(this, ""));
- writer.AddAttribute("language", "javascript");
- }
-
- if(AccessKey.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, AccessKey);
- }
-
- if(TabIndex > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Tabindex, TabIndex.ToString(NumberFormatInfo.InvariantInfo))
- }
-
- writer.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Input);
- writer.RenderEndTag();
- }
-
- private string UniqueGroupNamePrivate
- {
- get
- {
- string retVal = GroupName;
- if(UniqueID.LastIndexOf(":") >= 0)
- {
- retVal += UniqueID.Substring(UniqueID.LastIndexOf(":") + 1);
- }
- return retVal;
- }
- }
-
- private string ValueAttributePrivate
- {
- get
- {
- string retVal = Attributes["value"];
- if(retVal == null)
- {
- retVal = ID;
- }
- if(retVal == null)
- {
- retVal = UniqueID;
- }
- return retVal;
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- if(postCollection[UniqueGroupNamePrivate] != null && postCollection[UniqueGroupNamePrivate] == ValueAttributePrivate)
- {
- if(!Checked)
- {
- Checked = true;
- }
- return true;
- }
- if(Checked)
- {
- Checked = false;
- }
- return true;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- OnCheckChanged(EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButtonList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RadioButtonList.cs
deleted file mode 100644
index 8eef69a5468..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButtonList.cs
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RadioButtonList
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 95%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections.Specialized;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class RadioButtonList : ListControl, IRepeatInfoUser, INamingContainer, IPostBackDataHandler
- {
- private bool selectionIndexChanged;
- private int tabIndex;
-
- public RadioButtonList(): base()
- {
- selectionIndexChanged = false;
- }
-
- public virtual int CellPadding
- {
- get
- {
- if(ControlStyleCreated)
- return (int)(((TableStyle)ControlStyle).CellPadding);
- }
- set
- {
- ((TableStyle)ControlStyle).CellPadding = value;
- }
- }
-
- public virtual int CellSpacing
- {
- get
- {
- if(ControlStyleCreated)
- return (int)(((TableStyle)ControlStyle).CellSpacing);
- }
- set
- {
- ((TableStyle)ControlStyle).CellSpacing = value;
- }
- }
-
- public virtual int RepeatColumns
- {
- get
- {
- object o = ViewState["RepeatColumns"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException("value");
- ViewState["RepeatColumns"] = value;
- }
- }
-
- public virtual RepeatDirection RepeatDirection
- {
- get
- {
- object o = ViewState["RepeatDirection"];
- if(o != null)
- return (RepeatDirection)o;
- return RepeatDirection.Vertical;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatDirection), value))
- throw new ArgumentException();
- ViewState["RepeatDirection"] = value;
- }
- }
-
- public virtual RepeatLayout RepeatLayout
- {
- get
- {
- object o = ViewState["RepeatLayout"];
- if(o != null)
- return (RepeatLayout)o;
- return RepeatLayout.Table;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatLayout), value))
- throw new ArgumentException();
- ViewState["RepeatLayout"] = value;
- }
- }
-
- public virtual TextAlign TextAlign
- {
- get
- {
- object o = ViewState["TextAlign"];
- if(o != null)
- return (TextAlign)o;
- return TextAlign.Right;
- }
- set
- {
- if(!Enum.IsDefined(typeof(TextAlign), value))
- throw new ArgumentException();
- ViewState["TextAlign"] = value;
- }
- }
-
- protected override Style CreateControlStyle()
- {
- return new TableStyle(ViewState);
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- RepeatInfo info = new RepeatInfo();
- Style cStyle = (ControlStyleCreated ? ControlStyle : null);
- bool dirty = false;
- tabIndex = TabIndex;
- if(tabIndex != 0)
- {
- dirty = !ViewState.IsItemDirty("TabIndex");
- TabIndex = 0;
- }
- info.RepeatColumns = RepeatColumns;
- info.RepeatDirection = RepeatDirection;
- info.RenderRepeater(writer, this, cStyle, this);
- if(tabIndex != 0)
- {
- TabIndex = tabIndex;
- }
- if(dirty)
- {
- ViewState.SetItemDirty("TabIndex", false);
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- string value = postCollection[postDataKey];
- for(int i=0; i < Items.Count; i++)
- {
- if(Items[i].Value == value)
- {
- if(i != SelectedIndex)
- {
- SelectedIndex = i;
- }
- return true;
- }
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- if(selectionIndexChanged)
- OnSelectedIndexChanged(EventArgs.Empty);
- }
-
- Style IRepeatInfoUser.GetItemStyle(valuetype System.Web.UI.WebControls.ListItemType itemType, int repeatIndex)
- {
- return null;
- }
-
- [MonoTODO("RadioButtonList_RenderItem")]
- void IRepeatInfoUser.RenderItem(valuetype System.Web.UI.WebControls.ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
- {
- throw new NotImplementedException();
- }
-
- bool IRepeatInfoUser.HasFooter
- {
- get
- {
- return false;
- }
- }
-
- bool IRepeatInfoUser.HasHeader
- {
- get
- {
- return false;
- }
- }
-
- bool IRepeatInfoUser.HasSeparators
- {
- get
- {
- return false;
- }
- }
-
- int IRepeatInfoUser.RepeatedItemCount
- {
- get
- {
- return Items.Count;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs
deleted file mode 100755
index fc26596dafc..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: RepeatDirection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum RepeatDirection
- {
- Horizontal,
- Vertical
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs
deleted file mode 100644
index 7fb4fe94542..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs
+++ /dev/null
@@ -1,266 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RepeatInfo
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 90%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class RepeatInfo
- {
- private bool outerTableImp;
- private int repeatColumns;
- private RepeatDirection repeatDirection;
- private RepeatLayout repeatLayout;
-
- public RepeatInfo()
- {
- outerTableImp = false;
- repeatColumns = 0;
- repeatDirection = RepeatDirection.Vertical;
- repeatLayout = RepeatLayout.Table;
- }
-
- public bool OuterTableImplied
- {
- get
- {
- return outerTableImp;
- }
- set
- {
- outerTableImp = value;
- }
- }
-
- public int RepeatColumns
- {
- get
- {
- return repeatColumns;
- }
- set
- {
- repeatColumns = value;
- }
- }
-
- public RepeatDirection RepeatDirection
- {
- get
- {
- return repeatDirection;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatDirection), value))
- throw new ArgumentException();
- repeatDirection = value;
- }
- }
-
- public RepeatLayout RepeatLayout
- {
- get
- {
- return repeatLayout;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatLayout), value))
- throw new ArgumentException();
- repeatLayout = value;
- }
- }
-
- public void RenderRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
- {
- if(RepeatDirection == RepeatDirection.Vertical)
- {
- DoVerticalRendering(writer, user, controlStyle, basecontrol);
- } else
- {
- DoHorizontalRendering(writer, user, controlStyle, basecontrol);
- }
- }
-
- private void DoVerticalRendering(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
- {
- int total = user.RepeatedItemCount;
- int colsCount;
- int rowsCount;
- if(repeatColumns == 0 || repeatColumns==1)
- {
- colsCount = 1;
- rowsCount = total;
- } else
- {
- colsCount = repeatColumns;
- rowsCount = (total + repeatColumns - 1) / repeatColumns;
- if(rowsCount ==0 && total != 0)
- {
- rowsCount = 1;
- colsCount = total;
- }
- }
- WebControl ctrl = null;
- bool isTable = true;
- bool hasSeps = user.HasSeparators;
- if(!outerTableImpl)
- {
- if(RepeatLayout == RepeatLayout.Table)
- {
- ctrl = new Table();
- } else
- {
- ctrl = new WebControl(HtmlTextWriterTag.Span);
- isTable = false;
- }
- }
-
- if(ctrl != null)
- {
- ctrl.ID = baseControl.ClientID;
- ctrl.CopyBaseAttributes(baseControl);
- ctrl.ApplyControlStyle(controlStyle);
- ctrl.RenderBeginTag(writer);
- }
-
- Style itemStyle;
- int colSpan = 0;
- if(user.HasHeader)
- {
- if(isTable)
- {
- writer.RenderBeginTag(HtmlTextWriterTag.Tr);
- if(rowsCount != 1)
- {
- colSpan = rowsCount;
- if(hasSeps)
- colSpan += rowsCount;
- writer.AddAttribute(HtmlTextWriterAttribute.Colspan, colSpan.ToString(NumberFormatInfo.InvariantInfo));
- }
- itemStyle = user.GetItemStyle(ListItemType.Header, -1);
- if(itemStyle != null)
- {
- itemStyle.AddAttributesToRender(writer);
- }
- writer.RenderBeginTag(HtmlTextWriterTag.Td);
- }
- user.RenderItem(ListItemType.Header, -1, this, writer);
- if(isTable)
- {
- writer.RenderEndTag();
- writer.RenderEndTag();
- } else
- {
- if(!outerTableImp)
- {
- writer.WriteFullBeginTag("br");
- }
- }
- }
-
- int rowIndex = 0;
- int colIndex = 0;
- int index = 0;
- while(rowIndex < rowsCount)
- {
- if(isTable)
- writer.RenderBeginTag(HtmlTextWriterTag.Tr);
- colIndex = 0;
- while(colIndex < colCount)
- {
- index = rowIndex + colIndex * rowsCount;
- if(index < total)
- {
- if(isTable)
- {
- itemStyle = user.GetItemStyle(ListItemType.Item, index);
- if(itemStyle != null)
- {
- itemStyle.AddAttributesToRender(writer);
- }
- writer.RenderBeginTag(HtmlTextWriterTag.Td);
- }
- user.RenderItem(ListItemType.Item, index, this, writer);
- if(isTable)
- writer.RenderEndTag();
- if(hasSeps && index != (total - 1))
- {
- if(colsCount == 1)
- {
- writer.RenderEndTag();
- writer.RenderBeginTag(HtmlTextWriterTag.Tr);
- } else
- {
- writer.WriteFullBeginTag("br");
- }
- if(isTable)
- {
- itemStyle = user.GetItemStyle(ListItemType.Separator, index);
- if(itemStyle != null)
- itemStyle.AddAttributesToRender(writer);
- writer.RenderBeginTag(HtmlTextWriterTag.Td);
- }
- if(index < total)
- user.RenderItem(ListItemType.Separator, index, this, writer);
- if(isTable)
- writer.RenderEndTag();
- }
- }
- colIndex++;
- }
- if(isTable)
- writer.RenderEndTag();
- else
- if(rowIndex != (rowCount - 1) || (user.hasFooter && !outerTableImp))
- writer.WriteFullBeginTag("br");
- rowIndex++;
- }
- if(user.HasFooter)
- {
- if(isTable)
- {
- writer.RenderBeginTag(HtmlTextWriterTag.Tr);
- if(colsCount != 1)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Colspan, colSpan.ToString(NumberFormatInfo.InvariantInfo));
- }
- itemStyle = user.GetItemStyle(ListItemType.Footer, -1);
- if(itemStyle != null)
- {
- itemStyle.AddAttributesToRender(writer);
- }
- writer.RenderBeginTag(HtmlTextWriterTag.Td);
- }
- user.RenderItem(ListItemType.Footer, -1, this, writer);
- if(isTable)
- {
- writer.RenderEndTag();
- writer.RenderEndTag();
- }
- }
- if(ctrl != null)
- {
- ctrl.RenderEndTag(writer);
- }
- }
-
- private void DoHorizontalRendering(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
- {
-
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs
deleted file mode 100755
index de1e81530e0..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: RepeatLayout
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum RepeatLayout
- {
- Table,
- Flow
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs
deleted file mode 100644
index 1d2e5c298ff..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: RepeaterCommandEventArgs
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class RepeaterCommandEventArgs: CommandEventArgs
- {
- private RepeaterItem rItem;
- private object cmdSrc;
-
- public RepeaterCommandEventArgs(RepeaterItem item, object commandSource, CommandEventArgs originalArgs): base(originalArgs)
- {
- rItem = item;
- cmdSrc = commandSource;
- }
-
- public object CommandSource
- {
- get
- {
- return cmdSrc;
- }
- }
-
- public RepeaterItem Item
- {
- get
- {
- return rItem;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs
deleted file mode 100644
index 1d93d3d8a67..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void RepeaterCommandEventHandler(object sender, RepeaterCommandEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs
deleted file mode 100644
index bea65a8499e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: RepeaterItem
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 40%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class RepeaterItem: Control, INamingContainer
- {
-
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs
deleted file mode 100644
index 73f7913171c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void RepeaterItemEventHandler(object sender, RepeaterItemEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs
deleted file mode 100644
index 486d7af99d6..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RequiredFieldValidator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-namespace System.Web.UI.WebControls
-{
- public class RequiredFieldValidator : BaseValidator
- {
- public RequiredFieldValidator(): base()
- {
- }
-
- public string InitialValue
- {
- get
- {
- object o = ViewState["InitialValue"];
- if(o != null)
- return (String)o;
- return String.Empty;
- }
- set
- {
- ViewState["InitialValue"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(RenderUpLevel)
- {
- writer.AddAttribute("evaluationfunction", "RequiredFieldValidatorEvaluateIsValid");
- writer.AddAttribute("initialvalue", InitialValue);
- }
- }
-
- protected override bool EvaluateIsValid()
- {
- string val = GetControlValidationValue(ControlToValidate);
- if(val != null)
- {
- return (val.Trim() == InitialValue.Trim());
- }
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs
deleted file mode 100644
index b37ffd5f26f..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void ServerValidateEventHandler(object sender, ServerValidateEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
deleted file mode 100644
index f5fae181629..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
+++ /dev/null
@@ -1,535 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Style
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Drawing;
-using System.Globalization;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class Style : Component , IStateManager
- {
- internal static int MARKED = (0x01 << 0);
- internal static int BACKCOLOR = (0x01 << 1);
- internal static int BORDERCOLOR = (0x01 << 2);
- internal static int BORDERSTYLE = (0x01 << 3);
- internal static int BORDERWIDTH = (0x01 << 4);
- internal static int CSSCLASS = (0x01 << 5);
- internal static int FORECOLOR = (0x01 << 6);
- internal static int HEIGHT = (0x01 << 7);
- internal static int WIDTH = (0x01 << 8);
- internal static int FONT_BOLD = (0x01 << 9);
- internal static int FONT_ITALIC = (0x01 << 10);
- internal static int FONT_NAMES = (0x01 << 11);
- internal static int FONT_SIZE = (0x01 << 12);
- internal static int FONT_STRIKE = (0x01 << 13);
- internal static int FONT_OLINE = (0x01 << 14);
- internal static int FONT_ULINE = (0x01 << 15);
-
- internal static string selectionBitString = "_SystemWebUIWebControlsStyle_SBS";
-
- private StateBag viewState;
- private int selectionBits;
- private bool selfStateBag;
-
- private FontInfo font;
-
- public Style()
- {
- Initialize(null);
- selfStateBag = true;
- }
-
- public Style(StateBag bag): base()
- {
- Initialize(bag);
- selfStateBag = false;
- }
-
- private void Initialize(StateBag bag)
- {
- viewState = bag;
- selectionBits = 0x00;
- }
-
- internal virtual StateBag ViewState
- {
- get
- {
- if(viewState == null)
- {
- viewState = new StateBag(false);
- if(IsTrackingViewState)
- viewState.TrackViewState();
- }
- return viewState;
- }
- }
-
- internal bool IsSet(int bit)
- {
- return ( (selectionBits & bit) != 0x00);
- }
-
- internal virtual void Set(int bit)
- {
- selectionBits |= bit;
- if(IsTrackingViewState)
- selectionBits |= MARKED;
- }
-
- public Color BackColor
- {
- get
- {
- if(IsSet(BACKCOLOR))
- return (Color)ViewState["BackColor"];
- return Color.Empty;
- }
- set
- {
- ViewState["BackColor"] = value;
- Set(BACKCOLOR);
- }
- }
-
- public Color BorderColor
- {
- get
- {
- if(IsSet(BORDERCOLOR))
- return (Color)ViewState["BorderColor"];
- return Color.Empty;
- }
- set
- {
- ViewState["BorderColor"] = value;
- Set(BORDERCOLOR);
- }
- }
-
- public BorderStyle BorderStyle
- {
- get
- {
- if(IsSet(BORDERSTYLE))
- return (BorderStyle)ViewState["BorderStyle"];
- return BorderStyle.NotSet;
- }
- set
- {
- ViewState["BorderStyle"] = value;
- Set(BORDERSTYLE);
- }
- }
-
- public Unit BorderWidth
- {
- get
- {
- if(IsSet(BORDERWIDTH))
- return (Unit)ViewState["BorderWidth"];
- return Unit.Empty;
- }
- set
- {
- ViewState["BorderWidth"] = value;
- Set(BORDERWIDTH);
- }
- }
-
- public string CssClass
- {
- get
- {
- if(IsSet(CSSCLASS))
- return (string)ViewState["CssClass"];
- return string.Empty;
- }
- set
- {
- ViewState["CssClass"] = value;
- Set(CSSCLASS);
- }
- }
-
- public Color ForeColor
- {
- get
- {
- if(IsSet(FORECOLOR))
- return (Color)ViewState["ForeColor"];
- return Color.Empty;
- }
- set
- {
- ViewState["ForeColor"] = value;
- Set(FORECOLOR);
- }
- }
-
- public Unit Height
- {
- get
- {
- if(IsSet(HEIGHT))
- return (Unit)ViewState["Height"];
- return Unit.Empty;
- }
- set
- {
- ViewState["Height"] = value;
- Set(HEIGHT);
- }
- }
-
- public Unit Width
- {
- get
- {
- if(IsSet(WIDTH))
- return (Unit)ViewState["Width"];
- return Unit.Empty;
- }
- set
- {
- ViewState["Width"] = value;
- Set(HEIGHT);
- }
- }
-
- public FontInfo Font
- {
- get
- {
- if(font==null)
- font = new FontInfo(this);
- return font;
- }
- }
-
- internal virtual bool IsEmpty
- {
- get
- {
- return (selectionBits != 0);
- }
- }
-
- private void AddColor(HtmlTextWriter writer, HtmlTextWriterStyle style, Color color)
- {
- if(!color.IsEmpty)
- writer.AddStyleAttribute(style, ColorTranslator.ToHtml(color));
- }
-
- private static string StringArrayToString(string[] array, char separator)
- {
- if(array.Length == 0)
- return String.Empty;
- StringBuilder sb = new StringBuilder();
- for(int i=0; i < array.Length; i++)
- {
- if(i==0)
- {
- sb.Append(array[0]);
- } else
- {
- sb.Append(separator);
- sb.Append(array[i]);
- }
- }
- return sb.ToString();
- }
-
- public void AddAttributesToRender(HtmlTextWriter writer)
- {
- AddAttributesToRender(writer, null);
- }
-
- public void AddAttributesToRender(HtmlTextWriter writer, WebControl owner)
- {
- if(IsSet(BACKCOLOR))
- {
- AddColor(writer, HtmlTextWriterStyle.BackgroundColor, (Color)ViewState["BackColor"]);
- }
-
- if(IsSet(BORDERCOLOR))
- {
- AddColor(writer, HtmlTextWriterStyle.BorderColor, (Color)ViewState["BorderColor"]);
- }
-
- if(IsSet(FORECOLOR))
- {
- AddColor(writer, HtmlTextWriterStyle.Color, (Color)ViewState["ForeColor"]);
- }
-
- if(IsSet(CSSCLASS))
- {
- string cssClass = (string)ViewState["CssClass"];
- if(cssClass.Length > 0)
- writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass);
- }
-
- if(!BorderWidth.IsEmpty)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth, BorderWidth.ToString(CultureInfo.InvariantCulture));
- if(BorderStyle!=BorderStyle.NotSet)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, Enum.Format(typeof(BorderStyle), BorderStyle, "G"));
- } else
- {
- if(BorderWidth.Value != 0.0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, "solid");
- }
- }
- } else
- {
- if(BorderStyle!=BorderStyle.NotSet)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, Enum.Format(typeof(BorderStyle), BorderStyle, "G"));
- }
- }
-
- if(Font.Names.Length > 0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.FontFamily, StringArrayToString(Font.Names,','));
- }
-
- if(!Font.Size.IsEmpty)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, Font.Size.ToString(CultureInfo.InvariantCulture));
- }
-
- if(Font.Bold)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.FontWeight, "bold");
- }
-
- if(Font.Italic)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.FontStyle, "italic");
- }
-
- string textDecoration = String.Empty;
- if(Font.Strikeout)
- {
- textDecoration += " strikeout";
- }
- if(Font.Underline)
- {
- textDecoration += " underline";
- }
- if(Font.Overline)
- {
- textDecoration += " overline";
- }
- if(textDecoration.Length > 0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.TextDecoration, textDecoration);
- }
-
- Unit u = Unit.Empty;
- if(IsSet(HEIGHT))
- {
- u = (Unit)ViewState["Height"];
- writer.AddStyleAttribute(HtmlTextWriterStyle.Height, u.ToString(CultureInfo.InvariantCulture));
- }
- if(IsSet(WIDTH))
- {
- u = (Unit)ViewState["Width"];
- writer.AddStyleAttribute(HtmlTextWriterStyle.Width, u.ToString(CultureInfo.InvariantCulture));
- }
- }
-
- public virtual void CopyFrom(Style source)
- {
- if(source!=null && !source.IsEmpty)
- {
- Font.CopyFrom(source.Font);
- if(source.Height!=Unit.Empty)
- {
- Height = source.Height;
- }
- if(source.Width!=Unit.Empty)
- {
- Width = source.Width;
- }
- if(source.BorderColor!=Color.Empty)
- {
- BorderColor = source.BorderColor;
- }
- if(source.BorderWidth!=Unit.Empty)
- {
- BorderWidth = source.BorderWidth;
- }
- if(source.BorderStyle!=BorderStyle.NotSet)
- {
- BorderStyle = source.BorderStyle;
- }
- if(source.BackColor!=Color.Empty)
- {
- BackColor = source.BackColor;
- }
- if(source.CssClass!=String.Empty)
- {
- CssClass = source.CssClass;
- }
- if(source.ForeColor!=Color.Empty)
- {
- ForeColor = source.ForeColor;
- }
- }
- }
-
- public virtual void MergeWith(Style with)
- {
- if(with!=null && !with.IsEmpty)
- {
- if(IsEmpty)
- {
- CopyFrom(with);
- return;
- }
-
- Font.MergeWith(with.Font);
- if(!IsSet(HEIGHT) && with.Height!=Unit.Empty)
- {
- Height = with.Height;
- }
- if(!IsSet(WIDTH) && with.Width!=Unit.Empty)
- {
- Width = with.Width;
- }
- if(!IsSet(BORDERCOLOR) && with.BorderColor!=Color.Empty)
- {
- BorderColor = with.BorderColor;
- }
- if(!IsSet(BORDERWIDTH) && with.BorderWidth!=Unit.Empty)
- {
- BorderWidth = with.BorderWidth;
- }
- if(!IsSet(BORDERSTYLE) && with.BorderStyle!=BorderStyle.NotSet)
- {
- BorderStyle = with.BorderStyle;
- }
- if(!IsSet(BACKCOLOR) && with.BackColor!=Color.Empty)
- {
- BackColor = with.BackColor;
- }
- if(!IsSet(CSSCLASS) && with.CssClass!=String.Empty)
- {
- CssClass = with.CssClass;
- }
- if(!IsSet(FORECOLOR) && with.ForeColor!=Color.Empty)
- {
- ForeColor = with.ForeColor;
- }
- }
- }
-
- public virtual void Reset()
- {
- if(IsSet(BACKCOLOR))
- ViewState.Remove("BackColor");
- if(IsSet(BORDERCOLOR))
- ViewState.Remove("BorderColor");
- if(IsSet(BORDERSTYLE))
- ViewState.Remove("BorderStyle");
- if(IsSet(BORDERWIDTH))
- ViewState.Remove("BorderWidth");
- if(IsSet(CSSCLASS))
- ViewState.Remove("CssClass");
- if(IsSet(FORECOLOR))
- ViewState.Remove("ForeColor");
- if(IsSet(HEIGHT))
- ViewState.Remove("Height");
- if(IsSet(WIDTH))
- ViewState.Remove("Width");
- if(font!=null)
- font.Reset();
- selectionBits = 0x00;
- }
-
- protected bool IsTrackingViewState
- {
- get
- {
- return ( (selectionBits & MARKED) != 0x00 );
- }
- }
-
- protected internal virtual void TrackViewState()
- {
- if(viewState!=null)
- ViewState.TrackViewState();
- Set(MARKED);
- }
-
- protected internal object SaveViewState()
- {
- if(viewState != null)
- {
- if(IsSet(MARKED))
- {
- ViewState[selectionBitString] = selectionBits;
- }
- if(selfStateBag)
- {
- return ViewState.SaveViewState();
- }
- }
- return null;
- }
-
- protected internal void LoadViewState(object state)
- {
- if(state!=null && selfStateBag)
- {
- ViewState.LoadViewState(state);
- }
- if(viewState!=null)
- {
- selectionBits = (int)ViewState[selectionBitString];
- }
- }
-
- void IStateManager.LoadViewState(object state)
- {
- LoadViewState(state);
- }
-
- object IStateManager.SaveViewState()
- {
- return SaveViewState();
- }
-
- void IStateManager.TrackViewState()
- {
- TrackViewState();
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get
- {
- return IsTrackingViewState;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TODO b/mcs/class/System.Web/System.Web.UI.WebControls/TODO
deleted file mode 100755
index 5b09ccc2f67..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TODO
+++ /dev/null
@@ -1,156 +0,0 @@
-All Classes, Interfaces, Structures, Delegates and Enumerations
-
-
-<attributesIssue>
- Attributes may have to be supplied to the classes. Some of the attributes
- include DefaultPropertyAttribute, ToolboxItemAttribute, ParseChildrenAttribute
- (to be added to System.Web.UI) etc. Currently, I have not taken care of these
- aspects. They are to be handled later on.
-</attributesIssue>
-
-<disposableItemsIssue>
- I have not taken care of any disposing issues that may be involved. But I think
- it will not be a problem since I am no where using unmanaged code.
-</disposableItemsIssue>
-
-<legends>
-*: Completed
-&: Work in progress. See <item-name>.cs file for maintainer's name
-</legends>
-
-* AdCreatedEventArgs
-* AdRotator
-* BaseCompareValidator
-* BaseDataList
-& BaseValidator
-& BoundColumn
-* Button
-* ButtonColumn
-& Calendar
-* CalendarDay
-* CheckBox
-* CheckBoxList
-* CommandEventArgs
-& CompareValidator
-CustomValidator
-& DataGrid
-DataGridColumn
-DataGridColumnCollection
-* DataGridCommandEventArgs
-& DataGridItem
-* DataGridItemCollection
-* DataGridItemEventArgs
-* DataGridPageChangedEventArgs
-DataGridPagerStyle
-* DataGridShortCommandEventArgs
-DataKeyCollection
-& DataList
-* DataListCommandEventArgs
-DataListItem
-DataListItemCollecton
-* DataListItemEventArgs
-* DayRenderEventArgs
-* DropDownList
-EditCommandColumn
-* FontInfo
-* FontNamesConverter
-& FontUnitConverter
-* HyperLink
-* HyperLinkColumn
-* HyperLinkControlBuilder
-* Image
-* ImageButton
-* Label
-* LabelControlBuilder
-* LinkButton
-* LinkButtonControlBuilder
-* ListBox
-* ListControl
-* ListItem
-* ListItemCollection
-* ListItemControlBuilder
-* Literal
-* LiteralControlBuilder
-* MonthChangedEventArgs
-PagedDataSource
-* Panel
-* PlaceHolder
-* PlaceHolderControlBuilder
-* RadioButton
-& RadioButtonList
-RangeValidator
-RegularExpressionValidator
-Repeater
-* RepeaterCommandEventArgs
-& RepeaterItem
-RepeaterItemCollection
-* RepeaterItemEventArgs
-& RepeatInfo
-* RequiredFieldValidator
-SelectedDatesCollection
-* ServerValidateEventArgs
-* Style
-* Table
-* TableCell
-* TableCellCollection
-* TableCellControlBuilder
-* TableHeaderCell
-* TableItemStyle
-* TableRow
-* TableRowCollection
-* TableStyle
-* TargetConverter
-* TemplateColumn
-& TextBox
-* TextBoxControlBuilder
-* UnitConverter
-* ValidatedControlConverter
-& ValidationSummary
-& WebColorConverter
-& WebControl
-& Xml
-
-* IRepeatInfoUser
-
-* FontUnit
-* Unit
-
-* AdCreatedEventHandler
-* CommandEventHandler
-* DataGridCommandEventHandler
-* DataGridItemEventHandler
-* DataGridPageChangedEventHandler
-* DataGridSortCommandEventHandler
-* DataListCommandEventHandler
-* DataListItemEventHandler
-* DayRenderEventHandler
-* MonthChangedEventHandler
-* RepeaterCommandEventHandler
-* RepeaterItemEventHandler
-* ServerValidateEventHandler
-
-* BorderStyle
-* ButtonColumnType
-* CalendarSelectionMode
-* DayNameFormat
-* FirstDayOfWeek
-* FontSize
-* GridLines
-* HorizontalAlign
-* ImageAlign
-* ListItemType
-* ListSelectionMode
-* NextPrevFormat
-* PagerMode
-* PagerPosition
-* RepeatDirection
-* RepeatLayout
-* TextAlign
-* TextBoxMode
-* TitleFormat
-* UnitType
-* ValidationCompareOperator
-* ValidationDataType
-* ValidationSummaryDisplayMode
-* ValidatorDisplay
-* VerticalAlign
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs
deleted file mode 100644
index c391f655c4d..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Table
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Drawing;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class Table: WebControl
- {
- private TableRowCollection rows;
-
- private class TableRowControlCollection : ControlCollection
- {
- public TableRowControlCollection(Control owner): base(owner)
- {
- }
-
- public override void Add(Control child)
- {
- if(child is TableRow)
- {
- Add(child);
- return;
- }
- throw new ArgumentException(HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "Table", child.GetType().Name.ToString()));
- }
-
- public override void AddAt(int index, Control child)
- {
- if(child is TableRow)
- {
- Add(child);
- return;
- }
- throw new ArgumentException(HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "Table", child.GetType().Name.ToString()));
- }
- }
-
- public Table(): base(HtmlTextWriterTag.Table)
- {
- }
-
- public virtual string BackImageUrl
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableStyle)ControlStyle).BackImageUrl;
- }
- set
- {
- ((TableStyle)ControlStyle).BackImageUrl = value;
- }
- }
-
- public virtual int CellPadding
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableStyle)ControlStyle).CellPadding;
- }
- set
- {
- ((TableStyle)ControlStyle).CellPadding = value;
- }
- }
-
- public virtual int CellSpacing
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableStyle)ControlStyle).CellSpacing;
- }
- set
- {
- ((TableStyle)ControlStyle).CellSpacing = value;
- }
- }
-
- public virtual GridLines GridLines
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableStyle)ControlStyle).GridLines;
- }
- set
- {
- ((TableStyle)ControlStyle).GridLines = value;
- }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableStyle)ControlStyle).HorizontalAlign;
- }
- set
- {
- ((TableStyle)ControlStyle).HorizontalAlign = value;
- }
- }
-
- public virtual TableRowCollection Rows
- {
- get
- {
- if(rows == null)
- {
- rows = new TableRowCollection(this);
- }
- return rows;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer): AddAttributesToRender(writer)
- {
- if(!BorderColor.IsEmpty)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Bordercolor, ColorTranslator.ToHtml(BorderColor));
- }
-
- Unit bw = BorderWidth;
- if(GridLines == GridLines.None)
- {
- bw = Unit.Pixel(0);
- } else if(!bw.IsEmpty && bw.Type == UnitType.Pixel)
- {
- bw = Unit.Pixel(1);
- }
- writer.AddAttribute(HtmlTextWriterAttribute.Border, ((int)bw.Value).ToString(NumberFormatInfo.InvariantInfo));
- }
-
- protected override ControlCollection CreateControlCollection()
- {
- return new TableRowControlCollection(this);
- }
-
- protected override Style CreateControlStyle()
- {
- return new TableStyle(ViewState);
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- foreach(object current in Rows)
- {
- ((TableRow)current).RenderControl(writer);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs
deleted file mode 100644
index fa978e0fb6e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableCell
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableCell: WebControl
- {
- [MonoTODO]
- public TableCell(): base(HtmlTextWriterTag.Td)
- {
- //TODO: What's the function to prevent Control to give _auto_generated_id
- }
-
- [MonoTODO]
- internal TableCell(HtmlTextWriterTag tag): base(tag)
- {
- //TODO: What's the function to prevent Control to give _auto_generated_id
- }
-
- public virtual int ColumnSpan
- {
- get
- {
- object o = ViewState["ColumnSpan"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- ViewState["ColumnSpan"] = value;
- }
- }
-
- public virtual int RowSpan
- {
- get
- {
- object o = ViewState["RowSpan"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- ViewState["RowSpan"] = value;
- }
- }
-
- public virtual string Text
- {
- get
- {
- object o = ViewState["Text"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableItemStyle)ControlStyle).HorizontalAlign;
- return HorizontalAlign.NotSet;
- }
- set
- {
- ((TableItemStyle)ControlStyle).HorizontalAlign = value;
- }
- }
-
- public virtual VerticalAlign VerticalAlign
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableItemStyle)ControlStyle).VerticalAlign;
- return VerticalAlign.NotSet;
- }
- set
- {
- ((TableItemStyle)ControlStyle).VerticalAlign = value;
- }
- }
-
- public virtual bool Wrap
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableItemStyle)ControlStyle).Wrap;
- return true;
- }
- set
- {
- ((TableItemStyle)ControlStyle).Wrap = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer): AddAttributesToRender(writer)
- {
- if(ColumnSpan > 0)
- writer.AddAttribute(HtmlTextWriterAttribute.Colspan, Colspan.ToString(NumberFormatInfo.InvariantInfo));
- if(RowSpan > 0)
- writer.AddAttribute(HtmlTextWriterAttribute.Rowspan, Rowspan.ToString(NumberFormatInfo.InvariantInfo));
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(HasControls())
- {
- AddParsedSubObject(obj);
- return;
- }
- if(obj is LiteralControl)
- {
- Text = ((LiteralControl)obj).Text;
- return;
- }
- string text = Text;
- if(text.Length > 0)
- {
- Text = String.Empty;
- AddParsedSubObject(new LiteralControl(text));
- }
- AddParsedSubObject(obj);
- }
-
- protected override Style CreateControlStyle()
- {
- return new TableItemStyle(ViewState);
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- if(HasControls())
- {
- RenderContents(writer);
- return;
- }
- writer.Write(Text);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableCellCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableCellCollection.cs
deleted file mode 100644
index ac8c76f85a4..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableCellCollection.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableCellCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class TableCellCollection: IList, ICollection, IEnumerable
- {
- private TableRow owner;
-
- internal TableCellCollection(TableRow owner)
- {
- if(owner == null)
- {
- throw new ArgumentNullException();
- }
- this.owner = owner;
- }
-
- public int Count
- {
- get
- {
- return owner.Controls.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public TableCell this[int index]
- {
- get
- {
- return (TableCell)owner.Controls[index];
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public int Add(TableCell cell)
- {
- AddAt(-1, cell);
- return owner.Controls.Count;
- }
-
- public void AddAt(int index, TableCell cell)
- {
- owner.Controls.AddAt(index, cell);
- }
-
- public void AddRange(TableCell[] cells)
- {
- foreach(TableCell cell in cells)
- {
- Add(cell);
- }
- }
-
- public void Clear()
- {
- if(owner.HasControls())
- {
- owner.Controls.Clear();
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(object cell in this)
- {
- array.SetValue(cell, index++);
- }
- }
-
- public int GetCellIndex(TableCell cell)
- {
- if(!owner.HasControls())
- {
- return -1;
- }
- return owner.Controls.IndexOf(cell);
- }
-
- public IEnumerator GetEnumerator()
- {
- return owner.Controls.GetEnumerator();
- }
-
- public void Remove(TableCell cell)
- {
- owner.Controls.Remove(cell);
- }
-
- public void RemoveAt(int index)
- {
- owner.Controls.RemoveAt(index);
- }
-
- private void IList.Add(object o)
- {
- Add((TableCell)o);
- }
-
- private bool IList.Contains(object o)
- {
- return owner.Controls.Contains((TableCell)o);
- }
-
- private int IList.IndexOf(object o)
- {
- return owner.Controls.IndexOf((TableCell)o);
- }
-
- private void IList.Insert(int index, object o)
- {
- onwer.Controls.Insert(index, (TableCell)o);
- }
-
- private void IList.Remove(object o)
- {
- onwer.Controls.Remove((TableCell)o);
- }
-
- private bool IList.IsFixedSize()
- {
- return false;
- }
-
- private object IList.this[int index]
- {
- get
- {
- return this[index];
- }
- set
- {
- RemoveAt(index);
- AddAt(index, (TableCell)value);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableCellControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableCellControlBuilder.cs
deleted file mode 100644
index 6363462fa51..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableCellControlBuilder.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableCellControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableCellControlBuilder: ControlBuilder
- {
- public TableCellControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderCell.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderCell.cs
deleted file mode 100644
index e3ccb0c1a93..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderCell.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableHeaderCell
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableHeaderCell: TableCell
- {
- public TableHeaderCell(): base(HtmlTextWriterTag.Th)
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableItemStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableItemStyle.cs
deleted file mode 100644
index 708d2df730c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableItemStyle.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableItemStyle
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableItemStyle: Style
- {
- private static int H_ALIGN = (0x01 << 16);
- private static int V_ALIGN = (0x01 << 17);
- private static int WRAP = (0x01 << 18);
-
- public TableItemStyle(): base()
- {
- }
-
- public TableItemStyle(StateBag bag): base(bag)
- {
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- if(IsSet(H_ALIGN))
- return (HorizontalAlign)ViewState["HorizontalAlign"];
- return HorizontalAlign.NotSet;
- }
- set
- {
- if(!Enum.IsDefined(typeof(HorizontalAlign), value))
- {
- throw new ArgumentException();
- }
- ViewState["HorizontalAlign"] = value;
- Set(H_ALIGN);
- }
- }
-
- public virtual VerticalAlign VerticalAlign
- {
- get
- {
- if(IsSet(V_ALIGN))
- return (VerticalAlign)iewState["VerticalAlign"];
- return VerticalAlign.NotSet;
- }
- set
- {
- if(!Enum.IsDefined(typeof(VerticalAlign), value))
- {
- throw new ArgumentException();
- }
- ViewState["VerticalAlign"] = value;
- Set(V_ALIGN);
- }
- }
-
- public virtual bool Wrap
- {
- get
- {
- if(IsSet(WRAP))
- return (bool)ViewState["Wrap"];
- return true;
- }
- set
- {
- ViewState["Wrap"] = value;
- }
- }
-
- public override void CopyFrom(Style s)
- {
- if(s!=null && s is TableItemStyle && !s.IsEmpty)
- {
- base.CopyFrom(s);
- TableItemStyle from = (TableItemStyle)s;
- if(from.IsSet(H_ALIGN))
- {
- HorizontalAlign = from.HorizontalAlign;
- }
- if(from.IsSet(V_ALIGN))
- {
- VerticalAlign = from.VerticalAlign;
- }
- if(from.IsSet(WRAP))
- {
- Wrap = from.Wrap;
- }
- }
- }
-
- public override void MergeWith(Style s)
- {
- if(s!=null && s is TableItemStyle && !s.IsEmpty)
- {
- base.MergeWith(s);
- TableItemStyle with = (TableItemStyle)s;
- if(from.IsSet(H_ALIGN) && !IsSet(H_ALIGN))
- {
- HorizontalAlign = with.HorizontalAlign;
- }
- if(from.IsSet(V_ALIGN) && !IsSet(V_ALIGN))
- {
- VerticalAlign = with.VerticalAlign;
- }
- if(from.IsSet(WRAP) && !IsSet(WRAP))
- {
- Wrap = with.Wrap;
- }
- }
- }
-
- public override void Reset()
- {
- if(IsSet(H_ALIGN))
- ViewState.Remove("HorizontalAlign");
- if(IsSet(V_ALIGN))
- ViewState.Remove("VerticalAlign");
- if(IsSet(WRAP))
- ViewState.Remove("Wrap");
- base.Reset();
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer, WebControl owner)
- {
- base.AddAttributesToRender(writer, owner);
- if(!Wrap)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.NoWrap, "nowrap");
- }
- if(HorizontalAlign != HorizontalAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Align, TypeDescriptor.GetConverter(typeof(HorizontalAlign)).ConvertToString(HorizontalAlign));
- }
- if(VerticalAlign != VerticalAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Valign, TypeDescriptor.GetConverter(typeof(VerticalAlign)).ConvertToString(VerticalAlign));
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs
deleted file mode 100644
index 8e5151c3c7b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableRow
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableRow: WebControl
- {
- private TableCellCollection cells;
-
- public TableRow(): base(HtmlTextWriterTag.Tr)
- {
- PreventAutoID();
- }
-
- public virtual TableCellCollection Cells
- {
- get
- {
- if(cells == null)
- {
- cells = new TableCellCollection(this);
- }
- return cells;
- }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- object o = ViewState["HorizontalAlign"];
- if(o != null)
- return (HorizontalAlign)o;
- return HorizontalAlign.NotSet;
- }
- set
- {
- ViewState["HorizontalAlign"] = value;
- }
- }
-
- public virtual VerticalAlign VerticalAlign
- {
- get
- {
- object o = ViewState["VerticalAlign"];
- if(o != null)
- return (VerticalAlign)o;
- return VerticalAlign.NotSet;
- }
- set
- {
- ViewState["VerticalAlign"] = value;
- }
- }
-
- protected override Style CreateControlStyle()
- {
- return new TableItemStyle(ViewState);
- }
-
- protected override ControlCollection CreateControlCollection()
- {
- return new CellControlCollection(this);
- }
-
- class CellControlCollection: ControlCollection
- {
- public CellControlCollection(Control owner): base(owner)
- {
- }
-
- public void Add(Control child)
- {
- if(child is TableCell)
- {
- base.Add(child);
- } else
- {
- throw new ArgumentException(HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "TableRow", GetType().Name.ToString()));
- }
- }
-
- public void AddAt(int index, Control child)
- {
- if(child is TableCell)
- {
- base.AddAt(index, child);
- } else
- {
- throw new ArgumentException(HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "TableRow", GetType().Name.ToString()));
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs
deleted file mode 100644
index 74bd96aa7c5..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableRowCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class TableRowCollection: IList, ICollection, IEnumerable
- {
- TableRow owner;
-
- internal TableRowCollection(TableRow owner)
- {
- if(owner == null)
- {
- throw new ArgumentNullException();
- }
- this.owner = owner;
- }
-
- public int Count
- {
- get
- {
- return owner.Controls.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public TableRow this[int index]
- {
- get
- {
- return (TableRow)owner.Controls[index];
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public int Add(TableRow row)
- {
- AddAt(-1, row);
- return owner.Controls.Count;
- }
-
- public void AddAt(int index, TableRow row)
- {
- owner.Controls.AddAt(index, row);
- }
-
- public void AddRange(TableRow[] rows)
- {
- foreach(TableRow row in rows)
- {
- Add(row);
- }
- }
-
- public void Clear()
- {
- if(owner.HasControls())
- {
- owner.Controls.Clear();
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(object current in this)
- {
- array.SetValue(current, index++);
- }
- }
-
- public int GetRowIndex(TableRow row)
- {
- if(!owner.HasControls())
- {
- return -1;
- }
- return owner.Controls.IndexOf(row);
- }
-
- public IEnumerator GetEnumerator()
- {
- return owner.Controls.GetEnumerator();
- }
-
- public void Remove(TableRow row)
- {
- owner.Controls.Remove(row);
- }
-
- public void RemoveAt(int index)
- {
- owner.Controls.RemoveAt(index);
- }
-
- private void IList.Add(object o)
- {
- Add((TableRow)o);
- }
-
- private bool IList.Contains(object o)
- {
- return owner.Controls.Contains((TableRow)o);
- }
-
- private int IList.IndexOf(object o)
- {
- return owner.Controls.IndexOf((TableRow)o);
- }
-
- private void IList.Insert(int index, object o)
- {
- onwer.Controls.Insert(index, (TableRow)o);
- }
-
- private void IList.Remove(object o)
- {
- onwer.Controls.Remove((TableRow)o);
- }
-
- private bool IList.IsFixedSize()
- {
- return false;
- }
-
- private object IList.this[int index]
- {
- get
- {
- return this[index];
- }
- set
- {
- RemoveAt(index);
- AddAt(index, (TableRow)value);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
deleted file mode 100644
index ffb8a53bcf8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
+++ /dev/null
@@ -1,234 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableStyle
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableStyle : Style
- {
- private static int IMAGE_URL = (0x01 << 16);
- private static int CELL_PADD = (0x01 << 17);
- private static int CELL_SPAC = (0x01 << 18);
- private static int GRID_LINE = (0x01 << 19);
- private static int HOR_ALIGN = (0x01 << 20);
-
- public TableStyle(): base()
- {
- }
-
- public TableStyle(StateBag bag): base(bag)
- {
- }
-
- public virtual string BackImageUrl
- {
- get
- {
- if(IsSet(IMAGE_URL))
- return (string)(ViewState["BackImageUrl"]);
- return String.Empty;
- }
- set
- {
- if(value == null)
- throw new ArgumentNullException("BackImageUrl");
- ViewState["BackImageUrl"] = value;
- Set(IMAGE_URL);
- }
- }
-
- public virtual int CellPadding
- {
- get
- {
- if(IsSet(CELL_PADD))
- return (int)(ViewState["CellPadding"]);
- return -1;
- }
- set
- {
- if(value < -1)
- throw new ArgumentOutOfRangeException("CellPadding");
- ViewState["CellPadding"] = value;
- Set(CELL_PADD);
- }
- }
-
- public virtual int CellSpacing
- {
- get
- {
- if(IsSet(CELL_SPAC))
- return (int)(ViewState["CellSpacing"]);
- return -1;
- }
- set
- {
- if(value < -1)
- throw new ArgumentOutOfRangeException("CellSpacing");
- ViewState["CellSpacing"] = value;
- Set(CELL_SPAC);
- }
- }
-
- public virtual GridLines GridLines
- {
- get
- {
- if(IsSet(GRID_LINE))
- return (string)(ViewState["GridLines"]);
- return GridLines.Both;
- }
- set
- {
- if(!Enum.IsDefined(typeof(GridLines), value))
- throw new ArgumentException();
- ViewState["GridLines"] = value;
- Set(GRID_LINE);
- }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- if(IsSet(HOR_ALIGN))
- return (string)(ViewState["HorizontalAlign"]);
- return HorizontalAlign.NotSet;
- }
- set
- {
- if(!Enum.IsDefined(typeof(HorizontalAlign), value))
- throw new ArgumentException();
- ViewState["HorizontalAlign"] = value;
- Set(HOR_ALIGN);
- }
- }
-
- public override void AddAttributesToRender(HtmlTextWriter writer, WebControl owner)
- {
- base.AddAttributesToRender(writer, owner);
- if(BackImageUrl.Length > 0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundImage, "url(" + ResolveUrl(BackImageUrl) + ")");
- }
- if(CellSpacing >= 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, CellSpacing.ToString(NumerFormatInfo.InvariantInfo));
- }
- if(CellPadding >= 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, CellPadding.ToString(NumerFormatInfo.InvariantInfo));
- }
- if(HorizontalAlign != HorizontalAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Align, Enum.Format(typeof(HorizontalAlign), HorizontalAlign, "G"));
- }
- string gd = "";
- switch(GridLines)
- {
- case GridLines.None: gd = "";
- break;
- case GridLines.Horizontal: gd = "cols";
- break;
- case GridLines.Vertical: gd = "rows";
- break;
- case GridLines.Both: gd = "all";
- break;
- }
- writer.AddAttribute(HtmlTextWriterAttribute.Rules, gd);
- }
-
- private static int IMAGE_URL = (0x01 << 16);
- private static int CELL_PADD = (0x01 << 17);
- private static int CELL_SPAC = (0x01 << 18);
- private static int GRID_LINE = (0x01 << 19);
- private static int HOR_ALIGN = (0x01 << 20);
-
- public override void CopyFrom(Style s)
- {
- if(s != null && s is TableStyle && !s.IsEmpty)
- {
- base.CopyFrom(s);
- TableStyle from = (TableStyle)s;
- if(from.IsSet(HOR_ALIGN))
- {
- HorizontalAlign = from.HorizontalAlign;
- }
- if(from.IsSet(IMAGE_URL))
- {
- BackImageUrl = from.BackImageUrl;
- }
- if(from.IsSet(CELL_PADD))
- {
- CellPadding = from.CellPadding;
- }
- if(from.IsSet(CELL_SPAC))
- {
- CellSpacing = from.CellSpacing;
- }
- if(from.IsSet(GRID_LINE))
- {
- GridLines = from.GridLines;
- }
- }
- }
-
- public override void MergeWith(Style s)
- {
- if(s != null && s is TableStyle && !s.IsEmpty)
- {
- base.MergeWith(s);
- TableStyle with = (TableStyle)s;
- if(from.IsSet(HOR_ALIGN) && IsSet(HOR_ALIGN))
- {
- HorizontalAlign = with.HorizontalAlign;
- }
- if(from.IsSet(IMAGE_URL) && IsSet(IMAGE_URL))
- {
- BackImageUrl = with.BackImageUrl;
- }
- if(from.IsSet(CELL_PADD) && IsSet(CELLL_PADD))
- {
- CellPadding = with.CellPadding;
- }
- if(from.IsSet(CELL_SPAC) && IsSet(CELL_SPAC))
- {
- CellSpacing = with.CellSpacing;
- }
- if(from.IsSet(GRID_LINE) && IsSet(GRID_LINE))
- {
- GridLines = with.GridLines;
- }
- }
- }
-
- public override void Reset()
- {
- if(IsSet(IMAGE_URL))
- ViewState.Remove("BackImageUrl");
- if(IsSet(HOR_ALIGN))
- ViewState.Remove("HorizontalAlign");
- if(IsSet(CELL_PADD))
- ViewState.Remove("CellPadding");
- if(IsSet(CELL_SPAC))
- ViewState.Remove("CellSpacing");
- if(IsSet(GRID_LINE))
- ViewState.Remove("GridLines");
- base.Reset();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TargetConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TargetConverter.cs
deleted file mode 100644
index 409dd35a9c0..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TargetConverter.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TargetConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TargetConverter : StringConverter
- {
- private StandardValuesCollection standardValues;
- private string[] values = {
- "_parent",
- "_self",
- "_blank",
- "_search",
- "_top"
- };
-
- public TargetConverter(): base()
- {
- }
-
- public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- if(standardValues == null)
- {
- standardValues = new StandardValuesCollection(values);
- }
- return standardValues;
- }
-
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return false;
- }
-
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TemplateColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TemplateColumn.cs
deleted file mode 100644
index 76e77bb51b8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TemplateColumn.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TemplateColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TemplateColumn : DataGridColumn
- {
- private ITemplate editItemTemplate;
- private ITemplate footerTemplate;
- private ITemplate headerTemplate;
- private ITemplate itemTemplate;
-
- public TemplateColumn(): base()
- {
- }
-
- public virtual ITemplate EditItemTemplate
- {
- get
- {
- return editItemTemplate;
- }
- set
- {
- editItemTemplate = value;
- OnColumnChanged();
- }
- }
-
- public virtual ITemplate FooterTemplate
- {
- get
- {
- return footerTemplate;
- }
- set
- {
- footerTemplate = value;
- OnColumnChanged();
- }
- }
-
- public virtual ITemplate HeaderTemplate
- {
- get
- {
- return headerTemplate;
- }
- set
- {
- headerTemplate = value;
- OnColumnChanged();
- }
- }
-
- public virtual ITemplate ItemTemplate
- {
- get
- {
- return itemTemplate;
- }
- set
- {
- itemTemplate = value;
- OnColumnChanged();
- }
- }
-
- public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
- {
- base.InitializeCell(cell, columnIndex, itemType);
- ITemplate toRender = null;
- switch(itemType)
- {
- case ListItemType.Header: toRender = headerTemplate;
- break;
- case ListItemType.Footer: toRender = footerTemplate;
- break;
- case ListItemType.Item: toRender = itemTemplate;
- break;
- case ListItemType.AlternatingItem: toRender = itemTemplate;
- break;
- case ListItemType.SelectedItem: toRender = editItemTemplate;
- break;
- default: toRender = editItemTemplate;
- }
- if(toRender != null)
- {
- cell.Text = String.Empty;
- toRender.InstantiateIn(cell);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs
deleted file mode 100755
index 906bb73badd..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: TextAlign
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum TextAlign
- {
- Left = 1,
- Right
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs
deleted file mode 100644
index ac0e1d2fc34..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs
+++ /dev/null
@@ -1,283 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TextBox
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 80%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections.Specialized;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TextBox : WebControl, IPostBackDataHandler
- {
- private static readonly object TextChangedEvent = new object();
-
- public TextBox(): base(HtmlTextWriterTag.Input)
- {
- }
-
- public virtual bool AutoPostBack
- {
- get
- {
- object o = ViewState["AutoPostBack"];
- if(o!=null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AutoPostBack"] = value;
- }
- }
-
- public virtual int Columns
- {
- get
- {
- object o = ViewState["Columns"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- ViewState["Columns"] = value;
- }
- }
-
- public virtual int MaxLength
- {
- get
- {
- object o = ViewState["MaxLrngth"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- ViewState["MaxLrngth"] = value;
- }
- }
-
- public virtual bool ReadOnly
- {
- get
- {
- object o = ViewState["ReadOnly"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["ReadOnly"] = value;
- }
- }
-
- public virtual int Rows
- {
- get
- {
- object o = ViewState["Rows"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- ViewState["Rows"] = value;
- }
- }
-
- public virtual string Text
- {
- get
- {
- object o = ViewState["Text"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- public virtual TextBoxMode TextMode
- {
- get
- {
- object o = ViewState["TextMode"];
- if(o != null)
- return (TextBoxMode)o;
- return TextBoxMode.SingleLine;
- }
- set
- {
- if(!Enum.IsDefined(typeof(TextBoxMode), value))
- {
- throw new ArgumentException();
- }
- ViewState["TextMode"] = value;
- }
- }
-
- public virtual bool Wrap
- {
- get
- {
- object o = ViewState["Wrap"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["Wrap"] = value;
- }
- }
-
- public event EventHandler TextChanged
- {
- add
- {
- Events.AddHandler(TextChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(TextChangedEvent, value);
- }
- }
-
- protected override HtmlTextWriterTag TagKey
- {
- get
- {
- if(TextMode == TextBoxMode.MultiLine)
- {
- return HtmlTextWriterTag.Textarea;
- }
- return HtmlTextWriterTag.Input;
- }
- }
-
- [MonoTODO("Check_Value_of_Text_Potential_Bug_In_MS_Implementation")]
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- if(Page != null)
- {
- Page.VerifyRenderingInServerForm(this);
- }
- writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID);
- if(TextMode == TextBoxMode.MultiLine)
- {
- if(Rows > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Rows, Rows.ToString(NumerFormatInfo.InvariantInfo));
- }
- if(Columns > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Cols, Columns.ToString(NumerFormatInfo.InvariantInfo));
- }
- if(!Wrap)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Wrap, "off");
- }
- } else
- {
- if(TextMode == TextBoxMode.Password)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Type, "password");
- } else
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Type, "text");
- }
- if(MaxLength > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Maxlength, MaxLength.ToString(NumberFormatInfo.InvariantInfo));
- }
- if(Columns > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Size, Columns.ToString(NumerFormatInfo.InvariantInfo));
- }
- }
-
- writer.AddAttribute(HtmlTextWriterAttribute.Value, Text);
- if(ReadOnly)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.ReadOnly, "readonly");
- }
- base.AddAttributesToRender(writer);
-
- if(AutoPostBack && Page != null)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Onchange, Page.GetPostBackClientEvent(this, ""));
- writer.AddAttribute("language", "javascript");
- }
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(obj is LiteralControl)
- {
- Text = ((LiteralControl)obj).Text;
- return;
- }
- throw new HttpException(HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "TextBox", GetType().Name.ToString()));
- }
-
- [MonoTODO("OnPreRender")]
- protected override void OnPreRender(EventArgs e)
- {
- OnPreRender(e);
- throw new NotImplementedException();
- }
-
- protected virtual void OnTextChanged(EventArgs e)
- {
- if(Events != null)
- {
- EventHandler eh = (EventHandler)(Events[TextChangedEvent]);
- if(eh != null)
- eh(this, e);
- }
- }
-
- [MonoTODO("Encode_Text")]
- protected override void Render(HtmlTextWriter writer)
- {
- RenderBeginTag(writer);
- //TODO: if(TextMode == MultiLine) { Encode(Text) and writeTo(writer) }
- RenderEndTag(writer);
- throw new NotImplementedException();
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- if(postCollection[postDataKey] != Text)
- {
- Text = postCollection[postDataKey];
- return true;
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- OnTextChanged(EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxControlBuilder.cs
deleted file mode 100644
index 3fdc6c2b180..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxControlBuilder.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TextBoxControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using Sytem.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TextBoxControlBuilder : ControlBuilder
- {
- public TextBoxControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
-
- public override bool HtmlDecodeLiterals()
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs
deleted file mode 100755
index 47b903ec0f2..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: TextBoxMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum TextBoxMode
- {
- SingleLine,
- MultiLine,
- Password
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TitleFormat.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TitleFormat.cs
deleted file mode 100755
index 3cfb9a42f42..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TitleFormat.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: TitleFormat
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum TitleFormat
- {
- Month,
- MonthYear
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs
deleted file mode 100644
index e10d0c4984d..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs
+++ /dev/null
@@ -1,254 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Struct: Unit
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public struct Unit
- {
- public static readonly Unit Empty = new Unit();
-
- private static int Min = -32768;
- private static int Max = +32767;
-
- private UnitType type;
- private double val;
-
- public static Unit Parse(string s)
- {
- return new Unit(s);
- }
-
- public static Unit Parse(string s, CultureInfo culture)
- {
- return new Unit(s, culture);
- }
-
- public static Unit Percentage(double n)
- {
- return new Unit(n);
- }
-
- public static Unit Pixel(int n)
- {
- return new Unit(n);
- }
-
- public static Unit Point(int n)
- {
- return new Unit(n, UnitType.Point);
- }
-
- public static bool operator ==(Unit left, Unit right)
- {
- return (left.type == right.type && left.val == right.val);
- }
-
- public static bool operator !=(Unit left, Unit right)
- {
- return !(left == right);
- }
-
- public static implicit operator Unit(int n)
- {
- return new Unit(n);
- }
-
- public Unit(double value)
- {
- if(value < Min || value > Max)
- {
- return ArgumentOutOfRangeException();
- }
- val = value;
- type = UnitType.Pixel;
- }
-
- public Unit(int value)
- {
- if(value < Min || value > Max)
- {
- return ArgumentOutOfRangeException();
- }
- val = value;
- type = UnitType.Pixel;
- }
-
- public Unit(string value): this(value, CultureInfo.CurrentCulture)
- {
- }
-
- public Unit(double value, UnitType type)
- {
- if(value < Min || value > Max)
- {
- return ArgumentOutOfRangeException();
- }
- val = value;
- this.type = type;
- }
-
- public Unit(string value, CultureInfo culture): this(value, culture, UnitType.Pixel)
- {
- }
-
- internal Unit(string value, CultureInfo culture, UnitType defType)
- {
- if(value == null || value.Length == 0)
- {
- this.val = 0;
- this.type = UnitType.Pixel;
- }
- if(culture == null)
- culture = CultureInfo.CurrentCulture;
- string strVal = value.Trim().ToLower();
- char c;
- int start = -1;
- int current = 0;
- for(int i = 0; i < strVal.Length; i++)
- {
- c = strVal[i];
- if( (c >= '0' && c <= '9') || (c == '-' || c == '.' || c == ',') )
- start = i;
- }
- if(start == -1)
- throw new ArgumentException();
- if( (start + 1) < strVal.Length)
- {
- this.type = GetTypeFromString(strVal.Substring(start + 1).Trim());
- } else
- {
- this.type = defType;
- }
- try
- {
- if(type == UnitType.Pixel)
- {
- val = (double)((new In32Converter()).ConvertFromString(null, culture, strVal.Substring(0, start + 1)));
- } else
- {
- val = (double)((new SingleConverter()).ConvertFromString(null, culture, strVal.Substring(0, start + 1)));
- }
- } catch(Exception e)
- {
- throw new ArgumentOutOfRangeException();
- }
- if(val < Min || val > Max)
- throw new ArgumentOutOfRangeException();
- }
-
- private UnitType GetTypeFromString(string s)
- {
- if(s == null || s.Length == 0)
- return UnitType.Pixel;
- s = s.ToLower().Trim();
- string[] uTypes = {
- "px",
- "pt",
- "pc",
- "in",
- "mm",
- "cm",
- "%",
- "em",
- "ex"
- }
- int i = 0;
- foreach(string cType in uTypes)
- {
- if(s == uTypes[i])
- return (UnitType)(i + 1);
- i++;
- }
- return UnitType.Pixel;
- }
-
- private string GetStringFromPixel(UnitType ut)
- {
- string[] uTypes = {
- "px",
- "pt",
- "pc",
- "in",
- "mm",
- "cm",
- "%",
- "em",
- "ex"
- }
- if( !Enum.IsDefined(typeof(UnitType), ut) )
- return "px";
- return uTypes[ut - 1];
- }
-
- public bool IsEmpty
- {
- get
- {
- return (type == 0);
- }
- }
-
- public UnitType Type
- {
- get
- {
- if(IsEmpty)
- return UnitType.Pixel;
- return type;
- }
- }
-
- public double Value
- {
- get
- {
- return val;
- }
- }
-
- public override bool Equals(object obj)
- {
- if(obj != null && obj is Unit)
- {
- Unit that = (Unit)obj;
- return ( this.type == that.type && this.val == that.val );
- }
- return false;
- }
-
- public override int GetHashCode()
- {
- return ( (type.GetHashCode() << 2) | (val.GetHashCode()) );
- }
-
- public override string ToString()
- {
- if(IsEmpty)
- return String.Empty;
- return ( val.ToString() + GetStringFromType(type) );
- }
-
- public override string ToString(CultureInfo culture)
- {
- if(IsEmpty)
- return String.Empty;
- return ( val.ToString(culture) + GetStringFromType(type) );
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs
deleted file mode 100644
index 7f1e774488c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: UnitConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class UnitConverter : TypeConverter
- {
- public UnitConverter(): base()
- {
- }
-
- public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
- {
- if(sourceType == typeof(string))
- return true;
- return CanConvertFrom(context, sourceType);
- }
-
- public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if(value == null)
- return null;
- if(value is string)
- {
- string val = ((string)value).Trim();
- if(val.Length == 0)
- {
- return Unit.Empty;
- }
- return (culture == null ? Unit.Parse(val) : Unit.Parse(val, culture));
- }
- return ConvertFrom(context, culture, value);
- }
-
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if(destinationType == typeof(string))
- {
- Unit val = (Unit)value;
- if(val == Unit.Empty)
- {
- return String.Empty;
- }
- return val.ToString(culture);
- }
- ConvertTo(context, culture, value, destinationType);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs
deleted file mode 100755
index 285c1cc7195..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: UnitType
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum UnitType
- {
- Pixel = 1,
- Point,
- Pica,
- Inch,
- Mm,
- Cm,
- Percentage,
- Em,
- Ex
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs
deleted file mode 100644
index 6f2bdd2a32b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ValidatedControlConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ValidatedControlConverter : StringConverter
- {
- public ValidatedControlConverter(): base()
- {
- }
-
- private object[] GetValues(IContainer container)
- {
- ArrayList values = new ArrayList();
- IEnumerator ie = container.Components.GetEnumerator();
- try
- {
- foreach(IComponent current in container.Components)
- {
- Control ctrl = (Control)current;
- if(ctrl == null || ctrl.ID == null || ctrl.ID.Length == 0)
- continue;
- ValidationPropertyAttribute attrib = (ValidationPropertyAttribute)((TypeDescriptor.GetAttributes(ctrl))[typeof(ValidationPropertyAttribute)]);
- if(attrib == null || attrib.Name == null)
- continue;
- values.Add(String.Copy(ctrl.ID));
- }
- }finally
- {
- if(ie is IDisposable)
- ie.Dispose();
- }
- values.Sort();
- return values.ToArray();
- }
-
- public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- if(context != null && context.Container != null)
- {
- object[] values = GetValues(context.Container);
- if(values != null)
- {
- return new StandardValuesCollection(values);
- }
- }
- return null;
- }
-
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return false;
- }
-
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs
deleted file mode 100755
index a752aa1df5d..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ValidationCompareOperator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ValidationCompareOperator
- {
- Equal,
- NotEqual,
- GreaterThan,
- GreaterThanEqual,
- LessThan,
- LessThanEqual,
- DataTypeCheck
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs
deleted file mode 100755
index 227133269e1..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ValidationDataType
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ValidationDataType
- {
- String,
- Integer,
- Double,
- Date,
- Currency
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
deleted file mode 100644
index 2c8199763e4..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ValidationSummary
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Drawing;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ValidationSummary : WebControl
- {
- private bool uplevelRender;
-
- public ValidationSummary(): base(HtmlTextWriterTag.Div)
- {
- uplevelRender = false;
- ForeColor = Color.Red;
- }
-
- public ValidationSummaryDisplayMode DisplayMode
- {
- get
- {
- object o = ViewState["DisplayMode"];
- if(o != null)
- return (ValidationSummaryDisplayMode)o;
- return ValidationSummaryDisplayMode.BulletList;
- }
- set
- {
- if(!Enum.IsDefined(typeof(ValidationSummaryDisplayMode), value))
- throw new ArgumentException();
- ViewState["DisplayMode"] = value;
- }
- }
-
- public bool EnableClientScript
- {
- get
- {
- object o = ViewState["EnableClientScript"];
- if(o != null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["EnableClientScript"] = value;
- }
- }
-
- public override Color ForeColor
- {
- get
- {
- return ForeColor;
- }
- set
- {
- ForeColor = value;
- }
- }
-
- public bool ShowMessageBox
- {
- get
- {
- object o = ViewState["ShowMessageBox"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["ShowMessageBox"] = value;
- }
- }
-
- public bool ShowSummary
- {
- get
- {
- object o = ViewState["ShowSummary"];
- if(o != null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowSummary"] = value;
- }
- }
-
- public string HeaderText
- {
- get
- {
- object o = ViewState["HeaderText"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["HeaderText"] = value;
- }
- }
-
- [MonoTODO("FIXME_See_Comments"}]
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- AddAttributesToRender(writer);
- if(uplevelRender)
- {
- //FIXME: This is not the case always. I forgot the case when it is absent.
- // something to do with the ID's value? or ClienID's value itself?
- writer.AddAttribute("id", ClientID);
- if(HeaderText.Length > 0)
- writer.AddAttribute("headertext", HeaderText, true);
- if(ShowMessageBox)
- writer.AddAttribute("showmessagebox", "True");
- if(!ShowSummary)
- writer.AddAttribute("showsummary", "False");
- if(ValidationSummary.DisplayMode != ValidationSummaryDisplayMode.BulletList)
- {
- writer.AddAttribute("displaymode", PropertyConverter.EnumToString(typeof(ValidationSummaryDisplayMode), ValidationSummary.DisplayMode));
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs
deleted file mode 100755
index c3cf718395c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ValidationSummaryDisplayMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ValidationSummaryDisplayMode
- {
- List,
- BulletList,
- SingleParagraph
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs
deleted file mode 100755
index 48086af18bc..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ValidatorDisplay
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ValidatorDisplay
- {
- None,
- Static,
- Dynamic
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs
deleted file mode 100755
index a115544e98c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: VerticalAlign
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum VerticalAlign
- {
- NotSet,
- Top,
- Middle,
- Bottom
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs
deleted file mode 100644
index 4686ae09546..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: WebColorConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Drawing;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class WebColorConverter : ColorConverter
- {
- public WebColorConverter(): base()
- {
- }
-
- [MonoTODO("Implement_If_Color_Is_#xxxxxx_OR_A_KnownColor")]
- public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if(value is string)
- {
- string val = ((string)value).Trim();
- if(val == String.Empty || val.Lenth == 0)
- {
- return Color.Empty;
- }
- if(val[0] == '#')
- {
- throw new NotImplementedException();
- }
- }
- return ConvertFrom(context, culture, value);
- }
-
- [MonoTODO("Convert_To_For_KnownColor_And_For_#xxxxxx")]
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if(destinationType == null)
- {
- throw new ArgumentNullException("destinationType");
- }
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
deleted file mode 100755
index 6d2cbacf7ac..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
+++ /dev/null
@@ -1,414 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: WebControl
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 40%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-using System.Drawing;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.WebControls
-{
- public class WebControl : Control, IAttributeAccessor
- {
- //TODO: A list of private members may be incomplete
-
- private HtmlTextWriterTag writerTag;
- private string stringTag;
- private AttributeCollection attributes;
- private StateBag attributeState;
- private Style controlStyle;
- private bool enabled;
- private HtmlTextWriterTag tagKey;
- private string tagName;
-
- // TODO: The constructors definitions
- protected WebControl(): base()
- {
- //todo: what now? To be rendered as SPAN tag!
- Initialize();
- }
-
- public WebControl(HtmlTextWriterTag tag): base()
- {
- //FIXME: am i right?
- writerTag = tag;
- //stringTag = null;
- Initialize();
- }
-
- protected WebControl(string tag): base()
- {
- //FIXME: am i right?
- stringTag = tag;
- //writerTag = null;
- Initialize();
- }
-
- private void Initialize()
- {
- controlStyle = null;
- enabled = true;
- tagName = null;
- attributeState = null;
- }
-
- public virtual string AccessKey
- {
- get
- {
- object o = ViewState["AccessKey"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["AccessKey"] = value;
- }
- }
-
- [MonoTODO("FIXME_Internal_method_calls")]
- public AttributeCollection Attributes
- {
- get
- {
- throw new NotImplementedException();
- if(attributes==null)
- {
- //FIXME: From where to get StateBag and how? I think this method is OK!
- if(attributeState == null)
- {
- attributeState = new StateBag(true);
- //FIXME: Uncomment the following in the final release
- // commented because of the assembly problem.
- //The function TrackViewState() is internal
- /*
- if(IsTrackingViewState)
- {
- attributeState.TrackViewState();
- }
- */
- }
- attributes = new AttributeCollection(attributeState);
- }
- return attributes;
- }
- }
-
- [MonoTODO("FIXME_Internal_method_calls")]
- public Style ControlStyle
- {
- get
- {
- if(controlStyle == null)
- {
- controlStyle = CreateControlStyle();
- //FIXME: Uncomment the following in the final release
- // commented because of the assembly problem.
- //The functions TrackViewState() and LoadViewState() are internal
- /*
- if(IsTrackingViewState)
- {
- controlStyle.TrackViewState();
- }
- controlStyle.LoadViewState(null);
- */
- }
- return controlStyle;
- }
- }
-
- public bool ControlStyleCreated
- {
- get
- {
- return (controlStyle!=null);
- }
- }
-
- public virtual string CssClass
- {
- get
- {
- return ControlStyle.CssClass;
- }
- set
- {
- ControlStyle.CssClass = value;
- }
- }
-
- public virtual bool Enabled
- {
- get
- {
- return enabled;
- }
- set
- {
- enabled = value;
- }
- }
-
- public virtual FontInfo Font
- {
- get
- {
- return ControlStyle.Font;
- }
- }
-
- public virtual Color ForeColor
- {
- get
- {
- return ControlStyle.ForeColor;
- }
- set
- {
- ControlStyle.ForeColor = value;
- }
- }
-
- public virtual Unit Height
- {
- get
- {
- return ControlStyle.Height;
- }
- set
- {
- ControlStyle.Height = value;
- }
- }
-
- public CssStyleCollection Style
- {
- get
- {
- return Attributes.CssStyle;
- }
- }
-
- public virtual short TabIndex
- {
- get
- {
- object o = ViewState["TabIndex"];
- if(o!=null)
- return (short)o;
- return 0;
- }
- set
- {
- if(value < -32768 || value > 32767)
- throw new ArgumentException();
- ViewState["TabIndex"] = value;
- }
- }
-
- public virtual string ToolTip
- {
- get
- {
- object o = ViewState["ToolTip"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["ToolTip"] = value;
- }
- }
-
- public virtual Unit Width
- {
- get
- {
- return ControlStyle.Width;
- }
- set
- {
- ControlStyle.Width = value;
- }
- }
-
- [MonoTODO("FIXME_Internal_method_calls")]
- public void ApplyStyle(Style s)
- {
- /* FIXME: Again internal problem
- if(!ControlStyle.IsEmpty)
- {
- */
- ControlStyle.CopyFrom(s);
- //}
- }
-
- [MonoTODO]
- public void CopyBaseAttributes(WebControl controlSrc)
- {
- //TODO: tocopy
- /*
- * AccessKey, Enabled, ToolTip, TabIndex, Attributes
- */
- AccessKey = controlSrc.AccessKey;
- Enabled = controlSrc.Enabled;
- ToolTip = controlSrc.ToolTip;
- TabIndex = controlSrc.TabIndex;
- attributes = controlSrc.Attributes;
- throw new NotImplementedException();
- }
-
- public void MergeStyle(Style s)
- {
- ControlStyle.MergeWith(s);
- }
-
- public virtual void RenderBeginTag(HtmlTextWriter writer)
- {
- AddAttributesToRender(writer);
- if(Enum.IsDefined(typeof(HtmlTextWriterTag), TagKey) )
- {
- writer.RenderBeginTag(TagKey);
- return;
- }
- writer.RenderBeginTag(tagName);
- }
-
- public virtual void RenderEndTag(HtmlTextWriter writer)
- {
- writer.RenderEndTag();
- }
-
- protected virtual HtmlTextWriterTag TagKey
- {
- get
- {
- return tagKey;
- }
- }
-
- protected virtual string TagName
- {
- get
- {
- if(tagName==null && Enum.IsDefined(typeof(HtmlTextWriterTag), tagKey) )
- {
- tagName = Enum.Format(typeof(HtmlTextWriterTag), tagKey, "G").ToString();
- }
- return tagName;
- }
- }
-
- protected virtual void AddAttributesToRender(HtmlTextWriter writer)
- {
- if(ID!=null)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
- }
- if(AccessKey.Length>0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, AccessKey);
- }
- if(!Enabled)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled");
- }
- if(ToolTip.Length>0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Title, ToolTip);
- }
- if(TabIndex != 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Tabindex, TabIndex.ToString());
- }
- if(ControlStyleCreated)
- {
- if(!ControlStyle.IsEmpty)
- {
- ControlStyle.AddAttributesToRender(writer, this);
- }
- }
- if(attributeState!=null)
- {
- IEnumerator ie = Attributes.Keys.GetEnumerator();
- do
- {
- writer.AddAttribute((string)ie.Current, Attributes[(string)ie.Current]);
- } while(ie.MoveNext());
- }
- }
-
- protected virtual Style CreateControlStyle()
- {
- return new Style(ViewState);
- }
-
- [MonoTODO]
- protected override void LoadViewState(object savedState)
- {
- throw new NotImplementedException();
- //TODO: Load viewStates
- /*
- * May be will have to first look at Control::LoadViewState
- */
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- RenderBeginTag(writer);
- RenderContents(writer);
- RenderEndTag(writer);
- }
-
- protected virtual void RenderContents(HtmlTextWriter writer)
- {
- base.Render(writer);
- }
-
- [MonoTODO]
- protected override object SaveViewState()
- {
- throw new NotImplementedException();
- //TODO: Implement me!
- }
-
- protected override void TrackViewState()
- {
- TrackViewState();
- if(ControlStyleCreated)
- {
- ControlStyle.TrackViewState();
- }
- if(attributeState!=null)
- {
- attributeState.TrackViewState();
- }
- }
-
- string IAttributeAccessor.GetAttribute(string key)
- {
- if(Attributes!=null)
- return (string)Attributes[key];
- return null;
- }
-
- void IAttributeAccessor.SetAttribute(string key, string value)
- {
- Attributes[key] = value;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs
deleted file mode 100644
index 47f86426d03..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs
+++ /dev/null
@@ -1,202 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Xml
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 75%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Xml;
-using System.Xml.Xsl;
-using System.Xml.XPath;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class Xml : Control
- {
- private XmlDocument document;
- private string documentContent;
- private string documentSource;
- private XslTransform transform;
- private XsltArgumentList transformArgumentList;
- private string transformSource;
-
- private XPathDocument xpathDoc;
-
- private static XslTransform defaultTransform;
-
- static Xml()
- {
- XmlTextReader reader = new StringReader("<xsl:stylesheet version='1.0' " +
- "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>" +
- "<xsl:template match=\"\">" +
- "<xsl:copy-of select=\".\"/>" +
- "</xsl:template>" +
- "</xsl:stylesheet>");
- defaultTransform = new XslTransform();
- defaultTransform.Load(reader);
- }
-
- public Xml(): base()
- {
- }
-
- [MonoTODO("Initialize_Document")]
- private void LoadXmlDoc()
- {
- throw new NotImplementedException();
- }
-
- public XmlDocument Document
- {
- get
- {
- if(document == null)
- LoadXmlDoc();
- return document;
- }
- set
- {
- documentSource = null;
- documentContent = null;
- xpathDoc = null;
- document = value;
- }
- }
-
- public string DocumentContent
- {
- get
- {
- return String.Empty;
- }
- set
- {
- document = null;
- xpathDoc = null;
- documentContent = value;
- }
- }
-
- public string DocumentSource
- {
- get
- {
- if(documentSource != null)
- return documentSource;
- return String.Empty;
- }
- set
- {
- document = null;
- documentContent = null;
- xpathDoc = null;
- documentSource = value;
- }
- }
-
- public XslTransform Transform
- {
- get
- {
- return transform;
- }
- set
- {
- transformSource = null;
- transform = value;
- }
- }
-
- public string TransformSource
- {
- get
- {
- if(transformSource != null)
- return transformSource;
- return String.Empty;
- }
- set
- {
- transform = null
- transformSource = value;
- }
- }
-
- public XsltArgumentList TransformArgumentList
- {
- get
- {
- return transformArgumentList;
- }
- set
- {
- transformArgumentList = value;
- }
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(obj is LiteralControl)
- {
- DocumentContent = ((LiteralContent)obj).Text;
- return;
- }
- throw new HttpException(HttpRuntime.FormatResourceString("Cannot_Have_Children_of_Type", "Xml", GetType().Name.ToString()));
- }
-
- [MonoTODO("Initialize_xpathDocument")]
- private void LoadXpathDoc()
- {
- if(documentContent != null && documentContent.Length > 0)
- {
- xpathDoc = new XPathDocument(new StringReader(documentContent));
- return;
- }
- if(documentSource == null || documentSource.Length == 0)
- {
- return;
- }
- throw new NotImplementedException();
- }
-
- [MonoTODO("Initialize_Transform")]
- private void LoadTransform()
- {
- throw new ArgumentException();
- }
-
- [MonoTODO]
- protected override void Render(HtmlTextWriter output)
- {
- if(document == null)
- {
- LoadXpathDoc();
- }
-
- LoadTransform();
- if(document == null || xpathDoc == null)
- {
- return;
- }
- if(transform == null)
- {
- transform = defaultTransform;
- }
- if(document != null)
- {
- Transform.Transform(document, transformArgumentList, output);
- return;
- }
- Transform.Transform(xpathDoc, transformArgumentList, output);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/BuildMethod.cs b/mcs/class/System.Web/System.Web.UI/BuildMethod.cs
deleted file mode 100644
index d06a4024166..00000000000
--- a/mcs/class/System.Web/System.Web.UI/BuildMethod.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.UI.BuildMethod.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public delegate Control BuildMethod();
-}
diff --git a/mcs/class/System.Web/System.Web.UI/BuildTemplateMethod.cs b/mcs/class/System.Web/System.Web.UI/BuildTemplateMethod.cs
deleted file mode 100644
index 8d53ce41e2e..00000000000
--- a/mcs/class/System.Web/System.Web.UI/BuildTemplateMethod.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.UI.BuildTemplateMethod.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public delegate void BuildTemplateMethod(Control control);
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog
deleted file mode 100644
index d99e6fc2794..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ChangeLog
+++ /dev/null
@@ -1,77 +0,0 @@
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * DesignTimeParseData.cs: initialze static member to avoid compile
- error
- * PropertyConverter.cs: remove uneeded exception variables from
- catch blocks.
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * DesignTimeParseData.cs: fix header to show correct class name
-
-2001-12-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * StateBag.cs - Completed
-
-2001-12-19 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * Pair.cs - Small undocumented class. Completed.
-
-2001-12-18 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * DesignTimeParseData.cs - Initial implementation
- * StateBag.cs - Initial implementation
-
-2001-12-17 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * PropertyConverter.cs - Undocumented class. Completed.
- * Utils.cs - Undocumented, private class.
- Initial implementation
-
-2001-08-28 Bob Smith <bob@thestuff.net>
- * Control.cs: Figured out some undocumented API.
- * Added TODO.
- * BuildMethod.cs: Initial implementation.
- * BuildTemplateMethod.cs: Initial implementation.
- * HtmlTextWriterAttribute.cs: Initial implementation.
- * HtmlTextWriterStyle.cs: Initial implementation.
- * HtmlTextWriterTag.cs: Initial implementation.
- * IAttributeAccessor.cs: Initial implementation.
- * IDataBindingsAccessor.cs: Initial implementation.
- * ImageClickEventHandler.cs: Initial implementation.
- * INamingContainer.cs: Initial implementation.
- * IParserAccessor.cs: Initial implementation.
- * IPostBackDataHandler.cs: Initial implementation.
- * IPostBackEventHandler.cs: Initial implementation.
- * IStateManager.cs: Initial implementation.
- * ITagNameToTypeMapper.cs: Initial implementation.
- * ITemplate.cs: Initial implementation.
- * IValidator.cs: Initial implementation.
- * OutputCacheLocation.cs: Initial implementation.
- * PersistanceMode.cs: Initial implementation.
- * StateItem.cs: Initial implementation.
-
-2001-08-27 Bob Smith <bob@thestuff.net>
-
- * Control.cs: Bug fixes and implementations.
-
-2001-08-24 Bob Smith <bob@thestuff.net>
-
- * Control.cs: Bug fixes.
-
-2001-08-23 Bob Smith <bob@thestuff.net>
-
- * Control.cs: More implementation. Events reworked for performance.
-
-2001-08-22 Bob Smith <bob@thestuff.net>
-
- * LiteralControl.cs: Implemented.
- * Control.cs: Even more implementation (Events). What a beast.
-
-2001-08-20 Bob Smith <bob@thestuff.net>
-
- * Control.cs: More implementation. Not done yet. Shutter.
-
-2001-08-17 Bob Smith <bob@thestuff.net>
-
- * Control.cs: Partial implementation.
diff --git a/mcs/class/System.Web/System.Web.UI/Control.cs b/mcs/class/System.Web/System.Web.UI/Control.cs
deleted file mode 100644
index 70779b7cdaa..00000000000
--- a/mcs/class/System.Web/System.Web.UI/Control.cs
+++ /dev/null
@@ -1,608 +0,0 @@
-//
-// System.Web.UI.Control.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-/*
- * Maintainer: bob@thestuff.net, gvaish@iitk.ac.in
- * (C) Bob Smith, Gaurav Vaish
- */
-
-//notes: view state only tracks changes after OnInit method is executed for the page request. You can read from it at any time, but cant write to it during rendering.
-//even more notes: view state info in trackviewstate method description. read later.
-//Ok, enough notes: what the heck is different between enable view state, and track view state.
-//Well, maybe not. How does the ViewState know when to track changes? Does it look at the property
-//on the owning control, or does it have a method/property of its own that gets called?
-// I think this last question is solved in the Interface for it. Look into this.
-
-//cycle:
-//init is called when control is first created.
-//load view state ic called right after init to populate the view state.
-//loadpostdata is called if ipostbackdatahandler is implemented.
-//load is called when control is loaded into a page
-//raisepostdatachangedevent if ipostbackdatahandler is implemented.
-//raisepostbackevent if ipostbackeventhandler is implemented.
-//prerender is called when the server is about to render its page object
-//SaveViewState is called.
-//Unload then dispose it apears. :)
-
-//Naming Container MUST have some methods. What are they? No clue. Help?
-
-//read this later. http://gotdotnet.com/quickstart/aspplus/
-//This to: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguidnf/html/cpconattributesdesign-timesupport.asp
-//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguidnf/html/cpcontracefunctionality.asp
-
-// Isnt life grand? :)
-// See the undocumented methods? Gota love um. ;)
-// ASP.test4_aspx.Page_Load(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.Web.UI.Control.OnLoad(EventArgs e) +67
-// System.Web.UI.Control.LoadRecursive() +73
-// System.Web.UI.Page.ProcessRequestMain() +394
-
-// ASP.test4_aspx.Page_Unload(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.EventHandler.Invoke(Object sender, EventArgs e) +0
-// System.Web.UI.Control.OnUnload(EventArgs e) +67
-// System.Web.UI.Control.UnloadRecursive(Boolean dispose) +78
-// System.Web.UI.Page.ProcessRequest() +194
-// System.Web.UI.Page.ProcessRequest(HttpContext context) +18
-// System.Web.CallHandlerExecutionStep.Execute() +179
-// System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
-
-
-// ASP.test4_aspx.Page_Unload(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.Web.UI.Control.OnUnload(EventArgs e) +67
-// System.Web.UI.Control.UnloadRecursive(Boolean dispose) +78
-// System.Web.UI.Page.ProcessRequest()
-
-// ASP.test4_aspx.Page_Kill(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.Web.UI.Control.OnPreRender(EventArgs e) +67
-// System.Web.UI.Control.PreRenderRecursiveInternal() +61
-// System.Web.UI.Page.ProcessRequestMain() +753
-
-// ASP.test4_aspx.OnInit(EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.Web.UI.Control.InitRecursive(Control namingContainer) +202
-// System.Web.UI.Page.ProcessRequestMain() +120
-
-// ASP.test4_aspx.SaveViewState() in \\genfs2\www24\bobsmith11\test4.aspx:12
-// System.Web.UI.Control.SaveViewStateRecursive() +51
-// System.Web.UI.Page.SavePageViewState() +174
-// System.Web.UI.Page.ProcessRequestMain() +861
-
-// ASP.test_aspx.LoadViewState(Object t) +28
-// System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +125
-// System.Web.UI.Page.LoadPageViewState() +182
-// System.Web.UI.Page.ProcessRequestMain() +256
-
-using System;
-using System.Collections;
-using System.Web;
-using System.ComponentModel;
-
-namespace System.Web.UI
-{
- public class Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor
- {
- private static readonly object DataBindingEvent = new object();
- private static readonly object DisposedEvent = new object();
- private static readonly object InitEvent = new object();
- private static readonly object LoadEvent = new object();
- private static readonly object PreRenderEvent = new object();
- private static readonly object UnloadEvent = new object();
- private string _userId = null;
- private string _cachedUserId = null;
- private string _cachedClientId = null;
- private ControlCollection _controls = null;
- private bool _enableViewState = true;
- private IDictionary _childViewStates = null; //TODO: Not sure datatype. Placeholder guess.
- private bool _isNamingContainer = false;
- private Control _namingContainer = null;
- private Page _page = null;
- private Control _parent = null;
- private ISite _site = null;
- private bool _visible = true;
- private HttpContext _context = null;
- private bool _childControlsCreated = false;
- private StateBag _viewState = null;
- private bool _trackViewState = false;
- private EventHandlerList _events = new EventHandlerList();
- private RenderMethod _renderMethodDelegate = null;
-
- private DataBindingCollection dataBindings = null;
-
- public Control()
- {
- if (this is INamingContainer) _isNamingContainer = true;
- }
- public virtual string ClientID //DIT
- {
- get
- {
- if (_cachedUserId != null && _cachedClientId != null)
- return _cachedClientId;
- _cachedUserId = UniqueID.Replace(':', '_');
- return _cachedUserId;
- }
- }
- public virtual ControlCollection Controls //DIT
- {
- get
- {
- if (_controls == null) _controls = CreateControlCollection();
- return _controls;
- }
- }
- public virtual bool EnableViewState //DIT
- {
- get
- {
- return _enableViewState;
- }
- set
- {
- _enableViewState = value;
- }
- }
- public virtual string ID
- {
- get //DIT
- {
- return _userId;
- }
- set
- {
- if (value == null || value == "") return;
- _userId = value;
- _cachedUserId = null;
- //TODO: Some Naming Container stuff here I think.
- }
- }
- public virtual Control NamingContainer //DIT
- {
- get
- {
- if (_namingContainer == null && _parent != null)
- {
- if (_parent._isNamingContainer == false)
- _namingContainer = _parent.NamingContainer;
- else
- _namingContainer = _parent;
- }
- return _namingContainer;
- }
- }
- public virtual Page Page //DIT
- {
- get
- {
- if (_page == null && _parent != null) _page = _parent.Page;
- return _page;
- }
- set
- {
- _page = value;
- }
- }
- public virtual Control Parent //DIT
- {
- get
- {
- return _parent;
- }
- }
- public ISite Site //DIT
- {
- get
- {
- return _site;
- }
- set
- {
- _site = value;
- }
- }
- public virtual string TemplateSourceDirectory
- {
- get
- {
- return Context.Request.ApplicationPath; //TODO: Dont think this is right.
- }
- }
-
- [MonoTODO]
- public virtual string UniqueID
- {
- get
- {
- //TODO: Some Naming container methods here. What are they? Why arnt they declared?
- //Note: Nuked the old stuff here. Was total crap. :)
- throw new NotImplementedException();
- }
- }
- public virtual bool Visible
- { //TODO: Are children visible when parents are not?
- get
- {
- return _visible;
- }
- set
- {
- _visible = value;
- }
- }
- protected bool ChildControlsCreated //DIT
- {
- get
- {
- return _childControlsCreated;
- }
- set
- {
- if (value == false && _childControlsCreated == true)
- _controls.Clear();
- _childControlsCreated = value;
- }
- }
- protected virtual HttpContext Context //DIT
- {
- get
- {
- HttpContext context;
- if (_context != null)
- return _context;
- if (_parent == null)
- return HttpContext.Current;
- context = _parent.Context;
- if (context != null)
- return context;
- return HttpContext.Current;
- }
- }
- protected EventHandlerList Events //DIT
- {
- get
- {
- if (_events == null)
- {
- _events = new EventHandlerList();
- }
- return _events;
- }
- }
- protected bool HasChildViewState //DIT
- {
- get
- {
- if (_childViewStates == null) return false;
- return true;
- }
- }
- protected bool IsTrackingViewState //DIT
- {
- get
- {
- return _trackViewState;
- }
- }
- protected virtual StateBag ViewState
- {
- get
- {
- if(_viewState == null)
- {
- _viewState = new StateBag(ViewStateIgnoresCase);
- if(IsTrackingViewState)
- _viewState.TrackViewState();
- }
- return _viewState;
- }
- }
- protected virtual bool ViewStateIgnoresCase //DIT
- {
- get
- {
- return true;
- }
- }
- protected virtual void AddParsedSubObject(object obj) //DIT
- {
- Control c = (Control)obj;
- if (c != null) Controls.Add(c);
- }
- protected void BuildProfileTree(string parentId, bool calcViewState)
- {
- //TODO
- }
- protected void ClearChildViewState()
- {
- //TODO
- //Not quite sure about this. an example clears children then calls this, so I think
- //view state is local to the current object, not children.
- }
- protected virtual void CreateChildControls() {} //DIT
- protected virtual ControlCollection CreateControlCollection() //DIT
- {
- return new ControlCollection(this);
- }
- protected virtual void EnsureChildControls() //DIT
- {
- if (_childControlsCreated == false)
- {
- CreateChildControls();
- ChildControlsCreated = true;
- }
- }
- protected virtual Control FindControl(string id, int pathOffset)
- {
- //TODO: I think there is Naming Container stuff here. Redo.
- int i;
- for (i = pathOffset; i < _controls.Count; i++)
- if (_controls[i].ID == id) return _controls[i];
- return null;
- }
- protected virtual void LoadViewState(object savedState)
- {
- //TODO: What should I do by default?
- }
-
- [MonoTODO]
- protected string MapPathSecure(string virtualPath)
- {
- throw new NotImplementedException();
- //TODO: Need to read up on security+web.
- }
- protected virtual bool OnBubbleEvent(object source, EventArgs args) //DIT
- {
- return false;
- }
- protected virtual void OnDataBinding(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[DataBindingEvent]);
- if (eh != null) eh(this, e);
- }
- }
- protected virtual void OnInit(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[InitEvent]);
- if (eh != null) eh(this, e);
- }
- }
- protected virtual void OnLoad(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[LoadEvent]);
- if (eh != null) eh(this, e);
- }
- }
- protected virtual void OnPreRender(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[PreRenderEvent]);
- if (eh != null) eh(this, e);
- }
- }
- protected virtual void OnUnload(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[UnloadEvent]);
- if (eh != null) eh(this, e);
- }
- }
-
- [MonoTODO]
- protected void RaiseBubbleEvent(object source, EventArgs args)
- {
- throw new NotImplementedException();
- //return false;
- }
- protected virtual void Render(HtmlTextWriter writer) //DIT
- {
- RenderChildren(writer);
- }
- protected virtual void RenderChildren(HtmlTextWriter writer) //DIT
- {
- if (_renderMethodDelegate != null)
- _renderMethodDelegate(writer, this);
- else if (_controls != null)
- foreach (Control c in _controls)
- c.RenderControl(writer);
- }
- protected virtual object SaveViewState()
- {
- return ViewState;
- }
- protected virtual void TrackViewState()
- {
- _trackViewState = true;
- }
-
- [MonoTODO]
- public virtual void Dispose()
- {
- //TODO: nuke stuff.
- throw new NotImplementedException();
- /*
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[DisposedEvent]);
- if (eh != null) eh(this, e);
- }
- */
- }
- public event EventHandler DataBinding //DIT
- {
- add
- {
- Events.AddHandler(DataBindingEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DataBindingEvent, value);
- }
- }
- public event EventHandler Disposed //DIT
- {
- add
- {
- Events.AddHandler(DisposedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DisposedEvent, value);
- }
- }
- public event EventHandler Init //DIT
- {
- add
- {
- Events.AddHandler(InitEvent, value);
- }
- remove
- {
- Events.RemoveHandler(InitEvent, value);
- }
- }
- public event EventHandler Load //DIT
- {
- add
- {
- Events.AddHandler(LoadEvent, value);
- }
- remove
- {
- Events.RemoveHandler(LoadEvent, value);
- }
- }
- public event EventHandler PreRender //DIT
- {
- add
- {
- Events.AddHandler(PreRenderEvent, value);
- }
- remove
- {
- Events.RemoveHandler(PreRenderEvent, value);
- }
- }
- public event EventHandler Unload //DIT
- {
- add
- {
- Events.AddHandler(UnloadEvent, value);
- }
- remove
- {
- Events.RemoveHandler(UnloadEvent, value);
- }
- }
- public virtual void DataBind() //DIT
- {
- OnDataBinding(EventArgs.Empty);
- if (_controls != null)
- foreach (Control c in _controls)
- c.DataBind();
- }
- public virtual Control FindControl(string id) //DIT
- {
- return FindControl(id, 0);
- }
- public virtual bool HasControls() //DIT
- {
- if (_controls != null && _controls.Count >0) return true;
- return false;
- }
- public void RenderControl(HtmlTextWriter writer)
- {
- if (_visible)
- {
- //TODO: Something about tracing here.
- Render(writer);
- }
- }
-
- [MonoTODO]
- public string ResolveUrl(string relativeUrl)
- {
- throw new NotImplementedException();
- }
- public void SetRenderMethodDelegate(RenderMethod renderMethod) //DIT
- {
- _renderMethodDelegate = renderMethod;
- }
- protected void LoadRecursive()
- {
- OnLoad(EventArgs.Empty);
- if (_controls != null) foreach (Control c in _controls) c.LoadRecursive();
- }
- protected void UnloadRecursive(Boolean dispose)
- {
- OnUnload(EventArgs.Empty);
- if (_controls != null) foreach (Control c in _controls) c.UnloadRecursive(dispose);
- if (dispose) Dispose();
- }
- protected void PreRenderRecursiveInternal()
- {
- OnPreRender(EventArgs.Empty);
- if (_controls != null) foreach (Control c in _controls) c.PreRenderRecursiveInternal();
- }
- protected void InitRecursive(Control namingContainer)
- {
- if (_controls != null) foreach (Control c in _controls) c.InitRecursive(namingContainer);
- OnInit(EventArgs.Empty);
- }
-
- [MonoTODO]
- protected object SaveViewStateRecursive()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- protected void LoadViewStateRecursive(Object savedState)
- {
- throw new NotImplementedException();
- }
-
- void IParserAccessor.AddParsedSubObject(object obj)
- {
- this.AddParsedSubObject(obj);
- }
-
- DataBindingCollection IDataBindingsAccessor.DataBindings
- {
- get
- {
- if(dataBindings == null)
- dataBindings = new DataBindingCollection();
- return dataBindings;
- }
- }
-
- bool IDataBindingsAccessor.HasDataBindings
- {
- get
- {
- return (dataBindings!=null && dataBindings.Count>0);
- }
- }
-
- [MonoTODO("To set a flag to prevent automatic generation of IDs")]
- internal void PreventAutoID()
- {
- throw new NotImplementedException();
- }
-
- //TODO: I think there are some needed Interface implementations to do here.
- //TODO: Find api for INamingContainer.
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/DesignTimeParseData.cs b/mcs/class/System.Web/System.Web.UI/DesignTimeParseData.cs
deleted file mode 100644
index 901e0c4cb91..00000000000
--- a/mcs/class/System.Web/System.Web.UI/DesignTimeParseData.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: DesignTimeParseData
- *
- * Author: Gaurav Vaish
- * Contact: <gvaish@iitk.ac.in>
- * Status: ?%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public sealed class DesignTimeParseData
- {
- private static bool inDesigner = false;
-
- internal static bool InDesigner
- {
- get
- {
- return inDesigner;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
deleted file mode 100644
index ef794771686..00000000000
--- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
+++ /dev/null
@@ -1,1028 +0,0 @@
-/* System.Web.UI
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI{
-
-public class HtmlTextWriter : System.IO.TextWriter {
-
-static HtmlTextWriter(){
- HtmlTextWriter._tagKeyLookupTable = new Hashtable(97);
- HtmlTextWriter._tagNameLookupArray = new TagInformation[97];
- HtmlTextWriter.RegisterTag("", HtmlTextWriterTag.Unknown, TagType.Other);
- HtmlTextWriter.RegisterTag("a", HtmlTextWriterTag.A, TagType.Inline);
- HtmlTextWriter.RegisterTag("acronym", HtmlTextWriterTag.Acronym, TagType.Inline);
- HtmlTextWriter.RegisterTag("address", HtmlTextWriterTag.Address, TagType.Other);
- HtmlTextWriter.RegisterTag("area", HtmlTextWriterTag.Area, TagType.Other);
- HtmlTextWriter.RegisterTag("b", HtmlTextWriterTag.B, TagType.Inline);
- HtmlTextWriter.RegisterTag("base", HtmlTextWriterTag.Base, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("basefont", HtmlTextWriterTag.Basefont, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("bdo", HtmlTextWriterTag.Bdo, TagType.Inline);
- HtmlTextWriter.RegisterTag("bgsound", HtmlTextWriterTag.Bgsound, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("big", HtmlTextWriterTag.Big, TagType.Inline);
- HtmlTextWriter.RegisterTag("blockquote", HtmlTextWriterTag.Blockquote, TagType.Other);
- HtmlTextWriter.RegisterTag("body", HtmlTextWriterTag.Body, TagType.Other);
- HtmlTextWriter.RegisterTag("br", HtmlTextWriterTag.Br, TagType.Other);
- HtmlTextWriter.RegisterTag("button", HtmlTextWriterTag.Button, TagType.Inline);
- HtmlTextWriter.RegisterTag("caption", HtmlTextWriterTag.Caption, TagType.Other);
- HtmlTextWriter.RegisterTag("center", HtmlTextWriterTag.Center, TagType.Other);
- HtmlTextWriter.RegisterTag("cite", HtmlTextWriterTag.Cite, TagType.Inline);
- HtmlTextWriter.RegisterTag("code", HtmlTextWriterTag.Code, TagType.Inline);
- HtmlTextWriter.RegisterTag("col", HtmlTextWriterTag.Col, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("colgroup", HtmlTextWriterTag.Colgroup, TagType.Other);
- HtmlTextWriter.RegisterTag("del", HtmlTextWriterTag.Del, TagType.Inline);
- HtmlTextWriter.RegisterTag("dd", HtmlTextWriterTag.Dd, TagType.Inline);
- HtmlTextWriter.RegisterTag("dfn", HtmlTextWriterTag.Dfn, TagType.Inline);
- HtmlTextWriter.RegisterTag("dir", HtmlTextWriterTag.Dir, TagType.Other);
- HtmlTextWriter.RegisterTag("div", HtmlTextWriterTag.Div, TagType.Other);
- HtmlTextWriter.RegisterTag("dl", HtmlTextWriterTag.Dl, TagType.Other);
- HtmlTextWriter.RegisterTag("dt", HtmlTextWriterTag.Dt, TagType.Inline);
- HtmlTextWriter.RegisterTag("em", HtmlTextWriterTag.Em, TagType.Inline);
- HtmlTextWriter.RegisterTag("embed", HtmlTextWriterTag.Embed, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("fieldset", HtmlTextWriterTag.Fieldset, TagType.Other);
- HtmlTextWriter.RegisterTag("font", HtmlTextWriterTag.Font, TagType.Inline);
- HtmlTextWriter.RegisterTag("form", HtmlTextWriterTag.Form, TagType.Other);
- HtmlTextWriter.RegisterTag("frame", HtmlTextWriterTag.Frame, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("frameset", HtmlTextWriterTag.Frameset, TagType.Other);
- HtmlTextWriter.RegisterTag("h1", HtmlTextWriterTag.H1, TagType.Other);
- HtmlTextWriter.RegisterTag("h2", HtmlTextWriterTag.H2, TagType.Other);
- HtmlTextWriter.RegisterTag("h3", HtmlTextWriterTag.H3, TagType.Other);
- HtmlTextWriter.RegisterTag("h4", HtmlTextWriterTag.H4, TagType.Other);
- HtmlTextWriter.RegisterTag("h5", HtmlTextWriterTag.H5, TagType.Other);
- HtmlTextWriter.RegisterTag("h6", HtmlTextWriterTag.H6, TagType.Other);
- HtmlTextWriter.RegisterTag("head", HtmlTextWriterTag.Head, TagType.Other);
- HtmlTextWriter.RegisterTag("hr", HtmlTextWriterTag.Hr, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("html", HtmlTextWriterTag.Html, TagType.Other);
- HtmlTextWriter.RegisterTag("i", HtmlTextWriterTag.I, TagType.Inline);
- HtmlTextWriter.RegisterTag("iframe", HtmlTextWriterTag.Iframe, TagType.Other);
- HtmlTextWriter.RegisterTag("img", HtmlTextWriterTag.Img, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("input", HtmlTextWriterTag.Input, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("ins", HtmlTextWriterTag.Ins, TagType.Inline);
- HtmlTextWriter.RegisterTag("isindex", HtmlTextWriterTag.Isindex, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("kbd", HtmlTextWriterTag.Kbd, TagType.Inline);
- HtmlTextWriter.RegisterTag("label", HtmlTextWriterTag.Label, TagType.Inline);
- HtmlTextWriter.RegisterTag("legend", HtmlTextWriterTag.Legend, TagType.Other);
- HtmlTextWriter.RegisterTag("li", HtmlTextWriterTag.Li, TagType.Inline);
- HtmlTextWriter.RegisterTag("link", HtmlTextWriterTag.Link, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("map", HtmlTextWriterTag.Map, TagType.Other);
- HtmlTextWriter.RegisterTag("marquee", HtmlTextWriterTag.Marquee, TagType.Other);
- HtmlTextWriter.RegisterTag("menu", HtmlTextWriterTag.Menu, TagType.Other);
- HtmlTextWriter.RegisterTag("meta", HtmlTextWriterTag.Meta, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("nobr", HtmlTextWriterTag.Nobr, TagType.Inline);
- HtmlTextWriter.RegisterTag("noframes", HtmlTextWriterTag.Noframes, TagType.Other);
- HtmlTextWriter.RegisterTag("noscript", HtmlTextWriterTag.Noscript, TagType.Other);
- HtmlTextWriter.RegisterTag("object", HtmlTextWriterTag.Object, TagType.Other);
- HtmlTextWriter.RegisterTag("ol", HtmlTextWriterTag.Ol, TagType.Other);
- HtmlTextWriter.RegisterTag("option", HtmlTextWriterTag.Option, TagType.Other);
- HtmlTextWriter.RegisterTag("p", HtmlTextWriterTag.P, TagType.Inline);
- HtmlTextWriter.RegisterTag("param", HtmlTextWriterTag.Param, TagType.Other);
- HtmlTextWriter.RegisterTag("pre", HtmlTextWriterTag.Pre, TagType.Other);
- HtmlTextWriter.RegisterTag("q", HtmlTextWriterTag.Q, TagType.Inline);
- HtmlTextWriter.RegisterTag("rt", HtmlTextWriterTag.Rt, TagType.Other);
- HtmlTextWriter.RegisterTag("ruby", HtmlTextWriterTag.Ruby, TagType.Other);
- HtmlTextWriter.RegisterTag("s", HtmlTextWriterTag.S, TagType.Inline);
- HtmlTextWriter.RegisterTag("samp", HtmlTextWriterTag.Samp, TagType.Inline);
- HtmlTextWriter.RegisterTag("script", HtmlTextWriterTag.Script, TagType.Other);
- HtmlTextWriter.RegisterTag("select", HtmlTextWriterTag.Select, TagType.Other);
- HtmlTextWriter.RegisterTag("small", HtmlTextWriterTag.Small, TagType.Other);
- HtmlTextWriter.RegisterTag("span", HtmlTextWriterTag.Span, TagType.Inline);
- HtmlTextWriter.RegisterTag("strike", HtmlTextWriterTag.Strike, TagType.Inline);
- HtmlTextWriter.RegisterTag("strong", HtmlTextWriterTag.Strong, TagType.Inline);
- HtmlTextWriter.RegisterTag("style", HtmlTextWriterTag.Style, TagType.Other);
- HtmlTextWriter.RegisterTag("sub", HtmlTextWriterTag.Sub, TagType.Inline);
- HtmlTextWriter.RegisterTag("sup", HtmlTextWriterTag.Sup, TagType.Inline);
- HtmlTextWriter.RegisterTag("table", HtmlTextWriterTag.Table, TagType.Other);
- HtmlTextWriter.RegisterTag("tbody", HtmlTextWriterTag.Tbody, TagType.Other);
- HtmlTextWriter.RegisterTag("td", HtmlTextWriterTag.Td, TagType.Inline);
- HtmlTextWriter.RegisterTag("textarea", HtmlTextWriterTag.Textarea, TagType.Inline);
- HtmlTextWriter.RegisterTag("tfoot", HtmlTextWriterTag.Tfoot, TagType.Other);
- HtmlTextWriter.RegisterTag("th", HtmlTextWriterTag.Th, TagType.Inline);
- HtmlTextWriter.RegisterTag("thead", HtmlTextWriterTag.Thead, TagType.Other);
- HtmlTextWriter.RegisterTag("title", HtmlTextWriterTag.Title, TagType.Other);
- HtmlTextWriter.RegisterTag("tr", HtmlTextWriterTag.Tr, TagType.Other);
- HtmlTextWriter.RegisterTag("tt", HtmlTextWriterTag.Tt, TagType.Inline);
- HtmlTextWriter.RegisterTag("u", HtmlTextWriterTag.U, TagType.Inline);
- HtmlTextWriter.RegisterTag("ul", HtmlTextWriterTag.Ul, TagType.Other);
- HtmlTextWriter.RegisterTag("var", HtmlTextWriterTag.Var, TagType.Inline);
- HtmlTextWriter.RegisterTag("wbr", HtmlTextWriterTag.Wbr, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("xml", HtmlTextWriterTag.Xml, TagType.Other);
-
- HtmlTextWriter._attrKeyLookupTable = new Hashtable(40);
- HtmlTextWriter._attrNameLookupArray = new AttributeInformation[40];
- HtmlTextWriter.RegisterAttribute("accesskey", HtmlTextWriterAttribute.Accesskey, true);
- HtmlTextWriter.RegisterAttribute("align", HtmlTextWriterAttribute.Align, false);
- HtmlTextWriter.RegisterAttribute("alt", HtmlTextWriterAttribute.Alt, true);
- HtmlTextWriter.RegisterAttribute("background", HtmlTextWriterAttribute.Background, true);
- HtmlTextWriter.RegisterAttribute("bgcolor", HtmlTextWriterAttribute.Bgcolor, false);
- HtmlTextWriter.RegisterAttribute("border", HtmlTextWriterAttribute.Border, false);
- HtmlTextWriter.RegisterAttribute("bordercolor", HtmlTextWriterAttribute.Bordercolor, false);
- HtmlTextWriter.RegisterAttribute("cellpadding", HtmlTextWriterAttribute.Cellpadding, false);
- HtmlTextWriter.RegisterAttribute("cellspacing", HtmlTextWriterAttribute.Cellspacing, false);
- HtmlTextWriter.RegisterAttribute("checked", HtmlTextWriterAttribute.Checked, false);
- HtmlTextWriter.RegisterAttribute("class", HtmlTextWriterAttribute.Class, true);
- HtmlTextWriter.RegisterAttribute("cols", HtmlTextWriterAttribute.Cols, false);
- HtmlTextWriter.RegisterAttribute("colspan", HtmlTextWriterAttribute.Colspan, false);
- HtmlTextWriter.RegisterAttribute("disabled", HtmlTextWriterAttribute.Disabled, false);
- HtmlTextWriter.RegisterAttribute("for", HtmlTextWriterAttribute.For, false);
- HtmlTextWriter.RegisterAttribute("height", HtmlTextWriterAttribute.Height, false);
- HtmlTextWriter.RegisterAttribute("href", HtmlTextWriterAttribute.Href, true);
- HtmlTextWriter.RegisterAttribute("id", HtmlTextWriterAttribute.Id, false);
- HtmlTextWriter.RegisterAttribute("maxlength", HtmlTextWriterAttribute.Maxlength, false);
- HtmlTextWriter.RegisterAttribute("multiple", HtmlTextWriterAttribute.Multiple, false);
- HtmlTextWriter.RegisterAttribute("name", HtmlTextWriterAttribute.Name, false);
- HtmlTextWriter.RegisterAttribute("nowrap", HtmlTextWriterAttribute.Nowrap, false);
- HtmlTextWriter.RegisterAttribute("onchange", HtmlTextWriterAttribute.Onchange, true);
- HtmlTextWriter.RegisterAttribute("onclick", HtmlTextWriterAttribute.Onclick, true);
- HtmlTextWriter.RegisterAttribute("readonly", HtmlTextWriterAttribute.ReadOnly, false);
- HtmlTextWriter.RegisterAttribute("rows", HtmlTextWriterAttribute.Rows, false);
- HtmlTextWriter.RegisterAttribute("rowspan", HtmlTextWriterAttribute.Rowspan, false);
- HtmlTextWriter.RegisterAttribute("rules", HtmlTextWriterAttribute.Rules, false);
- HtmlTextWriter.RegisterAttribute("selected", HtmlTextWriterAttribute.Selected, false);
- HtmlTextWriter.RegisterAttribute("size", HtmlTextWriterAttribute.Size, false);
- HtmlTextWriter.RegisterAttribute("src", HtmlTextWriterAttribute.Src, true);
- HtmlTextWriter.RegisterAttribute("style", HtmlTextWriterAttribute.Style, false);
- HtmlTextWriter.RegisterAttribute("tabindex", HtmlTextWriterAttribute.Tabindex, false);
- HtmlTextWriter.RegisterAttribute("target", HtmlTextWriterAttribute.Target, false);
- HtmlTextWriter.RegisterAttribute("title", HtmlTextWriterAttribute.Title, true);
- HtmlTextWriter.RegisterAttribute("type", HtmlTextWriterAttribute.Type, false);
- HtmlTextWriter.RegisterAttribute("valign", HtmlTextWriterAttribute.Valign, false);
- HtmlTextWriter.RegisterAttribute("value", HtmlTextWriterAttribute.Value, true);
- HtmlTextWriter.RegisterAttribute("width", HtmlTextWriterAttribute.Width, false);
- HtmlTextWriter.RegisterAttribute("wrap", HtmlTextWriterAttribute.Wrap, false);
-
- HtmlTextWriter._styleKeyLookupTable = new Hashtable(14);
- HtmlTextWriter._styleNameLookupArray = new String[14];
- HtmlTextWriter.RegisterStyle("background-color", HtmlTextWriterStyle.BackgroundColor);
- HtmlTextWriter.RegisterStyle("background-image", HtmlTextWriterStyle.BackgroundImage);
- HtmlTextWriter.RegisterStyle("border-collapse", HtmlTextWriterStyle.BorderCollapse);
- HtmlTextWriter.RegisterStyle("border-color", HtmlTextWriterStyle.BorderColor);
- HtmlTextWriter.RegisterStyle("border-style", HtmlTextWriterStyle.BorderStyle);
- HtmlTextWriter.RegisterStyle("border-width", HtmlTextWriterStyle.BorderWidth);
- HtmlTextWriter.RegisterStyle("color", HtmlTextWriterStyle.Color);
- HtmlTextWriter.RegisterStyle("font-family", HtmlTextWriterStyle.FontFamily);
- HtmlTextWriter.RegisterStyle("font-size", HtmlTextWriterStyle.FontSize);
- HtmlTextWriter.RegisterStyle("font-style", HtmlTextWriterStyle.FontStyle);
- HtmlTextWriter.RegisterStyle("font-weight", HtmlTextWriterStyle.FontWeight);
- HtmlTextWriter.RegisterStyle("height", HtmlTextWriterStyle.Height);
- HtmlTextWriter.RegisterStyle("text-decoration", HtmlTextWriterStyle.TextDecoration);
- HtmlTextWriter.RegisterStyle("width", HtmlTextWriterStyle.Width);
-}
-
-public HtmlTextWriter(TextWriter writer):this(writer, " "){}
-
-public HtmlTextWriter(TextWriter writer, string tabString) : base() {
- writer = writer;
- tabString = tabString;
- indentLevel = 0;
- tabsPending = false;
- _httpWriter = writer as HttpWriter;
- _isDescendant = GetType() == typeof(HtmlTextWriter) == false;
- _attrList = new RenderAttribute[20];
- _attrCount = 0;
- _styleList = new RenderStyle[20];
- _styleCount = 0;
- _endTags = new TagStackEntry[16];
- _endTagCount = 0;
- _inlineCount = 0;
-}
-
-public virtual void AddAttribute(HtmlTextWriterAttribute key, string value){
- if ((int) key >= 0 && (int) key < HtmlTextWriter._attrNameLookupArray.Length) {
- AttributeInformation attrInfo = HtmlTextWriter._attrNameLookupArray[(int) key];
- AddAttribute(attrInfo.name, value, key, attrInfo.encode);
- }
-}
-
-public virtual void AddAttribute(HtmlTextWriterAttribute key, string value, bool fEncode){
- if ((int) key >= 0 && (int) key < HtmlTextWriter._attrNameLookupArray.Length) {
- AddAttribute(HtmlTextWriter._attrNameLookupArray[(int) key].name, value, key, fEncode);
- }
-}
-
-public virtual void AddAttribute(string name, string value){
- HtmlTextWriterAttribute attr = GetAttributeKey(name);
- value = EncodeAttributeValue(GetAttributeKey(name), value);
- AddAttribute(name, value, attr);
-}
-
-public virtual void AddAttribute(string name, string value, bool fEndode){
- value = EncodeAttributeValue(value, fEndode);
- AddAttribute(name, value, GetAttributeKey(name));
-}
-
-protected virtual void AddAttribute(string name, string value, HtmlTextWriterAttribute key){
- AddAttribute(name, value, key, false);
-}
-
-private void AddAttribute(string name, string value, HtmlTextWriterAttribute key, bool encode){
- if (_attrCount >= (int) _attrList.Length) {
- RenderAttribute[] rAttrArr = new RenderAttribute[_attrList.Length * 2];
- System.Array.Copy(_attrList, rAttrArr, (int) _attrList.Length);
- _attrList = rAttrArr;
- }
- RenderAttribute rAttr;
- rAttr.name = name;
- rAttr.value = value;
- rAttr.key = key;
- rAttr.encode = encode;
- _attrCount++;
-}
-
-public virtual void AddStyleAttribute(HtmlTextWriterStyle key, string value){
- AddStyleAttribute(GetStyleName(key), value, key);
-}
-
-public virtual void AddStyleAttribute(string name, string value){
- AddStyleAttribute(name, value, GetStyleKey(name));
-}
-
-protected virtual void AddStyleAttribute(string name, string value, HtmlTextWriterStyle key){
- RenderStyle[] tagRender;
- RenderStyle beforeTag;
-
- if (_styleCount > (int) _styleList.Length) {
- RenderStyle[] rAttrArr = new RenderStyle[_styleList.Length * 2];
- System.Array.Copy(_styleList, rAttrArr, (int) _styleList.Length);
- _styleList = rAttrArr;
- }
- RenderStyle rAttr;
- rAttr.name = name;
- rAttr.value = value;
- rAttr.key = key;
- _styleCount++;
-}
-
-public override void Close(){
- writer.Close();
-}
-
-protected virtual string EncodeAttributeValue(HtmlTextWriterAttribute attrKey, string value){
- bool valid = true;
- if (0 <= (int) attrKey && (int) attrKey < HtmlTextWriter._attrNameLookupArray.Length)
- valid = HtmlTextWriter._attrNameLookupArray[(int) attrKey].encode;
- return EncodeAttributeValue(value, valid);
-}
-
-protected string EncodeAttributeValue(string value, bool fEncode){
- if (value == null)
- return null;
- if (!(fEncode))
- return value;
- return System.Web.HttpUtility.HtmlAttributeEncode(value);
-}
-
-protected string EncodeUrl(string url){
- if (url.IndexOf(SpaceChar) < 0)
- return url;
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
- for(int i=0; i <= url.Length; i++){
- char temp = url[i];
- if (temp != 32)
- sb.Append(temp);
- else
- sb.Append("%20");
- }
- return sb.ToString();
-}
-
-protected virtual void FilterAttributes(){
- int count = 0;
- for(int i=0; i <= _styleCount; i++){
- RenderStyle rStyle = _styleList[i];
- if (OnStyleAttributeRender(rStyle.name, rStyle.value, rStyle.key)) {
- count++;
- }
- }
- _styleCount = count;
- count = 0;
- for(int i=0; i <= _attrCount; i++){
- RenderAttribute rAttr = _attrList[i];
- if (OnAttributeRender(rAttr.name, rAttr.value, rAttr.key)) {
- count++;
- }
- }
- _attrCount = count;
-}
-
-public override void Flush(){
- writer.Flush();
-}
-
-protected HtmlTextWriterAttribute GetAttributeKey(string attrName){
- if (attrName != null && attrName.Length > 0) {
- object attr = HtmlTextWriter._attrKeyLookupTable[attrName.ToLower()];
- if (attr != null)
- return (HtmlTextWriterAttribute) attr;
- }
- return (HtmlTextWriterAttribute) (-1);
-}
-
-protected string GetAttributeName(HtmlTextWriterAttribute attrKey){
- if ((int) attrKey >= 0 && (int) attrKey < HtmlTextWriter._attrNameLookupArray.Length)
- return HtmlTextWriter._attrNameLookupArray[(int) attrKey].name;
- return System.String.Empty;
-}
-
-protected HtmlTextWriterStyle GetStyleKey(string styleName){
- if (styleName != null && styleName.Length > 0) {
- object style = HtmlTextWriter._styleKeyLookupTable[styleName.ToLower()];
- if (style != null)
- return (HtmlTextWriterStyle) style;
- }
- return (HtmlTextWriterStyle) (-1);
-}
-
-protected string GetStyleName(HtmlTextWriterStyle styleKey){
- if ((int) styleKey >= 0 && (int) styleKey < HtmlTextWriter._styleNameLookupArray.Length)
- return HtmlTextWriter._styleNameLookupArray[(int) styleKey];
- return System.String.Empty;
-}
-
-protected virtual HtmlTextWriterTag GetTagKey(string tagName){
- if (tagName != null && tagName.Length > 0) {
- object tag = HtmlTextWriter._tagKeyLookupTable[tagName.ToLower()];
- if (tag != null)
- return (HtmlTextWriterTag) tag;
- }
- return 0;
-}
-
-protected virtual string GetTagName(HtmlTextWriterTag tagKey){
- if ((int) tagKey >= 0 && (int) tagKey < HtmlTextWriter._tagNameLookupArray.Length)
- return HtmlTextWriter._tagNameLookupArray[(int) tagKey].name;
- return System.String.Empty;
-}
-
-protected bool IsAttributeDefined(HtmlTextWriterAttribute key){
- for (int i=0; i <= _attrCount; i++) {
- if (_attrList[i].key == key)
- return true;
- }
- return false;
-}
-
-protected bool IsAttributeDefined(HtmlTextWriterAttribute key, ref string value){
- value = null;
- for (int i=0; i <= _attrCount; i++) {
- if (_attrList[i].key == key) {
- value = _attrList[i].value;
- return true;
- }
- }
- return false;
-}
-
-protected bool IsStyleAttributeDefined(HtmlTextWriterStyle key){
- for (int i= 0; i <= _styleCount; i++) {
- if (_styleList[i].key == key)
- return true;
- }
- return false;
-}
-
-protected bool IsStyleAttributeDefined(HtmlTextWriterStyle key, ref string value){
- value = null;
- for( int i=0; i <= _styleCount; i++) {
- if (_styleList[i].key == key) {
- value = _styleList[i].value;
- return true;
- }
- }
- return false;
-}
-
-protected virtual bool OnAttributeRender(string name, string value, HtmlTextWriterAttribute key){
- return true;
-}
-
-protected virtual bool OnStyleAttributeRender(string name, string value, HtmlTextWriterStyle key){
- return true;
-}
-
-protected virtual bool OnTagRender(string name, HtmlTextWriterTag key){
- return true;
-}
-
-protected virtual void OutputTabs(){
- if (tabsPending) {
- for(int i=0; i <= indentLevel; i++) {
- writer.Write(tabString);
- }
- tabsPending = false;
- }
-}
-
-protected string PopEndTag(){
- if (_endTagCount <= 0)
- throw new InvalidOperationException("A PopEndTag was called without a corresponding PushEndTag");
- _endTagCount--;
- TagKey = _endTags[_endTagCount].tagKey;
- return _endTags[_endTagCount].endTagText;
-}
-
-protected void PushEndTag(string endTag){
- if (_endTagCount >= (int) _endTags.Length) {
- TagStackEntry[] temp = new TagStackEntry[(int) _endTags.Length * 2];
- System.Array.Copy(_endTags, temp, (int) _endTags.Length);
- _endTags = temp;
- }
- _endTags[_endTagCount].tagKey = _tagKey;
- _endTags[_endTagCount].endTagText = endTag;
- _endTagCount++;
-}
-
-protected static void RegisterAttribute(string name, HtmlTextWriterAttribute key){
- HtmlTextWriter.RegisterAttribute(name, key, false);
-}
-
-private static void RegisterAttribute(string name, HtmlTextWriterAttribute key, bool fEncode){
- name = name.ToLower();
- HtmlTextWriter._attrKeyLookupTable.Add(name, key);
- if ((int) key < (int) HtmlTextWriter._attrNameLookupArray.Length)
- HtmlTextWriter._attrNameLookupArray[(int) key] = new AttributeInformation(name, fEncode);
-}
-
-protected static void RegisterStyle(string name, HtmlTextWriterStyle key){
- name = name.ToLower();
- HtmlTextWriter._styleKeyLookupTable.Add(name, key);
- if ((int) key < (int) HtmlTextWriter._styleNameLookupArray.Length)
- HtmlTextWriter._styleNameLookupArray[(int) key] = name;
-}
-
-protected static void RegisterTag(string name, HtmlTextWriterTag key){
- HtmlTextWriter.RegisterTag(name, key, TagType.Other);
-}
-
-private static void RegisterTag(string name, HtmlTextWriterTag key, TagType type){
- name = name.ToLower();
- HtmlTextWriter._tagKeyLookupTable.Add(name, key);
- string fullTag = null;
- if ((int) type != 1 && (int) key != 0) {
- fullTag = EndTagLeftChars + name + TagRightChar;
- }
- if ((int) key < HtmlTextWriter._tagNameLookupArray.Length)
- HtmlTextWriter._tagNameLookupArray[(int) key] = new TagInformation(name, type, fullTag);
-}
-
-protected virtual string RenderAfterContent(){
- return null;
-}
-
-protected virtual string RenderAfterTag(){
- return null;
-}
-
-protected virtual string RenderBeforeContent(){
- return null;
-}
-
-protected virtual string RenderBeforeTag(){
- return null;
-}
-
-public virtual void RenderBeginTag(HtmlTextWriterTag tagKey){
- TagKey = tagKey;
- bool tagRender = true;
- if (_isDescendant) {
- tagRender = OnTagRender(_tagName, _tagKey);
- FilterAttributes();
- string beforeTag = RenderBeforeTag();
- if (beforeTag != null) {
- if (tabsPending)
- OutputTabs();
- writer.Write(beforeTag);
- }
- }
- TagInformation currentTag = HtmlTextWriter._tagNameLookupArray[_tagIndex];
- bool tagRendered=true;
- if (!tagRender)
- tagRendered = false;
- if (tagRender) {
- if (tabsPending)
- OutputTabs();
- writer.Write(TagLeftChar);
- writer.Write(_tagName);
- RenderAttribute rAttr;
- string rAttrValue = null;
- for (int i=0; i <= _attrCount; i++) {
- rAttr = _attrList[i];
- if (rAttr.key == HtmlTextWriterAttribute.Style)
- rAttrValue = rAttr.value;
- else {
- writer.Write(SpaceChar);
- writer.Write(rAttr.name);
- if (rAttr.value != null) {
- writer.Write(EqualsChar);
- writer.Write(DoubleQuoteChar);
- if (rAttr.encode) {
- if (_httpWriter == null) {
- System.Web.HttpUtility.HtmlAttributeEncode(rAttr.value, writer);
- }
- else {
- System.Web.HttpUtility.HtmlAttributeEncode(rAttr.value, (TextWriter) _httpWriter);
- }
- }
- else {
- writer.Write(rAttr.value);
- }
- writer.Write(DoubleQuoteChar);
- }
- }
- }
- if (_styleCount > 0 || rAttrValue != null) {
- writer.Write(SpaceChar);
- writer.Write("style");
- writer.Write(EqualsChar);
- writer.Write(DoubleQuoteChar);
- RenderStyle rStyle;
- for (int i=0; i <= _styleCount; i++) {
- rStyle = _styleList[i];
- writer.Write(rStyle.name);
- writer.Write(StyleEqualsChar);
- writer.Write(rStyle.value);
- writer.Write(SemicolonChar);
- }
- if (rAttrValue != null)
- writer.Write(rAttrValue);
- writer.Write(DoubleQuoteChar);
- }
- if (currentTag.tagType == TagType.NonClosing) {
- writer.Write(SpaceChar);
- writer.Write(SlashChar);
- writer.Write(TagRightChar);
- }
- else
- writer.Write(TagRightChar);
- }
- string beforeContent = RenderBeforeContent();
- if (beforeContent != null) {
- if (tabsPending)
- OutputTabs();
- writer.Write(beforeContent);
- }
- if (tagRendered) {
- if (currentTag.tagType == TagType.Inline)
- _inlineCount++;
- else {
- WriteLine();
- Indent++;
- }
- if (currentTag.closingTag == null) {
- currentTag.closingTag = EndTagLeftChars + _tagName + TagRightChar;
- }
- }
- if (_isDescendant) {
- string afterContent = RenderAfterContent();
- if (afterContent != null) {
- if (currentTag.closingTag != null)
- currentTag.closingTag = afterContent;
- }
- string afterTag = RenderAfterTag();
- if (afterTag != null) {
- if (currentTag.closingTag != null)
- currentTag.closingTag = afterTag;
- }
- }
- PushEndTag(currentTag.closingTag);
- _attrCount = 0;
- _styleCount = 0;
-}
-
-public virtual void RenderBeginTag(string tagName){
- TagName = tagName;
- RenderBeginTag(_tagKey);
-}
-
-public virtual void RenderEndTag(){
- string endTagText = PopEndTag();
- if (endTagText != null) {
- if (HtmlTextWriter._tagNameLookupArray[_tagIndex].tagType == 0) {
- _inlineCount--;
- Write(endTagText);
- }
- else{
- WriteLine();
- Indent--;
- Write(endTagText);
- }
- }
-}
-
-public override void Write(bool value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(char value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(char[] buffer){
- if (tabsPending)
- OutputTabs();
- writer.Write(buffer);
-}
-
-public override void Write(char[] buffer, int index, int count){
- if (tabsPending)
- OutputTabs();
- writer.Write(buffer, index, count);
-}
-
-public override void Write(double value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(int value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(long value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(object value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(float value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(string s){
- if (tabsPending)
- OutputTabs();
- writer.Write(s);
-}
-
-public override void Write(string format, object arg0){
- if (tabsPending)
- OutputTabs();
- writer.Write(format, arg0);
-}
-
-public override void Write(string format, object arg0, object arg1){
- if (tabsPending)
- OutputTabs();
- writer.Write(format, arg0, arg1);
-}
-
-public override void Write(string format, params object[] arg){
- if (tabsPending)
- OutputTabs();
- writer.Write(format, arg);
-}
-
-public virtual void WriteAttribute(string name, string value){
- WriteAttribute(name, value, false);
-}
-
-public virtual void WriteAttribute(string name, string value, bool fEncode){
- writer.Write(SpaceChar);
- writer.Write(name);
- if (value != null) {
- writer.Write(EqualsChar);
- writer.Write(DoubleQuoteChar);
- if (fEncode) {
- if (_httpWriter == null) {
- System.Web.HttpUtility.HtmlAttributeEncode(value, writer);
- }
- else{
- System.Web.HttpUtility.HtmlAttributeEncode(value, (TextWriter) _httpWriter);
- }
- }
- else{
- writer.Write(value);
- }
- writer.Write(DoubleQuoteChar);
- }
-}
-
-public virtual void WriteBeginTag(string tagName){
- if (tabsPending)
- OutputTabs();
- writer.Write(TagLeftChar);
- writer.Write(tagName);
-}
-
-public virtual void WriteEndTag(string tagName){
- if (tabsPending)
- OutputTabs();
- writer.Write(TagLeftChar);
- writer.Write(SlashChar);
- writer.Write(tagName);
- writer.Write(TagRightChar);
-}
-
-public virtual void WriteFullBeginTag(string tagName){
- if (tabsPending)
- OutputTabs();
- writer.Write(TagLeftChar);
- writer.Write(tagName);
- writer.Write(TagRightChar);
-}
-
-public override void WriteLine(){
- writer.WriteLine();
- tabsPending = true;
-}
-
-public override void WriteLine(bool value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(char value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(char[] buffer){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(buffer);
- tabsPending = true;
-}
-
-public override void WriteLine(char[] buffer, int index, int count){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(buffer, index, count);
- tabsPending = true;
-}
-
-public override void WriteLine(double value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(int value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(long value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(object value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(float value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(string s){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(s);
- tabsPending = true;
-}
-
-public override void WriteLine(string format, object arg0){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(format, arg0);
- tabsPending = true;
-}
-
-public override void WriteLine(string format, object arg0, object arg1){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(format, arg0, arg1);
- tabsPending = true;
-}
-
-public override void WriteLine(string format, params object[] arg){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(format, arg);
- tabsPending = true;
-}
-
-[CLSCompliant(false)]
-public override void WriteLine(uint value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public void WriteLineNoTabs(string s){
- writer.WriteLine(s);
-}
-
-public virtual void WriteStyleAttribute(string name, string value){
- WriteStyleAttribute(name, value, false);
-}
-
-public virtual void WriteStyleAttribute(string name, string value, bool fEncode){
- writer.Write(name);
- writer.Write(StyleEqualsChar);
- if (fEncode) {
- if (_httpWriter == null) {
- System.Web.HttpUtility.HtmlAttributeEncode(value, writer);
- }
- else{
- System.Web.HttpUtility.HtmlAttributeEncode(value, (TextWriter) _httpWriter);
- }
- }
- else {
- writer.Write(value);
- }
- writer.Write(SemicolonChar);
-}
-
-public override System.Text.Encoding Encoding {
- get{
- return writer.Encoding;
- }
-}
-
-public int Indent {
- get{
- return indentLevel;
- }
- set{
- if (value < 0)
- value = 0;
- indentLevel = value;
- }
-}
-
-public TextWriter InnerWriter {
- get{
- return writer;
- }
- set{
- writer = value;
- _httpWriter = value as HttpWriter;
- }
-}
-
-public override string NewLine {
- get{
- return writer.NewLine;
- }
- set{
- writer.NewLine = value;
- }
-}
-
-protected HtmlTextWriterTag TagKey {
- get{
- return _tagKey;
- }
- set{
- _tagIndex = (int) value;
- if (_tagIndex < 0 || _tagIndex >= (int) HtmlTextWriter._tagNameLookupArray.Length)
- throw new ArgumentOutOfRangeException("value");
- _tagKey = value;
- if (value != 0)
- _tagName = HtmlTextWriter._tagNameLookupArray[_tagIndex].name;
- }
-}
-
-protected string TagName {
- get{
- return _tagName;
- }
- set{
- _tagName = value;
- _tagKey = GetTagKey(_tagName);
- _tagIndex = (int) _tagKey;
- }
-}
-
-public const string DefaultTabString = "\t";
-public const char DoubleQuoteChar = '"';
-public const string EndTagLeftChars = "</";
-public const char EqualsChar = '=';
-public const string EqualsDoubleQuoteString = "=\"";
-public const string SelfClosingChars = " /";
-public const string SelfClosingTagEnd = " />";
-public const char SemicolonChar = ';';
-public const char SingleQuoteChar = '\'';
-public const char SlashChar = '/';
-public const char SpaceChar = ' ';
-public const char StyleEqualsChar = ':';
-public const char TagLeftChar = '<';
-public const char TagRightChar = '>';
-
-private int _attrCount;
-private int _endTagCount;
-private int _styleCount;
-private int indentLevel;
-private int _inlineCount;
-private int _tagIndex;
-
-private bool _isDescendant;
-private bool tabsPending;
-
-private HtmlTextWriterTag _tagKey;
-private TextWriter writer;
-private HttpWriter _httpWriter;
-
-private static Hashtable _attrKeyLookupTable;
-private static Hashtable _styleKeyLookupTable;
-private static Hashtable _tagKeyLookupTable;
-
-private string _tagName;
-private string tabString;
-private static string[] _styleNameLookupArray;
-
-private RenderAttribute[] _attrList;
-private static AttributeInformation[] _attrNameLookupArray;
-private static TagInformation[] _tagNameLookupArray;
-private TagStackEntry[] _endTags;
-private RenderStyle[] _styleList;
-
-} //HtmlTextWriter
-
-struct AttributeInformation {
- public bool encode;
- public string name;
-
- public AttributeInformation(string name, bool encode){
- this.encode = encode;
- this.name = name;
- }
-}
-
-struct RenderAttribute {
- public bool encode;
- public HtmlTextWriterAttribute key;
- public string name;
- public string value;
-}
-
-struct RenderStyle {
- public HtmlTextWriterStyle key;
- public string name;
- public string value;
-}
-
-struct TagInformation {
- public string closingTag;
- public string name;
- public TagType tagType;
-
- public TagInformation(string name, TagType tagType, string closingTag){
- this.name = name;
- this.tagType = tagType;
- this.closingTag = closingTag;
- }
-}
-
-struct TagStackEntry {
- public string endTagText;
- public HtmlTextWriterTag tagKey;
-}
-
-enum TagType {
- Inline,
- NonClosing,
- Other
-}
-
-
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs
deleted file mode 100644
index 5b82723c5c3..00000000000
--- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/* System.Web.UI
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-
-namespace System.Web.UI{
-
-public enum HtmlTextWriterAttribute {
-Accesskey,
-Align,
-Alt,
-Background,
-Bgcolor,
-Border,
-Bordercolor,
-Cellpadding,
-Cellspacing,
-Checked,
-Class,
-Cols,
-Colspan,
-Disabled,
-For,
-Height,
-Href,
-Id,
-Maxlength,
-Multiple,
-Name,
-Nowrap,
-Onchange,
-Onclick,
-ReadOnly,
-Rows,
-Rowspan,
-Rules,
-Selected,
-Size,
-Src,
-Style,
-Tabindex,
-Target,
-Title,
-Type,
-Valign,
-Value,
-Width,
-Wrap,
-}
-
-
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs
deleted file mode 100644
index 4955422d668..00000000000
--- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-/* System.Web.UI
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-
-namespace System.Web.UI{
-
-public enum HtmlTextWriterStyle {
-BackgroundColor,
-BackgroundImage,
-BorderCollapse,
-BorderColor,
-BorderStyle,
-BorderWidth,
-Color,
-FontFamily,
-FontSize,
-FontStyle,
-FontWeight,
-Height,
-TextDecoration,
-Width
-}
-
-
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs
deleted file mode 100644
index f248979246a..00000000000
--- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-/* System.Web.UI
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-
-namespace System.Web.UI{
-
-public enum HtmlTextWriterTag {
-Unknown,
-A,
-Acronym,
-Address,
-Area,
-B,
-Base,
-Basefont,
-Bdo,
-Bgsound,
-Big,
-Blockquote,
-Body,
-Br,
-Button,
-Caption,
-Center,
-Cite,
-Code,
-Col,
-Colgroup,
-Dd,
-Del,
-Dfn,
-Dir,
-Div,
-Dl,
-Dt,
-Em,
-Embed,
-Fieldset,
-Font,
-Form,
-Frame,
-Frameset,
-H1,
-H2,
-H3,
-H4,
-H5,
-H6,
-Head,
-Hr,
-Html,
-I,
-Iframe,
-Img,
-Input,
-Ins,
-Isindex,
-Kbd,
-Label,
-Legend,
-Li,
-Link,
-Map,
-Marquee,
-Menu,
-Meta,
-Nobr,
-Noframes,
-Noscript,
-Object,
-Ol,
-Option,
-P,
-Param,
-Pre,
-Q,
-Rt,
-Ruby,
-S,
-Samp,
-Script,
-Select,
-Small,
-Span,
-Strike,
-Strong,
-Style,
-Sub,
-Sup,
-Table,
-Tbody,
-Td,
-Textarea,
-Tfoot,
-Th,
-Thead,
-Title,
-Tr,
-Tt,
-U,
-Ul,
-Var,
-Wbr,
-Xml
-}
-
-
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs b/mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs
deleted file mode 100644
index be0984b2c8b..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Web.UI.IAttributeAccessor.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IAttributeAccessor
- {
- string GetAttribute(string key);
- void SetAttribute(string key, string value);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs b/mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs
deleted file mode 100644
index 5ff7f00b2da..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Web.UI.IDataBindingsAccessor.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IDataBindingsAccessor
- {
- DataBindingCollection DataBindings {get;}
- bool HasDataBindings {get;}
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/INamingContainer.cs b/mcs/class/System.Web/System.Web.UI/INamingContainer.cs
deleted file mode 100644
index 659c5b60bed..00000000000
--- a/mcs/class/System.Web/System.Web.UI/INamingContainer.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Web.UI.INamingContainer.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface INamingContainer
- {
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IParserAccessor.cs b/mcs/class/System.Web/System.Web.UI/IParserAccessor.cs
deleted file mode 100644
index cad22017e9d..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IParserAccessor.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.UI.IParserAccessor.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IParserAccessor
- {
- void AddParsedSubObject(object obj);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs b/mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs
deleted file mode 100644
index 7d105cb7476..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Web.UI.IPostBackDataHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-using System.Collections.Specialized;
-
-namespace System.Web.UI
-{
- public interface IPostBackDataHandler
- {
- bool LoadPostData(string postDataKey, NameValueCollection postCollection);
- void RaisePostDataChangedEvent();
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs b/mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs
deleted file mode 100644
index daa6f70160c..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.UI.IPostBackEventHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IPostBackEventHandler
- {
- void RaisePostBackEvent(string eventArgument);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IStateManager.cs b/mcs/class/System.Web/System.Web.UI/IStateManager.cs
deleted file mode 100644
index 4bcb6b8deb0..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IStateManager.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Web.UI.IStateManager.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IStateManager
- {
- void LoadViewState(object state);
- object SaveViewState();
- void TrackViewState();
- bool IsTrackingViewState { get; }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ITagNameToTypeMapper.cs b/mcs/class/System.Web/System.Web.UI/ITagNameToTypeMapper.cs
deleted file mode 100644
index da35c6b0ee8..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ITagNameToTypeMapper.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Web.UI.ITagNameToTypeMapper.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-using System.Collections;
-
-namespace System.Web.UI
-{
- public interface ITagNameToTypeMapper
- {
- Type GetControlType(string tagName, IDictionary attribs);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ITemplate.cs b/mcs/class/System.Web/System.Web.UI/ITemplate.cs
deleted file mode 100644
index c9981859b37..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ITemplate.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.UI.ITemplate.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface ITemplate
- {
- void InstantiateIn(Control container);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IValidator.cs b/mcs/class/System.Web/System.Web.UI/IValidator.cs
deleted file mode 100644
index 47b418aee39..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IValidator.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Web.UI.IValidator.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IValidator
- {
- void Validate();
- string ErrorMessage {get; set;}
- bool IsValid {get; set;}
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs b/mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs
deleted file mode 100644
index 2bcc75881df..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.UI.ImageClickEventHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public delegate void ImageClickEventHandler(object sender, ImageClickEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI/LiteralControl.cs b/mcs/class/System.Web/System.Web.UI/LiteralControl.cs
deleted file mode 100644
index 180c700dc9a..00000000000
--- a/mcs/class/System.Web/System.Web.UI/LiteralControl.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Web.UI.LiteralControl.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public class LiteralControl : Control
- {
- private string _text = String.Empty;
- public LiteralControl() {}
- public LiteralControl(string text)
- {
- _text = text;
- }
- public virtual string Text
- {
- get
- {
- return _text;
- }
- set
- {
- _text = value;
- }
- }
- protected override void Render(HtmlTextWriter writer)
- {
- writer.Write(_text);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/OutputCacheLocation.cs b/mcs/class/System.Web/System.Web.UI/OutputCacheLocation.cs
deleted file mode 100644
index 734131f2fb0..00000000000
--- a/mcs/class/System.Web/System.Web.UI/OutputCacheLocation.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Web.UI.OutputCacheLocation.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public enum OutputCacheLocation
- {
- Any,
- Client,
- Downstream,
- None,
- Server
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/Pair.cs b/mcs/class/System.Web/System.Web.UI/Pair.cs
deleted file mode 100644
index bf13fabdce8..00000000000
--- a/mcs/class/System.Web/System.Web.UI/Pair.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: Pair
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace System.Web.UI
-{
- public class Pair
- {
- public object First;
- public object Second;
-
- public Pair(object first, object second)
- {
- First = first;
- Second = second;
- }
-
- public Pair()
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/PersistanceMode.cs b/mcs/class/System.Web/System.Web.UI/PersistanceMode.cs
deleted file mode 100644
index 4799d743c58..00000000000
--- a/mcs/class/System.Web/System.Web.UI/PersistanceMode.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Web.UI.PersistanceMode.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public enum PersistenceMode
- {
- Attribute,
- EncodedInnerDefaultProperty,
- InnerDefaultProperty,
- InnerProperty
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/PropertyConverter.cs b/mcs/class/System.Web/System.Web.UI/PropertyConverter.cs
deleted file mode 100644
index d98e80f912a..00000000000
--- a/mcs/class/System.Web/System.Web.UI/PropertyConverter.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: PropertyConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Globalization;
-using System.Reflection;
-
-namespace System.Web.UI
-{
- public sealed class PropertyConverter
- {
- private static Type[] parseMethodTypes;
- private static Type[] parseMethodTypesWithSOP;
-
- static PropertyConverter()
- {
- parseMethodTypes = new Type[1];
- parseMethodTypes[0] = typeof(string);
- parseMethodTypesWithSOP = new Type[2];
- parseMethodTypesWithSOP[0] = typeof(string);
- parseMethodTypesWithSOP[1] = typeof(IServiceProvider);
- }
-
- private PropertyConverter()
- {
- // Prevent any instance
- }
-
- public static object EnumFromString(Type enumType, string enumValue)
- {
- object retVal = null;
- try
- {
- retVal = Enum.Parse(enumType, enumValue, true);
- } catch
- {
- retVal = null;
- }
- return retVal;
- }
-
- public static string EnumToString(Type enumType, object enumValue)
- {
- string retVal = Enum.Format(enumType, enumValue, "G");
- return retVal.Replace('_','-');
- }
-
- public static object ObjectFromString(Type objType, MemberInfo propertyInfo, string objValue)
- {
- if(objValue == null)
- return null;
- if(! (!objType.Equals(typeof(Boolean)) || objValue.Length > 0) )
- {
- return null;
- }
- if(objType.IsEnum)
- {
- return EnumFromString(objType, objValue);
- }
- if(objType.Equals(typeof(string)))
- {
- return objValue;
- }
- PropertyDescriptor pc = null;
- if(propertyInfo != null)
- {
- pc = (TypeDescriptor.GetProperties(propertyInfo.ReflectedType))[propertyInfo.Name];
- }
- if(pc != null)
- {
- TypeConverter converter = pc.Converter;
- if(converter!=null && converter.CanConvertFrom(typeof(string)))
- {
- return converter.ConvertFromInvariantString(objValue);
- }
- }
- MethodInfo mi = objType.GetMethod("Parse", parseMethodTypesWithSOP);
- object o = null;
- if(mi != null)
- {
- object[] parameters = new object[2];
- parameters[0] = objValue;
- parameters[1] = CultureInfo.InvariantCulture;
- try
- {
- o = Utils.InvokeMethod(mi, null, parameters);
- } catch
- {
- }
- }
- if(o == null)
- {
- mi = objType.GetMethod("Parse", parseMethodTypes);
- if(mi!=null)
- {
- object[] parameters = new object[1];
- parameters[0] = objValue;
- try
- {
- o = Utils.InvokeMethod(mi, null, parameters);
- } catch
- {
- }
- }
- }
- if(o == null)
- {
- throw new HttpException(/*HttpRuntime.FormatResourceString(*/"Type_not_creatable_from_string"/*, objType.FullName, objValue, propertyInfo.Name)*/);
- }
- return o;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/StateBag.cs b/mcs/class/System.Web/System.Web.UI/StateBag.cs
deleted file mode 100644
index fecb7a1c5b2..00000000000
--- a/mcs/class/System.Web/System.Web.UI/StateBag.cs
+++ /dev/null
@@ -1,278 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: StateBag
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace System.Web.UI
-{
- public sealed class StateBag : IStateManager, IDictionary, ICollection, IEnumerable
- {
- private bool ignoreCase;
- private bool marked;
- private IDictionary bag;
-
- public StateBag(bool ignoreCase)
- {
- Initialize(ignoreCase);
- }
-
- public StateBag()
- {
- Initialize(false);
- }
-
- private void Initialize(bool ignoreCase)
- {
- this.ignoreCase = ignoreCase;
- marked = false;
- bag = new HybridDictionary(ignoreCase);
- }
-
- public int Count
- {
- get
- {
- return bag.Count;
- }
- }
-
- public object this[object key]
- {
- get
- {
- string sKey = (string)key;
- if(sKey==null || sKey.Length==0)
- throw new ArgumentException(HttpRuntime.FormatResourceString("Key_Cannot_Be_Null"));
- object val = bag[sKey];
- if(val is StateItem)
- return val;
- return null;
- }
- set
- {
- Add((string)key, value);
- }
- }
-
- public ICollection Keys
- {
- get
- {
- return bag.Keys;
- }
- }
-
- public ICollection Values
- {
- get
- {
- return bag.Values;
- }
- }
-
- public StateItem Add(string key, object value)
- {
- if(key == null || key.Length == 0)
- {
- throw new ArgumentException(HttpRuntime.FormatResourceString("Key_Cannot_Be_Null"));
- }
- StateItem val = null;
- if(bag[key] is StateItem)
- val = (StateItem)(bag[key]);
- if(val==null)
- {
- if(value!=null || marked)
- {
- val = new StateItem(value);
- bag.Add(key, val);
- }
-
- } else
- {
- if(value!=null && !marked)
- bag.Remove(key);
- val.Value = value;
- }
- if(val!=null && marked)
- {
- val.IsDirty = true;
- }
- return val;
- }
-
- public void Clear()
- {
- bag.Clear();
- }
-
- public IDictionaryEnumerator GetEnumerator()
- {
- return bag.GetEnumerator();
- }
-
- public bool IsItemDirty(string key)
- {
- object o = bag[key];
- if(o is StateItem)
- return ((StateItem)o).IsDirty;
- return false;
- }
-
- public void Remove(string key)
- {
- bag.Remove(key);
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- public void SetItemDirty(string key, bool dirty)
- {
- if(bag[key] is StateItem)
- ((StateItem)bag[key]).IsDirty = dirty;
- }
-
- internal bool IsTrackingViewState
- {
- get
- {
- return marked;
- }
- }
-
- internal void LoadViewState(object state)
- {
- if(state!=null)
- {
- Pair pair = (Pair)state;
- ArrayList keyList = (ArrayList)(pair.First);
- ArrayList valList = (ArrayList)(pair.Second);
- for(int i=0; i < keyList.Count; i++)
- Add((string)keyList[i], valList[i]);
- }
- }
-
- internal object SaveViewState()
- {
- if(bag.Count > 0)
- {
- ArrayList keyList = null, valList = null;
- foreach(IDictionaryEnumerator current in bag)
- {
- StateItem item = (StateItem)current.Value;
- if(item.IsDirty)
- {
- if(keyList==null)
- {
- keyList = new ArrayList();
- valList = new ArrayList();
- }
- keyList.Add(current.Key);
- valList.Add(current.Value);
- }
- }
- if(keyList!=null)
- return new Pair(keyList, valList);
- }
- return null;
- }
-
- internal void TrackViewState()
- {
- marked = true;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- void IStateManager.LoadViewState(object savedState)
- {
- LoadViewState(savedState);
- }
-
- object IStateManager.SaveViewState()
- {
- return SaveViewState();
- }
-
- void IStateManager.TrackViewState()
- {
- TrackViewState();
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get
- {
- return IsTrackingViewState;
- }
- }
-
- void ICollection.CopyTo(Array array, int index)
- {
- Values.CopyTo(array, index);
- }
-
- bool ICollection.IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- object ICollection.SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- void IDictionary.Add(object key, object value)
- {
- Add((string)key, value);
- }
-
- void IDictionary.Remove(object key)
- {
- Remove((string)key);
- }
-
- bool IDictionary.Contains(object key)
- {
- return bag.Contains((string)key);
- }
-
- bool IDictionary.IsFixedSize
- {
- get
- {
- return false;
- }
- }
-
- bool IDictionary.IsReadOnly
- {
- get
- {
- return false;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/StateItem.cs b/mcs/class/System.Web/System.Web.UI/StateItem.cs
deleted file mode 100644
index 81a425bbaac..00000000000
--- a/mcs/class/System.Web/System.Web.UI/StateItem.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Web.UI.StateItem.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public sealed class StateItem
- {
- private bool _isDirty = false;
- private object _value = null;
- public bool IsDirty
- {
- get
- {
- return _isDirty;
- }
- set
- {
- _isDirty = value;
- }
- }
- public object Value
- {
- get
- {
- return _value;
- }
- set
- {
- _value = value;
- }
- }
- private StateItem() {}
- internal StateItem(Object value)
- {
- _value = value;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/TODO b/mcs/class/System.Web/System.Web.UI/TODO
deleted file mode 100644
index de529b87f86..00000000000
--- a/mcs/class/System.Web/System.Web.UI/TODO
+++ /dev/null
@@ -1,42 +0,0 @@
-AttributeCollection
-BaseParser
-BasePartialCachingControl
-CompiledTemplateBuilder
-ConstructorNeedsTagAttribute
-ControlBuilder
-ControlBuilderAttribute
-ControlCollection
-CssStyleCollection
-DataBinder
-DataBinding
-DataBindingCollection
-DataBindingHandlerAttribute
-DataBoundLiteralControl
-DesignTimeParseData
-DesignTimeTemplateParser
-EmptyControlCollection
-Html32TextWriter
-HtmlTextWriter
-ImageClickEventArgs
-LosFormatter
-Page
-PageParser
-ParseChildrenAttribute
-PartialCachingAttribute
-PartialCachingControl
-PersistChildrenAttribute
-PersistanceModeAttribute
-RootBuilder
-SimpleWebHandlerParser
-StateBag
-StaticPartialCachingControl
-TagPrefixAttribute
-TemplateBuilder
-TemplateContainerAttribute
-TemplateControl
-TemplateControlParser
-ToolboxDataAttribute
-UserControl
-ValidationPropertyAttribute
-ValidatorCollection
-WebServiceProvider
diff --git a/mcs/class/System.Web/System.Web.UI/Utils.cs b/mcs/class/System.Web/System.Web.UI/Utils.cs
deleted file mode 100644
index 48138375e13..00000000000
--- a/mcs/class/System.Web/System.Web.UI/Utils.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: Utils
- *
- * Author: Gaurav Vaish
- * Maintainer-> gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Reflection;
-
-namespace System.Web.UI
-{
- internal class Utils
- {
- internal static object InvokeMethod(MethodInfo info, object obj, object[] parameters)
- {
- object retVal = null;
- try
- {
- retVal = info.Invoke(obj, parameters);
- } catch(TargetInvocationException tie)
- {
- throw tie.InnerException;
- }
- return retVal;
- }
-
- internal static string GetClientValidatedEvent(/*Page page*/)
- {
- return "if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate();";
- }
-
- internal static string GetClientValidatedPostBack(Control control)
- {
- return (" { if (typeof(Page_ClientValidate) != 'function' || Page_ClientValidate()) " +
- control.Page.GetPostBackEventReference(control) +
- " } " );
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/.cvsignore b/mcs/class/System.Web/System.Web.Utils/.cvsignore
deleted file mode 100644
index 04bc145deea..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-_*
diff --git a/mcs/class/System.Web/System.Web.Utils/ApacheVersionInfo.cs b/mcs/class/System.Web/System.Web.Utils/ApacheVersionInfo.cs
deleted file mode 100644
index b166b32b8d5..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/ApacheVersionInfo.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: ApacheVersionInfo
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- /// <summary>
- /// Versions of the modules related to Apache
- /// </summary>
- /// <remarks>
- /// At present I don't know what modules are to be loaded and how
- /// </remarks>
- /// <see>
- /// System.Web.Utils.IISVersionInfo
- /// </see>
- internal class ApacheVersionInfo
- {
- public ApacheVersionInfo()
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/ChangeLog b/mcs/class/System.Web/System.Web.Utils/ChangeLog
deleted file mode 100644
index e027d138da4..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/ChangeLog
+++ /dev/null
@@ -1,57 +0,0 @@
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * FileChangesMonitor.cs: remove redundant using statement; use int
- for MAXLEN; capitalize correctly 'WebHashCodeProvider';
- fix typo rsLock -> rwLock; Change IsRooted to IsPathRooted;
- set out parameter value where needed
- * FilePathParser.cs: qualify method GetPathRoot() with 'Path.'
- * IISVersionInfo.cs: initialize static member to avoid compile error.
- * WebEqualComparer.cs: static member defC shouldn't be readonly;
- the string comparer had some typos (fixed)
- * WebHashCodeProvider.cs: needed System.Globalization; static member
- defHcp shouldn't be readonly; remove double equal typo.
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * FileAction.cs: Use 0x7FFFFFFF as enum value for error. 0xFFFFFFFF
- is too big for Int32.
- * FileChangeEventHandler.cs: put missing 'void' return type on delegate
- FileChangeEventHandler()
- * FileChangedEventArgs.cs: ditto for FileChangedEvent()
- * NativeFileChangeEventHandler.cs: ditto for NativeFileChangeEventHandler()
- * FileChangesMonitor.cs: add needed namespaces and comment out imcomplete
- code.
-
-2001-12-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * ApacheVersionInfo.cs - Dummy class, for later use.
- * FileAction.cs:
- * FileChangeEventHandler.cs:
- * FileChangeEventArgs.cs:
- * FileChangesMonitor.cs:
- * NativeFileChangeEventHandler.cs
- - To be used in System.Web/Http* classes.
- Initially needed for HttpRuntime
- * IISVersionInfo.cs - Some useful methods
-
-
-2001-12-17 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * UrlUtils.cs - Added functions Combine and Reduce
-
-2001-12-16 Miguel de Icaza <miguel@ximian.com>
-
- * DataSourceHelper.cs, UrlUtils.cs: Set the correct namespace.
-
-2001-11-30
- Gaurav Vaish <gvaish@iitk.ac.in>
- * DataSourceHelper.cs - Resolving DataSource objects
-
-2001-11-09
- Gaurav Vaish <gvaish@iitk.ac.in>
- * UrlUtil.cs - Some basic functions
-
-2001-11-08
- Gaurav Vaish <gvaish@iitk.ac.in>
- * Namespace - Created the namespace for commonly used,
- otherwise not available functions \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.Utils/DataSourceHelper.cs b/mcs/class/System.Web/System.Web.Utils/DataSourceHelper.cs
deleted file mode 100644
index 35efcfa749d..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/DataSourceHelper.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Namespace: System.Web.UI.Utils
- * Class: DataSourceHelper
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Status: 10%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Web.Utils
-{
- internal class DataSourceHelper
- {
- public static IEnumerable GetResolvedDataSource(object source, string member)
- {
- if(source==null)
- return null;
- if(source is IListSource)
- {
- IListSource ils = (IListSource)source;
- IList il = ils.GetList();
- if(ils.ContainsListCollection)
- {
- return il;
- }
- if(il is ITypedList)
- {
- ITypedList itl = (ITypedList)il;
- PropertyDescriptorCollection pdc = itl.GetItemProperties(new PropertyDescriptor[0]);
- PropertyDescriptor pd = null;
- if(pdc != null)
- {
- if(pdc.Count > 0)
- {
- if(member != null)
- {
- if(member.Length > 0)
- {
- pd = pdc.Find(member, true);
- } else
- {
- pd = pdc[0];
- }
- }
- }
- }
- if(pd!=null)
- {
- object o = pd.GetValue(il[0]);
- if(o!=null)
- {
- if(o is IEnumerable)
- return (IEnumerable)o;
- }
- throw new HttpException("ListSource Empty"); // no data in ListSource object
- }
- }
- } else if(source is IEnumerable)
- {
- return (IEnumerable)source;
- }
- return null;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FileAction.cs b/mcs/class/System.Web/System.Web.Utils/FileAction.cs
deleted file mode 100644
index 7de90d2aead..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FileAction.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: FileAction
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- public enum FileAction
- {
- Overwhleming,
- Added,
- Removed,
- Modifiled,
- RenamedOldName,
- RenamedNewName,
- Error = 0x7FFFFFFF
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FileChangeEventHandler.cs b/mcs/class/System.Web/System.Web.Utils/FileChangeEventHandler.cs
deleted file mode 100644
index e202fbcb503..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FileChangeEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: FileChangeEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- public delegate void FileChangeEventHandler(object sender, int method);
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FileChangedEventArgs.cs b/mcs/class/System.Web/System.Web.Utils/FileChangedEventArgs.cs
deleted file mode 100644
index 909711dbbe2..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FileChangedEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: FileChangedEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- internal class FileChangedEventArgs : EventArgs
- {
- private string filename;
- private FileAction action;
-
- public void FileChangedEvent(FileAction action, string file)
- {
- this.action = action;
- this.filename = file;
- }
-
- public string FileName
- {
- get
- {
- return filename;
- }
- }
-
- public FileAction Action
- {
- get
- {
- return action;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FileChangesMonitor.cs b/mcs/class/System.Web/System.Web.Utils/FileChangesMonitor.cs
deleted file mode 100644
index 7d288ca0515..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FileChangesMonitor.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- *
- * Namespace: System.Web.Utils
- * Class: FileChangesMonitor
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.IO;
-using System.Web;
-using System.Runtime.InteropServices;
-using System.Collections;
-using System.Threading;
-
-namespace System.Web.Utils
-{
- internal class FileChangesMonitor
- {
- private static string BIN = "bin";
- private static string BINDIR = "bin/";
- private static int MAXLEN = 260;
-
- private FileChangeEventHandler cbRename;
- private NativeFileChangeEventHandler cbSubDirs;
-
- private int monitoredSubdirs;
- private string rootDir;
- private Hashtable allDirs;
- private GCHandle rootcbSubDirs;
-
- private ReaderWriterLock rwLock;
-
- public FileChangesMonitor()
- {
- allDirs = new Hashtable(WebHashCodeProvider.Default, WebEqualComparer.Default);
- rwLock = new ReaderWriterLock();
- }
-
- /// <param name="file">Name of the file</param>
- /// <param name="mTime">Last modification date</param>
- /// <param name="length">Legnth of the file</param>
- [MonoTODO]
- public void GetFileAttributes(string file, out DateTime mTime, long length)
- {
- if(!Path.IsPathRooted(file))
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Path_must_be_rooted"));
- }
- // TODO: finish this
- mTime = DateTime.Now;
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FilePathParser.cs b/mcs/class/System.Web/System.Web.Utils/FilePathParser.cs
deleted file mode 100644
index 25bd7740a98..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FilePathParser.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: FilePathParser
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-using System.IO;
-
-namespace System.Web.Utils
-{
- internal class FilePathParser
- {
- private static char[] pathSeparators = {
- Path.DirectorySeparatorChar,
- Path.AltDirectorySeparatorChar
- };
-
- private string dirName;
- private string fileName;
- private string shortDirName;
- private string shortFileName;
-
- private bool exists;
-
- [MonoTODO]
- public FilePathParser(string path, bool isFile, bool getShortNames)
- {
- path = path.Trim();
- if(Path.GetPathRoot(path).Length < path.Length)
- {
- path = path.TrimEnd(pathSeparators);
- }
- if(!isFile)
- {
- dirName = GetBaseDirOrRoot(path);
- } else
- {
- dirName = path;
- }
- if(getShortNames)
- {
- if(!Directory.Exists(dirName))
- {
- dirName = null;
- return;
- }
- shortDirName = GetShortPathName(dirName);
- if(shortDirName==null)
- {
- dirName = null;
- return;
- }
- if(shortDirName == dirName)
- {
- shortDirName = null;
- } else
- {
- throw new NotImplementedException();
- }
- }
- }
-
- public static string GetBaseDirOrRoot(string file)
- {
- string bDir = Path.GetDirectoryName(file);
- return ( bDir!=null ? bDir : Path.GetPathRoot(file));
- }
-
- [MonoTODO("Native_Call_Required")]
- public static string GetShortPathName(string path)
- {
- //TODO: Native calls required, it's in kernel32.dll for windows
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/IISVersionInfo.cs b/mcs/class/System.Web/System.Web.Utils/IISVersionInfo.cs
deleted file mode 100644
index fce89988b12..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/IISVersionInfo.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
-
- * Namespace: System.Web.Utils
- * Class: IISVersionInfo
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
-
- *
-
- * (C) Gaurav Vaish (2001)
-
- */
-
-
-using System;
-using System.Diagnostics;
-using System.Web;
-using System.Web.Utils;
-
-namespace System.Web.Utils
-{
- //FIXME: This is highly Windows/IIS specific code. What about Apache related stuff?
- internal class IISVersionInfo
- {
- private static string isapiVersion;
- private static string mscoreeVersion;
- private static string systemWebVersion;
-
- private static readonly object lockObj = null;
-
- public IISVersionInfo()
- {
- }
-
- internal static string IsapiVersion
- {
- get
- {
- if(isapiVersion==null)
- {
- lock(lockObj)
- {
- // Recheck - another thread may have set the value
- // before entering lock / exiting previous lock
- if(isapiVersion==null)
- {
- //FIXME: What about Apache? What dll/shared-object to be loaded?
- isapiVersion = GetLoadedModuleVersion("aspnet_isapi.dll");
- }
- }
- }
- return isapiVersion;
- }
- }
-
- internal static string ClrVersion
- {
- get
- {
- if(mscoreeVersion==null)
- {
- lock(lockObj)
- {
- if(mscoreeVersion==null)
- {
- mscoreeVersion = GetLoadedModuleVersion("mscorlib.dll");
- }
- }
- }
- return mscoreeVersion;
- }
- }
-
- internal static string SystemWebVersion
- {
- get
- {
- if(systemWebVersion == null)
- {
- lock(lockObj)
- {
- if(systemWebVersion==null)
- {
- systemWebVersion = (FileVersionInfo.GetVersionInfo((typeof(HttpRuntime)).Module.FullyQualifiedName)).FileVersion;
- }
- }
- }
- return systemWebVersion;
- }
- }
-
- [MonoTODO]
- internal static string GetLoadedModuleVersion(string modulename)
- {
- //TODO: Load the version information from the module
- // Needs native calls - which ones, since the module will not be .Net aware
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- internal static string GetLoadedModuleFilename(string modulename)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/NativeFileChangeEventHandler.cs b/mcs/class/System.Web/System.Web.Utils/NativeFileChangeEventHandler.cs
deleted file mode 100644
index 6047a52688b..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/NativeFileChangeEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: NativeFileChangeEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- public delegate void NativeFileChangeEventHandler(object sender, int method);
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/UrlUtils.cs b/mcs/class/System.Web/System.Web.Utils/UrlUtils.cs
deleted file mode 100644
index 5da94a47ac6..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/UrlUtils.cs
+++ /dev/null
@@ -1,283 +0,0 @@
-/**
- * Namespace: System.Web.UI.Utils
- * Class: UrlUtils
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Text;
-
-namespace System.Web.Utils
-{
- internal class UrlUtils
- {
- /*
- * I could not find these functions in the class System.Uri
- * Besides, an instance of Uri will not be formed until and unless the address is of
- * the form protocol://[user:pass]host[:port]/[fullpath]
- * ie, a protocol, and that too without any blanks before,
- * is a must which may not be the case here.
- * Important: Escaped URL is assumed here. nothing like .aspx?path=/something
- * It should be .aspx?path=%2Fsomething
- */
- public static string GetProtocol(string url)
- {
- //Taking code from Java Class java.net.URL
- if(url!=null)
- {
- if(url.Length>0)
- {
-
- int i, start = 0, limit;
- limit = url.Length;
- char c;
- bool aRef = false;
- while( (limit > 0) && (url[limit-1] <= ' '))
- {
- limit --;
- }
- while( (start < limit) && (url[start] <= ' '))
- {
- start++;
- }
- if(RegionMatches(true, url, start, "url:", 0, 4))
- {
- start += 4;
- }
- if(start < url.Length && url[start]=='#')
- {
- aRef = true;
- }
- for(i = start; !aRef && (i < limit) && ((c=url[i]) != '/'); i++)
- {
- if(c==':')
- {
- return url.Substring(start, i - start);
- }
- }
- }
- }
- return String.Empty;
- }
-
- public static bool IsRelativeUrl(string url)
- {
- if(url.IndexOf(':') != -1)
- return !IsRootUrl(url);
- return true;
- }
-
- public static bool IsRootUrl(string url)
- {
- if(url!=null)
- {
- if(url.Length>0)
- {
- return IsValidProtocol(GetProtocol(url).ToLower());
- }
- }
- return true;
- }
-
- public static bool IsRooted(string path)
- {
- if(path!=null && path.Length > 0)
- {
- return (path[0]=='/' || path[0]=='\\');
- }
- return false;
- }
-
- public static void FailIfPhysicalPath(string path)
- {
- if(path!= null && path.Length > 0)
- {
- if(path[0]==':' || path.StartsWith(@"\\"))
- throw new HttpException(HttpRuntime.FormatResourceString("Physical_path_not_allowed", path));
- }
- }
-
- public static string Combine(string basePath, string relPath)
- {
- FailIfPhysicalPath(relPath);
- if(IsRootUrl(relPath))
- {
- if(relPath != null && relPath.Length > 0)
- {
- return Reduce(relPath);
- }
- return String.Empty;
- }
- if(relPath.Length < 3 || relPath[0]!='~' || (relPath[0]!='/' && relPath[0]!='\\'))
- {
- if(basePath==null || basePath.Length==1 || basePath[0]=='/')
- basePath = String.Empty;
- return Reduce(basePath + "/" + relPath);
- }
- string vPath = HttpRuntime.AppDomainAppVirtualPath;
- if(vPath.Length <= 1)
- vPath = String.Empty;
- return Reduce(vPath + "/" + relPath.Substring(2));
- }
-
- public static bool IsValidProtocol(string protocol)
- {
- if(protocol.Length < 1)
- return false;
- char c = protocol[0];
- if(!Char.IsLetter(c))
- {
- return false;
- }
- for(int i=1; i < protocol.Length; i++)
- {
- c = protocol[i];
- if(!Char.IsLetterOrDigit(c) && c!='.' && c!='+' && c!='-')
- {
- return false;
- }
- }
- return true;
- }
-
- /*
- * MakeRelative("http://www.foo.com/bar1/bar2/file","http://www.foo.com/bar1")
- * will return "bar2/file"
- * while MakeRelative("http://www.foo.com/bar1/...","http://www.anotherfoo.com")
- * return 'null' and so does the call
- * MakeRelative("http://www.foo.com/bar1/bar2","http://www.foo.com/bar")
- */
- public static string MakeRelative(string fullUrl, string relativeTo)
- {
- if(fullUrl==relativeTo)
- {
- return String.Empty;
- }
- if(fullUrl.IndexOf(relativeTo)!=0)
- {
- return null;
- }
- string leftOver = fullUrl.Substring(relativeTo.Length);
- if(!fullUrl.EndsWith("/") && !leftOver.StartsWith("/"))
- {
- return null;
- }
- if(leftOver.StartsWith("/"))
- {
- leftOver = leftOver.Substring(1);
- }
- return leftOver;
- }
-
- /*
- * Check JavaDocs for java.lang.String#RegionMatches(bool, int, String, int, int)
- * Could not find anything similar in the System.String class
- */
- public static bool RegionMatches(bool ignoreCase, string source, int start, string match, int offset, int len)
- {
- if(source!=null || match!=null)
- {
- if(source.Length>0 && match.Length>0)
- {
- char[] ta = source.ToCharArray();
- char[] pa = match.ToCharArray();
- if((offset < 0) || (start < 0) || (start > (source.Length - len)) || (offset > (match.Length - len)))
- {
- return false;
- }
- while(len-- > 0)
- {
- char c1 = ta[start++];
- char c2 = pa[offset++];
- if(c1==c2)
- continue;
- if(ignoreCase)
- {
- if(Char.ToUpper(c1)==Char.ToUpper(c2))
- continue;
- // Check for Gregorian Calendar where the above may not hold good
- if(Char.ToLower(c1)==Char.ToLower(c2))
- continue;
- }
- return false;
- }
- return true;
- }
- }
- return false;
- }
-
- public static string Reduce(string path)
- {
- int len = path.Length;
- int dotIndex = -1;
- path = path.Replace('\\','/');
- while(true)
- {
- dotIndex++;
- dotIndex = path.IndexOf('.', dotIndex);
- if(dotIndex < 0)
- {
- return path;
- }
- if(dotIndex != 0 && path[dotIndex -1]=='/')
- continue;
- if(dotIndex+1 == len || path[dotIndex+1]=='/')
- break;
- if(path[dotIndex+1]=='.')
- continue;
- if(dotIndex+2 == len || path[dotIndex+2]=='/')
- break;
- }
- ArrayList list = new ArrayList();
- StringBuilder sb = new StringBuilder();
- dotIndex = 0;
- int temp;
- do
- {
- temp = dotIndex;
- dotIndex = path.IndexOf('/', temp + 1);
- if(dotIndex < 0)
- dotIndex = len;
- if( (dotIndex - temp) <= 3 && (dotIndex < 1 || path[dotIndex - 1]== '.') && ( (temp+1) >= len || path[temp+1]=='.') )
- {
- if(dotIndex - temp == 3)
- continue;
- if(list.Count == 0)
- throw new System.Web.HttpException(System.Web.HttpRuntime.FormatResourceString("Cannot_exit_up_top_directory"));
- sb.Length = (int) list[list.Count - 1];
- list.RemoveRange(list.Count - 1, 1);
- continue;
- }
- list.Add(sb.Length);
- sb.Append(path, temp, dotIndex - temp);
- } while(dotIndex != len);
- return sb.ToString();
- }
-
- public static string GetDirectory(string url)
- {
- if(url==null)
- {
- return null;
- }
- if(url.Length==0)
- {
- return String.Empty;
- }
- url.Replace('\\','/');
- string baseDir = url.Substring(0, url.LastIndexOf('/'));
- if(baseDir.Length==0)
- {
- baseDir = "/";
- }
- return baseDir;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/WebEqualComparer.cs b/mcs/class/System.Web/System.Web.Utils/WebEqualComparer.cs
deleted file mode 100644
index ee570dd34c6..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/WebEqualComparer.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: WebEqualComparer
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Globalization;
-using System.Collections;
-
-namespace System.Web.Utils
-{
- public class WebEqualComparer : IComparer
- {
- private static IComparer defC;
-
- public WebEqualComparer()
- {
- }
-
- public static IComparer Default
- {
- get
- {
- if(defC == null)
- {
- defC = new WebEqualComparer();
- }
- return defC;
- }
- }
-
- /// <summary>
- /// To compare two strings
- /// </summary>
- /// <remarks>
- /// Cannot apply String.Compare(..) since I am at web
- /// </remarks>
- int IComparer.Compare(object left, object right)
- {
- string leftStr, rightStr;
- leftStr = null;
- rightStr = null;
- if(left is string)
- {
- leftStr = (string)left;
- }
- if(right is string)
- {
- rightStr = (string)right;
- }
-
- if(leftStr==null || rightStr==null)
- {
- throw new ArgumentException();
- }
-
- int ll = leftStr.Length;
- int lr = rightStr.Length;
- if(ll==0 && lr==0)
- {
- return 0;
- }
-
- if(ll==0 || lr==0)
- {
- return ( (ll > 0) ? 1 : -1);
- }
-
- char cl,cr;
- int i=0;
- for(i=0; i < leftStr.Length; i++)
- {
- if(i==lr)
- {
- return 1;
- }
- cl = leftStr[i];
- cr = leftStr[i];
- if(cl==cr)
- {
- continue;
- }
- UnicodeCategory ucl = Char.GetUnicodeCategory(cl);
- UnicodeCategory ucr = Char.GetUnicodeCategory(cr);
- if(ucl==ucr)
- {
- return ( (cl > cr) ? 1 : -1 );
- }
- cl = Char.ToLower(cl);
- cr = Char.ToLower(cr);
- if(cl!=cr)
- {
- return ( (cl > cr) ? 1 : -1);
- }
- }
- return ( (i==lr) ? 0 : -1 );
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/WebHashCodeProvider.cs b/mcs/class/System.Web/System.Web.Utils/WebHashCodeProvider.cs
deleted file mode 100644
index a2db4a4577f..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/WebHashCodeProvider.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
-
- * Namespace: System.Web.Utils
- * Class: WebHashCodeProvider
- *
-
- * Author: Gaurav Vaish
-
- * Maintainer: gvaish@iitk.ac.in
-
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
-
- * Implementation: yes
-
- * Status: ??%
-
- *
-
- * (C) Gaurav Vaish (2001)
-
- */
-
-
-using System.Collections;
-using System.Globalization;
-
-namespace System.Web.Utils
-{
- public class WebHashCodeProvider : IHashCodeProvider
- {
- private static IHashCodeProvider defHcp;
-
- public WebHashCodeProvider()
- {
- }
-
- int IHashCodeProvider.GetHashCode(object key)
- {
- return Default.GetHashCode(key);
- }
-
- public static IHashCodeProvider Default
- {
- get
- {
- if(defHcp==null)
- {
- defHcp = new CaseInsensitiveHashCodeProvider(CultureInfo.InvariantCulture);
- }
- return defHcp;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.build b/mcs/class/System.Web/System.Web.build
deleted file mode 100644
index cf47df81f4f..00000000000
--- a/mcs/class/System.Web/System.Web.build
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.Web.dll -->
-
-<project name="System" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/System.Web.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0169"/>
- <arg value="/unsafe"/>
- <arg value="/r:System.dll"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- <excludes name="System.Web/HttpWorkerRequest.cs"/>
- <excludes name="System.Web.Hosting/**"/>
- <!--<excludes name="System.Web.UI/**"/>-->
- <excludes name="System.Web/IHttpModule.cs"/>
- <excludes name="System.Web.UI.HtmlControls/**"/>
- <excludes name="System.Web.UI.WebControls/**"/>
- <excludes name="System.Web/IHttpHandlerFactory.cs"/>
- <excludes name="System.Web/HttpCacheValidateHandler.cs"/>
- <excludes name="System.Web/IHttpAsyncHandler.cs"/>
- <excludes name="System.Web/IHttpHandler.cs"/>
- </sources>
- </csc>
- </target>
-</project>
diff --git a/mcs/class/System.Web/System.Web/.cvsignore b/mcs/class/System.Web/System.Web/.cvsignore
deleted file mode 100644
index 04bc145deea..00000000000
--- a/mcs/class/System.Web/System.Web/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-_*
diff --git a/mcs/class/System.Web/System.Web/BeginEventHandler.cs b/mcs/class/System.Web/System.Web/BeginEventHandler.cs
deleted file mode 100644
index c2bd1ac2782..00000000000
--- a/mcs/class/System.Web/System.Web/BeginEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.BeginEventHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public delegate IAsyncResult BeginEventHandler(object sender,
- EventArgs e,
- AsyncCallback cb,
- object extraData);
-}
diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog
deleted file mode 100644
index fe8e6137fc7..00000000000
--- a/mcs/class/System.Web/System.Web/ChangeLog
+++ /dev/null
@@ -1,43 +0,0 @@
-2002-01-08 Gaurav Vaish <gavish@iitk.ac.in>
-
- * TODOAttribute.cs : Added, as an internal class to the assembly
-
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * HttpRuntime.cs: remove uneeded exception variable from catch and
- initialize remaining instance members to avoid compile warnings
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * HttpRuntime.cs: fix spelling error/variable name change.
-
-2001-12-18 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * HttpRuntime.cs : Initial implementation
-
-2001-08-29 Bob Smith <bob@thestuff.net>
-
- * HttpWorkerRequest.cs: Partial Implementation.
-
-2001-08-16 Bob Smith <bob@thestuff.net>
-
- * HttpCookieCollection.cs, HttpCookie.cs: Bug fixes.
-
-2001-08-09 Bob Smith <bob@thestuff.net>
-
- * BeginEventHandler.cs: Implemented.
- * EndEventHandler.cs: Implemented.
- * HttpCacheability.cs: Implemented.
- * HttpCacheRevalidation.cs: Implemented.
- * HttpCacheValidateHandler.cs: Implemented.
- * HttpCookieCollection.cs: Implemented.
- * HttpCookie.cs: Implemented.
- * HttpValidationStatus.cs: Implemented.
- * HttpWorkerRequest.EndOfSendNotification.cs: Implemented.
- * IHttpAsyncHandler.cs: Implemented.
- * IHttpHandler.cs: Implemented.
- * IHttpHandlerFactory.cs: Implemented.
- * IHttpModule.cs: Implemented.
- * ProcessShutdownReason.cs: Implemented.
- * ProcessStatus.cs: Implemented.
- * TraceMode.cs: Implemented.
diff --git a/mcs/class/System.Web/System.Web/EndEventHandler.cs b/mcs/class/System.Web/System.Web/EndEventHandler.cs
deleted file mode 100644
index cd7a51c222a..00000000000
--- a/mcs/class/System.Web/System.Web/EndEventHandler.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// System.Web.EndEventHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public delegate void EndEventHandler(IAsyncResult ar);
-}
diff --git a/mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs b/mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs
deleted file mode 100644
index c0a4038bfa5..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Web.HttpCacheRevalidation.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public enum HttpCacheRevalidation
- {
- AllCaches,
- None,
- ProxyCaches
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/HttpCacheValidateHandler.cs b/mcs/class/System.Web/System.Web/HttpCacheValidateHandler.cs
deleted file mode 100644
index 032aea39f6f..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCacheValidateHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.HttpCacheValidateHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public delegate void HttpCacheValidateHandler(
- HttpContext context,
- object data,
- ref HttpValidationStatus validationStatus);
-}
diff --git a/mcs/class/System.Web/System.Web/HttpCacheability.cs b/mcs/class/System.Web/System.Web/HttpCacheability.cs
deleted file mode 100644
index 4a89bf89e9b..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCacheability.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.HttpCacheability.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public enum HttpCacheability
- {
- NoCache,
- Private,
- Public,
- Server
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/HttpCookie.cs b/mcs/class/System.Web/System.Web/HttpCookie.cs
deleted file mode 100644
index bc16a17cd67..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCookie.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// System.Web.HttpCookie.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Collections.Specialized;
-
-namespace System.Web
-{
- public sealed class HttpCookie
- {
- private string _name;
- private string _value = null;
- private string _domain; //TODO: default to some pref.
- private DateTime _expires;
- private string _path; //TODO: default is the current request path.
- private bool _secure = false;
- public HttpCookie(string name)
- {
- _name = name;
- }
- public HttpCookie(string name, string value)
- {
- _name = name;
- _value = value;
- }
- public string Domain
- {
- get
- {
- return _domain;
- }
- set
- {
- _domain = value;
- }
- }
- public DateTime Expires
- {
- get
- {
- return _expires;
- }
- set
- {
- _expires = value;
- }
- }
- public bool HasKeys
- {
- get
- {
- return false; //TODO
- }
- }
- public string this[string key]
- {
-//TODO: get/set subcookie.
- get {return "";}
- set {}
- }
- public string Name
- {
- get
- {
- return _name;
- }
- set
- {
- _name = value;
- }
- }
- public string Path
- {
- get
- {
- return _path;
- }
- set
- {
- _path = value;
- }
- }
- public bool Secure
- {
- get
- {
- return _secure;
- }
- set
- {
- _secure = value;
- }
- }
- public string Value
- {
- get
- {
- return _value;
- }
- set
- {
- _value = value;
- }
- }
- public NameValueCollection Values
- {
-//TODO
- get {return null;}
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpCookieCollection.cs b/mcs/class/System.Web/System.Web/HttpCookieCollection.cs
deleted file mode 100644
index b13b38d1348..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCookieCollection.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// System.Web.HttpCookieCollection.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Collections.Specialized;
-
-namespace System.Web
-{
- public sealed class HttpCookieCollection : NameObjectCollectionBase
- {
- public HttpCookieCollection() {}
- public string[] AllKeys
- {
- get
- {
- return this.BaseGetAllKeys();
- }
- }
- public HttpCookie this[int index]
- {
- get
- {
- return (HttpCookie)(this.BaseGet(index));
- }
- }
- public HttpCookie this[string name]
- {
- get
- {
- return (HttpCookie)(this.BaseGet(name));
- }
- }
- public void Add(HttpCookie cookie)
- {
- this.BaseAdd(cookie.Name, cookie);
- }
- public void Clear()
- {
- this.BaseClear();
- }
- public void CopyTo(Array dest, int index)
- {
- int i;
- HttpCookie cookie;
- for(i=0; i<this.Count; i++)
- {
- cookie=this[i];
- dest.SetValue(new HttpCookie(cookie.Name, cookie.Value), index+i);
- }
- }
- public string GetKey(int index)
- {
- return this.BaseGetKey(index);
- }
- public void Remove(string name)
- {
- this.BaseRemove(name);
- }
- public void Set(HttpCookie cookie)
- {
- this.BaseSet(cookie.Name, cookie);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpRuntime.cs b/mcs/class/System.Web/System.Web/HttpRuntime.cs
deleted file mode 100644
index 167a65d94a6..00000000000
--- a/mcs/class/System.Web/System.Web/HttpRuntime.cs
+++ /dev/null
@@ -1,355 +0,0 @@
-/**
- * Namespace: System.Web
- * Class: HttpRuntime
- *
- * Author: Gaurav Vaish
- * Contact: <gvaish@iitk.ac.in>
- * Status: ?%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-using System.Web.Caching;
-using System.Web.UI;
-using System.Web.Utils;
-
-namespace System.Web
-{
- public sealed class HttpRuntime
- {
- internal static byte[] autogenKeys;
-
- private static bool initialized;
- private static string installDir;
- private static HttpRuntime runtime;
-
- /// <summary>
- /// Loading of ISAPI
- /// </summary>
- private static bool isapiLoaded;
-
- private Cache cache;
-
- // Security permission helper objects
- private static IStackWalk appPathDiscoveryStackWalk;
- private static IStackWalk ctrlPrincipalStackWalk;
- private static IStackWalk sensitiveInfoStackWalk;
- private static IStackWalk unmgdCodeStackWalk;
- private static IStackWalk unrestrictedStackWalk;
- private static IStackWalk reflectionStackWalk;
-
- private string appDomainAppPath;
- private string appDomainAppVirtualPath;
-
- private FileChangesMonitor fcm;
-
- private Exception initErrorException;
-
- static HttpRuntime()
- {
- autogenKeys = new byte[88];
- initialized = false;
- isapiLoaded = false;
-
- appPathDiscoveryStackWalk = null;
- ctrlPrincipalStackWalk = null;
- sensitiveInfoStackWalk = null;
- unmgdCodeStackWalk = null;
- unrestrictedStackWalk = null;
-
- if(!DesignTimeParseData.InDesigner)
- Initialize();
- runtime = new HttpRuntime();
- if(!DesignTimeParseData.InDesigner)
- runtime.Init();
- }
-
- //FIXME: IIS specific code. Need information on what to do for Apache?
- internal static void Initialize()
- {
- if(!initialized)
- {
- bool moduleObtained = false;
- string file = IISVersionInfo.GetLoadedModuleFilename("aspnet_isapi.dll");
- string dir = null;
- string version = null;
- if(file!=null)
- {
- dir = file.Substring(0, file.LastIndexOf('\\'));
- moduleObtained = true;
- }
- if(dir!=null && dir.Length > 0)
- {
- try
- {
- version = IISVersionInfo.SystemWebVersion;
- /* TODO: I need the code to read registry
- * I need LOCAL_MACHINE\Software\Micorosoft\ASP.NET\<version>
- */
- } catch
- {
- dir = null;
- }
- }
- if(dir==null || dir.Length == 0)
- {
- string modulefile = (typeof(HttpRuntime)).Module.FullyQualifiedName;
- dir = modulefile.Substring(0, modulefile.LastIndexOf('\\'));
- }
- if(!moduleObtained)
- {
- //TODO: Now what? Module still not obtained
- // Try loading using native calls. something like LoadLibrary(...) in *java*
- // LoadLibrary(dir+"\\aspnet_asp.dll)
- }
- if(moduleObtained)
- {
- //TODO: Initialize the library
- // InitIsapiLibrary();
- }
- installDir = dir;
- isapiLoaded = moduleObtained;
- initialized = true;
- }
- }
-
- [MonoTODO("Init")]
- private void Init()
- {
- initErrorException = null;
- cache = new Cache();
- appDomainAppPath = "";
-
- try
- {
- //FIXME: OS Check?
- //if(false)
- // throw new PlatformNotSupportedException();
- //I am here <gvaish>
- throw new NotImplementedException();
- } catch(Exception e)
- {
- initErrorException = e;
- }
- }
-
- [MonoTODO("FormatResourceString(string, string, string)")]
- internal static string FormatResourceString(string key, string arg0, string type)
- {
- throw new NotImplementedException();
- }
-
- internal static string FormatResourceString(string key, string arg0)
- {
- string format = GetResourceString(key);
- if(format==null)
- return null;
- return String.Format(format, arg0);
- }
-
- internal static string FormatResourceString(string key)
- {
- return GetResourceString(key);
- }
-
- private static string GetResourceString(string key)
- {
- return runtime.GetResourceStringFromResourceManager(key);
- }
-
- [MonoTODO("GetResourceStringFromResourceManager(string)")]
- private string GetResourceStringFromResourceManager(string key)
- {
- throw new NotImplementedException();
- }
-
- public static Cache Cache
- {
- get
- {
- return runtime.cache;
- }
- }
-
- [MonoTODO]
- public static string AppDomainAppId
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static string AppDomainAppPath
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static string AppDomainAppVirtualPath
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static string AppDomainId
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static string AspInstallDirectory
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static string BinDirectory
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static string ClrInstallDirectory
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static string CodegenDir
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static bool IsOnUNCShare
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static string MachineConfigurationDirectory
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public static void Close()
- {
- throw new NotImplementedException();
- }
-
- internal static IStackWalk AppPathDiscovery
- {
- get
- {
- if(appPathDiscoveryStackWalk == null)
- {
- appPathDiscoveryStackWalk = new FileIOPermission(FileIOPermissionAccess.PathDiscovery, runtime.appDomainAppPath);
- }
- return appPathDiscoveryStackWalk;
- }
- }
-
- internal static IStackWalk ControlPrincipal
- {
- get
- {
- if(ctrlPrincipalStackWalk == null)
- {
- ctrlPrincipalStackWalk = new SecurityPermission(SecurityPermissionFlag.ControlPrincipal);
- }
- return ctrlPrincipalStackWalk;
- }
- }
-
- internal static IStackWalk Reflection
- {
- get
- {
- if(reflectionStackWalk == null)
- {
- reflectionStackWalk = new ReflectionPermission(ReflectionPermissionFlag.TypeInformation | ReflectionPermissionFlag.MemberAccess);
- }
- return reflectionStackWalk;
- }
- }
-
- internal static IStackWalk SensitiveInformation
- {
- get
- {
- if(sensitiveInfoStackWalk == null)
- {
- sensitiveInfoStackWalk = new EnvironmentPermission(PermissionState.Unrestricted);
- }
- return sensitiveInfoStackWalk;
- }
- }
-
- internal static IStackWalk UnmanagedCode
- {
- get
- {
- if(unmgdCodeStackWalk == null)
- {
- unmgdCodeStackWalk = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
- }
- return unmgdCodeStackWalk;
- }
- }
-
- internal static IStackWalk Unrestricted
- {
- get
- {
- if(unrestrictedStackWalk == null)
- {
- unrestrictedStackWalk = new PermissionSet(PermissionState.Unrestricted);
- }
- return unrestrictedStackWalk;
- }
- }
-
- internal static IStackWalk FileReadAccess(string file)
- {
- return new FileIOPermission(FileIOPermissionAccess.Read, file);
- }
-
- internal static IStackWalk PathDiscoveryAccess(string path)
- {
- return new FileIOPermission(FileIOPermissionAccess.PathDiscovery, path);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpValidationStatus.cs b/mcs/class/System.Web/System.Web/HttpValidationStatus.cs
deleted file mode 100644
index 6338b59d613..00000000000
--- a/mcs/class/System.Web/System.Web/HttpValidationStatus.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Web.HttpValidationStatus.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public enum HttpValidationStatus
- {
- IgnoreThisRequest,
- Invalid,
- Valid
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/HttpWorkerRequest.EndOfSendNotification.cs b/mcs/class/System.Web/System.Web/HttpWorkerRequest.EndOfSendNotification.cs
deleted file mode 100644
index d48edf0cce0..00000000000
--- a/mcs/class/System.Web/System.Web/HttpWorkerRequest.EndOfSendNotification.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Web.HttpWorkerRequest.EndOfSendNotification.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public class HttpWorkerRequest {
- public delegate void EndOfSendNotification(
- HttpWorkerRequest wr,
- object extraData);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs b/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs
deleted file mode 100644
index 88504cb55cd..00000000000
--- a/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// System.Web.HttpWorkerRequest.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web
-{
- public abstract class HttpWorkerRequest
- {
- public const int HeaderAccept = 20;
- public const int HeaderAcceptCharset = 21;
- public const int HeaderAcceptEncoding = 22;
- public const int HeaderAcceptLanguage = 23;
- public const int HeaderAcceptRanges = 20;
- public const int HeaderAge = 21;
- public const int HeaderAllow = 10;
- public const int HeaderAuthorization = 24;
- public const int HeaderCacheControl = 0;
- public const int HeaderConnection = 1;
- public const int HeaderContentEncoding = 13;
- public const int HeaderContentLanguage = 14;
- public const int HeaderContentLength = 11;
- public const int HeaderContentLocation = 15;
- public const int HeaderContentMd5 = 16;
- public const int HeaderContentRange = 17;
- public const int HeaderContentType = 12;
- public const int HeaderCookie = 25;
- public const int HeaderDate = 2;
- public const int HeaderEtag = 22;
- public const int HeaderExpect = 26;
- public const int HeaderExpires = 18;
- public const int HeaderFrom = 27;
- public const int HeaderHost = 28;
- public const int HeaderIfMatch = 29;
- public const int HeaderIfModifiedSince = 30;
- public const int HeaderIfNoneMatch = 31;
- public const int HeaderIfRange = 32;
- public const int HeaderIfUnmodifiedSince = 33;
- public const int HeaderKeepAlive = 3;
- public const int HeaderLastModified = 19;
- public const int HeaderLocation = 23;
- public const int HeaderMaxForwards = 34;
- public const int HeaderPragma = 4;
- public const int HeaderProxyAuthenticate = 24;
- public const int HeaderProxyAuthorization = 35;
- public const int HeaderRange = 37;
- public const int HeaderReferer = 36;
- public const int HeaderRetryAfter = 25;
- public const int HeaderServer = 26;
- public const int HeaderSetCookie = 27;
- public const int HeaderTe = 38;
- public const int HeaderTrailer = 5;
- public const int HeaderTransferEncoding = 6;
- public const int HeaderUpgrade = 7;
- public const int HeaderUserAgent = 39;
- public const int HeaderVary = 28;
- public const int HeaderVia = 8;
- public const int HeaderWarning = 9;
- public const int HeaderWwwAuthenticate = 29;
- public const int ReasonCachePolicy = 2;
- public const int ReasonCacheSecurity = 3;
- public const int ReasonClientDisconnect = 4;
- public const int ReasonDefault = 0;
- public const int ReasonFileHandleCacheMiss = 1;
- public const int ReasonResponseCacheMiss = 0;
- public const int RequestHeaderMaximum = 40;
- public const int ResponseHeaderMaximum = 30;
-
-public static int GetKnownRequestHeaderIndex(string header);
-public static string GetKnownRequestHeaderName(int index);
-public static int GetKnownResponseHeaderIndex(string header);
-public static string GetKnownResponseHeaderName(int index);
-public static string GetStatusDescription(int code);
-public virtual string MachineConfigPath {get;}
-public virtual string MachineInstallDirectory {get;}
-
- protected HttpWorkerRequest() {}
-
-public virtual void CloseConnection();
-public abstract void EndOfRequest();
-public abstract void FlushResponse(bool finalFlush);
-public virtual string GetAppPath();
-public virtual string GetAppPathTranslated();
-public virtual string GetAppPoolID();
-public virtual long GetBytesRead();
-public virtual byte[] GetClientCertificate();
-public virtual byte[] GetClientCertificateBinaryIssuer();
-public virtual int GetClientCertificateEncoding();
-public virtual byte[] GetClientCertificatePublicKey();
-public virtual DateTime GetClientCertificateValidFrom();
-public virtual DateTime GetClientCertificateValidUntil();
-public virtual long GetConnectionID();
-public virtual string GetFilePath();
-public virtual string GetFilePathTranslated();
-public abstract string GetHttpVerbName();
-public abstract string GetHttpVersion();
-public virtual string GetKnownRequestHeader(int index);
-public abstract string GetLocalAddress();
-public abstract int GetLocalPort();
-public virtual string GetPathInfo();
-public virtual byte[] GetPreloadedEntityBody();
-public virtual string GetProtocol();
-public abstract string GetQueryString();
-public virtual byte[] GetQueryStringRawBytes();
-public abstract string GetRawUrl();
-public abstract string GetRemoteAddress();
-public virtual string GetRemoteName();
-public abstract int GetRemotePort();
-public virtual int GetRequestReason();
-public virtual string GetServerName();
-public virtual string GetServerVariable(string name);
-public virtual string GetUnknownRequestHeader(string name);
-public virtual string[][] GetUnknownRequestHeaders();
-public abstract string GetUriPath();
-public virtual long GetUrlContextID();
-public virtual IntPtr GetUserToken();
-public virtual IntPtr GetVirtualPathToken();
-public bool HasEntityBody();
-public virtual bool HeadersSent();
-public virtual bool IsClientConnected();
-public virtual bool IsEntireEntityBodyIsPreloaded();
-public virtual bool IsSecure();
-public virtual string MapPath(string virtualPath);
-public virtual int ReadEntityBody(byte[] buffer, int size);
-public virtual void SendCalculatedContentLength(int contentLength);
-public abstract void SendKnownResponseHeader(int index, string value);
-public abstract void SendResponseFromFile(IntPtr handle, long offset, long length);
-public abstract void SendResponseFromFile(string filename, long offset, long length);
-public abstract void SendResponseFromMemory(byte[] data, int length);
-public virtual void SendResponseFromMemory(IntPtr data, int length);
-public abstract void SendStatus(int statusCode, string statusDescription);
-public abstract void SendUnknownResponseHeader(string name, string value);
-public virtual void SetEndOfSendNotification(HttpWorkerRequest.EndOfSendNotification callback, object extraData);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs b/mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs
deleted file mode 100644
index 42b13299c68..00000000000
--- a/mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.IHttpAsyncHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public interface IHttpAsyncHandler : IHttpHandler
- {
- IAsyncResult BeginProcessRequest(HttpContext context,
- AsyncCallback cb,
- object extraData);
- void EndProcessRequest(IAsyncResult result);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/IHttpHandler.cs b/mcs/class/System.Web/System.Web/IHttpHandler.cs
deleted file mode 100644
index 9cc39cf0281..00000000000
--- a/mcs/class/System.Web/System.Web/IHttpHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.IHttpHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public interface IHttpHandler
- {
- bool IsReusable {get;}
- void ProcessRequest(HttpContext context);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs b/mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs
deleted file mode 100644
index 836953d8a37..00000000000
--- a/mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Web.IHttpHandlerFactory.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public interface IHttpHandlerFactory
- {
- IHttpHandler GetHandler(HttpContext context,
- string requestType,
- string url,
- string pathTranslated);
- void ReleaseHandler(IHttpHandler handler);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/IHttpModule.cs b/mcs/class/System.Web/System.Web/IHttpModule.cs
deleted file mode 100644
index a000b15049d..00000000000
--- a/mcs/class/System.Web/System.Web/IHttpModule.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Web.IHttpModule.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public interface IHttpModule
- {
- void Dispose();
- void Init(HttpApplication context);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/NOTES b/mcs/class/System.Web/System.Web/NOTES
deleted file mode 100644
index 55926bd4ef9..00000000000
--- a/mcs/class/System.Web/System.Web/NOTES
+++ /dev/null
@@ -1,21 +0,0 @@
-Found another namespace not listed. System.Web.Hosting.
-HttpRuntime.ProcessRequest and HttpWorkerRequest seems to be the key.
-
-ASP maintains a pool of HttpApplication objects dirived from Global.asax.
-One is used per request, then reclamed after the request is totally
-complete.
-
-Read:
-http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguidnf/html/cpconaspnetapplications.asp
-
-
-Request notes:
-It apears each http request has its own thread. Need to figure out how to deal with this with apache.
-
-Session notes:
-When a request is finished, the contents of Request.Session are serialized and dumped to the State Server.
-When a request is started, a new Request.Session is created, data is deserialized from the State Server, and the objects are placed back into Request.Session.
-The State Server is accessed via the SessionStateModule which is used for both session ID and state data management.
-HttpApplicationState instance is created the first time a url within the applications virtual directory is accessed. Its accessable through HttpContext.Application.
-HttpApplicationState needs to use lock/unlock explicitly.
-Not shared across machines or multiple processes.
diff --git a/mcs/class/System.Web/System.Web/ProcessShutdownReason.cs b/mcs/class/System.Web/System.Web/ProcessShutdownReason.cs
deleted file mode 100644
index 1b8586ebc05..00000000000
--- a/mcs/class/System.Web/System.Web/ProcessShutdownReason.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Web.ProcessShutdownReason.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public enum ProcessShutdownReason
- {
- IdleTimeout,
- MemoryLimitExceeded,
- None,
- PingFailed,
- RequestQueueLimit,
- RequestsLimit,
- Timeout,
- Unexpected
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/ProcessStatus.cs b/mcs/class/System.Web/System.Web/ProcessStatus.cs
deleted file mode 100644
index 79066887e78..00000000000
--- a/mcs/class/System.Web/System.Web/ProcessStatus.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.ProcessStatus.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public enum ProcessStatus
- {
- Alive,
- ShutDown,
- ShuttingDown,
- Terminated
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/TODO b/mcs/class/System.Web/System.Web/TODO
deleted file mode 100644
index fdc27344d3b..00000000000
--- a/mcs/class/System.Web/System.Web/TODO
+++ /dev/null
@@ -1,27 +0,0 @@
-HttpClientCertificate
-HttpApplicationState
-HttpFileCollection
-HttpModuleCollection
-HttpException
-HttpCompileException
-HttpParseException
-HttpUnhandledException
-HttpWriter
-HttpCapabilitiesBase
-HttpBrowserCapabilities
-HttpApplication
-HttpCachePolicy
-HttpCacheVaryByHeaders
-HttpCacheVaryByParams
-HttpContext
-HttpPostedFile
-HttpRequest
-HttpResponse
-HttpRuntime
-HttpServerUtility
-HttpStaticObjectsCollection
-HttpUtility
-HttpWorkerRequest
-ProcessInfo
-ProcessModelInfo
-TraceContext
diff --git a/mcs/class/System.Web/System.Web/TODOAttribute.cs b/mcs/class/System.Web/System.Web/TODOAttribute.cs
deleted file mode 100644
index eb2bfa0dda2..00000000000
--- a/mcs/class/System.Web/System.Web/TODOAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Web {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/TraceMode.cs b/mcs/class/System.Web/System.Web/TraceMode.cs
deleted file mode 100644
index 12549121110..00000000000
--- a/mcs/class/System.Web/System.Web/TraceMode.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Web.TraceMode.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public enum TraceMode
- {
- SortByCategory,
- SortByTime
- }
-}
diff --git a/mcs/class/System.Web/Test/test.aspx b/mcs/class/System.Web/Test/test.aspx
deleted file mode 100644
index 363fab9697f..00000000000
--- a/mcs/class/System.Web/Test/test.aspx
+++ /dev/null
@@ -1,29 +0,0 @@
-<%@ page language="c#"%>
-<html>
-<head>
-<title>Test</title>
-<%Response.Write("Test");%>
-
-<script runat="server" language="c#">
- void SubmitBtn_Click(Object sender, EventArgs e) {
- Response.Write("Hi");
- }
-</script>
-
-<form action="test.aspx" method="post" runat="server">
-<asp:button text="Click Me" OnClick="SubmitBtn_Click" runat="server"/>
-</form>
-
-<!-- output
-
-<html>
-<head>
-<title>Test</title>
-Test<form name="ctrl0" method="post" action="test.aspx" id="ctrl0">
-<input type="hidden" name="__VIEWSTATE" value="dDwtMTc0MDc5ODg1Mzs7Pg==" />
-
-<input type="submit" name="ctrl1" value="Click Me" />
-</form>
-
-
---> \ No newline at end of file
diff --git a/mcs/class/System.Web/Test/test2.aspx b/mcs/class/System.Web/Test/test2.aspx
deleted file mode 100644
index 168aa05cb58..00000000000
--- a/mcs/class/System.Web/Test/test2.aspx
+++ /dev/null
@@ -1,101 +0,0 @@
-<%@ Page Language="C#" %>
-<html>
-<head>
-<script language="C#" runat="server">
-void Page_Load(Object Sender, EventArgs e) {
- if (!IsPostBack) {
- ArrayList values = new ArrayList();
-
- values.Add(new PositionData("Microsoft", "Msft"));
- values.Add(new PositionData("Intel", "Intc"));
- values.Add(new PositionData("Dell", "Dell"));
-
- Repeater1.DataSource = values;
- Repeater1.DataBind();
-
- Repeater2.DataSource = values;
- Repeater2.DataBind();
- Response.Write(Repeater1.Controls[0].ClientID);
- Response.Write("<br>");
- Response.Write(Repeater1.Controls[0].UniqueID);
- Response.Write("<br>");
- }
- }
-
- public class PositionData {
-
- private string name;
- private string ticker;
-
- public PositionData(string name, string ticker) {
- this.name = name;
- this.ticker = ticker;
- }
-
- public string Name {
- get {
- return name;
- }
- }
-
- public string Ticker {
- get {
- return ticker;
- }
- }
- }
-
- </script>
-
-</head>
-<body>
-
-<h3><font face="Verdana">Repeater Example</font></h3>
-
-<form runat=server>
-
-<b>Repeater1:</b>
-
-<p>
-
-<asp:Repeater id=Repeater1 runat="server">
-<HeaderTemplate>
-<table border=1>
-<tr>
-<td><b>Company</b></td>
-<td><b>Symbol</b></td>
-</tr>
-</HeaderTemplate>
-
-<ItemTemplate>
-<tr>
-<td> <%# DataBinder.Eval(Container.DataItem, "Name") %> <asp:label id="test"></td>
-<td> <%# DataBinder.Eval(Container.DataItem, "Ticker") %> </td>
-</tr>
-</ItemTemplate>
-
-<FooterTemplate>
-</table>
-</FooterTemplate>
-
-</asp:Repeater>
-<p>
-
-<b>Repeater2:</b>
-<p>
-<asp:Repeater id=Repeater2 runat="server">
-
-<HeaderTemplate>
-Company data:
- </HeaderTemplate>
-
-<ItemTemplate>
-<%# DataBinder.Eval(Container.DataItem, "Name") %> (<%# DataBinder.Eval(Container.DataItem, "Ticker") %>)
- </ItemTemplate>
-
-<SeparatorTemplate>, </SeparatorTemplate>
-</asp:Repeater>
-</form>
-</body>
-</html>
-
diff --git a/mcs/class/System.Web/Test/test3.aspx b/mcs/class/System.Web/Test/test3.aspx
deleted file mode 100644
index d8776e45f48..00000000000
--- a/mcs/class/System.Web/Test/test3.aspx
+++ /dev/null
@@ -1,23 +0,0 @@
-<%@ Page Debug="true" %>
-<html>
-<script runat=server language="vb">
-
-Sub AnchorBtn_Click(Source As Object, E as EventArgs)
- Message.InnerText = Message.InnerHtml
- End Sub
-
- </script>
-
-<body>
-<form method=post runat=server>
-
-<a OnServerClick="AnchorBtn_Click" runat=server> Click here at your peril.</a>
-
-<h1>
-<span id="Message" runat=server><span id="Message2" runat=server>narf</span></span>
-</h1>
-
-</form>
-</body>
-</html>
-
diff --git a/mcs/class/System.Web/Test/test4.aspx b/mcs/class/System.Web/Test/test4.aspx
deleted file mode 100644
index f9c020c1d85..00000000000
--- a/mcs/class/System.Web/Test/test4.aspx
+++ /dev/null
@@ -1,119 +0,0 @@
-<%@ Page Language="C#" Debug="true" %>
-<html>
-<head>
-<script language="C#" runat="server">
-// protected override void OnInit(EventArgs e){
-// throw new Exception();
-// }
- protected override void LoadViewState(object savedState){
- throw new Exception();
- }
- protected override object SaveViewState(){
- throw new Exception();
- }
- void Page_Kill(Object Sender, EventArgs e) {
- throw new Exception();
- }
- protected override void OnInit(EventArgs e){
- EnableViewState = true;
- TrackViewState();
- ViewState["test"] = "DIE!";
- }
- void Page_Load(Object Sender, EventArgs e) {
-// ((Control)Sender).PreRender += new EventHandler(Page_Kill);
- if (!IsPostBack) {
- ArrayList values = new ArrayList();
-
- values.Add(new PositionData("Microsoft", "Msft"));
- values.Add(new PositionData("Intel", "Intc"));
- values.Add(new PositionData("Dell", "Dell"));
-
- Repeater1.DataSource = values;
- Repeater1.DataBind();
-
- Repeater2.DataSource = values;
- Repeater2.DataBind();
- Response.Write(Repeater1.Controls[0].ClientID);
- Response.Write("<br>");
- Response.Write(Repeater1.Controls[0].UniqueID);
- Response.Write("<br>");
- }
- }
-
- public class PositionData {
-
- private string name;
- private string ticker;
-
- public PositionData(string name, string ticker) {
- this.name = name;
- this.ticker = ticker;
- }
-
- public string Name {
- get {
- return name;
- }
- }
-
- public string Ticker {
- get {
- return ticker;
- }
- }
- }
-
- </script>
-
-</head>
-<body>
-
-<h3><font face="Verdana">Repeater Example</font></h3>
-
-<form runat=server>
-
-<b>Repeater1:</b>
-
-<p>
-
-<asp:Repeater id=Repeater1 runat="server">
-<HeaderTemplate>
-<table border=1>
-<tr>
-<td><b>Company</b></td>
-<td><b>Symbol</b></td>
-</tr>
-</HeaderTemplate>
-
-<ItemTemplate>
-<tr>
-<td> <%# DataBinder.Eval(Container.DataItem, "Name") %> <asp:label id="test"></td>
-<td> <%# DataBinder.Eval(Container.DataItem, "Ticker") %> </td>
-</tr>
-</ItemTemplate>
-
-<FooterTemplate>
-</table>
-</FooterTemplate>
-
-</asp:Repeater>
-<p>
-
-<b>Repeater2:</b>
-<p>
-<asp:Repeater id=Repeater2 runat="server">
-
-<HeaderTemplate>
-Company data:
- </HeaderTemplate>
-
-<ItemTemplate>
-<%# DataBinder.Eval(Container.DataItem, "Name") %> (<%# DataBinder.Eval(Container.DataItem, "Ticker") %>)
- </ItemTemplate>
-
-<SeparatorTemplate>, </SeparatorTemplate>
-</asp:Repeater>
-</form>
-</body>
-</html>
-
diff --git a/mcs/class/System.Web/Test/test5.aspx b/mcs/class/System.Web/Test/test5.aspx
deleted file mode 100644
index 2aaf4bf06c2..00000000000
--- a/mcs/class/System.Web/Test/test5.aspx
+++ /dev/null
@@ -1,121 +0,0 @@
-<%@ Page Language="C#" Debug="true" %>
-<html>
-<head>
-<%
-Response.Write(HttpWorkerRequest.HeaderAccept);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAcceptCharset);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAcceptEncoding);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAcceptLanguage);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAcceptRanges);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAge);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAllow);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAuthorization);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderCacheControl);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderConnection);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentEncoding);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentLanguage);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentLength);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentLocation);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentMd5);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentRange);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentType);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderCookie);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderDate);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderEtag);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderExpect);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderExpires);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderFrom);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderHost);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfMatch);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfModifiedSince);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfNoneMatch);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfRange);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfUnmodifiedSince);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderKeepAlive);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderLastModified);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderLocation);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderMaxForwards);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderPragma);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderProxyAuthenticate);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderProxyAuthorization);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderRange);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderReferer);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderRetryAfter);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderServer);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderSetCookie);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderTe);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderTrailer);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderTransferEncoding);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderUpgrade);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderUserAgent);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderVary);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderVia);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderWarning);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderWwwAuthenticate);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonCachePolicy);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonCacheSecurity);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonClientDisconnect);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonDefault);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonFileHandleCacheMiss);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonResponseCacheMiss);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.RequestHeaderMaximum);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ResponseHeaderMaximum);
-Response.Write("<br>");
-%> \ No newline at end of file
diff --git a/mcs/class/System.Web/Test/test6.aspx b/mcs/class/System.Web/Test/test6.aspx
deleted file mode 100644
index 594c4bc7bbb..00000000000
--- a/mcs/class/System.Web/Test/test6.aspx
+++ /dev/null
@@ -1,83 +0,0 @@
-<html>
-<head>
-<!--
- Author: Gaurav Vaish
- Original Source: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebUIWebControlsCalendarClassSelectedDateTopic.asp
- Copyright: (C) Gaurav Vaish, 2001
--->
- <script language="C#" runat="server">
-
- void Selection_Change(Object sender, EventArgs e)
- {
- Label1.Text = "The selected date is " + Calendar1.SelectedDate.ToShortDateString();
- }
-
- void Selection_Change_Month(Object sender, EventArgs e)
- {
- Label2.Text = "The selected date is " + Calendar2.SelectedDate.ToShortDateString();
- }
-
- void Selection_Change_DWM(Object sender, EventArgs e)
- {
- Label3.Text = "The selected date is " + Calendar3.SelectedDate.ToShortDateString();
- }
-
- </script>
-
-</head>
-<body>
-
- <form runat="server">
-
- <h3><font face="Verdana">Calendar Example</font></h3>
-
- Select a date on the Calendar control.<br><br>
-
- <asp:Calendar ID="Calendar1" runat="server"
- SelectionMode="Day"
- ShowGridLines="True"
- OnSelectionChanged="Selection_Change">
-
- <SelectedDayStyle BackColor="Yellow"
- ForeColor="Red">
- </SelectedDayStyle>
-
- </asp:Calendar>
-
- <asp:Label id="Label1" runat=server />
-
- <hr><br>
-
- <asp:Calendar ID="Calendar2" runat="server"
- SelectionMode="DayWeek"
- ShowGridLines="True"
- OnSelectionChanged="Selection_Change_Month">
-
- <SelectedDayStyle BackColor="Yellow"
- ForeColor="Red">
- </SelectedDayStyle>
-
- </asp:Calendar>
-
- <asp:Label id="Label2" runat=server />
-
- <hr><br>
-
- <asp:Calendar ID="Calendar3" runat="server"
- SelectionMode="DayWeekMonth"
- ShowGridLines="True"
- OnSelectionChanged="Selection_Change_DWM">
-
- <SelectedDayStyle BackColor="Yellow"
- ForeColor="Red">
- </SelectedDayStyle>
-
- </asp:Calendar>
-
- <asp:Label id="Label3" runat=server />
-
- <hr><br>
-
- </form>
-</body>
-</html> \ No newline at end of file
diff --git a/mcs/class/System.XML/.cvsignore b/mcs/class/System.XML/.cvsignore
deleted file mode 100644
index 3be2b9a15a5..00000000000
--- a/mcs/class/System.XML/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.dll
-list
diff --git a/mcs/class/System.XML/ChangeLog b/mcs/class/System.XML/ChangeLog
deleted file mode 100644
index 30f9cb90a0e..00000000000
--- a/mcs/class/System.XML/ChangeLog
+++ /dev/null
@@ -1,11 +0,0 @@
-2002-02-23 Nick Drochak <ndrochak@gol.com>
-
- * System.XML.build: Change dll name to System.Xml.dll from
- System.XML.dll (not easy to notice, btw)
-
-2001-12-07 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Add the change log to this directory
-
- * System.XML.build: Add dependancy on linux target to test target. Need to have the dll before we can test it, right? Plus is encourages other to try 'make test'.
-
diff --git a/mcs/class/System.XML/System.XML.build b/mcs/class/System.XML/System.XML.build
deleted file mode 100644
index b50b2ea5774..00000000000
--- a/mcs/class/System.XML/System.XML.build
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.XML.dll -->
-
-<project name="System.XML" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/System.Xml.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- </sources>
- </csc>
- <copy file="../lib/System.Xml.dll" tofile="Test/System.XML.dll"/>
- <nant basedir="Test" target="build"/>
- </target>
-
- <target name="test" depends="build">
- <nant basedir="Test" target="test"/>
- </target>
-
- <target name="clean">
- <nant basedir="Test" target="clean"/>
- <delete file="../lib/System.XML.dll" failonerror="false"/>
- <delete file="../lib/System.Xml.dll" failonerror="false"/>
- <delete file="Test/System.XML.dll" failonerror="false"/>
- <delete file="Test/System.Xml.dll" failonerror="false"/>
- <delete file="../lib/System.XML.pdb" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System.XML/System.Xml.XPath/IXPathNavigable.cs b/mcs/class/System.XML/System.Xml.XPath/IXPathNavigable.cs
deleted file mode 100644
index cacb01db8f9..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/IXPathNavigable.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.IXmlLineInfo.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml.XPath
-{
- public interface IXPathNavigable
- {
- XPathNavigator CreateNavigator();
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs b/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
deleted file mode 100644
index fd043b42b3b..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace System.Xml.XPath
-{
- /// <summary>
- /// Summary description for XPathNavigator.
- /// </summary>
- public class XPathNavigator
- {
- public XPathNavigator()
- {
- //
- // TODO: Add constructor logic here
- //
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
deleted file mode 100644
index 69d5bff1709..00000000000
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ /dev/null
@@ -1,67 +0,0 @@
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * XmlCDataSection.cs: Initial implementation.
-
- * NameTable.cs: Fixed the whole thing. Wrote a NUnit test to test
- it out. This should (hopefully) be correct.
-
-2002-02-26 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReader.cs: Apparently Microsoft's implementation treats
- namespace declarations as attributes so we do now, too.
-
- * XmlNamespaceManager.cs: HasNamespace fixed so that it only
- checks the current scope.
-
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * XmlDocumentType.cs: Added a few hacks here and there to
- temporarily fix the "I broke the build issue".
-
-2002-02-25 Jason Diamond <jason@injektilo.org>
-
- * XmlDocument.cs, XmlElement.cs, XmlNode.xs, XmlNodeList.cs,
- XmlNodeListAsArrayList.cs: Multiple fixes necessary to get
- simple test to pass. The existing code is really shitty so I'll
- probably start writing tests and refactoring before much else
- can get done.
-
-2002-02-25 Duncan Mak <duncan@ximian.com>
-
- * NameTable.cs: Implemented.
-
- * XmlDeclaration.cs: It should inherit from XmlLinkedNode, not XmlNode.
-
-2002-02-24 Duncan Mak <duncan@ximian.com>
-
- * XmlNodeOrder.cs: Added to CVS.
-
- * XmlQualifiedName.cs: Fixed a warning from Equals ().
-
- * XmlTokenizedType.cs: Added to CVS.
-
- * XmlUrlResolver.cs: Added to CVS with one TODO task.
-
-2002-02-23 Duncan Mak <duncan@ximian.com>
-
- * XmlQualifiedName.cs: Fixed ToString () and added the operators
- (== and !=).
-
-2002-02-23 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReader.cs: Added support for qualified attributes.
-
-2002-02-23 Jason Diamond <jason@injektilo.org>
-
- * XmlNamespaceManager.cs: Initial implementation.
-
- * XmlTextReader.cs: Added support for NamespaceURI property on
- elements.
-
-2002-02-23 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Add the change log to this directory
-
- * XmlQualifiedName.cs: Fixed compile errors so it would build. Still has
- MonoTODO's
-
diff --git a/mcs/class/System.XML/System.Xml/DomEncodingType.cs b/mcs/class/System.XML/System.Xml/DomEncodingType.cs
deleted file mode 100644
index bacfb8d7541..00000000000
--- a/mcs/class/System.XML/System.Xml/DomEncodingType.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.DomEncodingType.cs
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-//
-
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Define encoding types for the DOM
- /// </summary>
- internal enum DomEncodingType
- {
- etUTF8,
- etUTF16BE,
- etUTF16LE,
- etLatin1,
- etLatin2,
- etLatin3,
- etLatin4,
- etCyrillic,
- etArabic,
- etGreek,
- etHebrew,
- etLatin5,
- etLatin6,
- etLatin7,
- etLatin8,
- etLatin9,
- etKOI8R,
- etcp10000_MacRoman,
- etcp1250,
- etcp1251,
- etcp1252,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/Driver.cs b/mcs/class/System.XML/System.Xml/Driver.cs
deleted file mode 100644
index 5d18ad29eec..00000000000
--- a/mcs/class/System.XML/System.Xml/Driver.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// Driver.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Xml;
-
-public class Driver
-{
- public static void Main(string[] args)
- {
- XmlReader xmlReader = null;
-
- if (args.Length < 1)
- {
- xmlReader = new XmlTextReader(Console.In);
- }
- else
- {
- xmlReader = new XmlTextReader(args[0]);
- }
-
- while (xmlReader.Read())
- {
- Console.WriteLine("NodeType = {0}", xmlReader.NodeType);
- Console.WriteLine(" Name = {0}", xmlReader.Name);
- Console.WriteLine(" IsEmptyElement = {0}", xmlReader.IsEmptyElement);
- Console.WriteLine(" HasAttributes = {0}", xmlReader.HasAttributes);
- Console.WriteLine(" AttributeCount = {0}", xmlReader.AttributeCount);
- Console.WriteLine(" HasValue = {0}", xmlReader.HasValue);
- Console.WriteLine(" Value = {0}", xmlReader.Value);
- Console.WriteLine(" Depth = {0}", xmlReader.Depth);
-
- if (xmlReader.HasAttributes)
- {
- while (xmlReader.MoveToNextAttribute())
- {
- Console.WriteLine(" AttributeName = {0}", xmlReader.Name);
- Console.WriteLine(" AttributeValue = {0}", xmlReader.Value);
-
- while (xmlReader.ReadAttributeValue())
- {
- Console.WriteLine(" AttributeValueNodeType = {0}", xmlReader.NodeType);
- Console.WriteLine(" AttributeValueName = {0}", xmlReader.Name);
- Console.WriteLine(" AttributeValueValue = {0}", xmlReader.Value);
- }
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/EntityHandling.cs b/mcs/class/System.XML/System.Xml/EntityHandling.cs
deleted file mode 100755
index c54b016b1e6..00000000000
--- a/mcs/class/System.XML/System.Xml/EntityHandling.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// EntityHandling.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:46:17 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum EntityHandling {
-
- /// <summary>
- /// </summary>
- ExpandEntities = 1,
-
- /// <summary>
- /// </summary>
- ExpandCharEntities = 2,
- } // EntityHandling
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/Formatting.cs b/mcs/class/System.XML/System.Xml/Formatting.cs
deleted file mode 100755
index 2586f58a04d..00000000000
--- a/mcs/class/System.XML/System.Xml/Formatting.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Formatting.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:31:21 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum Formatting {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- Indented = 1,
- } // Formatting
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/IXmlLineInfo.cs b/mcs/class/System.XML/System.Xml/IXmlLineInfo.cs
deleted file mode 100644
index 1c28509d4af..00000000000
--- a/mcs/class/System.XML/System.Xml/IXmlLineInfo.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.IXmlLineInfo.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml
-{
- public interface IXmlLineInfo
- {
- int LineNumber { get; }
- int LinePosition { get; }
-
- bool HasLineInfo();
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/NameTable.cs b/mcs/class/System.XML/System.Xml/NameTable.cs
deleted file mode 100755
index b9a4d09b40a..00000000000
--- a/mcs/class/System.XML/System.Xml/NameTable.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.Xml.NameTable.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- public class NameTable : XmlNameTable
- {
- // Fields
- Hashtable table;
-
- // Constructor
- public NameTable ()
- : base ()
- {
- table = new Hashtable ();
- }
-
- // Method
- public override string Add (string key)
- {
- if (table.Contains (key))
- return (string) table [key];
- else {
- table.Add (key, key);
- return key;
- }
- }
-
- public override string Add (char[] key, int start, int len)
- {
- if (((0 > start) && (start >= key.Length))
- || ((0 > len) && (len >= key.Length - len)))
- throw new IndexOutOfRangeException ("The Index is out of range.");
-
- if (len == 0)
- return String.Empty;
-
- string item = new string (key, start, len);
-
- return Add (item);
- }
-
- public override string Get (string key)
- {
- if (! (table.Contains (key)))
- return null;
- else
- return (string) table [key];
-
- }
-
- public override string Get (char[] array, int offset, int length)
- {
- if (((0 > offset) && (offset >= array.Length))
- || ((0 > length) && (length >= array.Length - offset)))
- throw new IndexOutOfRangeException ("The Index is out of range.");
-
- if (length == 0)
- return String.Empty;
-
- string key = new string (array, offset, length);
-
- //return (string) table [key];
- return Get (key);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/Profile.cs b/mcs/class/System.XML/System.Xml/Profile.cs
deleted file mode 100644
index d16049576d1..00000000000
--- a/mcs/class/System.XML/System.Xml/Profile.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// Profile.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Xml;
-
-using System.IO;
-using System.Text;
-
-public class Profile
-{
- public static void Main(string[] args)
- {
- XmlReader xmlReader = null;
-
- if (args.Length < 1)
- {
- xmlReader = new XmlTextReader(Console.In);
- }
- else
- {
- xmlReader = new XmlTextReader(args[0]);
- }
-
- int nodes = 0;
-
- DateTime start = DateTime.Now;
-
- while (xmlReader.Read())
- {
- ++nodes;
- }
-
- DateTime end = DateTime.Now;
-
- Console.WriteLine("time = {0}", end - start);
-
- Console.WriteLine("nodes = {0}", nodes);
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/ReadState.cs b/mcs/class/System.XML/System.Xml/ReadState.cs
deleted file mode 100644
index 6675af3990f..00000000000
--- a/mcs/class/System.XML/System.Xml/ReadState.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// ReadState.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:31:27 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum ReadState {
-
- /// <summary>
- /// </summary>
- Initial = 0,
-
- /// <summary>
- /// </summary>
- Interactive = 1,
-
- /// <summary>
- /// </summary>
- Error = 2,
-
- /// <summary>
- /// </summary>
- EndOfFile = 3,
-
- /// <summary>
- /// </summary>
- Closed = 4,
- } // ReadState
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/TODOAttribute.cs b/mcs/class/System.XML/System.Xml/TODOAttribute.cs
deleted file mode 100644
index 741cd760c1f..00000000000
--- a/mcs/class/System.XML/System.Xml/TODOAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Xml {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/TreePosition.cs b/mcs/class/System.XML/System.Xml/TreePosition.cs
deleted file mode 100755
index dd6cbf469cd..00000000000
--- a/mcs/class/System.XML/System.Xml/TreePosition.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// TreePosition.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:45:54 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum TreePosition {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- Before = 1,
-
- /// <summary>
- /// </summary>
- After = 2,
-
- /// <summary>
- /// </summary>
- FirstChild = 3,
-
- /// <summary>
- /// </summary>
- LastChild = 4,
-
- /// <summary>
- /// </summary>
- Parent = 5,
-
- /// <summary>
- /// </summary>
- FirstAttribute = 6,
-
- /// <summary>
- /// </summary>
- LastAttribute = 7,
- } // TreePosition
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/Validation.cs b/mcs/class/System.XML/System.Xml/Validation.cs
deleted file mode 100755
index f6a261b7ded..00000000000
--- a/mcs/class/System.XML/System.Xml/Validation.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// Validation.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:46:40 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum Validation {
-
- /// <summary>
- /// </summary>
- Auto = 0,
-
- /// <summary>
- /// </summary>
- None = 1,
-
- /// <summary>
- /// </summary>
- DTD = 2,
-
- /// <summary>
- /// </summary>
- Schema = 3,
- } // Validation
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/WhitespaceHandling.cs b/mcs/class/System.XML/System.Xml/WhitespaceHandling.cs
deleted file mode 100644
index 8e9962b367e..00000000000
--- a/mcs/class/System.XML/System.Xml/WhitespaceHandling.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// WhitespaceHandling.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:31:33 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum WhitespaceHandling {
-
- /// <summary>
- /// </summary>
- All = 0,
-
- /// <summary>
- /// </summary>
- Significant = 1,
-
- /// <summary>
- /// </summary>
- None = 2,
- } // WhitespaceHandling
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/WriteState.cs b/mcs/class/System.XML/System.Xml/WriteState.cs
deleted file mode 100755
index 7d387708782..00000000000
--- a/mcs/class/System.XML/System.Xml/WriteState.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.WriteState
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-
-namespace System.Xml
-{
-
-
- /// <summary>
- /// </summary>
- public enum WriteState {
-
- /// <summary>
- /// A write method has not been called.
- /// </summary>
- Start = 0,
-
- /// <summary>
- /// The prolog is being written.
- /// </summary>
- Prolog = 1,
-
- /// <summary>
- /// An element start tag is being written.
- /// </summary>
- Element = 2,
-
- /// <summary>
- /// An attribute is being written.
- /// </summary>
- Attribute = 3,
-
- /// <summary>
- /// Element content is being written.
- /// </summary>
- Content = 4,
-
- /// <summary>
- /// The close method has been called.
- /// </summary>
- Closed = 5,
-
-
-
-
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XPathNodeType.cs b/mcs/class/System.XML/System.Xml/XPathNodeType.cs
deleted file mode 100755
index d842974ff84..00000000000
--- a/mcs/class/System.XML/System.Xml/XPathNodeType.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// XPathNodeType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:33:53 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum XPathNodeType {
-
- /// <summary>
- /// </summary>
- String = 0,
-
- /// <summary>
- /// </summary>
- Boolean = 1,
-
- /// <summary>
- /// </summary>
- Number = 2,
-
- /// <summary>
- /// </summary>
- NodeSet = 3,
- } // XPathNodeType
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/XmlAttribute.cs b/mcs/class/System.XML/System.Xml/XmlAttribute.cs
deleted file mode 100644
index c51022c0796..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlAttribute.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlAttribute
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weberusing System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Summary description for XmlAttribute.
- /// </summary>
- public class XmlAttribute : XmlNode
- {
- // ============ private data structures ==============================
- private XmlNode FOwnerElement;
-
- string FattrName;
- string FattrValue;
-
- //==== Public Properties ====================================================
-
- /// <summary>
- /// Returns the local name of the attribute. For attributes, this is the same as Name
- /// </summary>
- public override string LocalName
- {
- get
- {
- return Name;
- }
- }
-
- /// <summary>
- /// Get the qualified attribute name. Attributes do not have an associated namespace.
- /// </summary>
- public override string Name
- {
- get
- {
- return Name;
- }
- }
-
- /// <summary>
- /// Override. Returns the node type.
- /// </summary>
- public override XmlNodeType NodeType
- {
- get
- {
- return XmlNodeType.Attribute;
- }
- }
-
- /// <summary>
- /// Retrieve the XmlElement owner of this attribute, or null if attribute not assigned
- /// </summary>
- public virtual XmlElement OwnerElement
- {
- get
- {
- if (FOwnerElement.NodeType == XmlNodeType.Element)
- return FOwnerElement as XmlElement;
- else
- return null;
- }
- }
-
- /// <summary>
- /// Get/Set the value for this node
- /// </summary>
- public override string Value
- {
- get
- {
- return FattrValue;
- }
-
- set
- {
- FattrValue = value;
- }
- }
-
- //============== Public Methods =============================================
-
- /// <summary>
- /// Return a clone of the node
- /// </summary>
- /// <param name="deep">Make copy of all children</param>
- /// <returns>Cloned node</returns>
- public override XmlNode CloneNode( bool deep)
- {
- // TODO - implement XmlAttribute.CloneNode()
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Saves all children of the current node to the passed writer
- /// </summary>
- /// <param name="w"></param>
- public override void WriteContentTo(XmlWriter w)
- {
- // TODO - implement XmlAttribute.WriteContentsTo(XmlWriter)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Saves the current node to writer w
- /// </summary>
- /// <param name="w"></param>
- public override void WriteTo(XmlWriter w)
- {
- // TODO - implement XmlAttribute.WriteTo(XmlWriter)
- throw new NotImplementedException();
- }
-
- // ============ Internal methods ====================================
- internal void setOwnerElement( XmlElement newOwnerElement)
- {
- FOwnerElement = newOwnerElement;
- }
-
- // ============ Constructors =========================================
- internal XmlAttribute ( XmlDocument aOwner, // owner document
- string attributeName, // cannot be ""
- string attValue) : base(aOwner)
- {
- if (aOwner == null)
- throw new ArgumentException("Null OwnerDocument passed to XmlAttribute constructor");
- if (attributeName.Length == 0)
- throw new ArgumentException("Empty string passed to XmlAttribute constructor");
-
- FOwnerElement = null;
- FattrName = attributeName;
- FattrValue = attValue;
- }
-
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs b/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs
deleted file mode 100644
index 2b206cf6695..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs
+++ /dev/null
@@ -1,506 +0,0 @@
-// System.Xml.XmlAttributeCollection.cs
-//
-// Author: Daniel Weber (daniel-weber@austin.rr.com)
-//
-// Implementation of abstract Xml.XmlAttributeCollection class
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- /// <summary>
- /// A collection of Attributes that can be accessed by index or name(space)
- /// Derived from XmlNamedNodeMap
- /// <seealso cref="XmlNamedNodeMap"/>
- /// </summary>
- public class XmlAttributeCollection : XmlNamedNodeMap, ICollection
- {
-
- // ===== ICollection interface elements ===================================
- /// <summary>
- /// Private class to provide Synchronzed Access to the attribute list.
- /// </summary>
- private class SyncAttributes : XmlAttributeCollection
- {
- private XmlAttributeCollection _attributes;
-
- public SyncAttributes ( XmlAttributeCollection attributes )
- {
- _attributes = attributes;
- }
-
- public override bool IsSynchronized
- {
- get {return true; }
- }
-
- // Override all properties/methods that modify/read items
- // and lock them so they are thread-safe
- public override void CopyTo(Array array, int index)
- {
- lock (_attributes )
- { _attributes.CopyTo(array, index); }
- }
-
- public override XmlAttribute this[string name]
- {
- get {
- lock (_attributes ) { return _attributes[name]; }
- }
- }
-
- public override XmlAttribute this[int i]
- {
- get {
- lock (_attributes) { return _attributes[i]; }
- }
- }
-
- public override XmlAttribute Append( XmlAttribute node )
- {
- lock (_attributes)
- { return _attributes.Append( node ); }
- }
-
- public override void CopyTo(XmlAttribute[] array, int index)
- {
- lock (_attributes)
- { _attributes.CopyTo(array, index); }
- }
-
- public override XmlAttribute InsertAfter(
- XmlAttribute newNode,
- XmlAttribute refNode)
- {
- lock (_attributes)
- { return _attributes.InsertAfter( newNode, refNode ); }
- }
-
- public override XmlAttribute Prepend(XmlAttribute node)
- {
- lock (_attributes)
- { return _attributes.Prepend(node); }
- }
-
- public override XmlAttribute Remove(XmlAttribute node)
- {
- lock (_attributes)
- { return _attributes.Remove( node ); }
- }
-
- public override void RemoveAll()
- {
- lock (_attributes)
- { _attributes.RemoveAll(); }
- }
-
- public override XmlAttribute RemoveAt(int i)
- {
- lock (_attributes)
- { return _attributes.RemoveAt(i); }
- }
-
- public override XmlNode SetNamedItem(XmlNode node)
- {
- lock (_attributes)
- { return _attributes.SetNamedItem(node); }
- }
-
- // Even ToString, since someone could come along and blow away an
- // attribute while we're iterating...
- public override string ToString()
- {
- lock (_attributes)
- { return _attributes.ToString(); }
- }
-
- } // SynchAttributes
-
- /// <summary>
- /// Return true if access is synchronized (thread-safe)
- /// </summary>
- public virtual bool IsSynchronized
- {
- // This version of the class is not synchronized
- get
- {
- return false;
- }
- }
-
- /// <summary>
- /// Return object used for synchronous access to class
- /// </summary>
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- /// <summary>
- /// Returns a thread-safe version of the attribute collection.
- /// </summary>
- /// <param name="attributes">Attribute collection to make thread-safe.</param>
- /// <returns>Thread-safe XmlAttributeCollection.</returns>
- public static XmlAttributeCollection Synchronized(XmlAttributeCollection attributes)
- {
- if (attributes == null)
- {
- throw new ArgumentNullException("Null XmlAttributeCollection passed to Synchronized()");
- }
-
- return new SyncAttributes(attributes);
- }
-
- /// <summary>
- /// Copy the XmlAttributeCollection into the passed array. Index is zero-based.
- /// </summary>
- /// <param name="array">Array to copy into</param>
- /// <param name="index">Index to start copying from</param>
- public virtual void CopyTo(Array array, int index)
- {
- // Let the Array handle all the errors, there's no risk to us
-
- // TODO - should we set OwnerElement to null in clone() in CopyTo(Array, int)? (yes, using setOwnerElement())
- int arrayIndex = 0;
- for (int i = index; i < FnodeList.Count; i++)
- {
- XmlAttribute e = FnodeList[i] as XmlAttribute;
- XmlAttribute theClone = e.Clone() as XmlAttribute;
- theClone.setOwnerElement(null);
- array.SetValue(theClone, arrayIndex);
- arrayIndex++;
- }
- }
- // XmlAttributeCollection Properties =================================
- /// <summary>
- /// Get the attribute with the specified name
- /// </summary>
- [System.Runtime.CompilerServices.IndexerName("ItemOf")]
- public virtual XmlAttribute this[string name]
- {
- get
- {
- return GetNamedItem(name) as XmlAttribute;
- }
- }
-
- /// <summary>
- /// Get the attribute at the specified index. The Collection is zero-based.
- /// </summary>
- [System.Runtime.CompilerServices.IndexerName("ItemOf")]
- public virtual XmlAttribute this[int i]
- {
- get
- {
- return base.Item(i) as XmlAttribute;
- }
- }
-
- /// <summary>
- /// Get the attribute with the specifed (localName, URI)
- /// </summary>
- [System.Runtime.CompilerServices.IndexerName("ItemOf")]
- public virtual XmlAttribute this[string localName, string namespaceURI]
- {
- get
- {
- return GetNamedItem(localName, namespaceURI) as XmlAttribute;
- }
- }
-
- // ============= Public methods =====================================
- /// <summary>
- /// Appends the specified node to the attribute list
- /// If the node is already in the list, it is moved to the end.
- /// If a node is in the list with the same name, the node is removed and the new node is added.
- /// </summary>
- /// <param name="node">Attribute node to append to the collection</param>
- /// <exception cref="ArgumentException">Node was created from a differant document or node is null</exception>
- /// <returns></returns>
- public virtual XmlAttribute Append( XmlAttribute node )
- {
- // TODO - node validation? (no)
-
- XmlAttribute retval = null;
-
- System.Diagnostics.Debug.Assert(node != null, "Null node passed to Append()");
-
- if (! FOwner.OwnerDocument.Equals(node.OwnerDocument))
- throw new ArgumentException("Cannot append node from another document");
-
- if (node.OwnerElement != null)
- throw new ArgumentException("Cannot append node from another document");
-
- foreach (XmlAttribute cur in FnodeList)
- {
- // If node is already in the collection, it is moved to the last position.
- if (cur.Equals(node))
- {
- retval = cur;
- FnodeList.Remove(cur);
- }
-
- //If an attribute with the same name is already present in the collection,
- // the original attribute is removed from the collection and
- // node is added to the end of the collection.
- if (cur.Name == node.Name)
- FnodeList.Remove(cur);
- }
-
- // add the new node to the end of the collection
- // set attribute owner element? (yes)
- node.setOwnerElement(FOwnerNode as XmlElement);
- FnodeList.Add(node);
-
- // return the removed item
- return retval;
- }
-
- /// <summary>
- /// Copies all attributes in collection into the array, starting at index.
- /// attribute index is zero-based.
- /// </summary>
- /// <exception cref="OverflowException">Thrown if insufficient room to copy all elements</exception>
- /// <param name="array">Array to copy XlmAttributes into</param>
- /// <param name="index">index to start copy</param>
- public virtual void CopyTo(XmlAttribute[] array, int index)
- {
- // Let the array handle all the errors, there's no risk to us
-
- // TODO - should we set OwnerElement to null in clone() in CopyTo(XmlAttribute[], int)? (yes, using setOwnerElement())
- int arrayIndex = 0;
- for (int i = index; i < FnodeList.Count; i++)
- {
- XmlAttribute e = FnodeList[i] as XmlAttribute;
- XmlAttribute theClone = e.Clone() as XmlAttribute;
- theClone.setOwnerElement(null);
- array[arrayIndex] = theClone;
- arrayIndex++;
- }
- }
-
- /// <summary>
- /// Helper function since InsertBefore/After use exact same algorithm
- /// </summary>
- /// <param name="refNode"></param>
- /// <param name="newNode"></param>
- /// <param name="offset">offset to add to Insert (0 or 1)</param>
- /// <returns>Deleted attribute</returns>
- private XmlAttribute InsertHelper(XmlAttribute newNode, XmlAttribute refNode, int offset)
- {
- // TODO - validation? (no)
- // TODO - null refNode is valid (== prepend)
- if (refNode == null)
- throw new ArgumentNullException("Null refNode passed to InsertAfter()");
- if (newNode == null)
- throw new ArgumentNullException("Null newNode passed to InsertAfter()");
-
- if (! newNode.OwnerDocument.Equals(FOwner.OwnerDocument) )
- throw new ArgumentException("Node to insert does not have same owner document as reference");
-
- // Logically, it makes no sense to insert node "A" after node "A",
- // since only one node "A" can be in the list - flag it as an error
- if (newNode.Name == refNode.Name)
- throw new ArgumentException("Node to insert has same name as reference node");
-
- // Other bizarre case is if refNode.Equals(newNode)
- // We'll flag this error after we check that refNode is in the list
-
- int refNodeIndex = -1;
- // Note that if newNode is in the list, then we'll get a name match
- int SameNameIndex = -1;
-
- for (int i = 0; i < FnodeList.Count; i++)
- {
- XmlAttribute curListNode = Item(i) as XmlAttribute;
- if (curListNode.Name == refNode.Name)
- refNodeIndex = i;
-
- if (curListNode.Name == newNode.Name)
- SameNameIndex = i;
- }
-
- if ( refNodeIndex == -1 )
- throw new ArgumentException("Attribute [" + refNode.Name + "] is not in Collection for InsertAfter()");
-
- // Check the obvious, InsertAfter( attr1, attr1);
- if (refNode.Equals( newNode ) )
- return newNode;
-
- XmlAttribute retval = null;
-
- if (SameNameIndex != -1)
- {
- // If this is newNode in the list, we'll insert it back in the right spot
- // If this is another node, just remove it
- retval = FnodeList[SameNameIndex] as XmlAttribute;
- FnodeList.RemoveAt(SameNameIndex);
- if ( SameNameIndex < refNodeIndex )
- refNodeIndex--;
- }
-
- FnodeList.Insert(refNodeIndex + offset, newNode);
-
- // TODO - set OwnerElement? (no)
- //node.setOwnerElement(FOwnerNode as XmlElement);
-
- // TODO - determine which node to return (deleted node)
- return retval;
- }
-
- /// <summary>
- /// Insert the specifed attribute immediately after the reference node.
- /// If an attribute with the same name is already in the collection, that attribute is removed and the new attribute inserted
- /// </summary>
- /// <exception cref="ArgumentException">Raised if newNode OwnerDocument differs from nodelist owner or refNode is not a member of the collection</exception>
- /// <param name="newNode">New attribute to insert</param>
- /// <param name="refNode">Reference node to insert new node after</param>
- /// <returns>Inserted node</returns>
- public virtual XmlAttribute InsertAfter( XmlAttribute newNode, XmlAttribute refNode)
- {
- return InsertHelper(newNode, refNode, 1);
- }
-
- /// <summary>
- /// Inserts newNode into the collection just before refNode.
- /// If a node with newNode.Name is already in the list, it is removed.
- /// </summary>
- /// <exception cref="ArgumentException">Thrown if inserted attribute created from different document, refNode not found in collection or
- /// refNode.Name == newNode.Name.</exception>
- /// <param name="newNode">Node to insert into list</param>
- /// <param name="refNode">Node to insert before</param>
- /// <returns>Deleted node, or null if no node was deleted.</returns>
- public virtual XmlAttribute InsertBefore(
- XmlAttribute newNode,
- XmlAttribute refNode
- )
- {
- return InsertHelper(newNode, refNode, 0);
- }
-
- /// <summary>
- /// Inserts the specified node as the first node in the collection
- /// </summary>
- /// <param name="node">XmlAttribute to insert</param>
- /// <exception cref="ArgumentException">If node is null, or owner document does not match collection.</exception>
- /// <returns>Node that was removed, or null if no node deleted.</returns>
- public virtual XmlAttribute Prepend(XmlAttribute node)
- {
- //TODO - node validation? (no)
- // TODO - set attribute owner element? (no)
- //node.setOwnerElement(FOwnerNode as XmlElement);
-
- if (FnodeList.Count > 0)
- {
- return InsertBefore(node, Item(0) as XmlAttribute);
- }
-
- if (node == null)
- throw new ArgumentException("Cannot prepend null node");
-
- if (! node.OwnerDocument.Equals(FOwner.OwnerDocument) )
- throw new ArgumentException("Node to prepend does not have same owner document as reference");
-
- FnodeList.Add(node);
- return node;
- }
-
- /// <summary>
- /// Removes the requested node from the collection.
- /// </summary>
- /// <param name="node">Node to remove</param>
- /// <returns>The node removed, or null if the node was not found in the collection.</returns>
- public virtual XmlAttribute Remove(XmlAttribute node)
- {
- for (int i = 0; i < FnodeList.Count; i++)
- {
- XmlAttribute e = FnodeList[i] as XmlAttribute;
-
- if (e.Equals(node))
- {
- FnodeList.RemoveAt(i);
- return node;
- }
- }
- // TODO - if node is a default, should we add it back with a default value? (no)
- return null;
- }
-
- /// <summary>
- /// Removes all attributes from the collection
- /// </summary>
- public virtual void RemoveAll()
- {
- // Can this be this easy?
- for (int i = FnodeList.Count - 1; i > 0; i--)
- {
- XmlAttribute e = FnodeList[i] as XmlAttribute;
- e.setOwnerElement(null);
- FnodeList.RemoveAt(i);
- }
-
- // TODO - Add default attributes back in in RemoveAll()? (no)
- }
-
- /// <summary>
- /// Removes the attribute at the specified index
- /// </summary>
- /// <param name="i">index of attribute to remove.</param>
- /// <returns>Removed node, or null if node not in collection</returns>
- public virtual XmlAttribute RemoveAt(int i)
- {
- if ((i < 0) | ( i >= FnodeList.Count))
- return null;
-
- // TODO - if default attribute removed in RemoveAt(), add it back? (no)
- XmlAttribute e = FnodeList[i] as XmlAttribute;
- FnodeList.RemoveAt(i);
- e.setOwnerElement(null);
- return e;
- }
-
- /// <summary>
- /// Adds a node to the collection using it's name. If a node with the same name exists,
- /// it is removed.
- /// </summary>
- /// <param name="node">XmlAttribute to add.</param>
- /// <returns>If a node replaces a named node, the replaced node is deleted and returned.
- /// Otherwise, null.</returns>
- public override XmlNode SetNamedItem(XmlNode node)
- {
- return base.SetNamedItem(node);
- }
-
- public override string ToString()
- {
- string retval = "System.Xml.XmlAttributeCollection ";
- if (FOwnerNode != null)
- retval += "OwnerElement: " + FOwnerNode.Name;
-
- foreach (XmlAttribute o in FnodeList)
- {
- retval += o.Name + "=" + o.Value;
- }
- return retval;
-
- }
- // ============= Constructors ========================================
- // TODO - change constructor to pass in IEnumerator?
- internal XmlAttributeCollection(XmlNode aOwner, XmlNode aOwnerNode, ArrayList nodeList) :
- base(aOwner, aOwnerNode, nodeList)
- {
- // Makes no sense to have namespace aware on attributes
- NamespaceAware = false;
- }
-
- internal XmlAttributeCollection ()
- {
- }
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml/XmlCDataSection.cs b/mcs/class/System.XML/System.Xml/XmlCDataSection.cs
deleted file mode 100644
index fab22e8bbfb..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlCDataSection.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Xml.XmlCDataSection.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public class XmlCDataSection : XmlCharacterData
- {
- // Constructor
- protected internal XmlCDataSection (string data, XmlDocument doc)
- : base (doc)
- {
- }
-
- // Properties
- public override string LocalName
- {
- get { return "#cdata-section"; }
- }
-
- public override string Name
- {
- get { return "#cdata-section"; }
- }
-
- public override XmlNodeType NodeType
- {
- get { return XmlNodeType.CDATA; }
- }
-
- // Methods
- public override XmlNode CloneNode (bool deep)
- {
- return null;
- }
-
- public override void WriteContentTo (XmlWriter w)
- {
- // CDATA nodes have no children, WriteContentTo has no effect.
- }
-
- public override void WriteTo (XmlWriter w)
- {
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlCaseOrder.cs b/mcs/class/System.XML/System.Xml/XmlCaseOrder.cs
deleted file mode 100755
index 90c34ef4d3c..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlCaseOrder.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// XmlCaseOrder.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:47:03 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum XmlCaseOrder {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- UpperFirst = 1,
-
- /// <summary>
- /// </summary>
- LowerFirst = 2,
- } // XmlCaseOrder
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/XmlChar.cs b/mcs/class/System.XML/System.Xml/XmlChar.cs
deleted file mode 100644
index 2ea00dd8572..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlChar.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlChar.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml
-{
- internal class XmlChar
- {
- internal static bool IsWhitespace(int ch)
- {
- return ch == 0x20 || ch == 0x9 || ch == 0xD || ch == 0xA;
- }
-
- internal static bool IsFirstNameChar(int ch)
- {
- bool result = false;
-
- if (ch >= 0 && ch <= 0xFFFF)
- {
- result = (nameBitmap[(firstNamePages[ch >> 8] << 3) + ((ch & 0xFF) >> 5)] & (1 << (ch & 0x1F))) != 0;
- }
-
- return result;
- }
-
- internal static bool IsNameChar(int ch)
- {
- bool result = false;
-
- if (ch >= 0 && ch <= 0xFFFF)
- {
- result = (nameBitmap[(namePages[ch >> 8] << 3) + ((ch & 0xFF) >> 5)] & (1 << (ch & 0x1F))) != 0;
- }
-
- return result;
- }
-
- private static byte[] firstNamePages =
- {
- 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00,
- 0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
- 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- private static byte[] namePages =
- {
- 0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00,
- 0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
- 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
- 0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- private static uint[] nameBitmap =
- {
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE,
- 0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
- 0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF,
- 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
- 0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
- 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
- 0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
- 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
- 0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF,
- 0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000,
- 0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
- 0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003,
- 0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003,
- 0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
- 0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001,
- 0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003,
- 0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
- 0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003,
- 0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003,
- 0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000,
- 0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
- 0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF,
- 0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB,
- 0x40000000, 0xF580C900, 0x00000007, 0x02010800,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF,
- 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
- 0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
- 0x00000000, 0x00004C40, 0x00000000, 0x00000000,
- 0x00000007, 0x00000000, 0x00000000, 0x00000000,
- 0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF,
- 0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF,
- 0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
- 0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
- 0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF,
- 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
- 0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003,
- 0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
- 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
- 0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
- 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
- 0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
- 0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF,
- 0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF,
- 0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
- 0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF,
- 0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0,
- 0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
- 0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3,
- 0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80,
- 0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
- 0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3,
- 0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000,
- 0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000,
- 0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
- 0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
- 0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF,
- 0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF
- };
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlCharacterData.cs b/mcs/class/System.XML/System.Xml/XmlCharacterData.cs
deleted file mode 100644
index 41ba1de77c7..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlCharacterData.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-// System.Xml.XmlCharacterData.cs
-//
-// Author: Daniel Weber (daniel-weber@austin.rr.com)
-//
-// Implementation of abstract Xml.XmlCharacterData class
-//
-// Provides text manipulation methods used by derived classes
-// abstract class
-
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Abstratc class to provide text manipulation methods for derived classes
- /// </summary>
- public abstract class XmlCharacterData : XmlLinkedNode
- {
- // ============ Public Properties =====================================
- //=====================================================================
- /// <summary>
- /// Contains the nodes data
- /// </summary>
- public virtual string Data
- {
- get
- {
- // TODO - implement Data {get;}
- throw new NotImplementedException();
- }
-
- set
- {
- // TODO - implement Data {set;}
- throw new NotImplementedException();
- }
- }
-
- /// <summary>
- /// Get/Set the nodes value
- /// </summary>
- public override string Value
- {
- get
- {
- // TODO - implement Value {get;}
- throw new NotImplementedException();
- }
-
- set
- {
- // TODO - implement Value {set;}
- throw new NotImplementedException();
- }
- }
-
- public override string InnerText
- {
- get
- {
- // TODO - implement InnerText {get;}
- throw new NotImplementedException();
- }
-
- set
- {
- // TODO - implement InnerText {set;}
- throw new NotImplementedException();
- }
- }
-
- /// <summary>
- /// Returns the length of data, in characters
- /// </summary>
- public virtual int Length
- {
- get
- {
- // TODO - implement Length {get;}
- throw new NotImplementedException();
- }
- }
-
- // ============ Public Methods =======================================
- //=====================================================================
- /// <summary>
- /// Appends string strData to the end of data
- /// </summary>
- /// <param name="strData"></param>
- public virtual void AppendData(string strData)
- {
- // TODO - implement AppendData(strData)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Remove a range of characters from the node
- /// </summary>
- /// <param name="offset">offset, in characters, to start delete</param>
- /// <param name="count">Number of characters to delete</param>
- public virtual void DeleteData(int offset, int count)
- {
- // TODO - implement DeleteData(offset, count)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Replaces the number of characters, starting at offset, with the passed string
- /// </summary>
- /// <param name="offset">Offset (in characters) to start replacement</param>
- /// <param name="count">Number of characters to replace</param>
- /// <param name="strData">Replacement string</param>
- public virtual void ReplaceData(int offset, int count, string strData)
- {
- // TODO - implement ReplaceData(offset, count, strData)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Retrieves a substring of the specified range
- /// </summary>
- /// <param name="offset">Character offset to begin string</param>
- /// <param name="count">Number of characters to return</param>
- /// <returns></returns>
- public virtual string Substring(int offset, int count)
- {
- // TODO - implement Substring(offset, count)
- throw new NotImplementedException();
- }
-
- // ============ Protected Methods ====================================
- //=====================================================================
- /// <summary>
- /// Listed in beta 2, but no description
- /// [to be supplied]
- /// </summary>
- /// <param name="node"></param>
- /// <param name="xnt"></param>
- /// <returns></returns>
- protected internal bool DecideXPNodeTypeForWhitespace(
- XmlNode node,
- ref XPathNodeType xnt
- )
- {
- // TODO
- throw new NotImplementedException();
- }
-
- // Constructors
- internal XmlCharacterData ( XmlDocument aOwnerDoc) : base(aOwnerDoc)
- {
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml/XmlComment.cs b/mcs/class/System.XML/System.Xml/XmlComment.cs
deleted file mode 100644
index f6d65065422..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlComment.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- ///
- /// </summary>
- ///
-
- /*
- * Section 2.5 of the XML spec says...
- [Definition: Comments may appear anywhere in a document outside other markup; in addition, they may appear within the document type declaration at places allowed by the grammar. They are not part of the document's character data; an XML processor may, but need not, make it possible for an application to retrieve the text of comments. For compatibility, the string "--" (double-hyphen) must not occur within comments.] Parameter entity references are not recognized within comments.
-
- Note that the grammar does not allow a comment ending in --->.
- Comment ::=   '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
- */
- public class XmlComment : XmlCharacterData
- {
- // Private data members
-
- // public properties
- public override string InnerText
- {
- get
- {
- // TODO - implement XmlComment.InnerText.get
- throw new NotImplementedException();
- }
-
- set
- {
- // TODO - implement XmlComment.InnerText.set
- throw new NotImplementedException();
- }
- }
-
- public override string LocalName
- {
- get
- {
- return "#comment";
- }
- }
-
- public override string Name
- {
- get
- {
- return "#comment";
- }
- }
-
- public override string Value
- {
- get
- {
- return Fvalue;
- }
-
- set
- {
- // TODO - Do our well-formedness checks on Value.set? (no)
- Fvalue = value;
- }
- }
-
-
- // Public Methods
- public override XmlNode CloneNode(bool deep)
- {
- // TODO - implement XmlComment.CloneNode(bool)
- throw new NotImplementedException();
- }
-
- public override void WriteContentTo(XmlWriter w)
- {
- // TODO - implement XmlComment.WriteContentTo(XmlWriter)
- throw new NotImplementedException();
- }
-
- public override void WriteTo(XmlWriter w)
- {
- // TODO - implement XmlComment.WriteTo(XmlWriter)
- throw new NotImplementedException();
- }
-
-
- // Internal methods
- /// <summary>
- /// Returns an exception object if passed text is not well-formed.
- /// Text is passed without introductory syntax elements.
- /// For comments, the leading "<!--" and trailing "-->" should be stripped.
- /// </summary>
- /// <param name="data"></param>
- /// <returns></returns>
- private XmlException wellFormed(string data, XmlInputSource src)
- {
- if (data.IndexOf("--") != -1)
- return new XmlException("Invalid characters (\"--\") in comment", src);
- if (data[0] == '-')
- return new XmlException("Invalid comment beginning (<!---)", src);
- if (data[data.Length - 1] == '-')
- return new XmlException("Invalid comment ending (--->)", src);
- return null;
-
- }
- // Constructors
- internal XmlComment(XmlDocument aOwner, string txt, XmlInputSource src) : base(aOwner)
- {
- XmlException e = wellFormed(txt, src);
-
- if ( e == null )
- {
- Fvalue = txt;
- }
- else
- throw e;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlDataType.cs b/mcs/class/System.XML/System.Xml/XmlDataType.cs
deleted file mode 100755
index b97d3f7873d..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDataType.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// XmlDataType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:47:13 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum XmlDataType {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- Text = 1,
-
- /// <summary>
- /// </summary>
- Number = 2,
-
- /// <summary>
- /// </summary>
- QName = 3,
- } // XmlDataType
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/XmlDeclaration.cs b/mcs/class/System.XML/System.Xml/XmlDeclaration.cs
deleted file mode 100644
index 0965622326a..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDeclaration.cs
+++ /dev/null
@@ -1,174 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlDeclaration
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- ///
- /// </summary>
- public class XmlDeclaration : XmlLinkedNode
- {
- // Private data members
- private string Fencoding = "UTF-8";
- bool Fstandalone;
-
- // public properties
- /// <summary>
- /// Get/Set the encoding used for the document
- /// Typical values are "UTF-8", "UTF-16", "ISO-8859-nn" (where n is 0-9).
- /// If not defined, "UTF-8" is assumed.
- /// encoding is not case sensitive.
- /// </summary>
- public string Encoding
- {
- get
- {
- return Fencoding;
- }
-
- set
- {
- string val = value.ToUpper();
-
- if ( (val == "UTF-8") | ( val == "UTF-16") )
- {
- Fencoding = value;
- return;
- }
- else
- {
- if ( ( val.StartsWith( "ISO-8859-" ) ) & (val.Length == 10) )
- {
- try
- {
- int code = System.Convert.ToInt32( val.Substring(9,1) );
- Fencoding = value;
- }
- catch
- {
- throw new NotImplementedException("Encoding " + value + " is not supported");
- }
-
- }
-
-
- }
- }
- }
-
- /// <summary>
- /// Get the local name of the declaration. Returns "xml"
- /// </summary>
- public override string LocalName
- {
- get
- {
- return "xml";
- }
- }
-
- /// <summary>
- /// Get the name of the node. For XmlDeclaration, returns "xml".
- /// </summary>
- public override string Name
- {
- get
- {
- return "xml";
- }
- }
-
- /// <summary>
- /// Return the node type. For XmlDeclaration, returns XmlNodeType.XmlDeclaration.
- /// </summary>
- public override XmlNodeType NodeType
- {
- get
- {
- return XmlNodeType.XmlDeclaration;
- }
- }
-
- /// <summary>
- /// Get/Set the value of the standalone attribute.
- /// "yes" => no external DTD required.
- /// "no" => external data sources required.
- /// Silently fails if Set to invalid value.
- /// Not case sensitive.
- /// </summary>
- public string Standalone {
- get
- {
- if (Fstandalone)
- return "yes";
- else
- return "no";
- }
-
- set
- {
- if (value.ToUpper() == "YES")
- Fstandalone = true;
- if (value.ToUpper() == "NO")
- Fstandalone = false;
- }
- }
-
- /// <summary>
- /// Get the xml version of the file. Returns "1.0"
- /// </summary>
- public string Version
- {
- get
- {
- return "1.0";
- }
- }
-
- // Public Methods
- /// <summary>
- /// Overriden. Returns a cloned version of this node.
- /// Serves as a copy constructor. Duplicate node has no parent.
- /// </summary>
- /// <param name="deep">Create deep copy. N/A for XmlDeclaration.</param>
- /// <returns>Cloned node.</returns>
- public override XmlNode CloneNode(bool deep)
- {
- // TODO - implement XmlDeclration.CloneNode()
- throw new NotImplementedException("XmlDeclration.CloneNode() not implemented");
- }
-
- /// <summary>
- /// Save the children of this node to the passed XmlWriter. Since an XmlDeclaration has
- /// no children, this call has no effect.
- /// </summary>
- /// <param name="w"></param>
- public override void WriteContentTo(XmlWriter w)
- {
- // Nothing to do - no children.
- }
-
- /// <summary>
- /// Saves the node to the specified XmlWriter
- /// </summary>
- /// <param name="w">XmlWriter to writ to.</param>
- public override void WriteTo(XmlWriter w)
- {
- // TODO - implement XmlDeclration.WriteTo()
- throw new NotImplementedException("XmlDeclaration.WriteTo() not implemented");
- }
-
- // Constructors
- internal XmlDeclaration( XmlDocument aOwnerDoc) : base(aOwnerDoc)
- {
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlDocument.cs b/mcs/class/System.XML/System.Xml/XmlDocument.cs
deleted file mode 100644
index e73e0794020..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDocument.cs
+++ /dev/null
@@ -1,511 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlDocument
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-
-using System;
-using System.IO;
-
-namespace System.Xml
-{
-
- public delegate void XmlNodeChangedEventHandler (XmlNodeChangedEventArgs args);
-
- /// <summary>
- /// Abstract class XmlNodeList.
- /// </summary>
- public class XmlDocument : XmlNode
- {
- // Private data members
- XmlResolver _resolver = null;
-
- // Public events
- //===========================================================================
- public event XmlNodeChangedEventHandler NodeChanged;
-
- public event XmlNodeChangedEventHandler NodeChanging;
-
- public event XmlNodeChangedEventHandler NodeInserted;
-
- public event XmlNodeChangedEventHandler NodeInserting;
-
- public event XmlNodeChangedEventHandler NodeRemoved;
-
- public event XmlNodeChangedEventHandler NodeRemoving;
-
- // public properties
-
- /// <summary>
- /// Get the base URI for this document (the location from where the document was loaded)
- /// </summary>
- /// <example>If a document was loaded with doc.Load("c:\tmp\mydoc.xml"),
- /// then BaseURI would hold "c:\tmp\mydoc.xml"</example>
- public override string BaseURI
- {
- get
- {
- // TODO - implement XmlDocument.BaseURI {get;}
- throw new NotImplementedException("BaseURI.get not implemented");
- }
- }
-
- /// <summary>
- /// Get the root element for the document. If no root exists, null is returned.
- /// </summary>
- public XmlElement DocumentElement
- {
- get
- {
- XmlNode node = FirstChild;
-
- while (node != null) {
- if (node is XmlElement)
- break;
- node = node.NextSibling;
- }
-
- return node != null ? node as XmlElement : null;
- }
- }
-
- /// <summary>
- /// Gets the node containing the DOCTYPE declaration.
- /// </summary>
- public virtual XmlDocumentType DocumentType
- {
- get
- {
- // TODO - implement XmlDocument.DocumentType
- throw new NotImplementedException("XmlDocument.DocumentType not implemented");
- }
- }
-
-
- /// <summary>
- /// Get the XmlImplemenation for the current document.
- /// </summary>
- public XmlImplementation Implementation
- {
- get
- {
- // TODO - implement XmlDocument.Implementation
- throw new NotImplementedException("Implementation not implemented");
- }
- }
-
-
- /// <summary>
- /// Get/Set the markup representing the children of the document.
- /// </summary>
- public override string InnerXml
- {
- get
- {
- // TODO - implement XmlDocument.InnerXml {get;}
- throw new NotImplementedException("InnerXml get not implemented");
- }
- set
- {
- // TODO - implement XmlDocument.InnerXml {set;}
- throw new NotImplementedException("InnerXml set not implemented");
- }
- }
-
- /// <summary>
- /// Get a value indicating if the document is read-only.
- /// </summary>
- public override bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- /// <summary>
- /// Get the local name of the node. For documents, returns "#document"
- /// </summary>
- public override string LocalName {
- get
- {
- return "#document";
- }
- }
-
- /// <summary>
- /// Get the qualified name of the node. For documents, returns "#document"
- /// </summary>
- public override string Name
- {
- get
- {
- return "#document";
- }
- }
-
- public XmlNameTable NameTable
- {
- get
- {
- // TODO - implement XmlDocument.NameTable {get;}
- throw new NotImplementedException("NameTable get not implemented");
- }
- }
-
-
- public override XmlNodeType NodeType
- {
- get
- {
- return XmlNodeType.Document;
- }
- }
-
- /// <summary>
- /// Returns OwnerDocument. For an XmlDocument, this property is always null.
- /// </summary>
- public override XmlDocument OwnerDocument
- {
- get
- {
- return null;
- }
- }
-
- public bool PreserveWhitespace
- {
- get
- {
- // TODO - implement XmlDocument.PreserveWhitespace {get;}
- throw new NotImplementedException("PreserveWhitespace get not implemented");
- }
- set
- {
- // TODO - implement XmlDocument.PreserveWhitespace {set;}
- throw new NotImplementedException("PreserveWhitespace set not implemented");
- }
- }
-
- public XmlResolver XmlResolver
- {
- set
- {
- // TODO - Finish/test XmlDocument.XmlResolver {set;}
- _resolver = value;
- }
- }
-
- // Public Methods
- //===========================================================================
- public override XmlNode CloneNode(bool deep)
- {
- // TODO - implement XmlDocument.CloneNode(bool)
- throw new NotImplementedException("CloneNode(bool) not implemented");
- }
-
- public XmlAttribute CreateAttribute(string name)
- {
- // TODO - implement XmlDocument.CreateAttribute(string name)
- throw new NotImplementedException("CreateAttribute(string name) not implemented");
- }
-
- public XmlAttribute CreateAttribute(string qualifiedName,string namespaceURI)
- {
- // TODO - implement XmlDocument.CreateAttribute(string, string)
- throw new NotImplementedException("CreateAttribute(string, string) not implemented");
- }
-
- public virtual XmlAttribute CreateAttribute(
- string prefix,
- string localName,
- string namespaceURI
- )
- {
- // TODO - implement XmlDocument.CreateAttribute(prefix, localName, namespaceURI)
- throw new NotImplementedException("CreateAttribute(prefix, localName, namespaceURI) not implemented");
- }
-
- public virtual XmlCDataSection CreateCDataSection(string data)
- {
- // TODO - implement XmlDocument.CreateCDataSection(string data)
- throw new NotImplementedException("CreateCDataSection(string data) not implemented");
- }
-
-
- public virtual XmlComment CreateComment(string data)
- {
- // TODO - implement XmlDocument.CreateComment(string data)
- throw new NotImplementedException("CreateComment(string data) not implemented");
- }
-
- public virtual XmlDocumentFragment CreateDocumentFragment()
- {
- // TODO - implement XmlDocument.CreateDocumentFragment
- throw new NotImplementedException("CreateDocumentFragment not implemented");
- }
-
- public virtual XmlDocumentType CreateDocumentType(
- string name,
- string publicId,
- string systemId,
- string internalSubset
- )
- {
- // TODO - implement XmlDocument.CreateDocumentType
- throw new NotImplementedException("CreateDocumentType not implemented");
- }
-
- public XmlElement CreateElement(string name)
- {
- // TODO - implement XmlDocument.CreateElement(string name)
- throw new NotImplementedException("CreateElement(string name) not implemented");
- }
-
- public XmlElement CreateElement(
- string qualifiedName,
- string namespaceURI
- )
- {
- // TODO - implement XmlDocument.CreateElement(string qualifiedName, string namespaceURI)
- throw new NotImplementedException("CreateElement(string qualifiedName, string namespaceURI) not implemented");
- }
-
- public virtual XmlElement CreateElement(
- string prefix,
- string localName,
- string namespaceURI
- )
- {
- return new XmlElement(prefix, localName, namespaceURI, this);
- }
-
-
- public virtual XmlEntityReference CreateEntityReference(string name)
- {
- // TODO - implement XmlDocument.CreateEntityReference
- throw new NotImplementedException("XmlDocument.CreateEntityReference not implemented.");
- }
-
- public virtual XmlNode CreateNode(
- string nodeTypeString,
- string name,
- string namespaceURI
- )
- {
- // TODO - implement XmlDocument.CreateNode(string, string, string)
- throw new NotImplementedException("XmlDocument.CreateNode not implemented.");
- }
-
- public virtual XmlNode CreateNode(
- XmlNodeType type,
- string name,
- string namespaceURI
- )
- {
- // TODO - implement XmlDocument.CreateNode(XmlNodeType, string, string)
- throw new NotImplementedException("XmlDocument.CreateNode not implemented.");
- }
-
- public virtual XmlNode CreateNode(
- XmlNodeType type,
- string prefix,
- string name,
- string namespaceURI
- )
- {
- // TODO - implement XmlDocument.CreateNode(XmlNodeType, string, string, string)
- throw new NotImplementedException("XmlDocument.CreateNode not implemented.");
- }
-
- public virtual XmlProcessingInstruction CreateProcessingInstruction(
- string target,
- string data
- )
- {
- // TODO - implement XmlDocument.CreateProcessingInstruction
- throw new NotImplementedException("XmlDocument.CreateProcessingInstruction not implemented.");
- }
-
- public virtual XmlSignificantWhitespace CreateSignificantWhitespace(string text )
- {
- // TODO - implement XmlDocument.CreateSignificantWhitespace
- throw new NotImplementedException("XmlDocument.CreateSignificantWhitespace not implemented.");
- }
-
- public virtual XmlText CreateTextNode(string text)
- {
- // TODO - implement XmlDocument.CreateTextNode
- throw new NotImplementedException("XmlDocument.CreateTextNode not implemented.");
- }
-
- public virtual XmlWhitespace CreateWhitespace(string text)
- {
- // TODO - implement XmlDocument.CreateWhitespace
- throw new NotImplementedException("XmlDocument.CreateWhitespace not implemented.");
- }
-
- public virtual XmlDeclaration CreateXmlDeclaration(
- string version,
- string encoding,
- string standalone
- )
- {
- // TODO - implement XmlDocument.CreateXmlDeclaration
- throw new NotImplementedException("XmlDocument.CreateXmlDeclaration not implemented.");
- }
-
- public virtual XmlElement GetElementById(string elementId)
- {
- // TODO - implement XmlDocument.GetElementById
- throw new NotImplementedException("XmlDocument.GetElementById not implemented.");
- }
-
- public virtual XmlNodeList GetElementsByTagName(string name)
- {
- // TODO - implement XmlDocument.GetElementsByTagName(name)
- throw new NotImplementedException("XmlDocument.GetElementsByTagName not implemented.");
- }
-
- public virtual XmlNodeList GetElementsByTagName(
- string localName,
- string namespaceURI
- )
- {
- // TODO - implement XmlDocument.GetElementsByTagName(localName, namespaceURI)
- throw new NotImplementedException("XmlDocument.GetElementsByTagName not implemented.");
- }
-
- public virtual XmlNode ImportNode(
- XmlNode node,
- bool deep
- )
- {
- // TODO - implement XmlDocument.ImportNode
- throw new NotImplementedException("XmlDocument.ImportNode not implemented.");
- }
-
- public virtual void Load(Stream inStream)
- {
- // TODO - implement XmlDocument.Load(Stream)
- throw new NotImplementedException("XmlDocument.Load(Stream) not implemented.");
- }
-
- public virtual void Load(string filename)
- {
- // TODO - implement XmlDocument.Load(string)
- throw new NotImplementedException("XmlDocument.Load(string) not implemented.");
- }
-
- public virtual void Load(TextReader txtReader)
- {
- // TODO - implement XmlDocument.Load(TextReader)
- throw new NotImplementedException("XmlDocument.Load(TextReader) not implemented.");
- }
-
- public virtual void Load(XmlReader reader)
- {
- // TODO - implement XmlDocument.Load(XmlReader)
- throw new NotImplementedException("XmlDocument.Load(XmlReader) not implemented.");
- }
-
- public virtual void LoadXml(string xml)
- {
- // TODO - implement XmlDocument.LoadXml
- throw new NotImplementedException("XmlDocument.LoadXml not implemented.");
- }
-
- public virtual void Save(Stream outStream)
- {
- // TODO - implement XmlDocument.Save(Stream)
- throw new NotImplementedException("XmlDocument.Save(Stream) not implemented.");
- }
-
- public virtual void Save(string filename)
- {
- // TODO - implement XmlDocument.Save(string)
- throw new NotImplementedException("XmlDocument.Save(string) not implemented.");
- }
-
- public virtual void Save(TextWriter writer)
- {
- // TODO - implement XmlDocument.Save(TextWriter)
- throw new NotImplementedException("XmlDocument.Save(TextWriter) not implemented.");
- }
-
- public virtual void Save(XmlWriter writer)
- {
- // TODO - implement XmlDocument.Save(XmlWriter)
- throw new NotImplementedException("XmlDocument.Save(XmlWriter) not implemented.");
- }
-
- public override void WriteContentTo(XmlWriter w)
- {
- // TODO - implement XmlDocument.WriteContentTo
- throw new NotImplementedException("XmlDocument.WriteContentTo not implemented.");
- }
-
- public override void WriteTo(XmlWriter w)
- {
- // TODO - implement XmlDocument.WriteTo
- throw new NotImplementedException("XmlDocument.WriteTo not implemented.");
- }
-
-
- // Internal functions
- //===========================================================================
- internal void onNodeChanging(XmlNode node, XmlNode Parent)
- {
- if (NodeInserting != null)
- NodeChanging( new XmlNodeChangedEventArgs(XmlNodeChangedAction.Change,
- node, Parent, Parent));
- }
-
- internal void onNodeChanged(XmlNode node, XmlNode Parent)
- {
- if (NodeChanged != null)
- NodeInserted( new XmlNodeChangedEventArgs(XmlNodeChangedAction.Change,
- node, Parent, Parent));
- }
-
- internal void onNodeInserting(XmlNode node, XmlNode newParent)
- {
- if (NodeInserting != null)
- NodeInserting( new XmlNodeChangedEventArgs(XmlNodeChangedAction.Insert,
- node, null, newParent));
- }
-
- internal void onNodeInserted(XmlNode node, XmlNode newParent)
- {
- if (NodeInserted != null)
- NodeInserted( new XmlNodeChangedEventArgs(XmlNodeChangedAction.Insert,
- node, null, newParent));
- }
-
- internal void onNodeRemoving(XmlNode node, XmlNode oldParent)
- {
- if (NodeRemoving != null)
- NodeRemoving(new XmlNodeChangedEventArgs(XmlNodeChangedAction.Remove,
- node, oldParent, null));
- }
-
- internal void onNodeRemoved(XmlNode node, XmlNode oldParent)
- {
- if (NodeRemoved != null)
- NodeRemoved(new XmlNodeChangedEventArgs(XmlNodeChangedAction.Remove,
- node, oldParent, null));
-
- }
-
- // Constructors
- //===========================================================================
- public XmlDocument() : base(null)
- {
- }
-
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlDocumentFragment.cs b/mcs/class/System.XML/System.Xml/XmlDocumentFragment.cs
deleted file mode 100644
index 24717d7a03c..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDocumentFragment.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlDocumentFragment
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- ///
- /// </summary>
- public class XmlDocumentFragment : XmlNode
- {
- // Private data members
-
- // public properties
- //===========================================================================
- /// <summary>
- /// Returns the local name of the node with. For document fragments, it returns "#document-fragment"
- /// </summary>
- public override string LocalName
- {
- get
- {
- return "#document-fragment";
- }
- }
-
-
- /// <summary>
- /// Get the node name. Document fragments return "#document-fragment".
- /// </summary>
- public override string Name
- {
- get
- {
- return "#document-fragment";
- }
- }
-
- /// <summary>
- /// Overridden. Returns XmlNodeType.DocumentFragment.
- /// </summary>
- public override XmlNodeType NodeType
- {
- get
- {
- return XmlNodeType.DocumentFragment;
- }
- }
-
- // Public Methods
- //===========================================================================
- /// <summary>
- /// Return a clone of the node
- /// </summary>
- /// <param name="deep">Make copy of all children</param>
- /// <returns>Cloned node</returns>
- public override XmlNode CloneNode( bool deep)
- {
- // TODO - implement CloneNode()
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Saves all children of the current node to the passed writer
- /// </summary>
- /// <param name="w"></param>
- public override void WriteContentTo(XmlWriter w)
- {
- // TODO - implement WriteContentsTo(XmlWriter)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Saves the current node to writer w
- /// </summary>
- /// <param name="w"></param>
- public override void WriteTo(XmlWriter w)
- {
- // TODO - implement WriteTo(XmlWriter)
- throw new NotImplementedException();
- }
-
- // Constructors
- //===========================================================================
- internal XmlDocumentFragment ( XmlDocument aOwner ) : base (aOwner)
- {
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlDocumentType.cs b/mcs/class/System.XML/System.Xml/XmlDocumentType.cs
deleted file mode 100644
index f0b2a96f243..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDocumentType.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// System.Xml.XmlDocumentType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public class XmlDocumentType : XmlLinkedNode
- {
- // Fields
- string name; // name of the document type
- string publicId; // public identifier on the DOCTYPE
- string systemId; // system identifier on the DOCTYPE
- string internalSubset; // value of the DTD internal subset
- XmlDocument document;
-
- // Constructor
- protected internal XmlDocumentType (string name, string publicId, string systemId,
- string internalSubset, XmlDocument doc)
- : base (null)
- {
- this.name = name;
- this.publicId = publicId;
- this.systemId = systemId;
- this.internalSubset = internalSubset;
- this.document = doc;
- }
-
-
- // Properties
- [MonoTODO]
- public XmlNamedNodeMap Entities
- {
- get { return null; }
- }
-
- public string InternalSubset
- {
- get { return internalSubset; }
- }
-
- public override bool IsReadOnly
- {
- get { return true; } // always return true
- }
-
- public override string LocalName
- {
- get { return name; }
- }
-
- public override string Name
- {
- get { return name; }
- }
-
- public override XmlNodeType NodeType
- {
- get { return XmlNodeType.DocumentType; }
- }
-
- [MonoTODO]
- public XmlNamedNodeMap Notations
- {
- get { return null; }
- }
-
- public string PublicId
- {
- get { return publicId; }
- }
-
- public string SystemId
- {
- get { return systemId; }
- }
-
- // Methods
- [MonoTODO]
- public override XmlNode CloneNode (bool deep)
- {
- return null;
- }
-
- [MonoTODO]
- public override void WriteContentTo (XmlWriter w)
- {
- }
-
- [MonoTODO]
- public override void WriteTo (XmlWriter w)
- {
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlElement.cs b/mcs/class/System.XML/System.Xml/XmlElement.cs
deleted file mode 100644
index 3419ab9a7c0..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlElement.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlElement
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-using System;
-
-namespace System.Xml
-{
- public class XmlElement : XmlLinkedNode
- {
- // Private/Protected internal data structures
- //===========================================================================
- private XmlAttributeCollection _attributes;
-
- private string prefix;
- private string localName;
- private string namespaceURI;
-
- // Public Properties
- //===========================================================================
-
- /// <summary>
- /// Return the XmlAttributeCollection on the Element
- /// </summary>
- public override XmlAttributeCollection Attributes
- {
- get
- {
- // TODO - implement Attributes
- return _attributes;
- }
- }
-
- /// <summary>
- /// Get/Set the value for this node
- /// </summary>
- public override string Value
- {
- get
- {
- return null;
- }
-
- set
- {
- // Do nothing, can't set value on XmlElement...
- }
- }
-
- // Implement abstract methods of XmlNode
- //=====================================================================
- /// <summary>
- /// Remove all children and attributes. If
- /// </summary>
- public override void RemoveAll()
- {
- // Remove all child nodes
- base.RemoveAll();
-
- // Remove all attributes
- _attributes.RemoveAll();
-
- // If we have any default attributes, add them back in with the
- // appropriate namespace, baseURI, name, localName
- // TODO - implement adding default attributes back in XmlElement.RemoveAll()
- }
-
- /// <summary>
- /// Return a clone of the node
- /// </summary>
- /// <param name="deep">Make copy of all children</param>
- /// <returns>Cloned node</returns>
- public override XmlNode CloneNode( bool deep)
- {
- // TODO - implement CloneNode()
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Saves all children of the current node to the passed writer
- /// </summary>
- /// <param name="w"></param>
- public override void WriteContentTo(XmlWriter w)
- {
- // TODO - implement WriteContentsTo(XmlWriter)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Saves the current node to writer w
- /// </summary>
- /// <param name="w"></param>
- public override void WriteTo(XmlWriter w)
- {
- // TODO - implement WriteTo(XmlWriter)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Returns the local name of the node with qualifiers removed
- /// LocalName of ns:elementName = "elementName"
- /// </summary>
- public override string LocalName
- {
- get {
- return localName;
- }
- }
-
-
- /// <summary>
- /// Get the qualified node name
- /// derived classes must implement as behavior varies
- /// by tag type.
- /// </summary>
- public override string Name
- {
- get
- {
- return prefix != String.Empty ? prefix + ":" + localName : localName;
- }
- }
-
- public override string NamespaceURI
- {
- get
- {
- return namespaceURI;
- }
- }
-
- public override XmlNodeType NodeType
- {
- get
- {
- return XmlNodeType.Element;
- }
- }
-
- public override string Prefix
- {
- get
- {
- return prefix;
- }
- }
-
-
- // ============= Internal calls =============================================
-
- // Constructors
- // ==========================================================================
- protected internal XmlElement(string prefix, string localName, string namespaceURI, XmlDocument doc) : base(doc)
- {
- this.prefix = prefix;
- this.localName = localName;
- this.namespaceURI = namespaceURI;
-
- _attributes = new XmlAttributeCollection(doc, this, null);
- }
-
-
- } // class
- } //namespace
diff --git a/mcs/class/System.XML/System.Xml/XmlEntityReference.cs b/mcs/class/System.XML/System.Xml/XmlEntityReference.cs
deleted file mode 100644
index 3ab2706aa59..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlEntityReference.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- ///
- /// </summary>
- public class XmlEntityReference
- {
- // Private data members
-
- // public properties
-
-
- // Public Methods
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlException.cs b/mcs/class/System.XML/System.Xml/XmlException.cs
deleted file mode 100755
index 1986b304fae..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlException.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlException
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Xml
-{
- /// <summary>
- /// Abstract class XmlNodeList.
- /// </summary>
- public class XmlException : SystemException
- {
- // Private data members
- int FlineNumber;
- int FlinePosition;
- string Fmessage;
-
- // public properties
- /// <summary>
- /// Get the line number where the exception occured
- /// </summary>
- public int LineNumber
- {
- get
- {
- return FlineNumber;
- }
- }
-
- /// <summary>
- /// Get the line position where the exception occured.
- /// </summary>
- public int LinePosition
- {
- get
- {
- return FlinePosition;
- }
- }
-
- /// <summary>
- /// Get the error message describing the exception.
- /// </summary>
- public override string Message
- {
- get
- {
- return Fmessage;
- }
- }
-
- // Public Methods
-
- // Constructors
- /// <summary>
- /// Create a new XmlException object.
- /// </summary>
- /// <param name="info">The serializatin object holding all exception information.</param>
- /// <param name="context">The streaming context containing the context of the error</param>
- public XmlException(
- SerializationInfo info,
- StreamingContext context
- )
- {
- FlineNumber = info.GetInt32("lineNumber");
- FlinePosition = info.GetInt32("linePosition");
- Fmessage = info.GetString("message");
-
- }
-
- /// <summary>
- /// Create a new XmlException
- /// </summary>
- /// <param name="message">Description of error</param>
- /// <param name="innerException">Exception causing error. Value can be null.</param>
- public XmlException(
- string message,
- Exception innerException
- )
- {
- Fmessage = message;
- }
-
- internal XmlException( string message, XmlInputSource src)
- {
- FlineNumber = src.lineNumber;
- FlinePosition = src.columnNumber;
- Fmessage = message;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlExceptionCode.cs b/mcs/class/System.XML/System.Xml/XmlExceptionCode.cs
deleted file mode 100755
index 1cf3e3b9ffb..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlExceptionCode.cs
+++ /dev/null
@@ -1,1045 +0,0 @@
-// XmlExceptionCode.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:47:23 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum XmlExceptionCode {
-
- /// <summary>
- /// </summary>
- Success = 0,
-
- /// <summary>
- /// </summary>
- UnclosedQuote = 1,
-
- /// <summary>
- /// </summary>
- UnexpectedEOF = 2,
-
- /// <summary>
- /// </summary>
- BadStartNameChar = 3,
-
- /// <summary>
- /// </summary>
- BadNameChar = 4,
-
- /// <summary>
- /// </summary>
- BadComment = 5,
-
- /// <summary>
- /// </summary>
- BadDecimalEntity = 6,
-
- /// <summary>
- /// </summary>
- BadHexEntity = 7,
-
- /// <summary>
- /// </summary>
- NumEntityOverflow = 8,
-
- /// <summary>
- /// </summary>
- MissingByteOrderMark = 9,
-
- /// <summary>
- /// </summary>
- UnknownEncoding = 10,
-
- /// <summary>
- /// </summary>
- InternalError = 11,
-
- /// <summary>
- /// </summary>
- UnexpectedWS = 12,
-
- /// <summary>
- /// </summary>
- UnexpectedChar = 13,
-
- /// <summary>
- /// </summary>
- NoInput = 14,
-
- /// <summary>
- /// </summary>
- NoHandler = 15,
-
- /// <summary>
- /// </summary>
- UnexpectedToken = 16,
-
- /// <summary>
- /// </summary>
- NotImplemented = 17,
-
- /// <summary>
- /// </summary>
- TagMismatch = 18,
-
- /// <summary>
- /// </summary>
- UnexpectedTag = 19,
-
- /// <summary>
- /// </summary>
- BadColon = 20,
-
- /// <summary>
- /// </summary>
- UnknownNs = 21,
-
- /// <summary>
- /// </summary>
- ReservedNs = 22,
-
- /// <summary>
- /// </summary>
- BadAttributeChar = 23,
-
- /// <summary>
- /// </summary>
- MissingRoot = 24,
-
- /// <summary>
- /// </summary>
- MultipleRoots = 25,
-
- /// <summary>
- /// </summary>
- BadElementData = 26,
-
- /// <summary>
- /// </summary>
- InvalidRootData = 27,
-
- /// <summary>
- /// </summary>
- XmlDeclNotFirst = 28,
-
- /// <summary>
- /// </summary>
- InvalidAttributeValue = 29,
-
- /// <summary>
- /// </summary>
- InvalidXmlDecl = 30,
-
- /// <summary>
- /// </summary>
- BadXmlDeclCase = 31,
-
- /// <summary>
- /// </summary>
- InvalidNodeType = 32,
-
- /// <summary>
- /// </summary>
- InvalidPIName = 33,
-
- /// <summary>
- /// </summary>
- InvalidXmlSpace = 34,
-
- /// <summary>
- /// </summary>
- InvalidXmlLang = 35,
-
- /// <summary>
- /// </summary>
- InvalidVersionNumber = 36,
-
- /// <summary>
- /// </summary>
- DupAttributeName = 37,
-
- /// <summary>
- /// </summary>
- BadDTDLocation = 38,
-
- /// <summary>
- /// </summary>
- UnexpectedElement = 39,
-
- /// <summary>
- /// </summary>
- TagNotInTheSameEntity = 40,
-
- /// <summary>
- /// </summary>
- PartialContentNodeTypeNotSupported = 41,
-
- /// <summary>
- /// </summary>
- InvalidPartialContentData = 42,
-
- /// <summary>
- /// </summary>
- TwoDTDsProvided = 43,
-
- /// <summary>
- /// </summary>
- CanNotBindToReservedNamespace = 44,
-
- /// <summary>
- /// </summary>
- TextDeclPosition = 45,
-
- /// <summary>
- /// </summary>
- DupElementDecl = 46,
-
- /// <summary>
- /// </summary>
- DupIDAttribute = 47,
-
- /// <summary>
- /// </summary>
- DupNotation = 48,
-
- /// <summary>
- /// </summary>
- DupEntity = 49,
-
- /// <summary>
- /// </summary>
- DupParEntity = 50,
-
- /// <summary>
- /// </summary>
- DupID = 51,
-
- /// <summary>
- /// </summary>
- UndeclaredElement = 52,
-
- /// <summary>
- /// </summary>
- UndeclaredAttribute = 53,
-
- /// <summary>
- /// </summary>
- UndeclaredNotation = 54,
-
- /// <summary>
- /// </summary>
- UndeclaredID = 55,
-
- /// <summary>
- /// </summary>
- UndeclaredParEntity = 56,
-
- /// <summary>
- /// </summary>
- UndeclaredEntity = 57,
-
- /// <summary>
- /// </summary>
- InvalidCondSect = 58,
-
- /// <summary>
- /// </summary>
- InvalidParEntityRef = 59,
-
- /// <summary>
- /// </summary>
- InvalidContentModel = 60,
-
- /// <summary>
- /// </summary>
- InvalidAttType = 61,
-
- /// <summary>
- /// </summary>
- InvalidTextDecl = 62,
-
- /// <summary>
- /// </summary>
- InvalidContent = 63,
-
- /// <summary>
- /// </summary>
- InvalidContentExpecting = 64,
-
- /// <summary>
- /// </summary>
- ParEntityRefNesting = 65,
-
- /// <summary>
- /// </summary>
- ReservedNsDecl = 66,
-
- /// <summary>
- /// </summary>
- RecursiveParEntity = 67,
-
- /// <summary>
- /// </summary>
- RootMatchDocType = 68,
-
- /// <summary>
- /// </summary>
- EmptyContent = 69,
-
- /// <summary>
- /// </summary>
- IncompleteContent = 70,
-
- /// <summary>
- /// </summary>
- UnparsedEntity = 71,
-
- /// <summary>
- /// </summary>
- SchemaRootExpected = 72,
-
- /// <summary>
- /// </summary>
- UnsupportedAttribute = 73,
-
- /// <summary>
- /// </summary>
- UnsupportedElement = 74,
-
- /// <summary>
- /// </summary>
- MissAttribute = 75,
-
- /// <summary>
- /// </summary>
- AnnotationLocation = 76,
-
- /// <summary>
- /// </summary>
- DataTypeTextOnly = 77,
-
- /// <summary>
- /// </summary>
- UnknownContent = 78,
-
- /// <summary>
- /// </summary>
- UnknownModel = 79,
-
- /// <summary>
- /// </summary>
- UnknownOrder = 80,
-
- /// <summary>
- /// </summary>
- MixedMany = 81,
-
- /// <summary>
- /// </summary>
- GroupDisabled = 82,
-
- /// <summary>
- /// </summary>
- DupConstraint = 83,
-
- /// <summary>
- /// </summary>
- MissDtvaluesAttribute = 84,
-
- /// <summary>
- /// </summary>
- MissDtvalue = 85,
-
- /// <summary>
- /// </summary>
- DupDtType = 86,
-
- /// <summary>
- /// </summary>
- DupAttribute = 87,
-
- /// <summary>
- /// </summary>
- UnknownDtType = 88,
-
- /// <summary>
- /// </summary>
- RequireEnumeration = 89,
-
- /// <summary>
- /// </summary>
- DefaultIDValue = 90,
-
- /// <summary>
- /// </summary>
- ElementNotAllowed = 91,
-
- /// <summary>
- /// </summary>
- ElementMissing = 92,
-
- /// <summary>
- /// </summary>
- ManyMaxOccurs = 93,
-
- /// <summary>
- /// </summary>
- UnknownRequired = 94,
-
- /// <summary>
- /// </summary>
- MaxOccursInvalid = 95,
-
- /// <summary>
- /// </summary>
- MinOccursInvalid = 96,
-
- /// <summary>
- /// </summary>
- DtMaxLenghtInvalid = 97,
-
- /// <summary>
- /// </summary>
- DtMinLenghtInvalid = 98,
-
- /// <summary>
- /// </summary>
- DupDtMaxLenght = 99,
-
- /// <summary>
- /// </summary>
- DupDtMinLenght = 100,
-
- /// <summary>
- /// </summary>
- DtMinMaxLength = 101,
-
- /// <summary>
- /// </summary>
- InvalidAttributeDefault = 102,
-
- /// <summary>
- /// </summary>
- DupElement = 103,
-
- /// <summary>
- /// </summary>
- InvalidValue = 104,
-
- /// <summary>
- /// </summary>
- RecursiveGenEntity = 105,
-
- /// <summary>
- /// </summary>
- ExternalEntityInAttValue = 106,
-
- /// <summary>
- /// </summary>
- UnparsedEntityRef = 107,
-
- /// <summary>
- /// </summary>
- MissRequiredAttribute = 108,
-
- /// <summary>
- /// </summary>
- FixedAttributeValue = 109,
-
- /// <summary>
- /// </summary>
- AttributeValueDataType = 110,
-
- /// <summary>
- /// </summary>
- IncludeLocation = 111,
-
- /// <summary>
- /// </summary>
- ImportLocation = 112,
-
- /// <summary>
- /// </summary>
- NoParticle = 113,
-
- /// <summary>
- /// </summary>
- InvalidProcessContentValue = 114,
-
- /// <summary>
- /// </summary>
- InvalidDerivedByValue = 115,
-
- /// <summary>
- /// </summary>
- InvalidBlockValue = 116,
-
- /// <summary>
- /// </summary>
- InvalidBlockDefaultValue = 117,
-
- /// <summary>
- /// </summary>
- InvalidFinalValue = 118,
-
- /// <summary>
- /// </summary>
- InvalidFinalDefaultValue = 119,
-
- /// <summary>
- /// </summary>
- DupAttributeValue = 120,
-
- /// <summary>
- /// </summary>
- InvalidID = 121,
-
- /// <summary>
- /// </summary>
- DupSimpleType = 122,
-
- /// <summary>
- /// </summary>
- DupComplexType = 123,
-
- /// <summary>
- /// </summary>
- InvalidContentValue = 124,
-
- /// <summary>
- /// </summary>
- DupGroup = 125,
-
- /// <summary>
- /// </summary>
- DefaultFixedAttributes = 126,
-
- /// <summary>
- /// </summary>
- DupAttributeGroup = 127,
-
- /// <summary>
- /// </summary>
- DerivedByNotAllowed = 128,
-
- /// <summary>
- /// </summary>
- DupXsdElement = 129,
-
- /// <summary>
- /// </summary>
- ForbiddenAttribute = 130,
-
- /// <summary>
- /// </summary>
- NoElementContent = 131,
-
- /// <summary>
- /// </summary>
- ElementRef = 132,
-
- /// <summary>
- /// </summary>
- TypeMutualExclusive = 133,
-
- /// <summary>
- /// </summary>
- ElementNameRef = 134,
-
- /// <summary>
- /// </summary>
- AttributeNameRef = 135,
-
- /// <summary>
- /// </summary>
- TextNotAllowed = 136,
-
- /// <summary>
- /// </summary>
- UndeclaredEquivClass = 137,
-
- /// <summary>
- /// </summary>
- UndeclaredType = 138,
-
- /// <summary>
- /// </summary>
- AttListPresence = 139,
-
- /// <summary>
- /// </summary>
- EmptySchemaCollection = 140,
-
- /// <summary>
- /// </summary>
- NotInSchemaCollection = 141,
-
- /// <summary>
- /// </summary>
- NotSameNameTable = 142,
-
- /// <summary>
- /// </summary>
- InvalidCharacter = 143,
-
- /// <summary>
- /// </summary>
- ValidDateElement = 144,
-
- /// <summary>
- /// </summary>
- NotationValue = 145,
-
- /// <summary>
- /// </summary>
- EnumerationValue = 146,
-
- /// <summary>
- /// </summary>
- EmptyAttributeValue = 147,
-
- /// <summary>
- /// </summary>
- InvalidName = 148,
-
- /// <summary>
- /// </summary>
- NoColonEntityName = 149,
-
- /// <summary>
- /// </summary>
- MultipleAttributeValue = 150,
-
- /// <summary>
- /// </summary>
- UnexpectedCDataEnd = 151,
-
- /// <summary>
- /// </summary>
- ResolveURL = 152,
-
- /// <summary>
- /// </summary>
- NullXmlResolver = 153,
-
- /// <summary>
- /// </summary>
- ColonInLocalName = 154,
-
- /// <summary>
- /// </summary>
- XmlLangNmtoken = 155,
-
- /// <summary>
- /// </summary>
- InvalidLanguageID = 156,
-
- /// <summary>
- /// </summary>
- XmlSpace = 157,
-
- /// <summary>
- /// </summary>
- ExpectDtdMarkup = 158,
-
- /// <summary>
- /// </summary>
- ExpectedExternalOrPublicID = 159,
-
- /// <summary>
- /// </summary>
- ExpectedExternalIdOrEntityValue = 160,
-
- /// <summary>
- /// </summary>
- ExpectAttType = 161,
-
- /// <summary>
- /// </summary>
- ExpectIgnoreOrInclude = 162,
-
- /// <summary>
- /// </summary>
- ExpectSubOrClose = 163,
-
- /// <summary>
- /// </summary>
- ExpectExternalOrClose = 164,
-
- /// <summary>
- /// </summary>
- ExpectOp = 165,
-
- /// <summary>
- /// </summary>
- ExpectPcData = 166,
-
- /// <summary>
- /// </summary>
- InvalidXsdAttributeValue = 167,
-
- /// <summary>
- /// </summary>
- ElementValueDataType = 168,
-
- /// <summary>
- /// </summary>
- AttributeRef = 169,
-
- /// <summary>
- /// </summary>
- AttributeComplexType = 170,
-
- /// <summary>
- /// </summary>
- NonDeterministic = 171,
-
- /// <summary>
- /// </summary>
- StandAlone = 172,
-
- /// <summary>
- /// </summary>
- InvalidSchema = 173,
-
- /// <summary>
- /// </summary>
- SimpleFromComplex = 174,
-
- /// <summary>
- /// </summary>
- ListFromList = 175,
-
- /// <summary>
- /// </summary>
- DerivedByBaseName = 176,
-
- /// <summary>
- /// </summary>
- InvalidXmlDocument = 177,
-
- /// <summary>
- /// </summary>
- ParticlesNotAllowed = 178,
-
- /// <summary>
- /// </summary>
- FacetsNotAllowed = 179,
-
- /// <summary>
- /// </summary>
- AttributesNotAllowed = 180,
-
- /// <summary>
- /// </summary>
- ComplexSimpleRestriction = 181,
-
- /// <summary>
- /// </summary>
- ComplexSimpleContent = 182,
-
- /// <summary>
- /// </summary>
- XmlNsAttribute = 183,
-
- /// <summary>
- /// </summary>
- GlobalAttributeFixedDefault = 184,
-
- /// <summary>
- /// </summary>
- XsiTargetNamespace = 185,
-
- /// <summary>
- /// </summary>
- BlockEquivClass = 186,
-
- /// <summary>
- /// </summary>
- ElementDefault = 187,
-
- /// <summary>
- /// </summary>
- UndeclaredModelGroup = 188,
-
- /// <summary>
- /// </summary>
- UndeclaredAttributeGroup = 189,
-
- /// <summary>
- /// </summary>
- FragmentID = 190,
-
- /// <summary>
- /// </summary>
- AllElement = 191,
-
- /// <summary>
- /// </summary>
- MaxOccursInAll = 192,
-
- /// <summary>
- /// </summary>
- MisMatchTargetNamespace = 193,
-
- /// <summary>
- /// </summary>
- AttributeFollowCompositor = 194,
-
- /// <summary>
- /// </summary>
- XsiTypeNotFound = 195,
-
- /// <summary>
- /// </summary>
- ListFromNonatomic = 196,
-
- /// <summary>
- /// </summary>
- DupLengthFacet = 197,
-
- /// <summary>
- /// </summary>
- DupMinLengthFacet = 198,
-
- /// <summary>
- /// </summary>
- DupMaxLengthFacet = 199,
-
- /// <summary>
- /// </summary>
- DupPatternFacet = 200,
-
- /// <summary>
- /// </summary>
- DupWhiteSpaceFacet = 201,
-
- /// <summary>
- /// </summary>
- DupMaxInclusiveFacet = 202,
-
- /// <summary>
- /// </summary>
- DupMaxExclusiveFacet = 203,
-
- /// <summary>
- /// </summary>
- DupMinInclusiveFacet = 204,
-
- /// <summary>
- /// </summary>
- DupMinExclusiveFacet = 205,
-
- /// <summary>
- /// </summary>
- DupPrecisionFacet = 206,
-
- /// <summary>
- /// </summary>
- DupScaleFacet = 207,
-
- /// <summary>
- /// </summary>
- DupEncodingFacet = 208,
-
- /// <summary>
- /// </summary>
- DupDurationFacet = 209,
-
- /// <summary>
- /// </summary>
- DupPeriodFacet = 210,
-
- /// <summary>
- /// </summary>
- LengthFacetProhibited = 211,
-
- /// <summary>
- /// </summary>
- MinLengthFacetProhibited = 212,
-
- /// <summary>
- /// </summary>
- MaxLengthFacetProhibited = 213,
-
- /// <summary>
- /// </summary>
- PatternFacetProhibited = 214,
-
- /// <summary>
- /// </summary>
- EnumerationFacetProhibited = 215,
-
- /// <summary>
- /// </summary>
- WhiteSpaceFacetProhibited = 216,
-
- /// <summary>
- /// </summary>
- MaxInclusiveFacetProhibited = 217,
-
- /// <summary>
- /// </summary>
- MaxExclusiveFacetProhibited = 218,
-
- /// <summary>
- /// </summary>
- MinInclusiveFacetProhibited = 219,
-
- /// <summary>
- /// </summary>
- MinExclusiveFacetProhibited = 220,
-
- /// <summary>
- /// </summary>
- PrecisionFacetProhibited = 221,
-
- /// <summary>
- /// </summary>
- ScaleFacetProhibited = 222,
-
- /// <summary>
- /// </summary>
- EncodingFacetProhibited = 223,
-
- /// <summary>
- /// </summary>
- DurationFacetProhibited = 224,
-
- /// <summary>
- /// </summary>
- PeriodFacetProhibited = 225,
-
- /// <summary>
- /// </summary>
- NegativeLength = 226,
-
- /// <summary>
- /// </summary>
- NegativeMinLength = 227,
-
- /// <summary>
- /// </summary>
- NegativeMaxLength = 228,
-
- /// <summary>
- /// </summary>
- FacetOnlyForAtomic = 229,
-
- /// <summary>
- /// </summary>
- InvalidEncoding = 230,
-
- /// <summary>
- /// </summary>
- InvalidWhiteSpace = 231,
-
- /// <summary>
- /// </summary>
- UnknownFacet = 232,
-
- /// <summary>
- /// </summary>
- LengthAndMinMax = 233,
-
- /// <summary>
- /// </summary>
- MinLengthGtMaxLength = 234,
-
- /// <summary>
- /// </summary>
- ScaleGtPrecision = 235,
-
- /// <summary>
- /// </summary>
- LengthConstraintFailed = 236,
-
- /// <summary>
- /// </summary>
- MinLengthConstraintFailed = 237,
-
- /// <summary>
- /// </summary>
- MaxLengthConstraintFailed = 238,
-
- /// <summary>
- /// </summary>
- PatternConstraintFailed = 239,
-
- /// <summary>
- /// </summary>
- EnumerationConstraintFailed = 240,
-
- /// <summary>
- /// </summary>
- MaxInclusiveConstraintFailed = 241,
-
- /// <summary>
- /// </summary>
- MaxExclusiveConstraintFailed = 242,
-
- /// <summary>
- /// </summary>
- MinInclusiveConstraintFailed = 243,
-
- /// <summary>
- /// </summary>
- MinExclusiveConstraintFailed = 244,
-
- /// <summary>
- /// </summary>
- PrecisionConstraintFailed = 245,
-
- /// <summary>
- /// </summary>
- ScaleConstraintFailed = 246,
-
- /// <summary>
- /// </summary>
- EncodingConstraintFailed = 247,
-
- /// <summary>
- /// </summary>
- DurationConstraintFailed = 248,
-
- /// <summary>
- /// </summary>
- PeriodConstraintFailed = 249,
-
- /// <summary>
- /// </summary>
- UnionFailed = 250,
-
- /// <summary>
- /// </summary>
- EncodingRequired = 251,
-
- /// <summary>
- /// </summary>
- MoreFacetsRequired = 252,
-
- /// <summary>
- /// </summary>
- DupNotationAttribute = 253,
-
- /// <summary>
- /// </summary>
- NotationAttributeOnEmptyElement = 254,
-
- /// <summary>
- /// </summary>
- Last = 255,
- } // XmlExceptionCode
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/XmlImplementation.cs b/mcs/class/System.XML/System.Xml/XmlImplementation.cs
deleted file mode 100644
index 7c688660a45..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlImplementation.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Xml.XmlImplementation.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public class XmlImplementation
- {
- public XmlImplementation ()
- : base ()
- {
- }
-
- [MonoTODO]
- public virtual XmlDocument CreateDocument ()
- {
- // return new XmlDocument (this);
- return null;
- }
-
- public bool HasFeature (string strFeature, string strVersion)
- {
- if ((strVersion == "XML") || (strVersion == "xml") // not case-sensitive
- && (strVersion == "1.0") || (strVersion == "2.0"))
- return true;
- else
- return false;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlInputSource.cs b/mcs/class/System.XML/System.Xml/XmlInputSource.cs
deleted file mode 100644
index 8505ecc3c2b..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlInputSource.cs
+++ /dev/null
@@ -1,619 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlInputSource.cs
-// port of Open Xml TXmlInputSource class
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com
-//
-// (C) 2001 Daniel Weber
-//
-//
-
-using System;
-using System.IO;
-
-namespace System.Xml
-{
- internal class XmlInputSource
- {
- private DomEncodingType Fencoding;
-
- private string FpublicID;
- private string FsystemID;
- public string FrootName;
-
- private Stream FStream;
-
- private bool FLastCharWasCR;
-
- // locator
- int FColumnNumber;
- int FStartColumnNumber;
- int FStartLineNumber;
- bool FLastWCharWasLF;
- int FLineNumber;
- bool FPieceEndSet;
-
- // Buffer storage for UTF-8 surrogates
- // see http://www.ietf.org/rfc/rfc2279.txt for a complete description of UTF-8 encoding
- private int FLastUcs4;
-
-
- //FLocator: TdomStandardLocator;
-
- // public properties
- //===========================================================================
- public DomEncodingType encoding
- {
- get
- {
- return Fencoding;
- }
- }
-
- //property locator: TdomStandardLocator read FLocator;
- public string publicId
- {
- get
- {
- return FpublicID;
- }
- }
-
- public string rootName
- {
- get
- {
- return FrootName;
- }
- }
-
- public Stream stream
- {
- get
- {
- return FStream;
- }
- }
-
- public string streamAsWideString
- {
- get
- {
- return string.Empty;
- //wideString read getStreamAsWideString;
- }
- }
-
- public string systemId
- {
- get
- {
- return FsystemID;
- }
- }
-
- public int columnNumber
- {
- get { return FColumnNumber; }
- }
-
- public int lineNumber
- {
- get { return FLineNumber; }
- }
-
- public int startColumnNumber
- {
- get { return FStartColumnNumber; }
- }
-
- public int startLineNumber
- {
- get { return FStartLineNumber; }
- }
-
- // private methods
- //===========================================================================
- /// <summary>
- /// Analyze the first bytes of an XML document to try and determine encoding
- /// </summary>
- /// <returns>Determined encoding type, defaults to UTF-8</returns>
- private void setEncodingType()
- {
- try
- {
- byte[] buf = new byte[4];
-
- FStream.Seek(0, SeekOrigin.Begin);
- FStream.Read(buf, 0, 4);
-
- // UTF-16 code streams should begin with 0xfeff for big-endian systems
- // or 0xfffe for little endian systems.
- // check that first....
- if ( (buf[0] == 0xfe) & (buf[1] == 0xff) )
- Fencoding = DomEncodingType.etUTF16BE;
- else if ( (buf[0] == 0xff) & (buf[1] == 0xfe) )
- Fencoding = DomEncodingType.etUTF16LE;
- else
- {
- // assume utf-8, look for encoding in <?xml version="1.0" encoding="ISO-8859-6"> tag, eg
- Fencoding = DomEncodingType.etUTF8;
-
- // Check if the stream begins with <?[X|x][M|m][L|l]
- if ( (buf[0] == 0x3c) & (buf[1] == 0x3f) & // "<?"
- ((buf[2] == 0x78) | (buf[2] ==0x58) ) & // "x" or "X"
- ( (buf[2] == 0x6d) | (buf[3] ==0x4d) ) & // "m" or "M"
- ( (buf[2] == 0x6c) | (buf[2] ==0x4c) ) ) // "l" or "L"
- {
-
- string tag = "";
- while (FStream.Position != FStream.Length)
- {
- char c = getNextChar();
- tag += c;
-
- if (c == '>')
- break;
- }
-
- // start from the location of "encoding", and scan for quotes
- string encodeString = readEncodingAttrFromTag(tag);
- encodeString = encodeString.ToUpper();
-
- if ( (encodeString.IndexOf("ISO-8859-1") != -1) |
- (encodeString.IndexOf("LATIN-1") != -1) )
- Fencoding = DomEncodingType.etLatin1;
- else if ( (encodeString.IndexOf("ISO-8859-2") != -1) |
- (encodeString.IndexOf("LATIN-2") != -1) )
- Fencoding = DomEncodingType.etLatin2;
- else if ( (encodeString.IndexOf("ISO-8859-3") != -1) |
- (encodeString.IndexOf("LATIN-3") != -1) )
- Fencoding = DomEncodingType.etLatin3;
- else if ( (encodeString.IndexOf("ISO-8859-4") != -1) |
- (encodeString.IndexOf("LATIN-4") != -1) )
- Fencoding = DomEncodingType.etLatin4;
- else if ( (encodeString.IndexOf("ISO-8859-5") != -1) |
- (encodeString.IndexOf("CYRILLIC") != -1) )
- Fencoding = DomEncodingType.etCyrillic;
- else if ( (encodeString.IndexOf("ISO-8859-6") != -1) |
- (encodeString.IndexOf("ARABIC") != -1) )
- Fencoding = DomEncodingType.etArabic;
- else if ( (encodeString.IndexOf("ISO-8859-7") != -1) |
- (encodeString.IndexOf("GREEK") != -1) )
- Fencoding = DomEncodingType.etGreek;
- else if ( (encodeString.IndexOf("ISO-8859-8") != -1) |
- (encodeString.IndexOf("HEBREW") != -1) )
- Fencoding = DomEncodingType.etHebrew;
- else if ( (encodeString.IndexOf("ISO-8859-9") != -1) |
- (encodeString.IndexOf("LATIN-5") != -1) )
- Fencoding = DomEncodingType.etLatin5;
- else if ( (encodeString.IndexOf("ISO-8859-10") != -1) |
- (encodeString.IndexOf("LATIN-6") != -1) )
- Fencoding = DomEncodingType.etLatin6;
- else if ( (encodeString.IndexOf("ISO-8859-13") != -1) |
- (encodeString.IndexOf("LATIN-7") != -1) )
- Fencoding = DomEncodingType.etLatin7;
- else if ( (encodeString.IndexOf("ISO-8859-14") != -1) |
- (encodeString.IndexOf("LATIN-8") != -1) )
- Fencoding = DomEncodingType.etLatin8;
- else if ( (encodeString.IndexOf("ISO-8859-15") != -1) |
- (encodeString.IndexOf("LATIN-9") != -1) )
- Fencoding = DomEncodingType.etLatin9;
- else if (encodeString.IndexOf("KOI8-R") != -1)
- Fencoding = DomEncodingType.etKOI8R;
- else if (encodeString.IndexOf("CP10000_MACROMAN") != -1)
- Fencoding = DomEncodingType.etcp10000_MacRoman;
- else if ( (encodeString.IndexOf("Windows-1250") != -1) |
- (encodeString.IndexOf("CP1250") != -1) )
- Fencoding = DomEncodingType.etcp1250;
- else if ( (encodeString.IndexOf("Windows-1251") != -1) |
- (encodeString.IndexOf("CP1251") != -1) )
- Fencoding = DomEncodingType.etcp1251;
- else if ( (encodeString.IndexOf("Windows-1252") != -1) |
- (encodeString.IndexOf("CP1252") != -1) )
- Fencoding = DomEncodingType.etcp1252;
- }
- }
-
- }
- catch
- {
- Fencoding = DomEncodingType.etUTF8;
- }
-
- FStream.Seek(0, SeekOrigin.Begin);
- }
-
- /// <summary>
- /// Helper function to try and find the encoding attribute value in
- /// declaration tag. Does not do well-formedness checks.
- /// </summary>
- /// <param name="tag">string to scan</param>
- /// <exception cref="InvalidOperationException">If bad encoding char found, mis-matched quotes, or no equals sign.</exception>
- /// <returns>encoding, or string.Empty if it is not found.</returns>
- private string readEncodingAttrFromTag( string tag )
- {
- int encodeIndex = tag.IndexOf("encoding");
- if ( encodeIndex == -1)
- return string.Empty;
- else
- {
- int curIndex = encodeIndex + "encoding".Length;
- bool firstQuoteFound = false;
- bool equalsFound = false;
- char quoteChar = (char) 0xffff; // c# insists on initialization...
- string encoding = "";
-
- while ( curIndex != tag.Length )
- {
- char c = tag[curIndex];
- curIndex++;
-
- if ( c == '=')
- {
- equalsFound = true;
- continue;
- }
-
- if ( (c== '\"') | (c=='\'') )
- {
- if ( !firstQuoteFound & !equalsFound)
- throw new InvalidOperationException("No equals sign found in encoding attribute");
- else if ( firstQuoteFound )
- {
- if (c == quoteChar)
- return encoding;
- else
- throw new InvalidOperationException("non-matching quotes in attribute value");
- }
- else
- {
- firstQuoteFound = true;
- quoteChar = c;
- continue;
- }
- }
- else if (firstQuoteFound)
- {
- if ( ( c >= 'a') & ( c <= 'z')) encoding += c;
- else if ( ( c >= 'A') & ( c <= 'Z')) encoding += c;
- else if ( ( c >= '0') & ( c <= '9')) encoding += c;
- else if ( c == '_' ) encoding += c;
- else if ( c == '-') encoding += c;
- else if (c == '.') encoding += c;
- else
- throw new InvalidOperationException("invalid character in encoding attribute");
- }
- }
- return string.Empty;
- }
- }
-
- private void evaluate(char c)
- {
- if (FLastWCharWasLF)
- {
- FLineNumber++;
- FLastWCharWasLF = false;
- FColumnNumber = 1;
- }
- else
- FColumnNumber++;
-
- if (c == (char) 10 )
- FLastWCharWasLF = true;
-
- if (FPieceEndSet)
- pieceStart();
- }
-
- public void pieceEnd()
- {
- FPieceEndSet = true;
- }
-
- public void pieceStart()
- {
- FStartColumnNumber = FColumnNumber;
- FStartLineNumber = FLineNumber;
- FPieceEndSet = false;
- }
-
- /// <summary>
- /// Return true if input stream is at EOF.
- /// </summary>
- /// <returns></returns>
- public bool atEOF()
- {
- return (FStream.Length == FStream.Position);
- }
-
- /// <summary>
- /// Sets the internal root name by analyzing the tags at the beginning of the stream.
- /// root name is:
- /// - the element tag of the first element found
- /// - the root name listed in a !DOCTYPE tag
- /// - empty if a parse error occurs, or no applicable tags are found.
- /// Does not do well-formedness checks - skips comments and proc. instructions
- /// </summary>
- private void getRootName()
- {
- reset();
- FrootName = string.Empty;
-
- while ( ! atEOF() )
- {
- string tag = "<";
- char c = getNextChar();
-
- // skip whitespace to first tag
- while ( !atEOF() && (XmlNames_1_0.IsXmlWhiteSpace( c )) )
- c = getNextChar();
- if ( (c != '<') | atEOF() ) break;
-
- while ( !atEOF() & ( c != '>' ) )
- {
- c = getNextChar();
- tag += c;
- }
- if ( atEOF() ) break;
-
- // Only allow 1) comments, 2) processing instructions before <!DOCTYPE ...>
- if ( tag.StartsWith("<?") ) // Processing instruction
- continue;
- else if ( tag.StartsWith("<--") ) // comment
- continue;
- else if ( tag.StartsWith("<!DOCTYPE") ) // what we're looking for...
- {
- setRootName( tag );
- break;
- }
- // no DOCTYPE tag? Use the first element tag as the root
- else if ( tag.StartsWith( "<" ) )
- setRootName( tag );
- // we hit a non-comment, processing instruction or declaration, we ain't gonna get it
- else
- {
- FrootName = string.Empty;
- break;
- }
- }
- }
-
- private void setRootName( string doctypeTag )
- {
- int start = doctypeTag.IndexOf("<DOCTYPE");
- if ( start == -1 )
- start = 1; // set from element
- else
- start += "<DOCTYPE".Length;
- while ( ( start != doctypeTag.Length ) & XmlNames_1_0.IsXmlWhiteSpace( doctypeTag[start] ) )
- start++;
-
- string tmp = string.Empty;
-
- while ( ( start != doctypeTag.Length ) &&
- !XmlNames_1_0.IsXmlWhiteSpace(doctypeTag[start]) &&
- (doctypeTag[start] != '>') &&
- (doctypeTag[start] != '[') &&
- (doctypeTag[start] != '/') )
- tmp += doctypeTag[start];
-
- if (XmlNames_1_0.isXmlName(tmp) ) FrootName = tmp;
- }
-
- /// <summary>
- /// Read in the next character (either UTF-8 or UTF-16) and convert by charset
- /// Normalize CR/LF pairs to single CR.
- /// </summary>
- /// <returns></returns>
- public char getNextChar()
- {
- byte[] buf = new byte[2];
- char retval = (char) 0xffff;
- int bCount;
-
- switch(Fencoding)
- {
- case DomEncodingType.etLatin1:
- bCount = stream.Read(buf,0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_1ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etLatin2:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_2ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etLatin3:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_3ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etLatin4:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_4ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etCyrillic:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_5ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etArabic:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_6ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etGreek:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_7ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etHebrew:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_8ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etLatin5:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_9ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etLatin6:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_10ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etLatin7:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_13ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etLatin8:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_14ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etLatin9:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.Iso8859_15ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etKOI8R:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.KOI8_RToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etcp10000_MacRoman:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.cp10000_MacRomanToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etcp1250:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.cp1250ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etcp1251:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.cp1251ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etcp1252:
- bCount = stream.Read(buf, 0, 1);
- if (bCount == 1)
- retval = XmlUtil.cp1252ToUTF16Char(buf[0]);
- break;
- case DomEncodingType.etUTF8:
- if ( FLastUcs4 >= 0x10000)
- {
- // Output low surrogate
- retval = XmlUtil.Utf16LowSurrogate(FLastUcs4);
- FLastUcs4 = 0;
- }
- else
- {
- FLastUcs4 = XmlUtil.ReadUTF8Char( stream );
- if ( FLastUcs4 >= 0x10000)
- retval = XmlUtil.Utf16HighSurrogate(FLastUcs4);
- else
- retval = (char) FLastUcs4;
- }
- break;
- case DomEncodingType.etUTF16BE:
- bCount = stream.Read(buf, 0, 2);
- if (bCount == 2)
- retval = System.Convert.ToChar( (buf[0] << 16) + buf[1] );
- break;
- case DomEncodingType.etUTF16LE:
- bCount = stream.Read(buf, 0, 2);
- if (bCount == 2)
- retval = System.Convert.ToChar( (buf[1] << 16) + buf[0] );
- break;
- }
-
- // normalize CRLF or a single CR to LF:
- if ( (retval == 0x000D) & FLastCharWasCR) // 0x000d = CR
- {
- FLastCharWasCR = false;
- return getNextChar();
- }
- else if ( retval == 0x000A) // 0x000a = LF
- {
- FLastCharWasCR = true;
- return (char) 0x000D;
- }
- else
- FLastCharWasCR = false;
-
- evaluate(retval);
- return retval;
- }
-
- /// <summary>
- /// Reset the Input to the origin and clear internal variables.
- /// </summary>
- public void reset()
- {
- FLastUcs4 = 0;
- FLastCharWasCR = false;
-
- switch(Fencoding)
- {
- // skip the leading 0xfeff/oxfffe on UTF-16 streams
- case DomEncodingType.etUTF16BE:
- FStream.Seek(2, SeekOrigin.Begin);
- break;
- case DomEncodingType.etUTF16LE:
- FStream.Seek(2, SeekOrigin.Begin);
- break;
- default:
- FStream.Seek(0, SeekOrigin.Begin);
- break;
- }
-
- FColumnNumber = 0;
- FLineNumber = 0;
- FStartColumnNumber = 0;
- FStartLineNumber = 0;
- FLastWCharWasLF = true;
- pieceEnd();
- }
-
-/*
- * private
-
-
- protected
- function getStreamAsWideString: wideString; virtual;
- procedure skipTextDecl(const locator: TdomStandardLocator); virtual;
- public
- constructor create(const stream: TStream;
- const publicId,
- systemId: wideString); virtual;
- destructor destroy; override;
-
-
-*/
- // Constructor
- //===========================================================================
- XmlInputSource(Stream inputStream, string publicID, string systemID)
- {
- if (inputStream == null)
- throw new NullReferenceException("Null stream passed to XmlInputSource constructor");
-
- FStream = inputStream;
- FLastUcs4 = 0;
- FLastCharWasCR = false;
- FpublicID = publicID;
- FsystemID = systemID;
- setEncodingType();
- //FLocator:= TdomStandardLocator.create(self);
- getRootName();
- }
- }
-
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlLinkedNode.cs b/mcs/class/System.XML/System.Xml/XmlLinkedNode.cs
deleted file mode 100644
index b277320b638..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlLinkedNode.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// System.Xml.XmlLinkedNode.cs
-//
-// Author: Daniel Weber (daniel-weber@austin.rr.com)
-//
-// Implementation of abstract Xml.XmlLinkedNode class
-
-using System;
-
-namespace System.Xml
-{
- public abstract class XmlLinkedNode : XmlNode
- {
- private XmlNode _nextSibling;
- private XmlNode _previousSibling;
-
- // ============ Properties ============================================
- //=====================================================================
- /// <summary>
- /// Get the node immediately following this node
- /// </summary>
- public override XmlNode NextSibling
- {
- get
- {
- return _nextSibling;
- }
- }
-
- /// <summary>
- /// Get the node immediately previous to this node
- /// </summary>
- public override XmlNode PreviousSibling
- {
- get
- {
- return _previousSibling;
- }
- }
-
- // Internal accessor methods
- //===========================================================================
- internal void setPreviousNode ( XmlNode previous )
- {
- _previousSibling = previous;
- }
-
- internal void setNextSibling ( XmlNode next )
- {
- _nextSibling = next;
- }
-
- // Constructors
- //===========================================================================
- internal XmlLinkedNode( XmlDocument aOwner ) : base(aOwner)
- {
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml/XmlNameTable.cs b/mcs/class/System.XML/System.Xml/XmlNameTable.cs
deleted file mode 100644
index 4f0df67af64..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNameTable.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlNameTable.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml
-{
- public abstract class XmlNameTable
- {
- public abstract string Add(string name);
- public abstract string Add(char[] buffer, int offset, int length);
- public abstract string Get(string name);
- public abstract string Get(char[] buffer, int offset, int length);
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNamedNodeMap.cs b/mcs/class/System.XML/System.Xml/XmlNamedNodeMap.cs
deleted file mode 100644
index e30aa7d4e42..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNamedNodeMap.cs
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// System.Xml.XmlNamedNodeMap.cs
-//
-// Author: Daniel Weber (daniel-weber@austin.rr.com)
-//
-// Implementation of abstract System.Xml.XmlNamedNodeMap class
-//
-// Credit for source code to Open XML 2.3.17
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
-
- public class XmlNamedNodeMap : IEnumerable
- {
- //=============== Class data structures ====================================
- // Use weak references for owners to prevent circular linkage
- protected XmlNode FOwner;
- protected XmlNode FOwnerNode;
-
- protected ArrayList FnodeList;
- private bool FNamespaceAware;
- private bool FIsReadonly;
-
- // ============ Public Properties =====================================
- //=====================================================================
- /// <summary>
- /// Get the count of nodes in the map
- /// </summary>
- public virtual int Count
- {
- get
- {
- return FnodeList.Count;
- }
- }
-
- // ============ Public Methods =====================================
- /// <summary>
- /// Get the node at the given index. Index is 0-based, top element is Count - 1
- /// </summary>
- /// <param name="index">index into array of XmlNode to get</param>
- /// <returns>XmlNode at index, or null if index out of range</returns>
- public virtual XmlNode Item(int index)
- {
- try
- {
- return FnodeList[index] as XmlNode; //FnodeList.Item(index);
- }
- catch (ArgumentOutOfRangeException)
- {
- return null;
- }
- }
-
- /// <summary>
- /// Get the node with the given name
- /// If the nodes have an associated namespace, use (localName, namespaceURI) instead
- /// </summary>
- /// <param name="name">name of the node to return</param>
- /// <returns>XmlNode, or null if node not found</returns>
- public virtual XmlNode GetNamedItem(string name)
- {
- // Can't return without a namespace to lookup
- // SDK doesn't specify an exception to throw, so just return null
- if (FNamespaceAware)
- return null;
-
- foreach (XmlNode cur in FnodeList)
- {
- if (cur.Name == name)
- return cur;
- }
-
- return null;
-
- }
-
- /// <summary>
- /// Get the node with localName in given namespaceURI
- /// </summary>
- /// <param name="localName">localName of node</param>
- /// <param name="namespaceURI">namespace of node</param>
- /// <returns>XmlNode at location, or null</returns>
- public virtual XmlNode GetNamedItem(string localName, string namespaceURI)
- {
- // No namespace data in objects, can't lookup
- // SDK doesn't specify an exception to throw, so just return null
- if (! FNamespaceAware)
- return null;
-
- foreach (XmlNode cur in FnodeList)
- {
- if ((cur.Name == localName) & (cur.NamespaceURI == namespaceURI))
- return cur;
- }
- return null;
-
- }
-
- /// <summary>
- /// Get the enumerator for the node map
- /// </summary>
- /// <returns>Enumerator</returns>
- public virtual IEnumerator GetEnumerator()
- {
- return FnodeList.GetEnumerator();
- }
-
-
- /// <summary>
- /// Removes the node with given name from the Map and returns it.
- /// If the node is namespace aware, use RemoveNamedItem(localName, namespaceURI) instead
- /// </summary>
- /// <param name="name">node name</param>
- /// <returns>Removed node, or null if node not found</returns>
- public virtual XmlNode RemoveNamedItem(string name)
- {
- // Can't return without a namespace to lookup
- // SDK doesn't specify an exception to throw, so just return null
- if (FNamespaceAware)
- return null;
-
- for (int i = 0; i < FnodeList.Count; i++)
- {
- XmlNode cur = FnodeList[i] as XmlNode;
- if (cur.Name == name)
- {
- FnodeList.RemoveAt(i);
- return cur;
- }
- }
- return null;
- }
-
- /// <summary>
- /// Removes the node with given localName in namespaceURI
- /// If this XmlNamedNodeMap is not namespace aware, use RemoveNamedItem(name) instead.
- /// </summary>
- /// <param name="localName">local node name</param>
- /// <param name="namespaceURI">namespace node is in</param>
- /// <returns>Node that was removed, or null if no node found</returns>
- public virtual XmlNode RemoveNamedItem(string localName, string namespaceURI)
- {
- // No namespace data in objects, can't lookup
- // SDK doesn't specify an exception to throw, so just return null
- if (! FNamespaceAware) // NOT _namespaceAware
- return null;
-
- for (int i = 0; i < FnodeList.Count; i++)
- {
- XmlNode cur = FnodeList[i] as XmlNode;
- if ((cur.Name == localName) & (cur.NamespaceURI == namespaceURI))
- {
- FnodeList.RemoveAt(i);
- return cur;
- }
- }
- return null;
- }
-
- /// <summary>
- /// Adds the passed node using the name property
- /// If a node with this name exists, it is returned, otherwise null is returned.
- /// </summary>
- /// <exception cref="ArgumentException">Raised if node was created from another docuement, or XmlNamedNodeMap is read-only</exception>
- /// <exception cref="InvalidOperationException">Node is an XmlAttribute of another XmlElement</exception>
- /// <param name="node"></param>
- /// <returns></returns>
- public virtual XmlNode SetNamedItem(XmlNode node)
- {
- XmlNode retValue ; // Return value of method
-
- // Can't add to read-only Map
- if (FIsReadonly)
- throw new ArgumentException("Attempt to add node to read-only Node Map");
-
- //if FOwner.OwnerDocument <> arg.OwnerDocument then raise EWrong_Document_Err
- if (! FOwner.OwnerDocument.Equals(node.OwnerDocument))
- throw new ArgumentException("Cannot add node from another document");
-
- // if FNamespaceAware then raise ENamespace_Err.create('Namespace error.');
- if (FNamespaceAware)
- throw new InvalidOperationException("Invalid Operation: Can't add node by name to namespace aware node list");
-
- // Can't assign node that has a parent
- // TODO - is this check required/valid in the .NET API?
- //if assigned(arg.parentNode) then raise EInuse_Node_Err.create('In use node error.');
- if (node.ParentNode != null)
- throw new ArgumentException("In use node error");
-
- // XmlAttribute cannot be assigned to an element
- //if arg.NodeType = ntAttribute_Node
- // then if assigned((arg as TdomAttr).OwnerElement)
- // then if (arg as TdomAttr).OwnerElement <> FOwnerNode then raise EInuse_Attribute_Err.create('Inuse attribute error.');
-
- if (node is XmlAttribute)
- {
- if ((node as XmlAttribute).OwnerElement != null)
- {
- if (! FOwnerNode.Equals( (node as XmlAttribute).OwnerElement ))
- throw new InvalidOperationException("XmlAttribute is assigned to another element");
- }
- }
-
- /*
- if not (arg.NodeType in FAllowedNodeTypes) then raise EHierarchy_Request_Err.create('Hierarchy request error.');
- */
-
- if ( GetNamedItem(node.Name) != null)
- {
- retValue = RemoveNamedItem(node.Name);
- }
- else
- {
- retValue = null;
- }
-
- FnodeList.Add(node);
-
- // TODO - check that owner is set properly on adding an attribute node
-
- return retValue;
- }
-
- // ============ Constructors =========================================
- internal XmlNamedNodeMap(XmlNode aOwner, XmlNode aOwnerNode, ArrayList nodeList)
- {
- if (nodeList == null)
- nodeList = new ArrayList();
- else
- FnodeList = nodeList;
- FOwner = aOwner;
- FOwnerNode = aOwnerNode;
- FIsReadonly = false;
- FNamespaceAware = false;
- }
-
- // Add a default costructor to satisfy Visual Studio....
- // TODO - figure out a way to get rid of default constructor on XmlNamedNodeMap()
- internal XmlNamedNodeMap()
- {
- FnodeList = new ArrayList();
- FOwner = null;
- FOwnerNode = null;
- FIsReadonly = false;
- FNamespaceAware = false;
- }
-
- // ============ Internal Properties ===================================
- //=====================================================================
- internal bool IsReadOnly
- {
- get
- {
- return FIsReadonly;
- }
- set
- {
- FIsReadonly = value;
- }
- }
-
- internal bool NamespaceAware
- {
- get
- {
- return FNamespaceAware;
- }
- set
- {
- FNamespaceAware = value;
- }
- }
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml/XmlNames_1_0.cs b/mcs/class/System.XML/System.Xml/XmlNames_1_0.cs
deleted file mode 100755
index 54bd6116e0c..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNames_1_0.cs
+++ /dev/null
@@ -1,547 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// internal System.Xml.XmlNames
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-// Code ported from Open XML 2.3.17
-//
-// (C) 2001 Daniel Weber
-//
-
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Helper class to determine validity of Xml Names
- /// </summary>
- internal class XmlNames_1_0
- {
- // Private data members
-
- // public properties
-
- // public methods
-
- // Static methods
- /// <summary>
- /// Return true if char is a valid Xml character
- /// </summary>
- /// <param name="S">unicode character to check</param>
- /// <returns>true if valid XML character, false otherwise.</returns>
- public static bool IsXmlChar(char S)
- {
- // TODO - verify XmlNames.IsXmlChar(char) ranges correct
- if (S == 0x0009) return true;
- if (S == 0x000A) return true;
- if (S == 0x000D) return true;
- if (S == 0x0020) return true;
- if ( (S >= 0xE000) & (S <= 0xFFFD) ) return true;
- if ( (S >= 0xD800) & (S <=0xDBFF) ) return true;
- if ( (S >= 0xDC00) & (S <= 0xDFFF) ) return true;
- return false;
- }
-
- /// <summary>
- /// Returns true if char is a valid Xml whitespace character.
- /// S is in unicode.
- /// </summary>
- /// <param name="S"></param>
- /// <returns></returns>
- public static bool IsXmlWhiteSpace( char S)
- {
- // TODO - validate XmlNames.IsXmlWhiteSpace
- if (S == 0x0009) return true;
- if (S == 0x000A) return true;
- if (S == 0x000D) return true;
- if (S == 0x0020) return true;
- return false;
- }
-
- /// <summary>
- /// Return true if character is a valid Xml base character
- /// </summary>
- /// <param name="S">unicode character to check.</param>
- /// <returns></returns>
- public static bool IsXmlBaseChar(char S)
- {
- long c = System.Convert.ToInt64(S);
- c = c >> 16;
-
- // Taken directly from Appendix B of the XML 1.0 spec
- // Do a switch on the high byte to minimize if's on each character.
- switch (c)
- {
- case 0:
- if ( (S >= 0x0041) & (S <= 0x005a) ) return true;
- if ( (S >= 0x0061) & (S <= 0x007a) ) return true;
- if ( (S >= 0x00c0) & (S <= 0x00d6) ) return true;
- if ( (S >= 0x00d8) & (S <= 0x00f6) ) return true;
- if ( (S >= 0x00f8) & (S <= 0x00ff) ) return true;
- break;
- case 1:
- if ( (S >= 0x0100) & (S <= 0x0131) ) return true;
- if ( (S >= 0x0134) & (S <= 0x013E) ) return true;
-
- if ( (S >= 0x0141) & (S <= 0x0148) ) return true;
- if ( (S >= 0x014a) & (S <= 0x017e) ) return true;
- if ( (S >= 0x0180) & (S <= 0x01c3) ) return true;
-
- if ( (S >= 0x01cd) & (S <= 0x01f0) ) return true;
- if ( (S >= 0x01f4) & (S <= 0x01f5) ) return true;
- if (S >= 0x01fa) return true;
- break;
- case 2:
- if ( (S >= 0x01fa) & (S <= 0x0217) ) return true;
- if ( (S >= 0x0250) & (S <= 0x02a8) ) return true;
- if ( (S >= 0x02bb) & (S <= 0x02c1) ) return true;
- break;
- case 3:
- if ( S == 0x0386) return true;
- if ( (S >= 0x0388) & (S <= 0x038a) ) return true;
- if ( S == 0x038c) return true;
- if ( (S >= 0x038e) & (S <= 0x03a1) ) return true;
- if ( (S >= 0x03a3) & (S <= 0x03ce) ) return true;
- if ( (S >= 0x03D0) & (S <= 0x03D6) ) return true;
-
- if ( S == 0x03DA) return true;
- if ( S == 0x03DC) return true;
- if ( S == 0x03DE) return true;
- if ( S == 0x03E0) return true;
- if ( (S >= 0x03E2) & (S <= 0x03F3) ) return true;
- break;
- case 4:
- if ( (S >= 0x0401) & (S <= 0x040C) ) return true;
- if ( (S >= 0x040E) & (S <= 0x044F) ) return true;
-
- if ( (S >= 0x0451) & (S <= 0x045C) ) return true;
- if ( (S >= 0x045E) & (S <= 0x0481) ) return true;
- if ( (S >= 0x0490) & (S <= 0x04C4) ) return true;
- if ( (S >= 0x04C7) & (S <= 0x04C8) ) return true;
- if ( (S >= 0x04CB) & (S <= 0x04CC) ) return true;
-
- if ( (S >= 0x04D0) & (S <= 0x04EB) ) return true;
- if ( (S >= 0x04EE) & (S <= 0x04F5) ) return true;
- if ( (S >= 0x04F8) & (S <= 0x04F9) ) return true;
- break;
- case 5:
- if ( (S >= 0x0531) & (S <= 0x0556) ) return true;
- if ( S == 0x0559) return true;
-
- if ( (S >= 0x0561) & (S <= 0x0586) ) return true;
- if ( (S >= 0x05D0) & (S <= 0x05EA) ) return true;
- if ( (S >= 0x05F0) & (S <= 0x05F2) ) return true;
- break;
- case 6:
- if ( (S >= 0x0621) & (S <= 0x063A) ) return true;
- if ( (S >= 0x0641) & (S <= 0x064A) ) return true;
- if ( (S >= 0x0671) & (S <= 0x06B7) ) return true;
- if ( (S >= 0x06BA) & (S <= 0x06BE) ) return true;
- if ( (S >= 0x06C0) & (S <= 0x06CE) ) return true;
- if ( (S >= 0x06D0) & (S <= 0x06D3) ) return true;
- if ( S == 0x06D5) return true;
- if ( (S >= 0x06E5) & (S <= 0x06E6) ) return true;
- break;
- case 9:
- if ( (S >= 0x0905) & (S <= 0x0939) ) return true;
- if ( S == 0x093D) return true;
- if ( (S >= 0x0958) & (S <= 0x0961) ) return true;
- if ( (S >= 0x0985) & (S <= 0x098C) ) return true;
- if ( (S >= 0x098F) & (S <= 0x0990) ) return true;
- if ( (S >= 0x0993) & (S <= 0x09A8) ) return true;
- if ( (S >= 0x09AA) & (S <= 0x09B0) ) return true;
- if ( S == 0x09B2) return true;
- if ( (S >= 0x09B6) & (S <= 0x09B9) ) return true;
- if ( (S >= 0x09DC) & (S <= 0x09DD) ) return true;
- if ( (S >= 0x09DF) & (S <= 0x09E1) ) return true;
- if ( (S >= 0x09F0) & (S <= 0x09F1) ) return true;
- break;
- case 10: // 0x0Ann
- if ( (S >= 0x0A05) & (S <= 0x0A0A) ) return true;
- if ( (S >= 0x0A0F) & (S <= 0x0A10) ) return true;
- if ( (S >= 0x0A13) & (S <= 0x0A28) ) return true;
- if ( (S >= 0x0A2A) & (S <= 0x0A30) ) return true;
- if ( (S >= 0x0A32) & (S <= 0x0A33) ) return true;
- if ( (S >= 0x0A35) & (S <= 0x0A36) ) return true;
- if ( (S >= 0x0A38) & (S <= 0x0A39) ) return true;
- if ( (S >= 0x0A59) & (S <= 0x0A5C) ) return true;
- if ( S == 0x0A5E) return true;
- if ( (S >= 0x0A72) & (S <= 0x0A74) ) return true;
- if ( (S >= 0x0A85) & (S <= 0x0A8B) ) return true;
- if ( S == 0x0A8D) return true;
- if ( (S >= 0x0A8F) & (S <= 0x0A91) ) return true;
- if ( (S >= 0x0A93) & (S <= 0x0AA8) ) return true;
- if ( (S >= 0x0AAA) & (S <= 0x0AB0) ) return true;
- if ( (S >= 0x0AB2) & (S <= 0x0AB3) ) return true;
- if ( (S >= 0x0AB5) & (S <= 0x0AB9) ) return true;
- if ( S == 0x0ABD) return true;
- if ( S == 0x0AE0) return true;
- break;
- case 11: // 0x0Bnn
- if ( (S >= 0x0B05) & (S <= 0x0B0C) ) return true;
- if ( (S >= 0x0B0F) & (S <= 0x0B10) ) return true;
- if ( (S >= 0x0B13) & (S <= 0x0B28) ) return true;
- if ( (S >= 0x0B2A) & (S <= 0x0B30) ) return true;
- if ( (S >= 0x0B32) & (S <= 0x0B33) ) return true;
- if ( (S >= 0x0B36) & (S <= 0x0B39) ) return true;
- if ( S == 0x0B3D) return true;
- if ( (S >= 0x0B5C) & (S <= 0x0B5D) ) return true;
- if ( (S >= 0x0B5F) & (S <= 0x0B61) ) return true;
- if ( (S >= 0x0B85) & (S <= 0x0B8A) ) return true;
- if ( (S >= 0x0B8E) & (S <= 0x0B90) ) return true;
- if ( (S >= 0x0B92) & (S <= 0x0B95) ) return true;
- if ( (S >= 0x0B99) & (S <= 0x0B9A) ) return true;
- if ( S == 0x0B9C) return true;
- if ( (S >= 0x0B9E) & (S <= 0x0B9F) ) return true;
- if ( (S >= 0x0BA3) & (S <= 0x0BA4) ) return true;
- if ( (S >= 0x0BA8) & (S <= 0x0BAA) ) return true;
- if ( (S >= 0x0BAE) & (S <= 0x0BB5) ) return true;
- if ( (S >= 0x0BB7) & (S <= 0x0BB9) ) return true;
- break;
- case 12: // 0x0Cnn
- if ( (S >= 0x0C05) & (S <= 0x0C0C) ) return true;
- if ( (S >= 0x0C0E) & (S <= 0x0C10) ) return true;
- if ( (S >= 0x0C12) & (S <= 0x0C28) ) return true;
- if ( (S >= 0x0C2A) & (S <= 0x0C33) ) return true;
- if ( (S >= 0x0C35) & (S <= 0x0C39) ) return true;
- if ( (S >= 0x0C60) & (S <= 0x0C61) ) return true;
- if ( (S >= 0x0C85) & (S <= 0x0C8C) ) return true;
- if ( (S >= 0x0C8E) & (S <= 0x0C90) ) return true;
- if ( (S >= 0x0C92) & (S <= 0x0CA8) ) return true;
- if ( (S >= 0x0CAA) & (S <= 0x0CB3) ) return true;
- if ( (S >= 0x0CB5) & (S <= 0x0CB9) ) return true;
- if ( S == 0x0CDE) return true;
- if ( (S >= 0x0CE0) & (S <= 0x0CE1) ) return true;
- break;
- case 13: // 0x0Dnn
- if ( (S >= 0x0D05) & (S <= 0x0D0C) ) return true;
- if ( (S >= 0x0D0E) & (S <= 0x0D10) ) return true;
- if ( (S >= 0x0D12) & (S <= 0x0D28) ) return true;
- if ( (S >= 0x0D2A) & (S <= 0x0D39) ) return true;
- if ( (S >= 0x0D60) & (S <= 0x0D61) ) return true;
- break;
- case 14: // 0x0Enn
- if ( (S >= 0x0E01) & (S <= 0x0E2E) ) return true;
- if ( S == 0x0E30) return true;
- if ( (S >= 0x0E32) & (S <= 0x0E33) ) return true;
- if ( (S >= 0x0E40) & (S <= 0x0E45) ) return true;
- if ( (S >= 0x0E81) & (S <= 0x0E82) ) return true;
- if ( S == 0x0E84) return true;
- if ( (S >= 0x0E87) & (S <= 0x0E88) ) return true;
- if ( S == 0x0E8A) return true;
- if ( S == 0x0E8D) return true;
- if ( (S >= 0x0E94) & (S <= 0x0E97) ) return true;
- if ( (S >= 0x0E99) & (S <= 0x0E9F) ) return true;
- if ( (S >= 0x0EA1) & (S <= 0x0EA3) ) return true;
- if ( S == 0x0EA5) return true;
- if ( S == 0x0EA7) return true;
- if ( (S >= 0x0EAA) & (S <= 0x0EAB) ) return true;
- if ( (S >= 0x0EAD) & (S <= 0x0EAE) ) return true;
- if ( S == 0x0EB0) return true;
- if ( (S >= 0x0EB2) & (S <= 0x0EB3) ) return true;
- if ( S == 0x0EBD) return true;
- if ( (S >= 0x0EC0) & (S <= 0x0EC4) ) return true;
- break;
- case 0x0F:
- if ( (S >= 0x0F40) & (S <= 0x0F47) ) return true;
- if ( (S >= 0x0F49) & (S <= 0x0F69) ) return true;
- break;
- case 0x10:
- if ( (S >= 0x10A0) & (S <= 0x10C5) ) return true;
- if ( (S >= 0x10D0) & (S <= 0x10F6) ) return true;
- break;
- case 0x11:
- if ( S == 0x1100) return true;
- if ( (S >= 0x1102) & (S <= 0x1103) ) return true;
- if ( (S >= 0x1105) & (S <= 0x1107) ) return true;
- if ( S == 0x1109) return true;
- if ( (S >= 0x110B) & (S <= 0x110C) ) return true;
- if ( (S >= 0x110E) & (S <= 0x1112) ) return true;
- if ( S == 0x113C) return true;
- if ( S == 0x113E) return true;
- if ( S == 0x1140) return true;
- if ( S == 0x114C) return true;
- if ( S == 0x114E) return true;
- if ( S == 0x1150) return true;
- if ( (S >= 0x1154) & (S <= 0x1155) ) return true;
- if ( S == 0x1159) return true;
- if ( (S >= 0x115F) & (S <= 0x1161) ) return true;
- if ( S == 0x1163) return true;
- if ( S == 0x1165) return true;
- if ( S == 0x1167) return true;
- if ( S == 0x1169) return true;
- if ( (S >= 0x116D) & (S <= 0x116E) ) return true;
- if ( (S >= 0x1172) & (S <= 0x1173) ) return true;
- if ( S == 0x1175) return true;
- if ( S == 0x119E) return true;
- if ( S == 0x11A8) return true;
- if ( S == 0x11AB) return true;
- if ( (S >= 0x11AE) & (S <= 0x11AF) ) return true;
- if ( (S >= 0x11B7) & (S <= 0x11B8) ) return true;
- if ( S == 0x11BA) return true;
- if ( (S >= 0x11BC) & (S <= 0x11C2) ) return true;
- if ( S == 0x11EB) return true;
- if ( S == 0x11F0) return true;
- if ( S == 0x11F9) return true;
- break;
- case 0x1E:
- if ( (S >= 0x1E00) & (S <= 0x1E9B) ) return true;
- if ( (S >= 0x1EA0) & (S <= 0x1EF9) ) return true;
- break;
- case 0x1F:
- if ( (S >= 0x1F00) & (S <= 0x1F15) ) return true;
- if ( (S >= 0x1F18) & (S <= 0x1F1D) ) return true;
- if ( (S >= 0x1F20) & (S <= 0x1F45) ) return true;
- if ( (S >= 0x1F48) & (S <= 0x1F4D) ) return true;
- if ( (S >= 0x1F50) & (S <= 0x1F57) ) return true;
- if ( S == 0x1F59) return true;
- if ( S == 0x1F5B) return true;
- if ( S == 0x1F5D) return true;
- if ( (S >= 0x1F5F) & (S <= 0x1F7D) ) return true;
- if ( (S >= 0x1F80) & (S <= 0x1FB4) ) return true;
- if ( (S >= 0x1FB6) & (S <= 0x1FBC) ) return true;
- if ( S == 0x1FBE) return true;
- if ( (S >= 0x1FC2) & (S <= 0x1FC4) ) return true;
- if ( (S >= 0x1FC6) & (S <= 0x1FCC) ) return true;
- if ( (S >= 0x1FD0) & (S <= 0x1FD3) ) return true;
- if ( (S >= 0x1FD6) & (S <= 0x1FDB) ) return true;
- if ( (S >= 0x1FE0) & (S <= 0x1FEC) ) return true;
- if ( (S >= 0x1FF2) & (S <= 0x1FF4) ) return true;
- if ( (S >= 0x1FF6) & (S <= 0x1FFC) ) return true;
- break;
- case 33: // 0x21nn
- if ( S == 0x2126) return true;
- if ( (S >= 0x212A) & (S <= 0x212B) ) return true;
- if ( S == 0x212E) return true;
- if ( (S >= 0x2180) & (S <= 0x2182) ) return true;
- break;
- case 48: // 0x30nn
- if ( (S >= 0x3041) & (S <= 0x3094) ) return true;
- if ( (S >= 0x30A1) & (S <= 0x30FA) ) return true;
- break;
- case 49: // 0x31nn
- if ( (S >= 0x3105) & (S <= 0x312C) ) return true;
- break;
- default:
- if ( (S >= 0xAC00) & (S <= 0xd7a3) ) return true;
- break;
- }
-
- return false;
- }
-
- /// <summary>
- /// Return true if S is a valid Xml Ideographic
- /// </summary>
- /// <param name="S">unicode character to check.</param>
- /// <returns></returns>
- public static bool IsXmlIdeographic( char S )
- {
- if ( (S >= 0x4E00) & (S <= 0x9FA5) ) return true;
- if ( S == 0x3007) return true;
- if ( (S >= 0x3021) & (S <= 0x3029) ) return true;
- return false;
-
- }
-
- /// <summary>
- /// Return true if S is a valid Xml combining character.
- /// </summary>
- /// <param name="S">Unicode character to check</param>
- /// <returns></returns>
- public static bool IsXmlCombiningChar( char S )
- {
- if ( (S >= 0x0300) & (S <= 0x0345) ) return true;
- if ( (S >= 0x0360) & (S <= 0x0361) ) return true;
- if ( (S >= 0x0483) & (S <= 0x0486) ) return true;
- if ( (S >= 0x0591) & (S <= 0x05A1) ) return true;
- if ( (S >= 0x05A3) & (S <= 0x05B9) ) return true;
- if ( (S >= 0x05BB) & (S <= 0x05BD) ) return true;
- if ( S == 0x05BF) return true;
- if ( (S >= 0x05C1) & (S <= 0x05C2) ) return true;
- if ( S == 0x05C4) return true;
- if ( (S >= 0x064B) & (S <= 0x0652) ) return true;
- if ( S == 0x0670) return true;
- if ( (S >= 0x06D6) & (S <= 0x06DC) ) return true;
- if ( (S >= 0x06DD) & (S <= 0x06DF) ) return true;
- if ( (S >= 0x06E0) & (S <= 0x06E4) ) return true;
- if ( (S >= 0x06E7) & (S <= 0x06E8) ) return true;
- if ( (S >= 0x06EA) & (S <= 0x06ED) ) return true;
- if ( (S >= 0x0901) & (S <= 0x0903) ) return true;
- if ( S == 0x093C) return true;
- if ( (S >= 0x093E) & (S <= 0x094C) ) return true;
- if ( S == 0x094D) return true;
- if ( (S >= 0x0951) & (S <= 0x0954) ) return true;
- if ( (S >= 0x0962) & (S <= 0x0963) ) return true;
- if ( (S >= 0x0981) & (S <= 0x0983) ) return true;
- if ( S == 0x09BC) return true;
- if ( S == 0x09BE) return true;
- if ( S == 0x09BF) return true;
- if ( (S >= 0x09C0) & (S <= 0x09C4) ) return true;
- if ( (S >= 0x09C7) & (S <= 0x09C8) ) return true;
- if ( (S >= 0x09CB) & (S <= 0x09CD) ) return true;
- if ( S == 0x09D7) return true;
- if ( (S >= 0x09E2) & (S <= 0x09E3) ) return true;
- if ( S == 0x0A02) return true;
- if ( S == 0x0A3C) return true;
- if ( S == 0x0A3E) return true;
- if ( S == 0x0A3F) return true;
- if ( (S >= 0x0A40) & (S <= 0x0A42) ) return true;
- if ( (S >= 0x0A47) & (S <= 0x0A48) ) return true;
- if ( (S >= 0x0A4B) & (S <= 0x0A4D) ) return true;
- if ( (S >= 0x0A70) & (S <= 0x0A71) ) return true;
- if ( (S >= 0x0A81) & (S <= 0x0A83) ) return true;
- if ( S == 0x0ABC) return true;
- if ( (S >= 0x0ABE) & (S <= 0x0AC5) ) return true;
- if ( (S >= 0x0AC7) & (S <= 0x0AC9) ) return true;
- if ( (S >= 0x0ACB) & (S <= 0x0ACD) ) return true;
- if ( (S >= 0x0B01) & (S <= 0x0B03) ) return true;
- if ( S == 0x0B3C) return true;
- if ( (S >= 0x0B3E) & (S <= 0x0B43) ) return true;
- if ( (S >= 0x0B47) & (S <= 0x0B48) ) return true;
- if ( (S >= 0x0B4B) & (S <= 0x0B4D) ) return true;
- if ( (S >= 0x0B56) & (S <= 0x0B57) ) return true;
- if ( (S >= 0x0B82) & (S <= 0x0B83) ) return true;
- if ( (S >= 0x0BBE) & (S <= 0x0BC2) ) return true;
- if ( (S >= 0x0BC6) & (S <= 0x0BC8) ) return true;
- if ( (S >= 0x0BCA) & (S <= 0x0BCD) ) return true;
- if ( S == 0x0BD7) return true;
- if ( (S >= 0x0C01) & (S <= 0x0C03) ) return true;
- if ( (S >= 0x0C3E) & (S <= 0x0C44) ) return true;
- if ( (S >= 0x0C46) & (S <= 0x0C48) ) return true;
- if ( (S >= 0x0C4A) & (S <= 0x0C4D) ) return true;
- if ( (S >= 0x0C55) & (S <= 0x0C56) ) return true;
- if ( (S >= 0x0C82) & (S <= 0x0C83) ) return true;
- if ( (S >= 0x0CBE) & (S <= 0x0CC4) ) return true;
- if ( (S >= 0x0CC6) & (S <= 0x0CC8) ) return true;
- if ( (S >= 0x0CCA) & (S <= 0x0CCD) ) return true;
- if ( (S >= 0x0CD5) & (S <= 0x0CD6) ) return true;
- if ( (S >= 0x0D02) & (S <= 0x0D03) ) return true;
- if ( (S >= 0x0D3E) & (S <= 0x0D43) ) return true;
- if ( (S >= 0x0D46) & (S <= 0x0D48) ) return true;
- if ( (S >= 0x0D4A) & (S <= 0x0D4D) ) return true;
- if ( S == 0x0D57) return true;
- if ( S == 0x0E31) return true;
- if ( (S >= 0x0E34) & (S <= 0x0E3A) ) return true;
- if ( (S >= 0x0E47) & (S <= 0x0E4E) ) return true;
- if ( S == 0x0EB1) return true;
- if ( (S >= 0x0EB4) & (S <= 0x0EB9) ) return true;
- if ( (S >= 0x0EBB) & (S <= 0x0EBC) ) return true;
- if ( (S >= 0x0EC8) & (S <= 0x0ECD) ) return true;
- if ( (S >= 0x0F18) & (S <= 0x0F19) ) return true;
- if ( S == 0x0F35) return true;
- if ( S == 0x0F37) return true;
- if ( S == 0x0F39) return true;
- if ( S == 0x0F3E) return true;
- if ( S == 0x0F3F) return true;
- if ( (S >= 0x0F71) & (S <= 0x0F84) ) return true;
- if ( (S >= 0x0F86) & (S <= 0x0F8B) ) return true;
- if ( (S >= 0x0F90) & (S <= 0x0F95) ) return true;
- if ( S == 0x0F97) return true;
- if ( (S >= 0x0F99) & (S <= 0x0FAD) ) return true;
- if ( (S >= 0x0FB1) & (S <= 0x0FB7) ) return true;
- if ( S == 0x0FB9) return true;
- if ( (S >= 0x20D0) & (S <= 0x20DC) ) return true;
- if ( S == 0x20E1) return true;
- if ( (S >= 0x302A) & (S <= 0x302F) ) return true;
- if ( S == 0x3099) return true;
- if ( S == 0x309A) return true;
-
- return false;
- }
-
- /// <summary>
- /// Return true if S is a valid Xml digit.
- /// </summary>
- /// <param name="S">Unicode character to check.</param>
- /// <returns>true if S is a valid unicode digit.</returns>
- public static bool IsXmlDigit( char S )
- {
- // TODO - validiate IsXmlDigit
- if ( (S >= 0x0030) & (S <= 0x0039) ) return true;
- if ( (S >= 0x0660) & (S <= 0x0669) ) return true;
- if ( (S >= 0x06F0) & (S <= 0x06F9) ) return true;
- if ( (S >= 0x0966) & (S <= 0x096F) ) return true;
- if ( (S >= 0x09E6) & (S <= 0x09EF) ) return true;
- if ( (S >= 0x0A66) & (S <= 0x0A6F) ) return true;
- if ( (S >= 0x0AE6) & (S <= 0x0AEF) ) return true;
- if ( (S >= 0x0B66) & (S <= 0x0B6F) ) return true;
- if ( (S >= 0x0BE7) & (S <= 0x0BEF) ) return true;
- if ( (S >= 0x0C66) & (S <= 0x0C6F) ) return true;
- if ( (S >= 0x0CE6) & (S <= 0x0CEF) ) return true;
- if ( (S >= 0x0D66) & (S <= 0x0D6F) ) return true;
- if ( (S >= 0x0E50) & (S <= 0x0E59) ) return true;
- if ( (S >= 0x0ED0) & (S <= 0x0ED9) ) return true;
- if ( (S >= 0x0F20) & (S <= 0x0F29) ) return true;
-
- return false;
- }
-
- /// <summary>
- /// Return true if S is a valid Xml Extender.
- /// </summary>
- /// <param name="S">unicode character to check.</param>
- /// <returns>true if S is a valid Xml Extender.</returns>
- public static bool IsXmlExtender ( char S )
- {
- if ( S == 0x00B7) return true;
- if ( S == 0x02D0) return true;
- if ( S == 0x02D1) return true;
- if ( S == 0x0387) return true;
- if ( S == 0x0640) return true;
- if ( S == 0x0E46) return true;
- if ( S == 0x0EC6) return true;
- if ( S == 0x3005) return true;
- if ( (S >= 0x3031) & ( S <= 0x3035) ) return true;
- if ( (S >= 0x309D) & ( S <= 0x309E) ) return true;
- if ( (S >= 0x30FC) & ( S <= 0x30FE) ) return true;
-
- return false;
- }
-
- public static bool IsXmlLetter(char S)
- {
- return IsXmlIdeographic(S) | IsXmlBaseChar(S);
- }
-
- /// <summary>
- /// Return true if S is a valid Xml name char.
- /// </summary>
- /// <param name="S">Unicode character to check</param>
- /// <returns>true if S is valid in an xml name.</returns>
- public static bool IsXmlNameChar ( char S )
- {
- if ( IsXmlLetter(S) | IsXmlDigit(S) | IsXmlCombiningChar(S) | IsXmlExtender(S) )
- return true;
- if ( (S == '.') | (S == '-') | (S == '_') | (S == ':') )
- return true;
- return false;
- }
-
- /// <summary>
- /// Return true if the passed string is a valid Xml 1.0 name
- /// </summary>
- /// <param name="s">String to check for validity</param>
- /// <returns>true if string is valid Xml name</returns>
- public static bool isXmlName( string s )
- {
- if ( s.Length == 0 ) return false;
-
- if ( !IsXmlLetter(s[0]) | (s[0] != '_') | (s[0] != ':') )
- return false;
-
- for (int i = 1; i < s.Length; i++)
- {
- if (! IsXmlNameChar( s[i] ) )
- return false;
- }
-
- return true;
- }
-
-
- // Constructors
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs b/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs
deleted file mode 100644
index 200706242c7..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlNamespaceManager.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System.Collections;
-
-namespace System.Xml
-{
- public class XmlNamespaceManager : IEnumerable
- {
- private XmlNameTable _NameTable;
- NamespaceScope _Top;
-
- public XmlNamespaceManager(XmlNameTable nameTable)
- {
- _NameTable = nameTable;
- PushScope();
- }
-
- public virtual string DefaultNamespace
- {
- get
- {
- return LookupNamespace(String.Empty);
- }
- }
-
- public XmlNameTable NameTable
- {
- get
- {
- return _NameTable;
- }
- }
-
- public virtual void AddNamespace(string prefix, string uri)
- {
- if (prefix == null)
- {
- throw new ArgumentNullException("prefix", "Value cannot be null.");
- }
-
- if (uri == null)
- {
- throw new ArgumentNullException("uri", "Value cannot be null.");
- }
-
- if (prefix.Length > 2 && prefix.Substring(0, 3).ToLower() == "xml")
- {
- throw new ArgumentException("Prefixes beginning with \"xml\" (regardless of whether the characters are uppercase, lowercase, or some combination thereof) are reserved for use by XML.", "prefix");
- }
-
- if (_Top.Namespaces == null)
- {
- _Top.Namespaces = new Hashtable();
- }
-
- _Top.Namespaces.Add(prefix, uri);
- }
-
- public virtual IEnumerator GetEnumerator()
- {
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public virtual bool HasNamespace(string prefix)
- {
- return _Top != null && _Top.Namespaces != null && _Top.Namespaces.Contains(prefix);
- }
-
- public virtual string LookupNamespace(string prefix)
- {
- NamespaceScope scope = _Top;
-
- while (scope != null)
- {
- if (scope.Namespaces != null && scope.Namespaces.Contains(prefix))
- {
- return scope.Namespaces[prefix] as string;
- }
-
- scope = scope.Next;
- }
-
- switch (prefix)
- {
- case "xmlns":
- return "http://www.w3.org/2000/xmlns/";
- case "xml":
- return "http://www.w3.org/XML/1998/namespace";
- case "":
- return String.Empty;
- }
-
- return null;
- }
-
- public virtual string LookupPrefix(string uri)
- {
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public virtual bool PopScope()
- {
- if (_Top != null)
- {
- _Top = _Top.Next;
- return true;
- }
-
- return false;
- }
-
- public virtual void PushScope()
- {
- NamespaceScope newScope = new NamespaceScope();
- newScope.Next = _Top;
- _Top = newScope;
- }
-
- public virtual void RemoveNamespace(string prefix, string uri)
- {
- // TODO: implement me.
- throw new NotImplementedException();
- }
- }
-
- internal class NamespaceScope
- {
- internal NamespaceScope Next;
- internal Hashtable Namespaces;
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNode.cs b/mcs/class/System.XML/System.Xml/XmlNode.cs
deleted file mode 100644
index eac9b6d1f34..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNode.cs
+++ /dev/null
@@ -1,749 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlNode
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-
-using System;
-using System.Collections;
-using System.Xml.XPath;
-
-namespace System.Xml
-{
- public abstract class XmlNode : ICloneable, IEnumerable, IXPathNavigable
- {
- //======= Private data members ==============================================
- private XmlNodeListAsArrayList _childNodes;
- protected XmlDocument FOwnerDocument;
- protected XmlNode _parent;
-
- // Names of node
- // for <foo:bar xmlns:foo="http://www.foobar.com/schema/foobar">... </foo:bar>
- // qualified name: foo:bar
- // namespaceURI = "http://www.foobar.com/schema/foobar"
- // localName = bar
- // prefix = foo
- // Note that namespaces can be nested (child namespace != parent namespace)
- // namespaces are optional
- protected string Fname;
- protected string FnamespaceURI;
- protected string Fprefix;
- protected string FlocalName;
-
- // baseURI holds the location from which the document was loaded
- // If the node was created from a document at c:\tmp.xml, then that's what will be here
- protected string FbaseURI;
-
- // value of the node (overriden in classes that do something different)
- // default behavior is just to store it
- protected string Fvalue;
-
- //=====================================================================
- // ============ Properties ============================================
- //=====================================================================
- /// <summary>
- /// Get the XmlAttributeCollection representing the attributes
- /// on the node type. Returns null if the node type is not XmlElement.
- /// </summary>
- public virtual XmlAttributeCollection Attributes
- {
- get
- {
- return null;
- }
- }
- /// <summary>
- /// Return the base Uniform Resource Indicator (URI) used to resolve
- /// this node, or String.Empty.
- /// </summary>
- public virtual string BaseURI
- {
- get
- {
- return FbaseURI;
- }
-
- }
- /// <summary>
- /// Return all child nodes of this node. If there are no children,
- /// return an empty XmlNodeList;
- /// </summary>
- public virtual XmlNodeList ChildNodes
- {
- get
- {
- if (_childNodes == null)
- _childNodes = new XmlNodeListAsArrayList();
-
- return _childNodes as XmlNodeList;
- }
- }
-
- /// <summary>
- /// Return first child node as XmlNode or null
- /// if the node has no children
- /// </summary>
- public virtual XmlNode FirstChild
- {
- get
- {
- if (ChildNodes.Count == 0)
- return null;
- else
- return ChildNodes[0];
- }
- }
-
- /// <summary>
- /// Return true if the node has children
- /// </summary>
- public virtual bool HasChildNodes
- {
- get
- {
- if (ChildNodes.Count == 0)
- return true;
- else
- return false;
- }
- }
-
- /// <summary>
- /// Get or Set the concatenated values of node and children
- /// </summary>
- public virtual string InnerText
- {
- get
- {
- // TODO - implement set InnerText()
- throw new NotImplementedException();
- }
-
- set
- {
- // TODO - implement set InnerText()
- throw new NotImplementedException();
- }
- }
-
- /// <summary>
- /// Get/Set the XML representing just the child nodes of this node
- /// </summary>
- public virtual string InnerXml
- {
- get
- {
- // TODO - implement set InnerXml()
- throw new NotImplementedException();
- }
-
- set
- {
- // TODO - implement set InnerXml()
- throw new NotImplementedException();
- }
- }
-
- /// <summary>
- /// Property Get - true if node is read-only
- /// </summary>
- public virtual bool IsReadOnly
- {
- get
- {
- return OwnerDocument.IsReadOnly;
- }
- }
-
- /// <summary>
- /// Return the child element named [string]. Returns XmlElement
- /// Indexer for XmlNode class.
- /// </summary>
- [System.Runtime.CompilerServices.IndexerNameAttribute("Item")]
- public virtual XmlElement this [String index]
- {
- get
- {
- // TODO - implement XmlNode.Item(string)
- throw new NotImplementedException();
- }
- }
-
- /// <summary>
- /// Get the last child node, or null if there are no nodes
- /// </summary>
- public virtual XmlNode LastChild
- {
- get
- {
- if (_childNodes.Count == 0)
- return null;
- else
- return _childNodes.Item(_childNodes.Count - 1);
- }
-
- }
-
- /// <summary>
- /// Returns the local name of the node with qualifiers removed
- /// LocalName of ns:elementName = "elementName"
- /// </summary>
- public abstract string LocalName {get;}
-
- /// <summary>
- /// Get the qualified node name
- /// derived classes must implement as behavior varies
- /// by tag type.
- /// </summary>
- public abstract string Name { get; }
-
- /// <summary>
- /// Get the namespace URI or String.Empty if none
- /// </summary>
- public virtual string NamespaceURI
- {
- get
- {
- // TODO - implement Namespace URI, or determine abstractness
- throw new NotImplementedException("XmlNode.NamespaceURI not implemented");
- }
- }
-
- /// <summary>
- /// Get the node immediatelly following this node, or null
- /// </summary>
- public virtual XmlNode NextSibling
- {
- get
- {
-
- if (_parent != null)
- {
- XmlNodeListAsArrayList children = _parent.ChildNodes as XmlNodeListAsArrayList;
- int ourIndex = children.data.IndexOf(this);
- return children[ourIndex + 1];
- }
- else
- return null;
- }
- }
-
- public virtual XmlNodeType NodeType
- {
- get
- {
- return XmlNodeType.None;
- }
- }
-
- /// <summary>
- /// Return the string representing this node and all it's children
- /// </summary>
- public virtual string OuterXml
- {
- get
- {
- // TODO - implement OuterXml {get;}
- throw new NotImplementedException();
- }
- }
-
- /// <summary>
- /// Return owning document.
- /// If this nodeType is a document, return null
- /// </summary>
- public virtual XmlDocument OwnerDocument
- {
- get
- {
- return FOwnerDocument;
- }
- }
-
- /// <summary>
- /// Returns the parent node, or null
- /// Return value depends on superclass node type
- /// </summary>
- public virtual XmlNode ParentNode
- {
- get
- {
- return _parent;
- }
- }
-
- /// <summary>
- /// set/get the namespace prefix for this node, or
- /// string.empty if it does not exist
- /// </summary>
- public virtual string Prefix
- {
- get
- {
- return Fprefix;
- }
-
- set
- {
- // TODO - validation on XmlNode.Prefix {set;}? (no)
- Fprefix = value;
- }
- }
-
- /// <summary>
- /// The preceding XmlNode or null
- /// </summary>
- public virtual XmlNode PreviousSibling {
- get
- {
- if (_parent != null)
- {
- XmlNodeListAsArrayList children = _parent.ChildNodes as XmlNodeListAsArrayList;
- int ourIndex = children.data.IndexOf(this);
- return children[ourIndex - 1];
- }
- else
- return null;
- }
- }
-
- /// <summary>
- /// Get/Set the value for this node
- /// </summary>
- public virtual string Value
- {
- get
- {
- return Fvalue;
- }
-
- set
- {
- Fvalue = value;
- }
- }
-
- //=====================================================================
- //======= Methods =====================================================
- //=====================================================================
- /// <summary>
- /// Appends the specified node to the end of the child node list
- /// </summary>
- /// <param name="newChild"></param>
- /// <returns></returns>
- public virtual XmlNode AppendChild (XmlNode newChild)
- {
- _childNodes.Add(newChild);
- return newChild;
- }
-
- /// <summary>
- /// Return a clone of this node
- /// </summary>
- /// <returns></returns>
- public virtual object Clone()
- {
- // TODO - implement XmlNode.Clone() as object
- throw new NotImplementedException("object XmlNode.Clone() not implmented");
- }
-
- /// <summary>
- /// Return a clone of the node
- /// </summary>
- /// <param name="deep">Make copy of all children</param>
- /// <returns>Cloned node</returns>
- public abstract XmlNode CloneNode( bool deep);
-
- /// <summary>
- /// Return an XPathNavigator for navigating this node
- /// </summary>
- /// <returns></returns>
- public System.Xml.XPath.XPathNavigator CreateNavigator()
- {
- // TODO - implement CreateNavigator()
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Provide support for "for each"
- /// </summary>
- /// <returns></returns>
- public IEnumerator GetEnumerator()
- {
- return _childNodes.data.GetEnumerator();
- }
-
- /// <summary>
- /// Look up the closest namespace for this node that is in scope for the given prefix
- /// </summary>
- /// <param name="prefix"></param>
- /// <returns>Namespace URI</returns>
- public virtual string GetNamespaceOfPrefix(string prefix)
- {
- // TODO - implement GetNamespaceOfPrefix()
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Get the closest xmlns declaration for the given namespace URI that is in scope.
- /// Returns the prefix defined in that declaration.
- /// </summary>
- /// <param name="namespaceURI"></param>
- /// <returns></returns>
- public virtual string GetPrefixOfNamespace(string namespaceURI)
- {
- // TODO - implement GetPrefixOfNamespace
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Insert newChild directly after the reference node.
- /// If refChild is null, newChild is inserted at the beginning of childnodes.
- /// If newChild is a document fragment, all nodes are inserted after refChild.
- /// If newChild is already in the tree, it is first removed.
- /// </summary>
- /// <exception cref="ArgumentException">NewChild was created from differant document.
- /// RefChild not a child of this node or null.
- /// Node is read-only</exception>
- /// <exception cref="InvalidOperationException">Node is of type that does not have children
- /// Node to insert is an ancestor of this node.</exception>
- /// <param name="newChild">Child node to insert.</param>
- /// <param name="refChild">Reference node to insert after</param>
- /// <returns>Removed node, or null if no node removed.</returns>
- public virtual XmlNode InsertAfter(XmlNode newChild, XmlNode refChild)
- {
- // Checks parent not ancestor, arguments valid, etc. Throws exception on error
- InsertionCheck(newChild, refChild);
-
- // Scan the node list, looking for refChild and seeing if newChild is in the list
- // Note that if refNode is null (prepend), we don't want to do the .Equals(null)
- XmlNode retval = null;
- int refNodeIndex = -1;
-
- for (int i = 0; i < _childNodes.Count; i++)
- {
- XmlNode e = _childNodes.data[i] as XmlNode;
- if (e.Equals(newChild))
- {
- retval = e;
- FOwnerDocument.onNodeRemoving(newChild, newChild.ParentNode);
- _childNodes.data.RemoveAt(i);
- newChild.setParent(null);
- FOwnerDocument.onNodeRemoved(newChild, null);
- break;
-
- }
-
- if ( (refChild != null ) & ( e.Equals(refChild) ) )
- {
- refNodeIndex = i;
-
- if (retval != null)
- break;
- }
- }
-
- if ( ( refNodeIndex == -1 ) & (refChild != null) )
- throw new ArgumentException("Reference node not found (and not null) in call to XmlNode.InsertAfter()");
-
- FOwnerDocument.onNodeInserting(newChild, this);
-
- if (refChild == null)
- refNodeIndex = 0;
- else
- refNodeIndex++; // insert after reference...
-
- if (newChild.NodeType == XmlNodeType.DocumentFragment)
- {
- // Insert all children, starting from refNodeIndex (0,1,2...n)
- for (int i = 0; i < newChild.ChildNodes.Count; i++)
- {
- XmlNode e = newChild.ChildNodes[i] as XmlNode;
- FOwnerDocument.onNodeInserting(e, this);
- _childNodes.data.Insert(refNodeIndex, newChild.ChildNodes[i]);
- e.setParent(this);
- FOwnerDocument.onNodeInserted(newChild, this);
- refNodeIndex ++;
- }
- }
- else
- {
- FOwnerDocument.onNodeInserting(newChild, this);
- _childNodes.data.Insert(refNodeIndex, newChild);
- newChild.setParent(this);
- FOwnerDocument.onNodeInserted(newChild, this);
- }
-
- return retval;
- }
-
- /// <summary>
- /// Insert newChild directly before the reference node.
- /// If refChild is null, newChild is inserted at the end of childnodes.
- /// If newChild is a document fragment, all nodes are inserted before refChild.
- /// If newChild is already in the tree, it is first removed.
- /// </summary>
- /// <exception cref="ArgumentException">NewChild was created from different document.
- /// RefChild not a child of this node, or is null.
- /// Node is read-only</exception>
- /// <exception cref="InvalidOperationException">Node is of type that does not have children.
- /// Node to insert is an ancestor of this node.</exception>
- /// <param name="newChild">Child node to insert.</param>
- /// <param name="refChild">Reference node to insert after</param>
- /// <returns>Removed node, or null if no node removed.</returns>
- public virtual XmlNode InsertBefore(XmlNode newChild, XmlNode refChild)
- {
- // Checks parent not ancestor, arguments valid, etc. Throws exception on error
- InsertionCheck(newChild, refChild);
-
- // Scan the node list, looking for refChild and seeing if newChild is in the list
- XmlNode retval = null;
- int refNodeIndex = -1;
-
- for (int i = 0; i < _childNodes.Count; i++)
- {
- XmlNode e = _childNodes.data[i] as XmlNode;
- if (e.Equals(newChild))
- {
- retval = e;
- FOwnerDocument.onNodeRemoving(newChild, newChild.ParentNode);
- _childNodes.data.RemoveAt(i);
- newChild.setParent(null);
- FOwnerDocument.onNodeRemoved(newChild, null);
- break;
- }
-
- if ( (refChild != null ) & ( e.Equals(refChild) ) )
- {
- refNodeIndex = i;
-
- if (retval != null)
- break;
- }
- }
-
- if ( ( refNodeIndex == -1 ) & (refChild != null) )
- throw new ArgumentException("Reference node not found (and not null) in call to XmlNode.InsertAfter()");
-
- if (refChild == null)
- refNodeIndex = _childNodes.Count;
-
- if (newChild.NodeType == XmlNodeType.DocumentFragment)
- {
- // Insert all children, starting from refNodeIndex (0,1,2...n)
- for (int i = 0; i < newChild.ChildNodes.Count; i++)
- {
- XmlNode e = newChild.ChildNodes[i] as XmlNode;
- FOwnerDocument.onNodeInserting(e, this);
- _childNodes.data.Insert(refNodeIndex, newChild.ChildNodes[i]);
- e.setParent(this);
- FOwnerDocument.onNodeInserted(newChild, this);
- refNodeIndex ++;
- }
- }
- else
- {
- newChild.OwnerDocument.onNodeInserting(newChild, this);
- _childNodes.data.Insert(refNodeIndex, newChild);
- newChild.setParent(this);
- newChild.OwnerDocument.onNodeInserted(newChild, this);
- }
-
- return retval;
- }
-
- /// <summary>
- /// Put all nodes under this node in "normal" form
- /// Whatever that means...
- /// </summary>
- public virtual void Normalize()
- {
- // TODO - Implement Normalize()
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Add the specified child to the beginning of the child node list
- /// </summary>
- /// <param name="newChild">Node to add</param>
- /// <returns>The node added</returns>
- public virtual XmlNode PrependChild(XmlNode newChild)
- {
- return InsertAfter(newChild, null);
- }
-
- /// <summary>
- /// Remove all children and attributes
- /// </summary>
- public virtual void RemoveAll()
- {
- if (_childNodes == null)
- return;
- else
- {
- // Remove in order, 0..n
- while (_childNodes.Count > 0)
- {
- XmlNode e = _childNodes[0];
- FOwnerDocument.onNodeRemoving(e, this);
- e.setParent(null);
- _childNodes.data.RemoveAt(0);
- FOwnerDocument.onNodeRemoved(e, null);
- }
- }
- }
-
- /// <summary>
- /// Remove specified child node
- /// </summary>
- /// <param name="oldChild"></param>
- /// <returns>Removed node</returns>
- public virtual XmlNode RemoveChild(XmlNode oldChild)
- {
- // TODO - implement RemoveChild(oldChild)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Select a list of nodes matching the xpath
- /// </summary>
- /// <param name="xpath"></param>
- /// <returns>matching nodes</returns>
- public XmlNodeList SelectNodes( string xpath)
- {
- // TODO - imlement SelectNodes(xpath)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Select a list of nodes matching the xpath. Any prefixes are resolved
- /// using the passed namespace manager
- /// </summary>
- /// <param name="xpath"></param>
- /// <param name="nsmgr"></param>
- /// <returns></returns>
- public XmlNodeList SelectNodes(string xpath, XmlNamespaceManager nsmgr)
- {
- // TODO - implement SelectNodes(xpath, nsmgr)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Selects the first node that matches xpath
- /// </summary>
- /// <param name="?"></param>
- /// <returns></returns>
- public XmlNode SelectSingleNode(string xpatch)
- {
- // TODO - implement SelectSingeNode(xpath)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Returns the first node that matches xpath
- /// Uses the passed namespace manager to resolve namespace URI's
- /// </summary>
- /// <param name="xpath"></param>
- /// <param name="nsmgr"></param>
- /// <returns></returns>
- public XmlNode SelectSingleNode(string xpath, XmlNamespaceManager nsmgr)
- {
- // Implement SelectSingleNode(xpath, nsmgr)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Tests if the DOM implementation supports the passed feature
- /// </summary>
- /// <param name="feature"></param>
- /// <param name="version"></param>
- /// <returns></returns>
- public virtual bool Supports(string feature, string version)
- {
- //TODO - implement Supports(feature, version)
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Returns a string representation of the current node and it's children
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- // TODO - implement ToString()
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Saves all children of the current node to the passed writer
- /// </summary>
- /// <param name="w"></param>
- public abstract void WriteContentTo(XmlWriter w);
-
- /// <summary>
- /// Saves the current node to writer w
- /// </summary>
- /// <param name="w"></param>
- public abstract void WriteTo(XmlWriter w);
-
- //======= Internal methods ===============================================
- /// <summary>
- /// accessor {set;} for parentNode only visible internally.
- /// </summary>
- /// <param name="newParent">new parent node.</param>
- internal void setParent( XmlNode newParent)
- {
- _parent = newParent;
- }
-
- //======= Protected methods ==============================================
-
- //======= Private Methods ===================================================
- /// <summary>
- /// Helper function to perform checks required before insrting a node.
- /// Throws applicable exceptions on error.
- /// </summary>
- /// <param name="newChild"></param>
- /// <param name="refChild"></param>
- private void InsertionCheck( XmlNode newChild, XmlNode refChild)
- {
- if (newChild == null)
- throw new ArgumentNullException("Null newNode passed to InsertAfter()");
-
- if (newChild.Equals(this))
- throw new ArgumentException("Cannot insert node onto itself");
-
- if (NodeType != XmlNodeType.Document && !FOwnerDocument.Equals( newChild.OwnerDocument) )
- throw new ArgumentException("Reference node has different owner document than this node");
-
- XmlDocument ownerDocument = newChild.OwnerDocument;
-
- if (ownerDocument.IsReadOnly )
- throw new ArgumentException("Operation not supported - tree is read-only");
-
- //Check that insert node is not in our path to the root
- XmlNode curParent = _parent;
- while ( (curParent != null) & (! ownerDocument.Equals(curParent) ))
- {
- if (curParent.Equals(newChild) )
- throw new ArgumentException("Cannot insert ancestor a node");
- curParent = curParent.ParentNode;
- }
- }
-
- // Constructors
- //===========================================================================
- //When we're first created, we won't know parent, etc.
- internal XmlNode( XmlDocument aOwnerDoc )
- {
- // Don't create childnodes object, since not all derived classes have children
- FOwnerDocument = aOwnerDoc;
- }
-
- } // XmlNode
-} // using namespace System.Xml
-
-
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeChangedAction.cs b/mcs/class/System.XML/System.Xml/XmlNodeChangedAction.cs
deleted file mode 100755
index 811edfd92f0..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeChangedAction.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Enumeration of node changed actions.
- /// </summary>
- public enum XmlNodeChangedAction
- {
-
- /// <summary>
- /// A node is being inserted in the tree
- /// </summary>
- Insert = 0,
-
- /// <summary>
- /// A node is being removed from the tree.
- /// </summary>
- Remove = 1,
-
- /// <summary>
- /// A node is being changed.
- /// </summary>
- Change = 2,
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeChangedEventArgs.cs b/mcs/class/System.XML/System.Xml/XmlNodeChangedEventArgs.cs
deleted file mode 100644
index 29a842ad55d..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeChangedEventArgs.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Passed to delegates on document tree changes
- /// </summary>
- public class XmlNodeChangedEventArgs
- {
- // Private data members
- XmlNode _oldParent;
- XmlNode _newParent;
- XmlNodeChangedAction _action;
- XmlNode _node;
-
- // public properties
- public XmlNodeChangedAction Action
- {
- get
- {
- return _action;
- }
- }
-
- public XmlNode Node
- {
- get
- {
- return _node;
- }
- }
-
-
- public XmlNode OldParent
- {
- get
- {
- return _oldParent;
- }
- }
-
-
- public XmlNode NewParent
- {
- get
- {
- return _newParent;
- }
- }
-
-
- // Public Methods
- // Internal Methods
- internal XmlNodeChangedEventArgs(
- XmlNodeChangedAction action,
- XmlNode node,
- XmlNode oldParent,
- XmlNode newParent)
- {
- _node = node;
- _oldParent = oldParent;
- _newParent = newParent;
- _action = action;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeList.cs b/mcs/class/System.XML/System.Xml/XmlNodeList.cs
deleted file mode 100644
index 1d166b9f118..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeList.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- /// <summary>
- /// Abstract class XmlNodeList.
- /// </summary>
- public abstract class XmlNodeList : IEnumerable
- {
- // public properties
- public abstract int Count { get; }
-
- [System.Runtime.CompilerServices.IndexerName("ItemOf")]
- public virtual XmlNode this[int i]
- {
- get
- {
- return Item(i);
- }
- }
-
- // Public Methods
- /// <summary>
- /// Abstract. Return the enumerator for the class.
- /// </summary>
- /// <returns>Enumerator</returns>
- public abstract IEnumerator GetEnumerator();
-
- /// <summary>
- /// Abstract. Returns the item at index. Index is 0-based.
- /// </summary>
- /// <param name="index"></param>
- /// <returns></returns>
- public abstract XmlNode Item(int index);
-
- public XmlNodeList()
- {
- // TODO: What should be done in constructor for XmlNodeList.XmlNodeList()? (nothing)
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeListAsArrayList.cs b/mcs/class/System.XML/System.Xml/XmlNodeListAsArrayList.cs
deleted file mode 100644
index dccb526fc73..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeListAsArrayList.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- /// <summary>
- /// Internal implementation of XmlNodeList for XmlNode
- /// </summary>
- internal class XmlNodeListAsArrayList : XmlNodeList
- {
- // Private data members
- ArrayList _items;
-
- // Public Methods
- //===========================================================================
- public override int Count
- {
- get
- {
- return _items.Count;
- }
- }
-
- public IList data
- {
- get
- {
- return _items;
- }
- }
-
- // Public Methods
- //===========================================================================
- public override IEnumerator GetEnumerator()
- {
- return _items.GetEnumerator();
- }
-
- public void Add(XmlNode node)
- {
- _items.Add(node);
- }
-
- public override XmlNode Item(int index)
- {
- if ((index >= 0) & (index < _items.Count))
- return _items[index] as XmlNode;
- else
- return null;
- }
-
- public XmlNodeListAsArrayList() : base()
- {
- _items = new ArrayList();
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs b/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs
deleted file mode 100755
index 9550967bbe6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Xml.XmlNodeOrder.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- [Serializable]
- public enum XmlNodeOrder
- {
- Before = 0,
- After = 1,
- Same = 2,
- Unknown = 3,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeType.cs b/mcs/class/System.XML/System.Xml/XmlNodeType.cs
deleted file mode 100644
index 8ed73dd8db6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeType.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// XmlNodeType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:31:46 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum XmlNodeType {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- Element = 1,
-
- /// <summary>
- /// </summary>
- Attribute = 2,
-
- /// <summary>
- /// </summary>
- Text = 3,
-
- /// <summary>
- /// </summary>
- CDATA = 4,
-
- /// <summary>
- /// </summary>
- EntityReference = 5,
-
- /// <summary>
- /// </summary>
- Entity = 6,
-
- /// <summary>
- /// </summary>
- ProcessingInstruction = 7,
-
- /// <summary>
- /// </summary>
- Comment = 8,
-
- /// <summary>
- /// </summary>
- Document = 9,
-
- /// <summary>
- /// </summary>
- DocumentType = 10,
-
- /// <summary>
- /// </summary>
- DocumentFragment = 11,
-
- /// <summary>
- /// </summary>
- Notation = 12,
-
- /// <summary>
- /// </summary>
- Whitespace = 13,
-
- /// <summary>
- /// </summary>
- SignificantWhitespace = 14,
-
- /// <summary>
- /// </summary>
- EndElement = 15,
-
- /// <summary>
- /// </summary>
- EndEntity = 16,
-
- /// <summary>
- /// </summary>
- XmlDeclaration = 17,
- } // XmlNodeType
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/XmlParser.cs b/mcs/class/System.XML/System.Xml/XmlParser.cs
deleted file mode 100644
index 8c02b02f1a1..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlParser.cs
+++ /dev/null
@@ -1,516 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// internal System.Xml.XmlParser
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- internal class XmlParser
- {
- // Private data members
- XmlDocument Fdoc;
- XmlInputSource Fsrc;
-
- // Elements push themselves on on start, pop on complete
- Stack RefNodes;
-
- // private classes
- private enum DomPieceType
- {
- xmlProcessingInstruction,
- xmlXmlDeclaration,
- xmlTextDeclaration,
- xmlComment,xmlCDATA,
- xmlPCDATA,
- xmlDoctype,
- xmlStartTag,
- xmlEndTag,
- xmlEmptyElementTag,
- xmlCharRef,
- xmlEntityRef,
- xmlParameterEntityRef,
- xmlEntityDecl,
- xmlElementDecl,
- xmlAttributeDecl,
- xmlNotationDecl,
- xmlCondSection,
- xmlUnknown,
-
- }
-
- // constants
- private const char CR = (char) 0x0D;
- private const char LF = (char) 0x0A;
- private const char QM = '?';
- private const char AMP = '&';
- private const char GTCODE = '<';
- private const char LTCODE = '>';
- private const char SINGLEQUOTE = (char) 0x39; // '
- private const char DOUBLEQUOTE = (char) 0x34; // "
- private const char NUMBERSIGN = (char) 0x35; // #
- private const char SLASH = (char) 0x47; // /
- private const string PISTART = "<?";
- private const string PIEND = "?>";
- private const string XMLDECLSTART = "<?xml";
- private const string COMMENTSTART = "<!--";
- private const string CDATASTART = "<![CDATA[";
- private const string DOCTYPESTART = "<!DOCTYPE";
-
- // private properties
- private XmlNode refNode
- {
- get
- {
- Object e = RefNodes.Peek();
- if ( e == null )
- return null;
- else
- return e as XmlNode;
- }
- }
-
- // public properties
-
- // public methods
- public bool parse()
- {
- bool retval = true;
- XmlException parseError = null;
- bool singleQuoteOpen = false;
- bool doubleQuoteOpen = false;
- bool bracketOpen = false;
- string content = "";
- DomPieceType pieceType = DomPieceType.xmlUnknown;
- string subEndMarker = "";
- string subStartMarker = "";
-
- try
- {
- while ( !Fsrc.atEOF() )
- {
- if ( parseError != null) break;
-
- char c = Fsrc.getNextChar();
-
- if ( !XmlNames_1_0.IsXmlChar(c) )
- {
- content += c;
- throw new XmlException("'Invalid character error.'", Fsrc);
- }
-
- switch (pieceType)
- {
- case DomPieceType.xmlUnknown:
- if ( c == GTCODE)
- pieceType = DomPieceType.xmlStartTag;
- else if ( c == AMP)
- pieceType = DomPieceType.xmlEntityRef;
- else
- pieceType = DomPieceType.xmlPCDATA;
- content += c;
- Fsrc.pieceStart();
- break;
-
- case DomPieceType.xmlPCDATA:
- if ( c == GTCODE )
- {
- parseError = writePCDATA(content);
- content = "";
- pieceType = DomPieceType.xmlStartTag;
- Fsrc.pieceStart();
- }
- else if ( c == AMP)
- {
- parseError = writePCDATA(content);
- content = "";
- pieceType = DomPieceType.xmlEntityRef;
- Fsrc.pieceStart();
- }
- content += c;
- break;
-
- case DomPieceType.xmlEntityRef:
- content += c;
- if ( c == ';' )
- {
- if ( content[2] == NUMBERSIGN )
- parseError = writeCharRef(content);
- else
- parseError = writeEntityRef(content);
- content = "";
- pieceType = DomPieceType.xmlUnknown;
- }
- break;
-
- case DomPieceType.xmlStartTag:
- content += c;
- switch( content.Length)
- {
- case 2:
- if (content.StartsWith(PISTART))
- pieceType = DomPieceType.xmlProcessingInstruction;
- break;
- case 4:
- if (content.StartsWith(COMMENTSTART))
- pieceType = DomPieceType.xmlComment;
- break;
- case 9:
- if (content.StartsWith(CDATASTART))
- pieceType = DomPieceType.xmlCDATA;
- else if (content.StartsWith(DOCTYPESTART))
- {
- pieceType = DomPieceType.xmlDoctype;
- subEndMarker = "";
- subStartMarker = "";
- bracketOpen = false;
- }
- break;
- }
-
- // Count quotation marks:
- if ((c == SINGLEQUOTE) && (! doubleQuoteOpen))
- singleQuoteOpen = ! singleQuoteOpen;
- else if ((c == DOUBLEQUOTE) && (! singleQuoteOpen))
- doubleQuoteOpen = ! doubleQuoteOpen;
- else if (c == LTCODE)
- {
- if ((! doubleQuoteOpen) && (! singleQuoteOpen))
- {
- if (content[2] == SLASH)
- {
- int l = content.Length;
- int offset = 3;
- // eliminate white-space after tag name:
- while ((l-offset > 0) && XmlNames_1_0.IsXmlWhiteSpace(content[l-offset+2]))
- offset++;
- parseError = writeEndElement(content.Substring(3, l-offset));
- }
- else
- {
- if (content[content.Length-1] == SLASH)
- parseError = writeEmptyElement(content.Substring(2, content.Length-3));
- else
- parseError = writeStartElement(content.Substring(2, content.Length-2));
- }
- content = "";
- pieceType = DomPieceType.xmlUnknown;
- }
- }
- break;
-
- //<?PINAME ?>
- case DomPieceType.xmlProcessingInstruction:
- content += c;
- if ( c == LTCODE )
- if (content[content.Length-1] == QM)
- {
- if ( (content.Length > 5) &&
- (XmlNames_1_0.IsXmlWhiteSpace(content[6])) &&
- (content.StartsWith(XMLDECLSTART)) )
- parseError = writeXmlDeclaration(content.Substring(3, content.Length-4));
- else
- parseError = writeProcessingInstruction(content.Substring(3, content.Length-4));
- content = "";
- pieceType = DomPieceType.xmlUnknown;
- }
- break;
-
-
- case DomPieceType.xmlComment:
- content += c;
- if (c == LTCODE)
- if ( (content.EndsWith("-->") ) && (content.Length > 6) )
- {
- parseError = writeComment(content.Substring(5, content.Length-7));
- content = "";
- pieceType = DomPieceType.xmlUnknown;
- }
- break;
-
- case DomPieceType.xmlCDATA:
- content += c;
- if (c == LTCODE )
- {
- if (content[content.Length-1] == ']' )
- if (content[content.Length-2] == ']')
- {
- parseError = writeCDATA(content.Substring(10, content.Length-12));
- content = "";
- pieceType = DomPieceType.xmlUnknown;
- }
- }
- break;
-
- case DomPieceType.xmlDoctype:
- content += c;
- if (subEndMarker == "")
- {
- if ( (c == SINGLEQUOTE) && (! doubleQuoteOpen))
- {
- singleQuoteOpen = !singleQuoteOpen;
- }
- else if ( (c == DOUBLEQUOTE) && (! singleQuoteOpen))
- {
- doubleQuoteOpen = ! doubleQuoteOpen;
- }
-
- if (bracketOpen)
- {
- if (! (singleQuoteOpen | doubleQuoteOpen) )
- {
- if (c == GTCODE)
- {
- subStartMarker = "<";
- }
- else if ( (c == '!') && (subStartMarker == "<"))
- {
- subStartMarker = "<";
- }
- else if ( (c == QM) && (subStartMarker == "<") )
- {
- subStartMarker = "";
- subEndMarker = PIEND;
- }
- else if ((c == '-') && (subStartMarker == "<!"))
- {
- subStartMarker = "<!-";
- }
- else if ((c == '-') && (subStartMarker == "<!-"))
- {
- subStartMarker = "";
- subEndMarker = "-->";
- }
- else if (subStartMarker != "")
- {
- subStartMarker = "";
- }
-
- if ((c == ']') && (! singleQuoteOpen) && (! doubleQuoteOpen))
- bracketOpen = false;
- }
- }
- else // if BracketOpened ...
- {
- if ((c == '[') && (! singleQuoteOpen) && (! doubleQuoteOpen))
- bracketOpen = true;
- }
- } //if BracketOpened ... else ...
- else // if (SubEndMarker = '') ...
- {
- if (content.EndsWith(subEndMarker))
- subEndMarker = "";
- } //if (SubEndMarker = '') ... else ...
-
- if ((! doubleQuoteOpen) && (! singleQuoteOpen) && (! bracketOpen) &&
- (subEndMarker == "") && (c == '>'))
- {
- parseError = writeDoctype(content);
- content = "";
- pieceType = DomPieceType.xmlUnknown;
- }
- break;
-
- } // switch
- } // while more characters
-
- if (parseError == null)
- if (content.Length > 0)
- parseError = writePCDATA(content);
- } // try
- catch
- {
- // we need to raise the exception again, converted to an XmlException
- /*
- except
- on EConvertError do raise EParserInvalidCharacter_Err.create('Invalid character error.');
- on EReadError do raise EParserInvalidCharacter_Err.create('Invalid character error.');
- end; {try ...}
- except
- on E: EParserInvalidCharacter_Err do
- parserError:= parserErrorFactory(sender,inputSource.Locator,
- EParserInvalidCharacter_Err.create('Invalid character error.'),
- '');
-
- */
- }
-
- if (parseError != null)
- {
- // Deal with the error, somehow
- retval = false;
- }
- return retval;
- }
-
-
- // private methods
- private XmlException writePCDATA(string content)
- {
- return null;
- }
-
- private XmlException writeEntityRef(string content)
- {
- string entityName = content.Substring(2, content.Length - 2);
- return null;
- }
-
- private XmlException writeCharRef( string content)
- {
- return null;
- }
-
- private XmlException writeEndElement( string content)
- {
- return null;
- }
-
- private XmlException writeEmptyElement( string content)
- {
- return null;
- }
-
- private XmlException writeStartElement( string content)
- {
- return null;
- }
-
- private XmlException writeComment( string content)
- {
-/*
- procedure TdomStandardIntSubsetBuilder.comment(const sender: TdomCustomParser;
- const locator: TdomStandardLocator;
- const data: wideString);
-var
- newComment: TdomCMComment;
-begin
- if not assigned(FRefNode) then exit;
- try
- newComment:= FRefNode.OwnerCMObject.CreateCMComment(data);
- try
- FRefNode.appendChild(newComment);
- except
- if assigned(newComment.ParentNode)
- then newComment.ParentNode.RemoveChild(newComment);
- FRefNode.OwnerCMObject.FreeAllCMNodes(TdomCMNode(newComment));
- raise;
- end; {try ...}
- except
- raise EParserInvalidCharacter_Err.create('Invalid character error.');
- end; {try ...}
-end;
-
-function TXmlDocBuilder.comment(const sender: TXmlCustomProcessorAgent;
- const locator: TdomStandardLocator;
- data: wideString): TXmlParserError;
-var
- newComment: TdomComment;
-begin
- if assigned(FOnComment) then FOnComment(sender,locator,data);
- result:= nil;
- if assigned(FRefNode) then begin
- try
- newComment:= FRefNode.OwnerDocument.CreateComment(data);
- try
- FRefNode.appendChild(newComment);
- except
- if assigned(newComment.ParentNode)
- then newComment.ParentNode.RemoveChild(newComment);
- FRefNode.OwnerDocument.FreeAllNodes(TdomNode(newComment));
- raise;
- end; {try ...}
- except
- result:= parserErrorFactory(sender,locator,
- EParserInvalidComment_Err.create('Invalid comment error.'),
- data);
- end; {try ...}
- end; {if assigned(FRefNode) ...}
-
- if not assigned(result)
- then if assigned(nextHandler)
- then result:= nextHandler.comment(sender,locator,data);
-end;
-
-
-function TXmlWFTestContentHandler.comment(const sender: TXmlCustomProcessorAgent;
- const locator: TdomStandardLocator;
- data: wideString): TXmlParserError;
-var
- dataLength: integer;
-begin
- if assigned(FOnComment) then FOnComment(sender,locator,data);
- if not FIsActive
- then raise EParserException.Create('TXmlWFTestContentHandler not active.');
- result:= nil;
- FXMLDeclarationAllowed:= false;
-
- if pos('--',data) > 0
- then result:= parserErrorFactory(sender,locator,
- EParserInvalidComment_Err.create('Invalid comment error.'),
- '--');
- dataLength:= length(data);
- if dataLength > 0
- then if WideChar(data[dataLength]) = '-'
- then if not assigned(result)
- then result:= parserErrorFactory(sender,locator,
- EParserInvalidComment_Err.create('Invalid comment error.'),
- '-');
- if not IsXmlChars(data)
- then if not assigned(result)
- then result:= parserErrorFactory(sender,locator,
- EParserInvalidCharacter_Err.create('Invalid character error.'),
- data);
-
- if not assigned(result)
- then if assigned(nextHandler)
- then result:= nextHandler.comment(sender,locator,data);
-end;
-
-
-*/
- return null;
- }
-
-
- private XmlException writeXmlDeclaration ( string content)
- {
- return null;
- }
-
- private XmlException writeProcessingInstruction( string content)
- {
- return null;
- }
-
- private XmlException writeCDATA( string content)
- {
- return null;
- }
-
- private XmlException writeDoctype( string content)
- {
- return null;
- }
-
- private void mainLoop()
- {
- }
-
- // Constructors
- public XmlParser ( XmlInputSource src, XmlDocument doc )
- {
- Fsrc = src;
- Fdoc = doc;
- RefNodes = new Stack();
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlParserContext.cs b/mcs/class/System.XML/System.Xml/XmlParserContext.cs
deleted file mode 100644
index a88f579c077..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlParserContext.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlParserContext.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml
-{
- public class XmlParserContext
- {
- // constructors
-
- public XmlParserContext(
- XmlNameTable nameTable,
- XmlNamespaceManager namespaceManager,
- string xmlLang,
- XmlSpace xmlSpace) :
-
- this(
- nameTable,
- namespaceManager,
- null,
- null,
- null,
- null,
- null,
- xmlLang,
- xmlSpace
- )
- {
- }
-
- public XmlParserContext(
- XmlNameTable nameTable,
- XmlNamespaceManager namespaceManager,
- string docTypeName,
- string publicID,
- string systemID,
- string internalSubset,
- string baseURI,
- string xmlLang,
- XmlSpace xmlSpace)
- {
- this.nameTable = nameTable;
- this.namespaceManager = namespaceManager;
- this.docTypeName = docTypeName;
- this.publicID = publicID;
- this.systemID = systemID;
- this.internalSubset = internalSubset;
- this.baseURI = baseURI;
- this.xmlLang = xmlLang;
- this.xmlSpace = xmlSpace;
- }
-
- // properties
-
- public string BaseURI
- {
- get { return baseURI; }
- set { baseURI = value; }
- }
-
- public string DocTypeName
- {
- get { return docTypeName; }
- set { docTypeName = value; }
- }
-
- public string InternalSubset
- {
- get { return internalSubset; }
- set { internalSubset = value; }
- }
-
- public XmlNamespaceManager NamespaceManager
- {
- get { return namespaceManager; }
- set { namespaceManager = value; }
- }
-
- public XmlNameTable NameTable
- {
- get { return nameTable; }
- set { nameTable = nameTable; }
- }
-
- public string PublicId
- {
- get { return publicID; }
- set { publicID = value; }
- }
-
- public string SystemId
- {
- get { return systemID; }
- set { systemID = value; }
- }
-
- public string XmlLang
- {
- get { return xmlLang; }
- set { xmlLang = value; }
- }
-
- public XmlSpace XmlSpace
- {
- get { return xmlSpace; }
- set { xmlSpace = value; }
- }
-
- // privates
-
- private string baseURI;
- private string docTypeName;
- private string internalSubset;
- private XmlNamespaceManager namespaceManager;
- private XmlNameTable nameTable;
- private string publicID;
- private string systemID;
- private string xmlLang;
- private XmlSpace xmlSpace;
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlProcessingInstruction.cs b/mcs/class/System.XML/System.Xml/XmlProcessingInstruction.cs
deleted file mode 100644
index 4066065d1d7..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlProcessingInstruction.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- ///
- /// </summary>
- public class XmlProcessingInstruction
- {
- // Private data members
-
- // public properties
-
-
- // Public Methods
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs b/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs
deleted file mode 100644
index 8e559a749ba..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// System.Xml.XmlQualifiedName.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Xml
-{
- public class XmlQualifiedName
- {
- // Constructors
- public XmlQualifiedName ()
- : base ()
- {
- }
-
- public XmlQualifiedName (string name)
- : base ()
- {
- this.name = name;
- }
-
- public XmlQualifiedName (string name, string ns)
- : base ()
- {
- this.name = name;
- this.ns = ns;
- }
-
- // Fields
- public static readonly XmlQualifiedName Empty = new XmlQualifiedName ();
- private string name;
- private string ns;
-
- // Properties
- public bool IsEmpty
- {
- get {
- if ((name == String.Empty) && (ns == String.Empty))
- return true;
- else
- return false;
- }
- }
-
- public string Name
- {
- get { return name; }
- }
-
- public string Namespace
- {
- get { return ns; }
- }
-
- // Methods
- public override bool Equals (object other)
- {
- if ((XmlQualifiedName) this == (XmlQualifiedName) other)
- return true;
- else
- return false;
- }
-
- [MonoTODO] public override int GetHashCode () { return 42; }
-
- public override string ToString ()
- {
- if (ns == null)
- return name;
- else
- return ns + ":" + name;
- }
-
- public static string ToString (string name, string ns)
- {
- if (ns == null)
- return name;
- else
- return ns + ":" + name;
- }
-
- // Operators
- public static bool operator == (XmlQualifiedName a, XmlQualifiedName b)
- {
- if ((a.Name == b.Name) && (a.Namespace == b.Namespace))
- return true;
- else
- return false;
- }
-
- public static bool operator != (XmlQualifiedName a, XmlQualifiedName b)
- {
- if (!(a == b))
- return false;
- else
- return true;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlReader.cs b/mcs/class/System.XML/System.Xml/XmlReader.cs
deleted file mode 100644
index e386b819593..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlReader.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlReader.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml
-{
- public abstract class XmlReader
- {
- // properties
-
- public abstract int AttributeCount { get; }
-
- public abstract string BaseURI { get; }
-
- public virtual bool CanResolveEntity
- {
- get
- {
- return false;
- }
- }
-
- public abstract int Depth { get; }
-
- public abstract bool EOF { get; }
-
- public virtual bool HasAttributes
- {
- get
- {
- return AttributeCount > 0;
- }
- }
-
- public abstract bool HasValue { get; }
-
- public abstract bool IsDefault { get; }
-
- public abstract bool IsEmptyElement { get; }
-
- public abstract string this[int i] { get; }
-
- public abstract string this[string name] { get; }
-
- public abstract string this[
- string localName,
- string namespaceName]
- { get; }
-
- public abstract string LocalName { get; }
-
- public abstract string Name { get; }
-
- public abstract string NamespaceURI { get; }
-
- public abstract XmlNameTable NameTable { get; }
-
- public abstract XmlNodeType NodeType { get; }
-
- public abstract string Prefix { get; }
-
- public abstract char QuoteChar { get; }
-
- public abstract ReadState ReadState { get; }
-
- public abstract string Value { get; }
-
- public abstract string XmlLang { get; }
-
- public abstract XmlSpace XmlSpace { get; }
-
- // methods
-
- public abstract void Close();
-
- public abstract string GetAttribute(int i);
-
- public abstract string GetAttribute(string name);
-
- public abstract string GetAttribute(
- string localName,
- string namespaceName);
-
- public static bool IsName(string s)
- {
- bool result = false;
-
- if (s != null && s.Length > 0)
- {
- char[] chars = s.ToCharArray();
-
- if (XmlChar.IsFirstNameChar(chars[0]))
- {
- int i = 1;
- int n = chars.Length;
-
- while (i < n && XmlChar.IsNameChar(chars[i]))
- {
- ++i;
- }
-
- result = i == n;
- }
- }
-
- return result;
- }
-
- public static bool IsNameToken(string s)
- {
- bool result = false;
-
- if (s != null && s.Length > 0)
- {
- char[] chars = s.ToCharArray();
-
- int i = 0;
- int n = chars.Length;
-
- while (i < n && XmlChar.IsNameChar(chars[i]))
- {
- ++i;
- }
-
- result = i == n;
- }
-
- return result;
- }
-
- public virtual bool IsStartElement()
- {
- // TODO: implement me.
- return false;
- }
-
- public virtual bool IsStartElement(string name)
- {
- // TODO: implement me.
- return false;
- }
-
- public virtual bool IsStartElement(
- string localName,
- string namespaceName)
- {
- // TODO: implement me.
- return false;
- }
-
- public abstract string LookupNamespace(string prefix);
-
- public abstract void MoveToAttribute(int i);
-
- public abstract bool MoveToAttribute(string name);
-
- public abstract bool MoveToAttribute(
- string localName,
- string namespaceName);
-
- public virtual XmlNodeType MoveToContent()
- {
- // TODO: implement me.
- return XmlNodeType.None;
- }
-
- public abstract bool MoveToElement();
-
- public abstract bool MoveToFirstAttribute();
-
- public abstract bool MoveToNextAttribute();
-
- public abstract bool Read();
-
- public abstract bool ReadAttributeValue();
-
- public virtual string ReadElementString()
- {
- // TODO: implement me.
- return null;
- }
-
- public virtual string ReadElementString(string name)
- {
- // TODO: implement me.
- return null;
- }
-
- public virtual string ReadElementString(
- string localName,
- string namespaceName)
- {
- // TODO: implement me.
- return null;
- }
-
- public virtual void ReadEndElement()
- {
- // TODO: implement me.
- }
-
- public abstract string ReadInnerXml();
-
- public abstract string ReadOuterXml();
-
- public virtual void ReadStartElement()
- {
- // TODO: implement me.
- }
-
- public virtual void ReadStartElement(string name)
- {
- // TODO: implement me.
- }
-
- public virtual void ReadStartElement(
- string localName,
- string namespaceName)
- {
- // TODO: implement me.
- }
-
- public abstract string ReadString();
-
- public abstract void ResolveEntity();
-
- public virtual void Skip()
- {
- // TODO: implement me.
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlResolver.cs b/mcs/class/System.XML/System.Xml/XmlResolver.cs
deleted file mode 100644
index 665dff630e6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlResolver.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlResolver.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Net;
-
-namespace System.Xml
-{
- public abstract class XmlResolver
- {
- public abstract ICredentials Credentials
- {
- set;
- }
-
- public abstract object GetEntity(
- Uri absoluteUri,
- string role,
- Type type);
-
- public abstract Uri ResolveUri(
- Uri baseUri,
- string relativeUri);
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs b/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs
deleted file mode 100644
index 82717e0e390..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- ///
- /// </summary>
- public class XmlSignificantWhitespace
- {
- // Private data members
-
- // public properties
-
-
- // Public Methods
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlSortOrder.cs b/mcs/class/System.XML/System.Xml/XmlSortOrder.cs
deleted file mode 100755
index 4d85b2f864c..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlSortOrder.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// XmlSortOrder.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:47:43 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum XmlSortOrder {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- Ascending = 1,
-
- /// <summary>
- /// </summary>
- Descending = 2,
- } // XmlSortOrder
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/XmlSpace.cs b/mcs/class/System.XML/System.Xml/XmlSpace.cs
deleted file mode 100644
index f1e1128ff3c..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlSpace.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// XmlSpace.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:31:52 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// Specifies the current xml:space scope
- /// </summary>
- public enum XmlSpace {
-
- /// <summary>
- /// No xml:space scope.
- /// </summary>
- None = 0,
-
- /// <summary>
- /// the xml:space scope = "default"
- /// </summary>
- Default = 1,
-
- /// <summary>
- /// the xml:space scope = "preserve"
- /// </summary>
- Preserve = 2,
- } // XmlSpace
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/XmlText.cs b/mcs/class/System.XML/System.Xml/XmlText.cs
deleted file mode 100644
index 15e590f1e04..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlText.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlText
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-
-
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Represents the text content of an element or attribute
- /// </summary>
- public class XmlText : XmlNode
- {
- // Private data members
-
- // public properties
- public override string LocalName
- {
- get
- {
- return "#text";
- }
- }
- /// <summary>
- /// Get the name of the node.
- /// </summary>
- public override string Name
- {
- get
- {
- return "#text";
- }
- }
-
- public override XmlNodeType NodeType
- {
- get
- {
- return XmlNodeType.Text;
- }
- }
-
-
- // Public Methods
- //===========================================================================
- /// <summary>
- /// Override. Throw InvalidOperationException - text nodes do not have child nodes
- /// </summary>
- /// <param name="newChild">N/A</param>
- /// <param name="refChild">N/A</param>
- /// <returns>N/A</returns>
- public override XmlNode InsertAfter(XmlNode newChild, XmlNode refChild)
- {
- throw new InvalidOperationException("#text nodes do not have child nodes");
- }
-
- public override XmlNode CloneNode( bool deep)
- {
- throw new NotImplementedException();
- }
-
- public override void WriteContentTo(XmlWriter w)
- {
- throw new NotImplementedException();
- }
-
- public override void WriteTo(XmlWriter w)
- {
- throw new NotImplementedException();
- }
-
- // Internal method calls
- //===========================================================================
-
- // Constructors
- //===========================================================================
- internal XmlText (XmlDocument aOwnerDoc ) : base(aOwnerDoc)
- {
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
deleted file mode 100644
index 07894af09a3..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs
+++ /dev/null
@@ -1,1331 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlTextReader.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-// FIXME:
-// This can only parse basic XML: elements, attributes, processing
-// instructions, and comments are OK.
-//
-// It barfs on DOCTYPE declarations.
-//
-// There's also no checking being done for either well-formedness
-// or validity.
-//
-// ParserContext and NameTables aren't being used yet.
-//
-// Some thought needs to be given to performance. There's too many
-// strings being allocated.
-//
-// None of the MoveTo methods have been implemented yet.
-//
-// LineNumber and LinePosition aren't being tracked.
-//
-// xml:space, xml:lang, and xml:base aren't being tracked.
-//
-// Depth isn't being tracked.
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Net;
-using System.Text;
-
-namespace System.Xml
-{
- public class XmlTextReader : XmlReader, IXmlLineInfo
- {
- // constructors
-
- protected XmlTextReader()
- {
- Init();
- }
-
- public XmlTextReader(Stream input)
- {
- Init();
- reader = new StreamReader(
- input,
- Encoding.UTF8,
- true);
- }
-
- public XmlTextReader(string url)
- {
- Init();
- WebClient client = new WebClient();
- reader = new StreamReader(
- client.OpenRead(url),
- Encoding.UTF8,
- true);
- }
-
- public XmlTextReader(TextReader input)
- {
- Init();
- reader = input;
- }
-
- public XmlTextReader(Stream input, XmlNameTable nameTable)
- {
- this.nameTable = nameTable;
-
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public XmlTextReader(string baseURI, Stream input)
- {
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public XmlTextReader(string baseURI, TextReader input)
- {
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public XmlTextReader(string url, XmlNameTable nameTable)
- {
- this.nameTable = nameTable;
-
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public XmlTextReader(
- TextReader input,
- XmlNameTable nameTable)
- {
- this.nameTable = nameTable;
-
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public XmlTextReader(
- Stream inputFragment,
- XmlNodeType fragmentType,
- XmlParserContext context)
- {
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public XmlTextReader(
- string baseURI,
- Stream input,
- XmlNameTable nameTable)
- {
- this.nameTable = nameTable;
-
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public XmlTextReader(
- string baseURI,
- TextReader input,
- XmlNameTable nameTable)
- {
- this.nameTable = nameTable;
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- public XmlTextReader(
- string fragment,
- XmlNodeType fragmentType,
- XmlParserContext context)
- {
- // TODO: implement me.
- throw new NotImplementedException();
- }
-
- // properties
-
- public override int AttributeCount
- {
- get
- {
- return attributes.Count;
- }
- }
-
- public override string BaseURI
- {
- get
- {
- // TODO: implement me.
- return null;
- }
- }
-
- public override bool CanResolveEntity
- {
- get
- {
- // XmlTextReaders don't resolve entities.
- return false;
- }
- }
-
- public override int Depth
- {
- get
- {
- // TODO: implement me.
- return depth > 0 ? depth : 0;
- }
- }
-
- public Encoding Encoding
- {
- get
- {
- // TODO: implement me.
- return null;
- }
- }
-
- public override bool EOF
- {
- get
- {
- return
- readState == ReadState.EndOfFile ||
- readState == ReadState.Closed;
- }
- }
-
- public override bool HasValue
- {
- get
- {
- return value != String.Empty;
- }
- }
-
- public override bool IsDefault
- {
- get
- {
- // XmlTextReader does not expand default attributes.
- return false;
- }
- }
-
- public override bool IsEmptyElement
- {
- get
- {
- return isEmptyElement;
- }
- }
-
- public override string this[int i]
- {
- get
- {
- return GetAttribute(i);
- }
- }
-
- public override string this[string name]
- {
- get
- {
- return GetAttribute(name);
- }
- }
-
- public override string this[
- string localName,
- string namespaceName]
- {
- get
- {
- return GetAttribute(localName, namespaceName);
- }
- }
-
- public int LineNumber
- {
- get
- {
- // TODO: implement me.
- return 0;
- }
- }
-
- public int LinePosition
- {
- get
- {
- // TODO: implement me.
- return 0;
- }
- }
-
- public override string LocalName
- {
- get
- {
- return localName;
- }
- }
-
- public override string Name
- {
- get
- {
- return name;
- }
- }
-
- public bool Namespaces
- {
- get
- {
- // TODO: implement me.
- return false;
- }
-
- set
- {
- // TODO: implement me.
- }
- }
-
- public override string NamespaceURI
- {
- get
- {
- return namespaceURI;
- }
- }
-
- public override XmlNameTable NameTable
- {
- get
- {
- // TODO: implement me.
- return null;
- }
- }
-
- public override XmlNodeType NodeType
- {
- get
- {
- return nodeType;
- }
- }
-
- public bool Normalization
- {
- get
- {
- // TODO: implement me.
- return false;
- }
-
- set
- {
- // TODO: implement me.
- }
- }
-
- public override string Prefix
- {
- get
- {
- return prefix;
- }
- }
-
- public override char QuoteChar
- {
- get
- {
- // TODO: implement me.
- return '"';
- }
- }
-
- public override ReadState ReadState
- {
- get
- {
- return readState;
- }
- }
-
- public override string Value
- {
- get
- {
- return value;
- }
- }
-
- public WhitespaceHandling WhitespaceHandling
- {
- get
- {
- // TODO: implement me.
- return WhitespaceHandling.All;
- }
-
- set
- {
- // TODO: implement me.
- }
- }
-
- public override string XmlLang
- {
- get
- {
- // TODO: implement me.
- return null;
- }
- }
-
- public XmlResolver XmlResolver
- {
- set
- {
- // TODO: implement me.
- }
- }
-
- public override XmlSpace XmlSpace
- {
- get
- {
- // TODO: implement me.
- return XmlSpace.Default;
- }
- }
-
- // methods
-
- public override void Close()
- {
- readState = ReadState.Closed;
- }
-
- public override string GetAttribute(int i)
- {
- // TODO: implement me.
- return null;
- }
-
- public override string GetAttribute(string name)
- {
- return (string)attributes[name];
- }
-
- public override string GetAttribute(
- string localName,
- string namespaceURI)
- {
- foreach (DictionaryEntry entry in attributes)
- {
- string thisName = (string)entry.Key;
-
- int indexOfColon = thisName.IndexOf(':');
-
- if (indexOfColon != -1)
- {
- string thisLocalName = thisName.Substring(indexOfColon + 1);
-
- if (localName == thisLocalName)
- {
- string thisPrefix = thisName.Substring(0, indexOfColon);
- string thisNamespaceURI = LookupNamespace(thisPrefix);
-
- if (namespaceURI == thisNamespaceURI)
- {
- return (string)attributes[thisName];
- }
- }
- }
- else if (localName == "xmlns" && namespaceURI == "http://www.w3.org/2000/xmlns/" && thisName == "xmlns")
- {
- return (string)attributes[thisName];
- }
- }
-
- return String.Empty;
- }
-
- public TextReader GetRemainder()
- {
- // TODO: implement me.
- return null;
- }
-
- // Why does this use explicit interface implementation?
- bool IXmlLineInfo.HasLineInfo()
- {
- // TODO: implement me.
- return false;
- }
-
- public override string LookupNamespace(string prefix)
- {
- return namespaceManager.LookupNamespace(prefix);
- }
-
- public override void MoveToAttribute(int i)
- {
- // TODO: implement me.
- }
-
- public override bool MoveToAttribute(string name)
- {
- // TODO: implement me.
- return false;
- }
-
- public override bool MoveToAttribute(
- string localName,
- string namespaceName)
- {
- // TODO: implement me.
- return false;
- }
-
- public override bool MoveToElement()
- {
- // TODO: implement me.
- return false;
- }
-
- public override bool MoveToFirstAttribute()
- {
- // TODO: implement me.
- return false;
- }
-
- public override bool MoveToNextAttribute()
- {
- // TODO: implement me.
- return false;
- }
-
- public override bool Read()
- {
- bool more = false;
-
- readState = ReadState.Interactive;
-
- more = ReadContent();
-
- return more;
- }
-
- public override bool ReadAttributeValue()
- {
- // TODO: implement me.
- return false;
- }
-
- public int ReadBase64(byte[] buffer, int offset, int length)
- {
- // TODO: implement me.
- return 0;
- }
-
- public int ReadBinHex(byte[] buffer, int offset, int length)
- {
- // TODO: implement me.
- return 0;
- }
-
- public int ReadChars(char[] buffer, int offset, int length)
- {
- // TODO: implement me.
- return 0;
- }
-
- public override string ReadInnerXml()
- {
- // TODO: implement me.
- return null;
- }
-
- public override string ReadOuterXml()
- {
- // TODO: implement me.
- return null;
- }
-
- public override string ReadString()
- {
- // TODO: implement me.
- return null;
- }
-
- public override void ResolveEntity()
- {
- // XmlTextReaders don't resolve entities.
- throw new InvalidOperationException("XmlTextReaders don't resolve entities.");
- }
-
- // privates
-
- private TextReader reader;
- private ReadState readState;
-
- private int depth;
- private bool depthDown;
-
- private XmlNameTable nameTable;
- private XmlNamespaceManager namespaceManager;
- private bool popScope;
-
- private XmlNodeType nodeType;
- private string name;
- private string prefix;
- private string localName;
- private string namespaceURI;
- private bool isEmptyElement;
- private string value;
- private Hashtable attributes;
-
- private bool returnEntityReference;
- private string entityReferenceName;
-
- private char[] nameBuffer;
- private int nameLength;
- private int nameCapacity;
- private const int initialNameCapacity = 256;
-
- private char[] valueBuffer;
- private int valueLength;
- private int valueCapacity;
- private const int initialValueCapacity = 8192;
-
- private void Init()
- {
- namespaceManager = new XmlNamespaceManager(nameTable);
- popScope = false;
-
- readState = ReadState.Initial;
-
- depth = -1;
- depthDown = false;
-
- nodeType = XmlNodeType.None;
- name = String.Empty;
- prefix = String.Empty;
- localName = string.Empty;
- isEmptyElement = false;
- value = String.Empty;
- attributes = new Hashtable();
-
- returnEntityReference = false;
- entityReferenceName = String.Empty;
-
- nameBuffer = new char[initialNameCapacity];
- nameLength = 0;
- nameCapacity = initialNameCapacity;
-
- valueBuffer = new char[initialValueCapacity];
- valueLength = 0;
- valueCapacity = initialValueCapacity;
- }
-
- // Use this method rather than setting the properties
- // directly so that all the necessary properties can
- // be changed in harmony with each other. Maybe the
- // fields should be in a seperate class to help enforce
- // this.
- private void SetProperties(
- XmlNodeType nodeType,
- string name,
- bool isEmptyElement,
- string value,
- bool clearAttributes)
- {
- this.nodeType = nodeType;
- this.name = name;
- this.isEmptyElement = isEmptyElement;
- this.value = value;
-
- if (clearAttributes)
- {
- ClearAttributes();
- }
-
- int indexOfColon = name.IndexOf(':');
-
- if (indexOfColon == -1)
- {
- prefix = String.Empty;
- localName = name;
- }
- else
- {
- prefix = name.Substring(0, indexOfColon);
- localName = name.Substring(indexOfColon + 1);
- }
-
- namespaceURI = LookupNamespace(prefix);
- }
-
- private void AddAttribute(string name, string value)
- {
- attributes.Add(name, value);
- }
-
- private void ClearAttributes()
- {
- if (attributes.Count > 0)
- {
- attributes.Clear();
- }
- }
-
- private int PeekChar()
- {
- return reader.Peek();
- }
-
- private int ReadChar()
- {
- return reader.Read();
- }
-
- // This should really keep track of some state so
- // that it's not possible to have more than one document
- // element or text outside of the document element.
- private bool ReadContent()
- {
- bool more = false;
-
- if (popScope)
- {
- namespaceManager.PopScope();
- popScope = false;
- }
-
- if (depthDown)
- {
- --depth;
- }
-
- if (returnEntityReference)
- {
- ++depth;
- SetEntityReferenceProperties();
- more = true;
- }
- else
- {
- switch (PeekChar())
- {
- case '<':
- ReadChar();
- ReadTag();
- more = true;
- break;
- case -1:
- readState = ReadState.EndOfFile;
- SetProperties(
- XmlNodeType.None, // nodeType
- String.Empty, // name
- false, // isEmptyElement
- String.Empty, // value
- true // clearAttributes
- );
- more = false;
- break;
- default:
- ReadText();
- more = true;
- break;
- }
- }
-
- return more;
- }
-
- private void SetEntityReferenceProperties()
- {
- SetProperties(
- XmlNodeType.EntityReference, // nodeType
- entityReferenceName, // name
- false, // isEmptyElement
- String.Empty, // value
- true // clearAttributes
- );
-
- returnEntityReference = false;
- entityReferenceName = String.Empty;
- }
-
- // The leading '<' has already been consumed.
- private void ReadTag()
- {
- switch (PeekChar())
- {
- case '/':
- ReadChar();
- ReadEndTag();
- break;
- case '?':
- ReadChar();
- ReadProcessingInstruction();
- break;
- case '!':
- ReadChar();
- ReadDeclaration();
- break;
- default:
- ReadStartTag();
- break;
- }
- }
-
- // The leading '<' has already been consumed.
- private void ReadStartTag()
- {
- namespaceManager.PushScope();
-
- string name = ReadName();
- SkipWhitespace();
-
- bool isEmptyElement = false;
-
- ClearAttributes();
-
- if (XmlChar.IsFirstNameChar(PeekChar()))
- {
- ReadAttributes();
- }
-
- if (PeekChar() == '/')
- {
- ReadChar();
- isEmptyElement = true;
- depthDown = true;
- popScope = true;
- }
-
- Expect('>');
-
- ++depth;
-
- SetProperties(
- XmlNodeType.Element, // nodeType
- name, // name
- isEmptyElement, // isEmptyElement
- String.Empty, // value
- false // clearAttributes
- );
- }
-
- // The reader is positioned on the first character
- // of the element's name.
- private void ReadEndTag()
- {
- string name = ReadName();
- SkipWhitespace();
- Expect('>');
-
- --depth;
-
- SetProperties(
- XmlNodeType.EndElement, // nodeType
- name, // name
- false, // isEmptyElement
- String.Empty, // value
- true // clearAttributes
- );
-
- popScope = true;
- }
-
- private void AppendNameChar(int ch)
- {
- CheckNameCapacity();
- nameBuffer[nameLength++] = (char)ch;
- }
-
- private void CheckNameCapacity()
- {
- if (nameLength == nameCapacity)
- {
- nameCapacity = nameCapacity * 2;
- char[] oldNameBuffer = nameBuffer;
- nameBuffer = new char[nameCapacity];
- Array.Copy(oldNameBuffer, nameBuffer, nameLength);
- }
- }
-
- private string CreateNameString()
- {
- return new String(nameBuffer, 0, nameLength);
- }
-
- private void AppendValueChar(int ch)
- {
- CheckValueCapacity();
- valueBuffer[valueLength++] = (char)ch;
- }
-
- private void CheckValueCapacity()
- {
- if (valueLength == valueCapacity)
- {
- valueCapacity = valueCapacity * 2;
- char[] oldValueBuffer = valueBuffer;
- valueBuffer = new char[valueCapacity];
- Array.Copy(oldValueBuffer, valueBuffer, valueLength);
- }
- }
-
- private string CreateValueString()
- {
- return new String(valueBuffer, 0, valueLength);
- }
-
- // The reader is positioned on the first character
- // of the text.
- private void ReadText()
- {
- valueLength = 0;
-
- int ch = PeekChar();
-
- while (ch != '<' && ch != -1)
- {
- if (ch == '&')
- {
- ReadChar();
-
- if (ReadReference(false))
- {
- break;
- }
- }
- else
- {
- AppendValueChar(ReadChar());
- }
-
- ch = PeekChar();
- }
-
- if (returnEntityReference && valueLength == 0)
- {
- ++depth;
- SetEntityReferenceProperties();
- }
- else
- {
- if (depth >= 0)
- {
- ++depth;
- depthDown = true;
- }
-
- SetProperties(
- XmlNodeType.Text, // nodeType
- String.Empty, // name
- false, // isEmptyElement
- CreateValueString(), // value
- true // clearAttributes
- );
- }
- }
-
- // The leading '&' has already been consumed.
- // Returns true if the entity reference isn't a simple
- // character reference or one of the predefined entities.
- // This allows the ReadText method to break so that the
- // next call to Read will return the EntityReference node.
- private bool ReadReference(bool ignoreEntityReferences)
- {
- if (PeekChar() == '#')
- {
- ReadChar();
- ReadCharacterReference();
- }
- else
- {
- ReadEntityReference(ignoreEntityReferences);
- }
-
- return returnEntityReference;
- }
-
- private void ReadCharacterReference()
- {
- int value = 0;
-
- if (PeekChar() == 'x')
- {
- ReadChar();
-
- while (PeekChar() != ';' && PeekChar() != -1)
- {
- int ch = ReadChar();
-
- if (ch >= '0' && ch <= '9')
- {
- value = (value << 4) + ch - '0';
- }
- else if (ch >= 'A' && ch <= 'F')
- {
- value = (value << 4) + ch - 'A' + 10;
- }
- else if (ch >= 'a' && ch <= 'f')
- {
- value = (value << 4) + ch - 'a' + 10;
- }
- else
- {
- throw new Exception(
- String.Format(
- "invalid hexadecimal digit: {0} (#x{1:X})",
- (char)ch,
- ch));
- }
- }
- }
- else
- {
- while (PeekChar() != ';' && PeekChar() != -1)
- {
- int ch = ReadChar();
-
- if (ch >= '0' && ch <= '9')
- {
- value = value * 10 + ch - '0';
- }
- else
- {
- throw new Exception(
- String.Format(
- "invalid decimal digit: {0} (#x{1:X})",
- (char)ch,
- ch));
- }
- }
- }
-
- ReadChar(); // ';'
-
- AppendValueChar(value);
- }
-
- private void ReadEntityReference(bool ignoreEntityReferences)
- {
- nameLength = 0;
-
- int ch = PeekChar();
-
- while (ch != ';' && ch != -1)
- {
- AppendNameChar(ReadChar());
- ch = PeekChar();
- }
-
- Expect(';');
-
- string name = CreateNameString();
-
- switch (name)
- {
- case "lt":
- AppendValueChar('<');
- break;
- case "gt":
- AppendValueChar('>');
- break;
- case "amp":
- AppendValueChar('&');
- break;
- case "apos":
- AppendValueChar('\'');
- break;
- case "quot":
- AppendValueChar('"');
- break;
- default:
- if (ignoreEntityReferences)
- {
- AppendValueChar('&');
-
- foreach (char ch2 in name)
- {
- AppendValueChar(ch2);
- }
-
- AppendValueChar(';');
- }
- else
- {
- returnEntityReference = true;
- entityReferenceName = name;
- }
- break;
- }
- }
-
- // The reader is positioned on the first character of
- // the attribute name.
- private void ReadAttributes()
- {
- do
- {
- string name = ReadName();
- SkipWhitespace();
- Expect('=');
- SkipWhitespace();
- string value = ReadAttribute();
- SkipWhitespace();
-
- if (name == "xmlns")
- {
- namespaceManager.AddNamespace(String.Empty, value);
- }
- else if (name.StartsWith("xmlns:"))
- {
- namespaceManager.AddNamespace(name.Substring(6), value);
- }
-
- AddAttribute(name, value);
- }
- while (PeekChar() != '/' && PeekChar() != '>' && PeekChar() != -1);
- }
-
- // The reader is positioned on the quote character.
- private string ReadAttribute()
- {
- int quoteChar = ReadChar();
-
- if (quoteChar != '\'' && quoteChar != '\"')
- {
- throw new Exception("an attribute value was not quoted");
- }
-
- valueLength = 0;
-
- while (PeekChar() != quoteChar)
- {
- int ch = ReadChar();
-
- switch (ch)
- {
- case '<':
- throw new Exception("attribute values cannot contain '<'");
- case '&':
- ReadReference(true);
- break;
- case -1:
- throw new Exception("unexpected end of file in an attribute value");
- default:
- AppendValueChar(ch);
- break;
- }
- }
-
- ReadChar(); // quoteChar
-
- return CreateValueString();
- }
-
- // The reader is positioned on the first character
- // of the target.
- private void ReadProcessingInstruction()
- {
- string target = ReadName();
- SkipWhitespace();
-
- valueLength = 0;
-
- while (PeekChar() != -1)
- {
- int ch = ReadChar();
-
- if (ch == '?' && PeekChar() == '>')
- {
- ReadChar();
- break;
- }
-
- AppendValueChar((char)ch);
- }
-
- SetProperties(
- XmlNodeType.ProcessingInstruction, // nodeType
- target, // name
- false, // isEmptyElement
- CreateValueString(), // value
- true // clearAttributes
- );
- }
-
- // The reader is positioned on the first character after
- // the leading '<!'.
- private void ReadDeclaration()
- {
- int ch = PeekChar();
-
- switch (ch)
- {
- case '-':
- Expect('-');
- Expect('-');
- ReadComment();
- break;
- case '[':
- ReadChar();
- Expect('C');
- Expect('D');
- Expect('A');
- Expect('T');
- Expect('A');
- Expect('[');
- ReadCDATA();
- break;
- }
- }
-
- // The reader is positioned on the first character after
- // the leading '<!--'.
- private void ReadComment()
- {
- valueLength = 0;
-
- while (PeekChar() != -1)
- {
- int ch = ReadChar();
-
- if (ch == '-' && PeekChar() == '-')
- {
- ReadChar();
-
- if (PeekChar() != '>')
- {
- throw new Exception("comments cannot contain '--'");
- }
-
- ReadChar();
- break;
- }
-
- AppendValueChar((char)ch);
- }
-
- SetProperties(
- XmlNodeType.Comment, // nodeType
- String.Empty, // name
- false, // isEmptyElement
- CreateValueString(), // value
- true // clearAttributes
- );
- }
-
- // The reader is positioned on the first character after
- // the leading '<![CDATA['.
- private void ReadCDATA()
- {
- valueLength = 0;
-
- while (PeekChar() != -1)
- {
- int ch = ReadChar();
-
- if (ch == ']' && PeekChar() == ']')
- {
- ch = ReadChar(); // ']'
-
- if (PeekChar() == '>')
- {
- ReadChar(); // '>'
- break;
- }
- else
- {
- AppendValueChar(']');
- AppendValueChar(']');
- ch = ReadChar();
- }
- }
-
- AppendValueChar((char)ch);
- }
-
- ++depth;
-
- SetProperties(
- XmlNodeType.CDATA, // nodeType
- String.Empty, // name
- false, // isEmptyElement
- CreateValueString(), // value
- true // clearAttributes
- );
- }
-
- // The reader is positioned on the first character
- // of the name.
- private string ReadName()
- {
- if (!XmlChar.IsFirstNameChar(PeekChar()))
- {
- throw new Exception("a name did not start with a legal character");
- }
-
- nameLength = 0;
-
- AppendNameChar(ReadChar());
-
- while (XmlChar.IsNameChar(PeekChar()))
- {
- AppendNameChar(ReadChar());
- }
-
- return CreateNameString();
- }
-
- // Read the next character and compare it against the
- // specified character.
- private void Expect(int expected)
- {
- int ch = ReadChar();
-
- if (ch != expected)
- {
- throw new Exception(String.Format(
- "expected '{0}' ({1:X}) but found '{2}' ({3:X})",
- (char)expected,
- expected,
- (char)ch,
- ch));
- }
- }
-
- // Does not consume the first non-whitespace character.
- private void SkipWhitespace()
- {
- while (XmlChar.IsWhitespace(PeekChar()))
- {
- ReadChar();
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlTokenizedType.cs b/mcs/class/System.XML/System.Xml/XmlTokenizedType.cs
deleted file mode 100755
index 13762770ce6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlTokenizedType.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Xml.XmlTokenizedType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- [Serializable] public enum XmlTokenizedType
- {
- CDATA = 0,
- ID = 1,
- IDREF = 2,
- IDREFS = 3,
- ENTITY = 4,
- ENTITIES = 5,
- NMTOKEN = 6,
- NMTOKENS = 7,
- NOTATION = 8,
- ENUMERATION = 9,
- QName = 10,
- NCName = 11,
- None = 12,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs b/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs
deleted file mode 100755
index 54750bb6f60..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// System.Xml.XmlUrlResolver.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System.Net;
-
-namespace System.Xml
-{
- public class XmlUrlResolver : XmlResolver
- {
- // Field
- ICredentials credential;
-
- // Constructor
- public XmlUrlResolver ()
- : base ()
- {
- }
-
- // Properties
- public override ICredentials Credentials
- {
- set { credential = value; }
- }
-
- // Methods
- [MonoTODO]
- public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn)
- {
- return null;
- }
-
- public override Uri ResolveUri (Uri baseUri, string relativeUri)
- {
- return new Uri (baseUri, relativeUri);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlUtil.cs b/mcs/class/System.XML/System.Xml/XmlUtil.cs
deleted file mode 100644
index 361f1f59c22..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlUtil.cs
+++ /dev/null
@@ -1,1067 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// internal System.Xml.XmlUtil
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-// Code ported from Open XML 2.3.17 (Delphi/Kylix)
-//
-// (C) 2001 Daniel Weber
-//
-
-using System;
-using System.IO;
-
-namespace System.Xml
-{
- /// <summary>
- /// Helper class with static utility functions that are not Xml version specific
- /// Such as encoding changes
- /// </summary>
- internal class XmlUtil
- {
- public static char Iso8859_1ToUTF16Char(byte P)
- {
- return (char) P;
- }
-
- public static char Iso8859_2ToUTF16Char(byte P)
- {
- switch (P)
- {
- case 0xa1: return (char) 0x0104; // LATIN CAPITAL LETTER A WITH OGONEK
- case 0xa2: return (char) 0x02d8; // BREVE
- case 0xa3: return (char) 0x0141; // LATIN CAPITAL LETTER L WITH STROKE
- case 0xa5: return (char) 0x0132; // LATIN CAPITAL LETTER L WITH CARON
- case 0xa6: return (char) 0x015a; // LATIN CAPITAL LETTER S WITH ACUTE
- case 0xa9: return (char) 0x0160; // LATIN CAPITAL LETTER S WITH CARON
- case 0xaa: return (char) 0x015e; // LATIN CAPITAL LETTER S WITH CEDILLA
- case 0xab: return (char) 0x0164; // LATIN CAPITAL LETTER T WITH CARON
- case 0xac: return (char) 0x0179; // LATIN CAPITAL LETTER Z WITH ACUTE
- case 0xae: return (char) 0x017d; // LATIN CAPITAL LETTER Z WITH CARON
- case 0xaf: return (char) 0x017b; // LATIN CAPITAL LETTER Z WITH DOT ABOVE
- case 0xb1: return (char) 0x0105; // LATIN SMALL LETTER A WITH OGONEK
- case 0xb2: return (char) 0x02db; // OGONEK
- case 0xb3: return (char) 0x0142; // LATIN SMALL LETTER L WITH STROKE
- case 0xb5: return (char) 0x013e; // LATIN SMALL LETTER L WITH CARON
- case 0xb6: return (char) 0x015b; // LATIN SMALL LETTER S WITH ACUTE
- case 0xb7: return (char) 0x02c7; // CARON
- case 0xb9: return (char) 0x0161; // LATIN SMALL LETTER S WITH CARON
- case 0xba: return (char) 0x015f; // LATIN SMALL LETTER S WITH CEDILLA
- case 0xbb: return (char) 0x0165; // LATIN SMALL LETTER T WITH CARON
- case 0xbc: return (char) 0x017a; // LATIN SMALL LETTER Z WITH ACUTE
- case 0xbd: return (char) 0x02dd; // DOUBLE ACUTE ACCENT
- case 0xbe: return (char) 0x017e; // LATIN SMALL LETTER Z WITH CARON
- case 0xbf: return (char) 0x017c; // LATIN SMALL LETTER Z WITH DOT ABOVE
- case 0xc0: return (char) 0x0154; // LATIN CAPITAL LETTER R WITH ACUTE
- case 0xc3: return (char) 0x0102; // LATIN CAPITAL LETTER A WITH BREVE
- case 0xc5: return (char) 0x0139; // LATIN CAPITAL LETTER L WITH ACUTE
- case 0xc6: return (char) 0x0106; // LATIN CAPITAL LETTER C WITH ACUTE
- case 0xc8: return (char) 0x010c; // LATIN CAPITAL LETTER C WITH CARON
- case 0xca: return (char) 0x0118; // LATIN CAPITAL LETTER E WITH OGONEK
- case 0xcc: return (char) 0x011a; // LATIN CAPITAL LETTER E WITH CARON
- case 0xcf: return (char) 0x010e; // LATIN CAPITAL LETTER D WITH CARON
- case 0xd0: return (char) 0x0110; // LATIN CAPITAL LETTER D WITH STROKE
- case 0xd1: return (char) 0x0143; // LATIN CAPITAL LETTER N WITH ACUTE
- case 0xd2: return (char) 0x0147; // LATIN CAPITAL LETTER N WITH CARON
- case 0xd5: return (char) 0x0150; // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
- case 0xd8: return (char) 0x0158; // LATIN CAPITAL LETTER R WITH CARON
- case 0xd9: return (char) 0x016e; // LATIN CAPITAL LETTER U WITH RING ABOVE
- case 0xdb: return (char) 0x0170; // LATIN CAPITAL LETTER U WITH WITH DOUBLE ACUTE
- case 0xde: return (char) 0x0162; // LATIN CAPITAL LETTER T WITH CEDILLA
- case 0xe0: return (char) 0x0155; // LATIN SMALL LETTER R WITH ACUTE
- case 0xe3: return (char) 0x0103; // LATIN SMALL LETTER A WITH BREVE
- case 0xe5: return (char) 0x013a; // LATIN SMALL LETTER L WITH ACUTE
- case 0xe6: return (char) 0x0107; // LATIN SMALL LETTER C WITH ACUTE
- case 0xe8: return (char) 0x010d; // LATIN SMALL LETTER C WITH CARON
- case 0xea: return (char) 0x0119; // LATIN SMALL LETTER E WITH OGONEK
- case 0xec: return (char) 0x011b; // LATIN SMALL LETTER E WITH CARON
- case 0xef: return (char) 0x010f; // LATIN SMALL LETTER D WITH CARON
- case 0xf0: return (char) 0x0111; // LATIN SMALL LETTER D WITH STROKE
- case 0xf1: return (char) 0x0144; // LATIN SMALL LETTER N WITH ACUTE
- case 0xf2: return (char) 0x0148; // LATIN SMALL LETTER N WITH CARON
- case 0xf5: return (char) 0x0151; // LATIN SMALL LETTER O WITH DOUBLE ACUTE
- case 0xf8: return (char) 0x0159; // LATIN SMALL LETTER R WITH CARON
- case 0xf9: return (char) 0x016f; // LATIN SMALL LETTER U WITH RING ABOVE
- case 0xfb: return (char) 0x0171; // LATIN SMALL LETTER U WITH WITH DOUBLE ACUTE
- case 0xfe: return (char) 0x0163; // LATIN SMALL LETTER T WITH CEDILLA
- case 0xff: return (char) 0x02d9; // DOT ABOVE
- default:
- return (char) P;
- }
- }
-
- public static char Iso8859_3ToUTF16Char( byte P)
- {
- switch (P)
- {
- case 0xa1: return (char) 0x0126; // LATIN CAPITAL LETTER H WITH STROKE
- case 0xa2: return (char) 0x02d8; // BREVE
- case 0xa5: throw new InvalidOperationException("Invalid ISO-8859-3 sequence [" + P.ToString() + "]");
- case 0xa6: return (char) 0x0124; // LATIN CAPITAL LETTER H WITH CIRCUMFLEX
- case 0xa9: return (char) 0x0130; // LATIN CAPITAL LETTER I WITH DOT ABOVE
- case 0xaa: return (char) 0x015e; // LATIN CAPITAL LETTER S WITH CEDILLA
- case 0xab: return (char) 0x011e; // LATIN CAPITAL LETTER G WITH BREVE
- case 0xac: return (char) 0x0134; // LATIN CAPITAL LETTER J WITH CIRCUMFLEX
- case 0xae: throw new InvalidOperationException("Invalid ISO-8859-3 sequence [" + P.ToString() + "]");
- case 0xaf: return (char) 0x017b; // LATIN CAPITAL LETTER Z WITH DOT
- case 0xb1: return (char) 0x0127; // LATIN SMALL LETTER H WITH STROKE
- case 0xb6: return (char) 0x0125; // LATIN SMALL LETTER H WITH CIRCUMFLEX
- case 0xb9: return (char) 0x0131; // LATIN SMALL LETTER DOTLESS I
- case 0xba: return (char) 0x015f; // LATIN SMALL LETTER S WITH CEDILLA
- case 0xbb: return (char) 0x011f; // LATIN SMALL LETTER G WITH BREVE
- case 0xbc: return (char) 0x0135; // LATIN SMALL LETTER J WITH CIRCUMFLEX
- case 0xbe: throw new InvalidOperationException("Invalid ISO-8859-3 sequence [" + P.ToString() + "]");
- case 0xbf: return (char) 0x017c; // LATIN SMALL LETTER Z WITH DOT
- case 0xc3: throw new InvalidOperationException("Invalid ISO-8859-3 sequence [" + P.ToString() + "]");
- case 0xc5: return (char) 0x010a; // LATIN CAPITAL LETTER C WITH DOT ABOVE
- case 0xc6: return (char) 0x0108; // LATIN CAPITAL LETTER C WITH CIRCUMFLEX
- case 0xd0: throw new InvalidOperationException("Invalid ISO-8859-3 sequence [" + P.ToString() + "]");
- case 0xd5: return (char) 0x0120; // LATIN CAPITAL LETTER G WITH DOT ABOVE
- case 0xd8: return (char) 0x011c; // LATIN CAPITAL LETTER G WITH CIRCUMFLEX
- case 0xdd: return (char) 0x016c; // LATIN CAPITAL LETTER U WITH BREVE
- case 0xde: return (char) 0x015c; // LATIN CAPITAL LETTER S WITH CIRCUMFLEX
- case 0xe3: throw new InvalidOperationException("Invalid ISO-8859-3 sequence [" + P.ToString() + "]");
- case 0xe5: return (char) 0x010b; // LATIN SMALL LETTER C WITH DOT ABOVE
- case 0xe6: return (char) 0x0109; // LATIN SMALL LETTER C WITH CIRCUMFLEX
- case 0xf0: throw new InvalidOperationException("Invalid ISO-8859-3 sequence [" + P.ToString() + "]");
- case 0xf5: return (char) 0x0121; // LATIN SMALL LETTER G WITH DOT ABOVE
- case 0xf8: return (char) 0x011d; // LATIN SMALL LETTER G WITH CIRCUMFLEX
- case 0xfd: return (char) 0x016d; // LATIN SMALL LETTER U WITH BREVE
- case 0xfe: return (char) 0x015d; // LATIN SMALL LETTER S WITH CIRCUMFLEX
- case 0xff: return (char) 0x02d9; // DOT ABOVE
- default:
- return (char) P;
- }
- }
-
- public static char Iso8859_4ToUTF16Char( byte P)
- {
- switch (P)
- {
- case 0xa1: return (char) 0x0104; // LATIN CAPITAL LETTER A WITH OGONEK
- case 0xa2: return (char) 0x0138; // LATIN SMALL LETTER KRA
- case 0xa3: return (char) 0x0156; // LATIN CAPITAL LETTER R WITH CEDILLA
- case 0xa5: return (char) 0x0128; // LATIN CAPITAL LETTER I WITH TILDE
- case 0xa6: return (char) 0x013b; // LATIN CAPITAL LETTER L WITH CEDILLA
- case 0xa9: return (char) 0x0160; // LATIN CAPITAL LETTER S WITH CARON
- case 0xaa: return (char) 0x0112; // LATIN CAPITAL LETTER E WITH MACRON
- case 0xab: return (char) 0x0122; // LATIN CAPITAL LETTER G WITH CEDILLA
- case 0xac: return (char) 0x0166; // LATIN CAPITAL LETTER T WITH STROKE
- case 0xae: return (char) 0x017d; // LATIN CAPITAL LETTER Z WITH CARON
- case 0xb1: return (char) 0x0105; // LATIN SMALL LETTER A WITH OGONEK
- case 0xb2: return (char) 0x02db; // OGONEK
- case 0xb3: return (char) 0x0157; // LATIN SMALL LETTER R WITH CEDILLA
- case 0xb5: return (char) 0x0129; // LATIN SMALL LETTER I WITH TILDE
- case 0xb6: return (char) 0x013c; // LATIN SMALL LETTER L WITH CEDILLA
- case 0xb7: return (char) 0x02c7; // CARON
- case 0xb9: return (char) 0x0161; // LATIN SMALL LETTER S WITH CARON
- case 0xba: return (char) 0x0113; // LATIN SMALL LETTER E WITH MACRON
- case 0xbb: return (char) 0x0123; // LATIN SMALL LETTER G WITH CEDILLA
- case 0xbc: return (char) 0x0167; // LATIN SMALL LETTER T WITH STROKE
- case 0xbd: return (char) 0x014a; // LATIN CAPITAL LETTER ENG
- case 0xbe: return (char) 0x017e; // LATIN SMALL LETTER Z WITH CARON
- case 0xbf: return (char) 0x014b; // LATIN SMALL LETTER ENG
- case 0xc0: return (char) 0x0100; // LATIN CAPITAL LETTER A WITH MACRON
- case 0xc7: return (char) 0x012e; // LATIN CAPITAL LETTER I WITH OGONEK
- case 0xc8: return (char) 0x010c; // LATIN CAPITAL LETTER C WITH CARON
- case 0xca: return (char) 0x0118; // LATIN CAPITAL LETTER E WITH OGONEK
- case 0xcc: return (char) 0x0116; // LATIN CAPITAL LETTER E WITH DOT ABOVE
- case 0xcf: return (char) 0x012a; // LATIN CAPITAL LETTER I WITH MACRON
- case 0xd0: return (char) 0x0110; // LATIN CAPITAL LETTER D WITH STROKE
- case 0xd1: return (char) 0x0145; // LATIN CAPITAL LETTER N WITH CEDILLA
- case 0xd2: return (char) 0x014c; // LATIN CAPITAL LETTER O WITH MACRON
- case 0xd3: return (char) 0x0136; // LATIN CAPITAL LETTER K WITH CEDILLA
- case 0xd9: return (char) 0x0172; // LATIN CAPITAL LETTER U WITH OGONEK
- case 0xdd: return (char) 0x0168; // LATIN CAPITAL LETTER U WITH TILDE
- case 0xde: return (char) 0x016a; // LATIN CAPITAL LETTER U WITH MACRON
- case 0xe0: return (char) 0x0101; // LATIN SMALL LETTER A WITH MACRON
- case 0xe7: return (char) 0x012f; // LATIN SMALL LETTER I WITH OGONEK
- case 0xe8: return (char) 0x010d; // LATIN SMALL LETTER C WITH CARON
- case 0xea: return (char) 0x0119; // LATIN SMALL LETTER E WITH OGONEK
- case 0xec: return (char) 0x0117; // LATIN SMALL LETTER E WITH DOT ABOVE
- case 0xef: return (char) 0x012b; // LATIN SMALL LETTER I WITH MACRON
- case 0xf0: return (char) 0x0111; // LATIN SMALL LETTER D WITH STROKE
- case 0xf1: return (char) 0x0146; // LATIN SMALL LETTER N WITH CEDILLA
- case 0xf2: return (char) 0x014d; // LATIN SMALL LETTER O WITH MACRON
- case 0xf3: return (char) 0x0137; // LATIN SMALL LETTER K WITH CEDILLA
- case 0xf9: return (char) 0x0173; // LATIN SMALL LETTER U WITH OGONEK
- case 0xfd: return (char) 0x0169; // LATIN SMALL LETTER U WITH TILDE
- case 0xfe: return (char) 0x016b; // LATIN SMALL LETTER U WITH MACRON
- case 0xff: return (char) 0x02d9; // DOT ABOVE
- default:
- return (char) P;
- }
- }
-
- public static char Iso8859_5ToUTF16Char(byte P)
- {
- if ( (P >= 0x00) & (P <= 0xa0) )
- return (char) P;
- else if ( P == 0xad )
- return (char) P;
- else if ( P == 0xf0 )
- return (char) 0x2116; // NUMERO SIGN
- else if ( P == 0xfd )
- return (char) 0x00a7; // SECTION SIGN
- else
- return System.Convert.ToChar( 0x0360 + P );
- }
-
- public static char Iso8859_6ToUTF16Char(byte P)
- {
- if ( (P >= 0x00) & ( P <= 0xa0) )
- return (char) P;
- else if ( P == 0xa4)
- return (char) P;
- else if ( ( P == 0xac ) | (P==0xbb) | (P==0xbf) )
- return System.Convert.ToChar(P + 0x0580);
- else if ( (P >= 0xc1) & ( P <= 0xda) )
- return System.Convert.ToChar(P + 0x0580);
- else if ( (P >= 0xe0) & ( P <= 0xf2) )
- return System.Convert.ToChar(P + 0x0580);
- else
- throw new InvalidOperationException("Invalid ISO-8859-6 sequence [" + P.ToString() + "]");
- }
-
- public static char Iso8859_7ToUTF16Char(byte P)
- {
- if ( (P >= 0x00) & ( P <= 0xa0) )
- return (char) P;
- else if ( (P >= 0xa6) & ( P <= 0xa9) )
- return (char) P;
- else if ( (P >= 0xab) & ( P <= 0xad) )
- return (char) P;
- else if ( (P >= 0xb0) & ( P <= 0xb3) )
- return (char) P;
- else if ( (P == 0xb7) | (P==0xbb) | (P==0xbd) )
- return (char) P;
- else if ( P ==0xa1 ) // LEFT SINGLE QUOTATION MARK
- return (char) 0x2018;
- else if ( P==0xa2 ) // RIGHT SINGLE QUOTATION MARK
- return (char) 0x2019;
- else if ( P==0xaf ) // HORIZONTAL BAR
- return (char) 0x2015;
- else if ( (P==0xd2) | (P==0xff) )
- throw new InvalidOperationException("Invalid ISO-8859-7 sequence [" + P.ToString() + "]");
- else
- return System.Convert.ToChar(P + 0x02d0);
-
- }
-
- public static char Iso8859_8ToUTF16Char(byte P)
- {
- if ( (P >= 0x00) & ( P <= 0xa0) )
- return (char) P;
- else if ( (P >= 0xa2) & ( P <= 0xa9) )
- return (char) P;
- else if ( (P >= 0xab) & ( P <= 0xae) )
- return (char) P;
- else if ( (P >= 0xb0) & ( P <= 0xb9) )
- return (char) P;
- else if ( (P >= 0xbb) & ( P <= 0xbe) )
- return (char) P;
- else if ( P==0xaa ) // MULTIPLICATION SIGN
- return (char) 0x00d7;
- else if ( P==0xaf ) // OVERLINE
- return (char) 0x203e;
- else if ( P==0xba ) // DIVISION SIGN
- return (char) 0x00f7;
- else if ( P==0xdf ) // DOUBLE LOW LINE
- return (char) 0x2017;
- else if ( (P >= 0xe0) & ( P <= 0xfa) )
- return System.Convert.ToChar(P + 0x04e0);
- else
- throw new InvalidOperationException("Invalid ISO-8859-8 sequence [" + P.ToString() + "]");
- }
-
- public static char Iso8859_9ToUTF16Char(byte P)
- {
- switch (P)
- {
- case 0xd0: return (char) 0x011e; // LATIN CAPITAL LETTER G WITH BREVE
- case 0xdd: return (char) 0x0130; // LATIN CAPITAL LETTER I WITH DOT ABOVE
- case 0xde: return (char) 0x015e; // LATIN CAPITAL LETTER S WITH CEDILLA
- case 0xf0: return (char) 0x011f; // LATIN SMALL LETTER G WITH BREVE
- case 0xfd: return (char) 0x0131; // LATIN SMALL LETTER I WITH DOT ABOVE
- case 0xfe: return (char) 0x015f; // LATIN SMALL LETTER S WITH CEDILLA
- default:
- return (char) P;
- }
- }
-
- public static char Iso8859_10ToUTF16Char(byte P)
- {
- switch (P)
- {
- case 0xa1: return (char) 0x0104; // LATIN CAPITAL LETTER A WITH OGONEK
- case 0xa2: return (char) 0x0112; // LATIN CAPITAL LETTER E WITH MACRON
- case 0xa3: return (char) 0x0122; // LATIN CAPITAL LETTER G WITH CEDILLA
- case 0xa4: return (char) 0x012a; // LATIN CAPITAL LETTER I WITH MACRON
- case 0xa5: return (char) 0x0128; // LATIN CAPITAL LETTER I WITH TILDE
- case 0xa6: return (char) 0x0136; // LATIN CAPITAL LETTER K WITH CEDILLA
- case 0xa8: return (char) 0x013b; // LATIN CAPITAL LETTER L WITH CEDILLA
- case 0xa9: return (char) 0x0110; // LATIN CAPITAL LETTER D WITH STROKE
- case 0xaa: return (char) 0x0160; // LATIN CAPITAL LETTER S WITH CARON
- case 0xab: return (char) 0x0166; // LATIN CAPITAL LETTER T WITH STROKE
- case 0xac: return (char) 0x017d; // LATIN CAPITAL LETTER Z WITH CARON
- case 0xae: return (char) 0x016a; // LATIN CAPITAL LETTER U WITH MACRON
- case 0xaf: return (char) 0x014a; // LATIN CAPITAL LETTER ENG
- case 0xb1: return (char) 0x0105; // LATIN SMALL LETTER A WITH OGONEK
- case 0xb2: return (char) 0x0113; // LATIN SMALL LETTER E WITH MACRON
- case 0xb3: return (char) 0x0123; // LATIN SMALL LETTER G WITH CEDILLA
- case 0xb4: return (char) 0x012b; // LATIN SMALL LETTER I WITH MACRON
- case 0xb5: return (char) 0x0129; // LATIN SMALL LETTER I WITH TILDE
- case 0xb6: return (char) 0x0137; // LATIN SMALL LETTER K WITH CEDILLA
- case 0xb8: return (char) 0x013c; // LATIN SMALL LETTER L WITH CEDILLA
- case 0xb9: return (char) 0x0111; // LATIN SMALL LETTER D WITH STROKE
- case 0xba: return (char) 0x0161; // LATIN SMALL LETTER S WITH CARON
- case 0xbb: return (char) 0x0167; // LATIN SMALL LETTER T WITH STROKE
- case 0xbc: return (char) 0x017e; // LATIN SMALL LETTER Z WITH CARON
- case 0xbd: return (char) 0x2015; // HORIZONTAL BAR
- case 0xbe: return (char) 0x016b; // LATIN SMALL LETTER U WITH MACRON
- case 0xbf: return (char) 0x014b; // LATIN SMALL LETTER ENG
- case 0xc0: return (char) 0x0100; // LATIN CAPITAL LETTER A WITH MACRON
- case 0xc7: return (char) 0x012e; // LATIN CAPITAL LETTER I WITH OGONEK
- case 0xc8: return (char) 0x010c; // LATIN CAPITAL LETTER C WITH CARON
- case 0xca: return (char) 0x0118; // LATIN CAPITAL LETTER E WITH OGONEK
- case 0xcc: return (char) 0x0116; // LATIN CAPITAL LETTER E WITH DOT ABOVE
- case 0xd1: return (char) 0x0145; // LATIN CAPITAL LETTER N WITH CEDILLA
- case 0xd2: return (char) 0x014c; // LATIN CAPITAL LETTER O WITH MACRON
- case 0xd7: return (char) 0x0168; // LATIN CAPITAL LETTER U WITH TILDE
- case 0xd9: return (char) 0x0172; // LATIN CAPITAL LETTER U WITH OGONEK
- case 0xe0: return (char) 0x0101; // LATIN SMALL LETTER A WITH MACRON
- case 0xe7: return (char) 0x012f; // LATIN SMALL LETTER I WITH OGONEK
- case 0xe8: return (char) 0x010d; // LATIN SMALL LETTER C WITH CARON
- case 0xea: return (char) 0x0119; // LATIN SMALL LETTER E WITH OGONEK
- case 0xec: return (char) 0x0117; // LATIN SMALL LETTER E WITH DOT ABOVE
- case 0xf1: return (char) 0x0146; // LATIN SMALL LETTER N WITH CEDILLA
- case 0xf2: return (char) 0x014d; // LATIN SMALL LETTER O WITH MACRON
- case 0xf7: return (char) 0x0169; // LATIN SMALL LETTER U WITH TILDE
- case 0xf9: return (char) 0x0173; // LATIN SMALL LETTER U WITH OGONEK
- case 0xff: return (char) 0x0138; // LATIN SMALL LETTER KRA
- default:
- return (char) P;
- }
- }
-
- public static char Iso8859_13ToUTF16Char(byte P)
- {
- switch(P)
- {
- case 0xa1: return (char) 0x201d; // RIGHT DOUBLE QUOTATION MARK
- case 0xa5: return (char) 0x201e; // DOUBLE LOW-9 QUOTATION MARK
- case 0xa8: return (char) 0x00d8; // LATIN CAPITAL LETTER O WITH STROKE
- case 0xaa: return (char) 0x0156; // LATIN CAPITAL LETTER R WITH CEDILLA
- case 0xaf: return (char) 0x00c6; // LATIN CAPITAL LETTER AE
- case 0xb4: return (char) 0x201c; // LEFT DOUBLE QUOTATION MARK
- case 0xb8: return (char) 0x00f8; // LATIN SMALL LETTER O WITH STROKE
- case 0xba: return (char) 0x0157; // LATIN SMALL LETTER R WITH CEDILLA
- case 0xbf: return (char) 0x00e6; // LATIN SMALL LETTER AE
- case 0xc0: return (char) 0x0104; // LATIN CAPITAL LETTER A WITH OGONEK
- case 0xc1: return (char) 0x012e; // LATIN CAPITAL LETTER I WITH OGONEK
- case 0xc2: return (char) 0x0100; // LATIN CAPITAL LETTER A WITH MACRON
- case 0xc3: return (char) 0x0106; // LATIN CAPITAL LETTER C WITH ACUTE
- case 0xc6: return (char) 0x0118; // LATIN CAPITAL LETTER E WITH OGONEK
- case 0xc7: return (char) 0x0112; // LATIN CAPITAL LETTER E WITH MACRON
- case 0xc8: return (char) 0x010c; // LATIN CAPITAL LETTER C WITH CARON
- case 0xca: return (char) 0x0179; // LATIN CAPITAL LETTER Z WITH ACUTE
- case 0xcb: return (char) 0x0116; // LATIN CAPITAL LETTER E WITH DOT ABOVE
- case 0xcc: return (char) 0x0122; // LATIN CAPITAL LETTER G WITH CEDILLA
- case 0xcd: return (char) 0x0136; // LATIN CAPITAL LETTER K WITH CEDILLA
- case 0xce: return (char) 0x012a; // LATIN CAPITAL LETTER I WITH MACRON
- case 0xcf: return (char) 0x013b; // LATIN CAPITAL LETTER L WITH CEDILLA
- case 0xd0: return (char) 0x0160; // LATIN CAPITAL LETTER S WITH CARON
- case 0xd1: return (char) 0x0143; // LATIN CAPITAL LETTER N WITH ACUTE
- case 0xd2: return (char) 0x0145; // LATIN CAPITAL LETTER N WITH CEDILLA
- case 0xd4: return (char) 0x014c; // LATIN CAPITAL LETTER O WITH MACRON
- case 0xd8: return (char) 0x0172; // LATIN CAPITAL LETTER U WITH OGONEK
- case 0xd9: return (char) 0x0141; // LATIN CAPITAL LETTER L WITH STROKE
- case 0xda: return (char) 0x015a; // LATIN CAPITAL LETTER S WITH ACUTE
- case 0xdb: return (char) 0x016a; // LATIN CAPITAL LETTER U WITH MACRON
- case 0xdd: return (char) 0x017b; // LATIN CAPITAL LETTER Z WITH DOT ABOVE
- case 0xde: return (char) 0x017d; // LATIN CAPITAL LETTER Z WITH CARON
- case 0xe0: return (char) 0x0105; // LATIN SMALL LETTER A WITH OGONEK
- case 0xe1: return (char) 0x012f; // LATIN SMALL LETTER I WITH OGONEK
- case 0xe2: return (char) 0x0101; // LATIN SMALL LETTER A WITH MACRON
- case 0xe3: return (char) 0x0107; // LATIN SMALL LETTER C WITH ACUTE
- case 0xe6: return (char) 0x0119; // LATIN SMALL LETTER E WITH OGONEK
- case 0xe7: return (char) 0x0113; // LATIN SMALL LETTER E WITH MACRON
- case 0xe8: return (char) 0x010d; // LATIN SMALL LETTER C WITH CARON
- case 0xea: return (char) 0x017a; // LATIN SMALL LETTER Z WITH ACUTE
- case 0xeb: return (char) 0x0117; // LATIN SMALL LETTER E WITH DOT ABOVE
- case 0xec: return (char) 0x0123; // LATIN SMALL LETTER G WITH CEDILLA
- case 0xed: return (char) 0x0137; // LATIN SMALL LETTER K WITH CEDILLA
- case 0xee: return (char) 0x012b; // LATIN SMALL LETTER I WITH MACRON
- case 0xef: return (char) 0x013c; // LATIN SMALL LETTER L WITH CEDILLA
- case 0xf0: return (char) 0x0161; // LATIN SMALL LETTER S WITH CARON
- case 0xf1: return (char) 0x0144; // LATIN SMALL LETTER N WITH ACUTE
- case 0xf2: return (char) 0x0146; // LATIN SMALL LETTER N WITH CEDILLA
- case 0xf4: return (char) 0x014d; // LATIN SMALL LETTER O WITH MACRON
- case 0xf8: return (char) 0x0173; // LATIN SMALL LETTER U WITH OGONEK
- case 0xf9: return (char) 0x0142; // LATIN SMALL LETTER L WITH STROKE
- case 0xfa: return (char) 0x015b; // LATIN SMALL LETTER S WITH ACUTE
- case 0xfb: return (char) 0x016b; // LATIN SMALL LETTER U WITH MACRON
- case 0xfd: return (char) 0x017c; // LATIN SMALL LETTER Z WITH DOT ABOVE
- case 0xfe: return (char) 0x017e; // LATIN SMALL LETTER Z WITH CARON
- case 0xff: return (char) 0x2019; // RIGHT SINGLE QUOTATION MARK
- default:
- return (char) P;
- }
- }
-
- public static char Iso8859_14ToUTF16Char(byte P)
- {
- switch (P)
- {
- case 0xa1: return (char) 0x1e02; // LATIN CAPITAL LETTER B WITH DOT ABOVE
- case 0xa2: return (char) 0x1e03; // LATIN SMALL LETTER B WITH DOT ABOVE
- case 0xa4: return (char) 0x010a; // LATIN CAPITAL LETTER C WITH DOT ABOVE
- case 0xa5: return (char) 0x010b; // LATIN SMALL LETTER C WITH DOT ABOVE
- case 0xa6: return (char) 0x1e0a; // LATIN CAPITAL LETTER D WITH DOT ABOVE
- case 0xa8: return (char) 0x1e80; // LATIN CAPITAL LETTER W WITH GRAVE
- case 0xaa: return (char) 0x1e82; // LATIN CAPITAL LETTER W WITH ACUTE
- case 0xab: return (char) 0x1e0b; // LATIN SMALL LETTER D WITH DOT ABOVE
- case 0xac: return (char) 0x1ef2; // LATIN CAPITAL LETTER Y WITH GRAVE
- case 0xaf: return (char) 0x0178; // LATIN CAPITAL LETTER Y WITH DIAERESIS
- case 0xb0: return (char) 0x1e1e; // LATIN CAPITAL LETTER F WITH DOT ABOVE
- case 0xb1: return (char) 0x1e1f; // LATIN SMALL LETTER F WITH DOT ABOVE
- case 0xb2: return (char) 0x0120; // LATIN CAPITAL LETTER G WITH DOT ABOVE
- case 0xb3: return (char) 0x0121; // LATIN SMALL LETTER G WITH DOT ABOVE
- case 0xb4: return (char) 0x1e40; // LATIN CAPITAL LETTER M WITH DOT ABOVE
- case 0xb5: return (char) 0x1e41; // LATIN SMALL LETTER M WITH DOT ABOVE
- case 0xb7: return (char) 0x1e56; // LATIN CAPITAL LETTER P WITH DOT ABOVE
- case 0xb8: return (char) 0x1e81; // LATIN SMALL LETTER W WITH GRAVE
- case 0xb9: return (char) 0x1e57; // LATIN SMALL LETTER P WITH DOT ABOVE
- case 0xba: return (char) 0x1e83; // LATIN SMALL LETTER W WITH ACUTE
- case 0xbb: return (char) 0x1e60; // LATIN CAPITAL LETTER S WITH DOT ABOVE
- case 0xbc: return (char) 0x1ef3; // LATIN SMALL LETTER Y WITH GRAVE
- case 0xbd: return (char) 0x1e84; // LATIN CAPITAL LETTER W WITH DIAERESIS
- case 0xbe: return (char) 0x1e85; // LATIN SMALL LETTER W WITH DIAERESIS
- case 0xbf: return (char) 0x1e61; // LATIN SMALL LETTER S WITH DOT ABOVE
- case 0xd0: return (char) 0x0174; // LATIN CAPITAL LETTER W WITH CIRCUMFLEX
- case 0xd7: return (char) 0x1e6a; // LATIN CAPITAL LETTER T WITH DOT ABOVE
- case 0xde: return (char) 0x0176; // LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
- case 0xf0: return (char) 0x0175; // LATIN SMALL LETTER W WITH CIRCUMFLEX
- case 0xf7: return (char) 0x1e6b; // LATIN SMALL LETTER T WITH DOT ABOVE
- case 0xfe: return (char) 0x0177; // LATIN SMALL LETTER Y WITH CIRCUMFLEX
- default:
- return (char) P;
- }
- }
-
- public static char Iso8859_15ToUTF16Char(byte P)
- {
- switch (P)
- {
- case 0xa4: return (char) 0x20ac; // EURO SIGN
- case 0xa6: return (char) 0x00a6; // LATIN CAPITAL LETTER S WITH CARON
- case 0xa8: return (char) 0x0161; // LATIN SMALL LETTER S WITH CARON
- case 0xb4: return (char) 0x017d; // LATIN CAPITAL LETTER Z WITH CARON
- case 0xb8: return (char) 0x017e; // LATIN SMALL LETTER Z WITH CARON
- case 0xbc: return (char) 0x0152; // LATIN CAPITAL LIGATURE OE
- case 0xbd: return (char) 0x0153; // LATIN SMALL LIGATURE OE
- case 0xbe: return (char) 0x0178; // LATIN CAPITAL LETTER Y WITH DIAERESIS
- default:
- return (char) P;
- }
- }
-
- public static char KOI8_RToUTF16Char(byte P)
- {
- switch (P)
- {
- case 0x80: return (char) 0x2500; // BOX DRAWINGS LIGHT HORIZONTAL
- case 0x81: return (char) 0x2502; // BOX DRAWINGS LIGHT VERTICAL
- case 0x82: return (char) 0x250c; // BOX DRAWINGS LIGHT DOWN AND RIGHT
- case 0x83: return (char) 0x2510; // BOX DRAWINGS LIGHT DOWN AND LEFT
- case 0x84: return (char) 0x2514; // BOX DRAWINGS LIGHT UP AND RIGHT
- case 0x85: return (char) 0x2518; // BOX DRAWINGS LIGHT UP AND LEFT
- case 0x86: return (char) 0x251c; // BOX DRAWINGS LIGHT VERTICAL AND RIGHT
- case 0x87: return (char) 0x2524; // BOX DRAWINGS LIGHT VERTICAL AND LEFT
- case 0x88: return (char) 0x252c; // BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
- case 0x89: return (char) 0x2534; // BOX DRAWINGS LIGHT UP AND HORIZONTAL
- case 0x8a: return (char) 0x253c; // BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
- case 0x8b: return (char) 0x2580; // UPPER HALF BLOCK
- case 0x8c: return (char) 0x2584; // LOWER HALF BLOCK
- case 0x8d: return (char) 0x2588; // FULL BLOCK
- case 0x8e: return (char) 0x258c; // LEFT HALF BLOCK
- case 0x8f: return (char) 0x2590; // RIGHT HALF BLOCK
- case 0x90: return (char) 0x2591; // LIGHT SHADE
- case 0x91: return (char) 0x2592; // MEDIUM SHADE
- case 0x92: return (char) 0x2593; // DARK SHADE
- case 0x93: return (char) 0x2320; // TOP HALF INTEGRAL
- case 0x94: return (char) 0x25a0; // BLACK SQUARE
- case 0x95: return (char) 0x2219; // BULLET OPERATOR
- case 0x96: return (char) 0x221a; // SQUARE ROOT
- case 0x97: return (char) 0x2248; // ALMOST EQUAL TO
- case 0x98: return (char) 0x2264; // LESS-THAN OR EQUAL TO
- case 0x99: return (char) 0x2265; // GREATER-THAN OR EQUAL TO
- case 0x9a: return (char) 0x00a0; // NO-BREAK SPACE
- case 0x9b: return (char) 0x2321; // BOTTOM HALF INTEGRAL
- case 0x9c: return (char) 0x00b0; // DEGREE SIGN
- case 0x9d: return (char) 0x00b2; // SUPERSCRIPT TWO
- case 0x9e: return (char) 0x00b7; // MIDDLE DOT
- case 0x9f: return (char) 0x00f7; // DIVISION SIGN
- case 0xa0: return (char) 0x2550; // BOX DRAWINGS DOUBLE HORIZONTAL
- case 0xa1: return (char) 0x2551; // BOX DRAWINGS DOUBLE VERTICAL
- case 0xa2: return (char) 0x2552; // BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
- case 0xa3: return (char) 0x0451; // CYRILLIC SMALL LETTER IO
- case 0xa4: return (char) 0x2553; // BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
- case 0xa5: return (char) 0x2554; // BOX DRAWINGS DOUBLE DOWN AND RIGHT
- case 0xa6: return (char) 0x2555; // BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
- case 0xa7: return (char) 0x2556; // BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
- case 0xa8: return (char) 0x2557; // BOX DRAWINGS DOUBLE DOWN AND LEFT
- case 0xa9: return (char) 0x2558; // BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
- case 0xaa: return (char) 0x2559; // BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
- case 0xab: return (char) 0x255a; // BOX DRAWINGS DOUBLE UP AND RIGHT
- case 0xac: return (char) 0x255b; // BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
- case 0xad: return (char) 0x255c; // BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
- case 0xae: return (char) 0x255d; // BOX DRAWINGS DOUBLE UP AND LEFT
- case 0xaf: return (char) 0x255e; // BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
- case 0xb0: return (char) 0x255f; // BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
- case 0xb1: return (char) 0x2560; // BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
- case 0xb2: return (char) 0x2561; // BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
- case 0xb3: return (char) 0x0401; // CYRILLIC CAPITAL LETTER IO
- case 0xb4: return (char) 0x2562; // BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
- case 0xb5: return (char) 0x2563; // BOX DRAWINGS DOUBLE VERTICAL AND LEFT
- case 0xb6: return (char) 0x2564; // BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
- case 0xb7: return (char) 0x2565; // BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
- case 0xb8: return (char) 0x2566; // BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
- case 0xb9: return (char) 0x2567; // BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
- case 0xba: return (char) 0x2568; // BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
- case 0xbb: return (char) 0x2569; // BOX DRAWINGS DOUBLE UP AND HORIZONTAL
- case 0xbc: return (char) 0x256a; // BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
- case 0xbd: return (char) 0x256b; // BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
- case 0xbe: return (char) 0x256c; // BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
- case 0xbf: return (char) 0x00a9; // COPYRIGHT SIGN
- case 0xc0: return (char) 0x044e; // CYRILLIC SMALL LETTER YU
- case 0xc1: return (char) 0x0430; // CYRILLIC SMALL LETTER A
- case 0xc2: return (char) 0x0431; // CYRILLIC SMALL LETTER BE
- case 0xc3: return (char) 0x0446; // CYRILLIC SMALL LETTER TSE
- case 0xc4: return (char) 0x0434; // CYRILLIC SMALL LETTER DE
- case 0xc5: return (char) 0x0435; // CYRILLIC SMALL LETTER IE
- case 0xc6: return (char) 0x0444; // CYRILLIC SMALL LETTER EF
- case 0xc7: return (char) 0x0433; // CYRILLIC SMALL LETTER GHE
- case 0xc8: return (char) 0x0445; // CYRILLIC SMALL LETTER HA
- case 0xc9: return (char) 0x0438; // CYRILLIC SMALL LETTER I
- case 0xca: return (char) 0x0439; // CYRILLIC SMALL LETTER SHORT I
- case 0xcb: return (char) 0x043a; // CYRILLIC SMALL LETTER KA
- case 0xcc: return (char) 0x043b; // CYRILLIC SMALL LETTER EL
- case 0xcd: return (char) 0x043c; // CYRILLIC SMALL LETTER EM
- case 0xce: return (char) 0x043d; // CYRILLIC SMALL LETTER EN
- case 0xcf: return (char) 0x043e; // CYRILLIC SMALL LETTER O
- case 0xd0: return (char) 0x043f; // CYRILLIC SMALL LETTER PE
- case 0xd1: return (char) 0x044f; // CYRILLIC SMALL LETTER YA
- case 0xd2: return (char) 0x0440; // CYRILLIC SMALL LETTER ER
- case 0xd3: return (char) 0x0441; // CYRILLIC SMALL LETTER ES
- case 0xd4: return (char) 0x0442; // CYRILLIC SMALL LETTER TE
- case 0xd5: return (char) 0x0443; // CYRILLIC SMALL LETTER U
- case 0xd6: return (char) 0x0436; // CYRILLIC SMALL LETTER ZHE
- case 0xd7: return (char) 0x0432; // CYRILLIC SMALL LETTER VE
- case 0xd8: return (char) 0x044c; // CYRILLIC SMALL LETTER SOFT SIGN
- case 0xd9: return (char) 0x044b; // CYRILLIC SMALL LETTER YERU
- case 0xda: return (char) 0x0437; // CYRILLIC SMALL LETTER ZE
- case 0xdb: return (char) 0x0448; // CYRILLIC SMALL LETTER SHA
- case 0xdc: return (char) 0x044d; // CYRILLIC SMALL LETTER E
- case 0xdd: return (char) 0x0449; // CYRILLIC SMALL LETTER SHCHA
- case 0xde: return (char) 0x0447; // CYRILLIC SMALL LETTER CHE
- case 0xdf: return (char) 0x044a; // CYRILLIC SMALL LETTER HARD SIGN
- case 0xe0: return (char) 0x042e; // CYRILLIC CAPITAL LETTER YU
- case 0xe1: return (char) 0x0410; // CYRILLIC CAPITAL LETTER A
- case 0xe2: return (char) 0x0411; // CYRILLIC CAPITAL LETTER BE
- case 0xe3: return (char) 0x0426; // CYRILLIC CAPITAL LETTER TSE
- case 0xe4: return (char) 0x0414; // CYRILLIC CAPITAL LETTER DE
- case 0xe5: return (char) 0x0415; // CYRILLIC CAPITAL LETTER IE
- case 0xe6: return (char) 0x0424; // CYRILLIC CAPITAL LETTER EF
- case 0xe7: return (char) 0x0413; // CYRILLIC CAPITAL LETTER GHE
- case 0xe8: return (char) 0x0425; // CYRILLIC CAPITAL LETTER HA
- case 0xe9: return (char) 0x0418; // CYRILLIC CAPITAL LETTER I
- case 0xea: return (char) 0x0419; // CYRILLIC CAPITAL LETTER SHORT I
- case 0xeb: return (char) 0x041a; // CYRILLIC CAPITAL LETTER KA
- case 0xec: return (char) 0x041b; // CYRILLIC CAPITAL LETTER EL
- case 0xed: return (char) 0x041c; // CYRILLIC CAPITAL LETTER EM
- case 0xee: return (char) 0x041d; // CYRILLIC CAPITAL LETTER EN
- case 0xef: return (char) 0x041e; // CYRILLIC CAPITAL LETTER O
- case 0xf0: return (char) 0x041f; // CYRILLIC CAPITAL LETTER PE
- case 0xf1: return (char) 0x042f; // CYRILLIC CAPITAL LETTER YA
- case 0xf2: return (char) 0x0420; // CYRILLIC CAPITAL LETTER ER
- case 0xf3: return (char) 0x0421; // CYRILLIC CAPITAL LETTER ES
- case 0xf4: return (char) 0x0422; // CYRILLIC CAPITAL LETTER TE
- case 0xf5: return (char) 0x0423; // CYRILLIC CAPITAL LETTER U
- case 0xf6: return (char) 0x0416; // CYRILLIC CAPITAL LETTER ZHE
- case 0xf7: return (char) 0x0412; // CYRILLIC CAPITAL LETTER VE
- case 0xf8: return (char) 0x042c; // CYRILLIC CAPITAL LETTER SOFT SIGN
- case 0xf9: return (char) 0x042b; // CYRILLIC CAPITAL LETTER YERU
- case 0xfa: return (char) 0x0417; // CYRILLIC CAPITAL LETTER ZE
- case 0xfb: return (char) 0x0428; // CYRILLIC CAPITAL LETTER SHA
- case 0xfc: return (char) 0x042d; // CYRILLIC CAPITAL LETTER E
- case 0xfd: return (char) 0x0429; // CYRILLIC CAPITAL LETTER SHCHA
- case 0xfe: return (char) 0x0427; // CYRILLIC CAPITAL LETTER CHE
- case 0xff: return (char) 0x042a; // CYRILLIC CAPITAL LETTER HARD SIGN
- default:
- return (char) P;
- }
- }
-
- public static char cp10000_MacRomanToUTF16Char(byte P)
- {
- switch (P)
- {
- case 0x80: return (char) 0x00c4; // LATIN CAPITAL LETTER A WITH DIAERESIS
- case 0x81: return (char) 0x00c5; // LATIN CAPITAL LETTER A WITH RING ABOVE
- case 0x82: return (char) 0x00c7; // LATIN CAPITAL LETTER C WITH CEDILLA
- case 0x83: return (char) 0x00c9; // LATIN CAPITAL LETTER E WITH ACUTE
- case 0x84: return (char) 0x00d1; // LATIN CAPITAL LETTER N WITH TILDE
- case 0x85: return (char) 0x00d6; // LATIN CAPITAL LETTER O WITH DIAERESIS
- case 0x86: return (char) 0x00dc; // LATIN CAPITAL LETTER U WITH DIAERESIS
- case 0x87: return (char) 0x00e1; // LATIN SMALL LETTER A WITH ACUTE
- case 0x88: return (char) 0x00e0; // LATIN SMALL LETTER A WITH GRAVE
- case 0x89: return (char) 0x00e2; // LATIN SMALL LETTER A WITH CIRCUMFLEX
- case 0x8a: return (char) 0x00e4; // LATIN SMALL LETTER A WITH DIAERESIS
- case 0x8b: return (char) 0x00e3; // LATIN SMALL LETTER A WITH TILDE
- case 0x8c: return (char) 0x00e5; // LATIN SMALL LETTER A WITH RING ABOVE
- case 0x8d: return (char) 0x00e7; // LATIN SMALL LETTER C WITH CEDILLA
- case 0x8e: return (char) 0x00e9; // LATIN SMALL LETTER E WITH ACUTE
- case 0x8f: return (char) 0x00e8; // LATIN SMALL LETTER E WITH GRAVE
- case 0x90: return (char) 0x00ea; // LATIN SMALL LETTER E WITH CIRCUMFLEX
- case 0x91: return (char) 0x00eb; // LATIN SMALL LETTER E WITH DIAERESIS
- case 0x92: return (char) 0x00ed; // LATIN SMALL LETTER I WITH ACUTE
- case 0x93: return (char) 0x00ec; // LATIN SMALL LETTER I WITH GRAVE
- case 0x94: return (char) 0x00ee; // LATIN SMALL LETTER I WITH CIRCUMFLEX
- case 0x95: return (char) 0x00ef; // LATIN SMALL LETTER I WITH DIAERESIS
- case 0x96: return (char) 0x00f1; // LATIN SMALL LETTER N WITH TILDE
- case 0x97: return (char) 0x00f3; // LATIN SMALL LETTER O WITH ACUTE
- case 0x98: return (char) 0x00f2; // LATIN SMALL LETTER O WITH GRAVE
- case 0x99: return (char) 0x00f4; // LATIN SMALL LETTER O WITH CIRCUMFLEX
- case 0x9a: return (char) 0x00f6; // LATIN SMALL LETTER O WITH DIAERESIS
- case 0x9b: return (char) 0x00f5; // LATIN SMALL LETTER O WITH TILDE
- case 0x9c: return (char) 0x00fa; // LATIN SMALL LETTER U WITH ACUTE
- case 0x9d: return (char) 0x00f9; // LATIN SMALL LETTER U WITH GRAVE
- case 0x9e: return (char) 0x00fb; // LATIN SMALL LETTER U WITH CIRCUMFLEX
- case 0x9f: return (char) 0x00fc; // LATIN SMALL LETTER U WITH DIAERESIS
- case 0xa0: return (char) 0x2020; // DAGGER
- case 0xa1: return (char) 0x00b0; // DEGREE SIGN
- case 0xa4: return (char) 0x00a7; // SECTION SIGN
- case 0xa5: return (char) 0x2022; // BULLET
- case 0xa6: return (char) 0x00b6; // PILCROW SIGN
- case 0xa7: return (char) 0x00df; // LATIN SMALL LETTER SHARP S
- case 0xa8: return (char) 0x00ae; // REGISTERED SIGN
- case 0xaa: return (char) 0x2122; // TRADE MARK SIGN
- case 0xab: return (char) 0x00b4; // ACUTE ACCENT
- case 0xac: return (char) 0x00a8; // DIAERESIS
- case 0xad: return (char) 0x2260; // NOT EQUAL TO
- case 0xae: return (char) 0x00c6; // LATIN CAPITAL LIGATURE AE
- case 0xaf: return (char) 0x00d8; // LATIN CAPITAL LETTER O WITH STROKE
- case 0xb0: return (char) 0x221e; // INFINITY
- case 0xb2: return (char) 0x2264; // LESS-THAN OR EQUAL TO
- case 0xb3: return (char) 0x2265; // GREATER-THAN OR EQUAL TO
- case 0xb4: return (char) 0x00a5; // YEN SIGN
- case 0xb6: return (char) 0x2202; // PARTIAL DIFFERENTIAL
- case 0xb7: return (char) 0x2211; // N-ARY SUMMATION
- case 0xb8: return (char) 0x220f; // N-ARY PRODUCT
- case 0xb9: return (char) 0x03c0; // GREEK SMALL LETTER PI
- case 0xba: return (char) 0x222b; // INTEGRAL
- case 0xbb: return (char) 0x00aa; // FEMININE ORDINAL INDICATOR
- case 0xbc: return (char) 0x00ba; // MASCULINE ORDINAL INDICATOR
- case 0xbd: return (char) 0x2126; // OHM SIGN
- case 0xbe: return (char) 0x00e6; // LATIN SMALL LIGATURE AE
- case 0xbf: return (char) 0x00f8; // LATIN SMALL LETTER O WITH STROKE
- case 0xc0: return (char) 0x00bf; // INVERTED QUESTION MARK
- case 0xc1: return (char) 0x00a1; // INVERTED EXCLAMATION MARK
- case 0xc2: return (char) 0x00ac; // NOT SIGN
- case 0xc3: return (char) 0x221a; // SQUARE ROOT
- case 0xc4: return (char) 0x0192; // LATIN SMALL LETTER F WITH HOOK
- case 0xc5: return (char) 0x2248; // ALMOST EQUAL TO
- case 0xc6: return (char) 0x2206; // INCREMENT
- case 0xc7: return (char) 0x00ab; // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
- case 0xc8: return (char) 0x00bb; // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
- case 0xc9: return (char) 0x2026; // HORIZONTAL ELLIPSIS
- case 0xca: return (char) 0x00a0; // NO-BREAK SPACE
- case 0xcb: return (char) 0x00c0; // LATIN CAPITAL LETTER A WITH GRAVE
- case 0xcc: return (char) 0x00c3; // LATIN CAPITAL LETTER A WITH TILDE
- case 0xcd: return (char) 0x00d5; // LATIN CAPITAL LETTER O WITH TILDE
- case 0xce: return (char) 0x0152; // LATIN CAPITAL LIGATURE OE
- case 0xcf: return (char) 0x0153; // LATIN SMALL LIGATURE OE
- case 0xd0: return (char) 0x2013; // EN DASH
- case 0xd1: return (char) 0x2014; // EM DASH
- case 0xd2: return (char) 0x201c; // LEFT DOUBLE QUOTATION MARK
- case 0xd3: return (char) 0x201d; // RIGHT DOUBLE QUOTATION MARK
- case 0xd4: return (char) 0x2018; // LEFT SINGLE QUOTATION MARK
- case 0xd5: return (char) 0x2019; // RIGHT SINGLE QUOTATION MARK
- case 0xd6: return (char) 0x00f7; // DIVISION SIGN
- case 0xd7: return (char) 0x25ca; // LOZENGE
- case 0xd8: return (char) 0x00ff; // LATIN SMALL LETTER Y WITH DIAERESIS
- case 0xd9: return (char) 0x0178; // LATIN CAPITAL LETTER Y WITH DIAERESIS
- case 0xda: return (char) 0x2044; // FRACTION SLASH
- case 0xdb: return (char) 0x00a4; // CURRENCY SIGN
- case 0xdc: return (char) 0x2039; // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
- case 0xdd: return (char) 0x203a; // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
- case 0xde: return (char) 0xfb01; // LATIN SMALL LIGATURE FI
- case 0xdf: return (char) 0xfb02; // LATIN SMALL LIGATURE FL
- case 0xe0: return (char) 0x2021; // DOUBLE DAGGER
- case 0xe1: return (char) 0x00b7; // MIDDLE DOT
- case 0xe2: return (char) 0x201a; // SINGLE LOW-9 QUOTATION MARK
- case 0xe3: return (char) 0x201e; // DOUBLE LOW-9 QUOTATION MARK
- case 0xe4: return (char) 0x2030; // PER MILLE SIGN
- case 0xe5: return (char) 0x00c2; // LATIN CAPITAL LETTER A WITH CIRCUMFLEX
- case 0xe6: return (char) 0x00ca; // LATIN CAPITAL LETTER E WITH CIRCUMFLEX
- case 0xe7: return (char) 0x00c1; // LATIN CAPITAL LETTER A WITH ACUTE
- case 0xe8: return (char) 0x00cb; // LATIN CAPITAL LETTER E WITH DIAERESIS
- case 0xe9: return (char) 0x00c8; // LATIN CAPITAL LETTER E WITH GRAVE
- case 0xea: return (char) 0x00cd; // LATIN CAPITAL LETTER I WITH ACUTE
- case 0xeb: return (char) 0x00ce; // LATIN CAPITAL LETTER I WITH CIRCUMFLEX
- case 0xec: return (char) 0x00cf; // LATIN CAPITAL LETTER I WITH DIAERESIS
- case 0xed: return (char) 0x00cc; // LATIN CAPITAL LETTER I WITH GRAVE
- case 0xee: return (char) 0x00d3; // LATIN CAPITAL LETTER O WITH ACUTE
- case 0xef: return (char) 0x00d4; // LATIN CAPITAL LETTER O WITH CIRCUMFLEX
- case 0xf0: throw new InvalidOperationException("Invalid cp10000_MacRoman sequence [" + P.ToString() + "]");
- case 0xf1: return (char) 0x00d2; // LATIN CAPITAL LETTER O WITH GRAVE
- case 0xf2: return (char) 0x00da; // LATIN CAPITAL LETTER U WITH ACUTE
- case 0xf3: return (char) 0x00db; // LATIN CAPITAL LETTER U WITH CIRCUMFLEX
- case 0xf4: return (char) 0x00d9; // LATIN CAPITAL LETTER U WITH GRAVE
- case 0xf5: return (char) 0x0131; // LATIN SMALL LETTER DOTLESS I
- case 0xf6: return (char) 0x02c6; // MODIFIER LETTER CIRCUMFLEX ACCENT
- case 0xf7: return (char) 0x02dc; // SMALL TILDE
- case 0xf8: return (char) 0x00af; // MACRON
- case 0xf9: return (char) 0x02d8; // BREVE
- case 0xfa: return (char) 0x02d9; // DOT ABOVE
- case 0xfb: return (char) 0x02da; // RING ABOVE
- case 0xfc: return (char) 0x00b8; // CEDILLA
- case 0xfd: return (char) 0x02dd; // DOUBLE ACUTE ACCENT
- case 0xfe: return (char) 0x02db; // OGONEK
- case 0xff: return (char) 0x02c7; // CARON
- default:
- return (char) P;
- }
- }
-
- public static char cp1250ToUTF16Char(byte P)
- {
- // This function was provided by Miloslav Skácel (ported by DrW)
- switch (P)
- {
- case 0x80: throw new InvalidOperationException("Invalid Windows-1250 sequence [" + P.ToString() + "]");
- case 0x81: throw new InvalidOperationException("Invalid Windows-1250 sequence [" + P.ToString() + "]");
- case 0x83: throw new InvalidOperationException("Invalid Windows-1250 sequence [" + P.ToString() + "]");
- case 0x88: throw new InvalidOperationException("Invalid Windows-1250 sequence [" + P.ToString() + "]");
- case 0x90: throw new InvalidOperationException("Invalid Windows-1250 sequence [" + P.ToString() + "]");
- case 0x98: throw new InvalidOperationException("Invalid Windows-1250 sequence [" + P.ToString() + "]");
- case 0x82: return (char) 0x201a; // SINGLE LOW-9 QUOTATION MARK
- case 0x84: return (char) 0x201e; // DOUBLE LOW-9 QUOTATION MARK
- case 0x85: return (char) 0x2026; // HORIZONTAL ELLIPSIS
- case 0x86: return (char) 0x2020; // DAGGER
- case 0x87: return (char) 0x2021; // DOUBLE DAGGER
- case 0x89: return (char) 0x2030; // PER MILLE SIGN
- case 0x8a: return (char) 0x0160; // LATIN CAPITAL LETTER S WITH CARON
- case 0x8b: return (char) 0x2039; // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
- case 0x8c: return (char) 0x015a; // LATIN CAPITAL LETTER S WITH ACUTE
- case 0x8d: return (char) 0x0164; // LATIN CAPITAL LETTER T WITH CARON
- case 0x8e: return (char) 0x017d; // LATIN CAPITAL LETTER Z WITH CARON
- case 0x8f: return (char) 0x0179; // LATIN CAPITAL LETTER Z WITH ACUTE
- case 0x91: return (char) 0x2018; // LEFT SINGLE QUOTATION MARK
- case 0x92: return (char) 0x2019; // RIGHT SINGLE QUOTATION MARK
- case 0x93: return (char) 0x201c; // LEFT DOUBLE QUOTATION MARK
- case 0x94: return (char) 0x201d; // RIGHT DOUBLE QUOTATION MARK
- case 0x95: return (char) 0x2022; // BULLET
- case 0x96: return (char) 0x2013; // EN-DASH
- case 0x97: return (char) 0x2014; // EM-DASH
- case 0x99: return (char) 0x2122; // TRADE MARK SIGN
- case 0x9a: return (char) 0x0161; // LATIN SMALL LETTER S WITH CARON
- case 0x9b: return (char) 0x203a; // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
- case 0x9c: return (char) 0x015b; // LATIN SMALL LETTER S WITH ACUTE
- case 0x9d: return (char) 0x0165; // LATIN SMALL LETTER T WITH CARON
- case 0x9e: return (char) 0x017e; // LATIN SMALL LETTER Z WITH CARON
- case 0x9f: return (char) 0x017a; // LATIN SMALL LETTER Z WITH ACUTE
- case 0xa0: return (char) 0x00a0; // NO-BREAK SPACE
- case 0xa1: return (char) 0x02c7; // CARON
- case 0xa2: return (char) 0x02d8; // BREVE
- case 0xa3: return (char) 0x0141; // LATIN CAPITAL LETTER L WITH STROKE
- case 0xa4: return (char) 0x00a4; // CURRENCY SIGN
- case 0xa5: return (char) 0x0104; // LATIN CAPITAL LETTER A WITH OGONEK
- case 0xa6: return (char) 0x00a6; // BROKEN BAR
- case 0xa7: return (char) 0x00a7; // SECTION SIGN
- case 0xa8: return (char) 0x00a8; // DIAERESIS
- case 0xa9: return (char) 0x00a9; // COPYRIGHT SIGN
- case 0xaa: return (char) 0x015e; // LATIN CAPITAL LETTER S WITH CEDILLA
- case 0xab: return (char) 0x00ab; // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
- case 0xac: return (char) 0x00ac; // NOT SIGN
- case 0xad: return (char) 0x00ad; // SOFT HYPHEN
- case 0xae: return (char) 0x00ae; // REGISTERED SIGN
- case 0xaf: return (char) 0x017b; // LATIN CAPITAL LETTER Z WITH DOT ABOVE
- case 0xb0: return (char) 0x00b0; // DEGREE SIGN
- case 0xb1: return (char) 0x00b1; // PLUS-MINUS SIGN
- case 0xb2: return (char) 0x02db; // OGONEK
- case 0xb3: return (char) 0x0142; // LATIN SMALL LETTER L WITH STROKE
- case 0xb4: return (char) 0x00b4; // ACUTE ACCENT
- case 0xb5: return (char) 0x00b5; // MIKRO SIGN
- case 0xb6: return (char) 0x00b6; // PILCROW SIGN
- case 0xb7: return (char) 0x00b7; // MIDDLE DOT
- case 0xb8: return (char) 0x00b8; // CEDILLA
- case 0xb9: return (char) 0x0105; // LATIN SMALL LETTER A WITH OGONEK
- case 0xba: return (char) 0x015f; // LATIN SMALL LETTER S WITH CEDILLA
- case 0xbb: return (char) 0x00bb; // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
- case 0xbc: return (char) 0x013d; // LATIN CAPITAL LETTER L WITH CARON
- case 0xbd: return (char) 0x02dd; // DOUBLE ACUTE ACCENT
- case 0xbe: return (char) 0x013e; // LATIN SMALL LETTER L WITH CARON
- case 0xbf: return (char) 0x017c; // LATIN SMALL LETTER Z WITH DOT ABOVE
- case 0xc0: return (char) 0x0154; // LATIN CAPITAL LETTER R WITH ACUTE
- case 0xc1: return (char) 0x00c1; // LATIN CAPITAL LETTER A WITH ACUTE
- case 0xc2: return (char) 0x00c2; // LATIN CAPITAL LETTER A WITH CIRCUMFLEX
- case 0xc3: return (char) 0x0102; // LATIN CAPITAL LETTER A WITH BREVE
- case 0xc4: return (char) 0x00c4; // LATIN CAPITAL LETTER A WITH DIAERESIS
- case 0xc5: return (char) 0x0139; // LATIN CAPITAL LETTER L WITH ACUTE
- case 0xc6: return (char) 0x0106; // LATIN CAPITAL LETTER C WITH ACUTE
- case 0xc7: return (char) 0x00c7; // LATIN CAPITAL LETTER C WITH CEDILLA
- case 0xc8: return (char) 0x010c; // LATIN CAPITAL LETTER C WITH CARON
- case 0xc9: return (char) 0x00c9; // LATIN CAPITAL LETTER E WITH ACUTE
- case 0xca: return (char) 0x0118; // LATIN CAPITAL LETTER E WITH OGONEK
- case 0xcb: return (char) 0x00cb; // LATIN CAPITAL LETTER E WITH DIAERESIS
- case 0xcc: return (char) 0x011a; // LATIN CAPITAL LETTER E WITH CARON
- case 0xcd: return (char) 0x00cd; // LATIN CAPITAL LETTER I WITH ACUTE
- case 0xce: return (char) 0x00ce; // LATIN CAPITAL LETTER I WITH CIRCUMFLEX
- case 0xcf: return (char) 0x010e; // LATIN CAPITAL LETTER D WITH CARON
- case 0xd0: return (char) 0x0110; // LATIN CAPITAL LETTER D WITH STROKE
- case 0xd1: return (char) 0x0143; // LATIN CAPITAL LETTER N WITH ACUTE
- case 0xd2: return (char) 0x0147; // LATIN CAPITAL LETTER N WITH CARON
- case 0xd3: return (char) 0x00d3; // LATIN CAPITAL LETTER O WITH ACUTE
- case 0xd4: return (char) 0x00d4; // LATIN CAPITAL LETTER O WITH CIRCUMFLEX
- case 0xd5: return (char) 0x0150; // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
- case 0xd6: return (char) 0x00d6; // LATIN CAPITAL LETTER O WITH DIAERESIS
- case 0xd7: return (char) 0x00d7; // MULTIPLICATION SIGN
- case 0xd8: return (char) 0x0158; // LATIN CAPITAL LETTER R WITH CARON
- case 0xd9: return (char) 0x016e; // LATIN CAPITAL LETTER U WITH RING ABOVE
- case 0xda: return (char) 0x00da; // LATIN CAPITAL LETTER U WITH ACUTE
- case 0xdb: return (char) 0x0170; // LATIN CAPITAL LETTER U WITH WITH DOUBLE ACUTE
- case 0xdc: return (char) 0x00dc; // LATIN CAPITAL LETTER U WITH DIAERESIS
- case 0xdd: return (char) 0x00dd; // LATIN CAPITAL LETTER Y WITH ACUTE
- case 0xde: return (char) 0x0162; // LATIN CAPITAL LETTER T WITH CEDILLA
- case 0xdf: return (char) 0x00df; // LATIN SMALL LETTER SHARP S
- case 0xe0: return (char) 0x0155; // LATIN SMALL LETTER R WITH ACUTE
- case 0xe1: return (char) 0x00e1; // LATIN SMALL LETTER A WITH ACUTE
- case 0xe2: return (char) 0x00e2; // LATIN SMALL LETTER A WITH CIRCUMFLEX
- case 0xe3: return (char) 0x0103; // LATIN SMALL LETTER A WITH BREVE
- case 0xe4: return (char) 0x00e4; // LATIN SMALL LETTER A WITH DIAERESIS
- case 0xe5: return (char) 0x013a; // LATIN SMALL LETTER L WITH ACUTE
- case 0xe6: return (char) 0x0107; // LATIN SMALL LETTER C WITH ACUTE
- case 0xe7: return (char) 0x00e7; // LATIN SMALL LETTER C WITH CEDILLA
- case 0xe8: return (char) 0x010d; // LATIN SMALL LETTER C WITH CARON 100D
- case 0xe9: return (char) 0x00e9; // LATIN SMALL LETTER E WITH ACUTE
- case 0xea: return (char) 0x0119; // LATIN SMALL LETTER E WITH OGONEK
- case 0xeb: return (char) 0x00eb; // LATIN SMALL LETTER E WITH DIAERESIS
- case 0xec: return (char) 0x011b; // LATIN SMALL LETTER E WITH CARON
- case 0xed: return (char) 0x00ed; // LATIN SMALL LETTER I WITH ACUTE
- case 0xee: return (char) 0x00ee; // LATIN SMALL LETTER I WITH CIRCUMFLEX
- case 0xef: return (char) 0x010f; // LATIN SMALL LETTER D WITH CARON
- case 0xf0: return (char) 0x0111; // LATIN SMALL LETTER D WITH STROKE
- case 0xf1: return (char) 0x0144; // LATIN SMALL LETTER N WITH ACUTE
- case 0xf2: return (char) 0x0148; // LATIN SMALL LETTER N WITH CARON
- case 0xf3: return (char) 0x00f3; // LATIN SMALL LETTER O WITH ACUTE
- case 0xf4: return (char) 0x00f4; // LATIN SMALL LETTER O WITH CIRCUMFLEX
- case 0xf5: return (char) 0x0151; // LATIN SMALL LETTER O WITH DOUBLE ACUTE
- case 0xf6: return (char) 0x00f6; // LATIN SMALL LETTER O WITH DIAERESIS
- case 0xf7: return (char) 0x00f7; // DIVISION SIGN
- case 0xf8: return (char) 0x0159; // LATIN SMALL LETTER R WITH CARON
- case 0xf9: return (char) 0x016f; // LATIN SMALL LETTER U WITH RING ABOVE
- case 0xfa: return (char) 0x00fa; // LATIN SMALL LETTER U WITH ACUTE
- case 0xfb: return (char) 0x0171; // LATIN SMALL LETTER U WITH WITH DOUBLE ACUTE
- case 0xfc: return (char) 0x00fc; // LATIN SMALL LETTER U WITH DIAERESIS
- case 0xfd: return (char) 0x00fd; // LATIN SMALL LETTER Y WITH ACUTE
- case 0xfe: return (char) 0x0163; // LATIN SMALL LETTER T WITH CEDILLA
- case 0xff: return (char) 0x02d9; // DOT ABOVE
- default:
- return (char) P;
- }
- }
-
- public static char cp1251ToUTF16Char(byte P)
- {
- switch (P)
- {
- case 0x80: return (char) 0x0402; // CYRILLIC CAPITAL LETTER DJE
- case 0x81: return (char) 0x0403; // CYRILLIC CAPITAL LETTER GJE
- case 0x82: return (char) 0x201a; // SINGLE LOW-9 QUOTATION MARK
- case 0x83: return (char) 0x0453; // CYRILLIC SMALL LETTER GJE
- case 0x84: return (char) 0x201e; // DOUBLE LOW-9 QUOTATION MARK
- case 0x85: return (char) 0x2026; // HORIZONTAL ELLIPSIS
- case 0x86: return (char) 0x2020; // DAGGER
- case 0x87: return (char) 0x2021; // DOUBLE DAGGER
- case 0x88: return (char) 0x20ac; // EURO SIGN
- case 0x89: return (char) 0x2030; // PER MILLE SIGN
- case 0x8a: return (char) 0x0409; // CYRILLIC CAPITAL LETTER LJE
- case 0x8b: return (char) 0x2039; // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
- case 0x8c: return (char) 0x040a; // CYRILLIC CAPITAL LETTER NJE
- case 0x8d: return (char) 0x040c; // CYRILLIC CAPITAL LETTER KJE
- case 0x8e: return (char) 0x040b; // CYRILLIC CAPITAL LETTER TSHE
- case 0x8f: return (char) 0x040f; // CYRILLIC CAPITAL LETTER DZHE
- case 0x90: return (char) 0x0452; // CYRILLIC SMALL LETTER DJE
- case 0x91: return (char) 0x2018; // LEFT SINGLE QUOTATION MARK
- case 0x92: return (char) 0x2019; // RIGHT SINGLE QUOTATION MARK
- case 0x93: return (char) 0x201c; // LEFT DOUBLE QUOTATION MARK
- case 0x94: return (char) 0x201d; // RIGHT DOUBLE QUOTATION MARK
- case 0x95: return (char) 0x2022; // BULLET
- case 0x96: return (char) 0x2013; // EN DASH
- case 0x97: return (char) 0x2014; // EM DASH
- case 0x98: throw new InvalidOperationException("Invalid cp1251 sequence [" + P.ToString() + "]");
- case 0x99: return (char) 0x2122; // TRADE MARK SIGN
- case 0x9a: return (char) 0x0459; // CYRILLIC SMALL LETTER LJE
- case 0x9b: return (char) 0x203a; // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
- case 0x9c: return (char) 0x045a; // CYRILLIC SMALL LETTER NJE
- case 0x9d: return (char) 0x045c; // CYRILLIC SMALL LETTER KJE
- case 0x9e: return (char) 0x045b; // CYRILLIC SMALL LETTER TSHE
- case 0x9f: return (char) 0x045f; // CYRILLIC SMALL LETTER DZHE
- case 0xa0: return (char) 0x00a0; // NO-BREAK SPACE
- case 0xa1: return (char) 0x040e; // CYRILLIC CAPITAL LETTER SHORT U
- case 0xa2: return (char) 0x045e; // CYRILLIC SMALL LETTER SHORT U
- case 0xa3: return (char) 0x0408; // CYRILLIC CAPITAL LETTER JE
- case 0xa4: return (char) 0x00a4; // CURRENCY SIGN
- case 0xa5: return (char) 0x0490; // CYRILLIC CAPITAL LETTER GHE WITH UPTURN
- case 0xa8: return (char) 0x0401; // CYRILLIC CAPITAL LETTER IO
- case 0xaa: return (char) 0x0404; // CYRILLIC CAPITAL LETTER UKRAINIAN IE
- case 0xaf: return (char) 0x0407; // CYRILLIC CAPITAL LETTER YI
- case 0xb2: return (char) 0x0406; // CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
- case 0xb3: return (char) 0x0456; // CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
- case 0xb4: return (char) 0x0491; // CYRILLIC SMALL LETTER GHE WITH UPTURN
- case 0xb8: return (char) 0x0451; // CYRILLIC SMALL LETTER IO
- case 0xb9: return (char) 0x2116; // NUMERO SIGN
- case 0xba: return (char) 0x0454; // CYRILLIC SMALL LETTER UKRAINIAN IE
- case 0xbc: return (char) 0x0458; // CYRILLIC SMALL LETTER JE
- case 0xbd: return (char) 0x0405; // CYRILLIC CAPITAL LETTER DZE
- case 0xbe: return (char) 0x0455; // CYRILLIC SMALL LETTER DZE
- case 0xbf: return (char) 0x0457; // CYRILLIC SMALL LETTER YI
- }
-
- if ( (P >= 0xc0) | (P <= 0xff) )
- return System.Convert.ToChar( P + 0x0350);
- return (char) P;
- }
-
- public static char cp1252ToUTF16Char(byte P)
- {
- // Provided by Olaf Lösken. (ported by DrW)
- // Info taken from
- // ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT
- switch (P)
- {
- case 0x80 : return (char) 0x20AC; //EUROSIGN
- case 0x81 : throw new InvalidOperationException("Invalid Windows-1252 sequence [" + P.ToString() + "]");
- case 0x82 : return (char) 0x201A; //SINGLE LOW-9 QUOTATION MARK
- case 0x83 : return (char) 0x0192; //ATIN SMALL LETTER F WITH HOOK
- case 0x84 : return (char) 0x201E; //DOUBLE LOW-9 QUOTATION MARK
- case 0x85 : return (char) 0x2026; //HORIZONTAL ELLIPSIS
- case 0x86 : return (char) 0x2020; //DAGGER
- case 0x87 : return (char) 0x2021; //DOUBLE DAGGER
- case 0x88 : return (char) 0x02C6; //MODIFIER LETTER CIRCUMFLEX ACCENT
- case 0x89 : return (char) 0x2030; //PER MILLE SIGN
- case 0x8A : return (char) 0x0160; //LATIN CAPITAL LETTER S WITH CARON
- case 0x8B : return (char) 0x2039; //SINGLE LEFT-POINTING ANGLE QUOTATION MARK
- case 0x8C : return (char) 0x0152; //LATIN CAPITAL LIGATURE OE
- case 0x8D : throw new InvalidOperationException("Invalid Windows-1252 sequence [" + P.ToString() + "]");
- case 0x8E : return (char) 0x017D; //LATIN CAPITAL LETTER Z WITH CARON
- case 0x8F : throw new InvalidOperationException("Invalid Windows-1252 sequence [" + P.ToString() + "]");
- case 0x90 : throw new InvalidOperationException("Invalid Windows-1252 sequence [" + P.ToString() + "]");
- case 0x91 : return (char) 0x2018; //LEFT SINGLE QUOTATION MARK
- case 0x92 : return (char) 0x2019; //RIGHT SINGLE QUOTATION MARK
- case 0x93 : return (char) 0x201C; //LEFT DOUBLE QUOTATION MARK
- case 0x94 : return (char) 0x201D; //RIGHT DOUBLE QUOTATION MARK
- case 0x95 : return (char) 0x2022; //BULLET
- case 0x96 : return (char) 0x2013; //EN DASH
- case 0x97 : return (char) 0x2014; //EM DASH
- case 0x98 : return (char) 0x02DC; //SMALL TILDE
- case 0x99 : return (char) 0x2122; //TRADE MARK SIGN
- case 0x9A : return (char) 0x0161; //LATIN SMALL LETTER S WITH CARON
- case 0x9B : return (char) 0x203A; //SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
- case 0x9C : return (char) 0x0153; //LATIN SMALL LIGATURE OE
- case 0x9D : throw new InvalidOperationException("Invalid Windows-1252 sequence [" + P.ToString() + "]");
- case 0x9E : return (char) 0x017E; //LATIN SMALL LETTER Z WITH CARON
- case 0x9F : return (char) 0x0178; //LATIN CAPITAL LETTER Y WITH D
- default:
- return (char) P;
- }
- }
-
- /// <summary>
- /// Read in a UTF-8 encoded character. If no character is on the stream, throws
- /// an ArgumentException.<seealso cref="http://www.ietf.org/rfc/rfc2279.txt"/>
- /// </summary>
- /// <exception cref="InvalidOperationException">Thrownn if 1) called at EOF,
- /// 2) invalid UTF-8 encoding found.</exception>
- /// <param name="stream">Stream to read from</param>
- /// <returns>Encoded character (could be two characters, upper/lower Surragate pair)</returns>
- public static int ReadUTF8Char(Stream stream)
- {
- byte[] buf = new byte[1];
-
- if ( stream.Read(buf, 0, 1) != 1)
- throw new InvalidOperationException("Unexptected EOF reading stream");
-
- if (buf[0] >= 0x80) // UTF-8 sequence
- {
- int numOctets = 1;
- byte first = buf[0];
- int mask = 0x40;
- int ucs4 = buf[0];
-
- // first octed must be 110x xxxx to 1111 110x if high order bit set
- if ( (buf[0] & 0xc0) != 0xc0)
- throw new InvalidOperationException("Invalid UTF-8 sequence at position " + stream.Position.ToString());
-
- // we could mask off the first octet and get the number of octets,
- // but it's easier to cycle through. If the bit is set, we have another character to read
- while ( (mask & first) != 0 )
- {
- // read next character of stream
- if (stream.Length == stream.Position)
- throw new InvalidOperationException("Aborted UTF-8 (unexpected EOF) sequence at position " + stream.Position.ToString());
-
- if ( stream.Read(buf, 0, 1) != 1)
- throw new InvalidOperationException("Aborted UTF-8 sequence (missing characters) at position " + stream.Position.ToString());
-
- // all octet sequence bytes start with 10nn nnnn, or they are invalid
- if ( (buf[0] & 0xc0) != 0x80 )
- throw new InvalidOperationException("Invalid UTF-8 sequence at position " + stream.Position.ToString());
-
- // 6 bits are valid in this item (low order 6)
- // mask them off and add them
- ucs4 = (ucs4 << 6) | (buf[0] & 0x3F); // add bits to result
- numOctets++;
- mask = mask >> 1; // adjust mask
- }
-
- // Max 6 octets in sequence
- if ( numOctets > 6)
- throw new InvalidOperationException("Invalid UTF-8 sequence (no 0-bit in hdr) at position " + stream.Position.ToString());
-
- // UTF-8 can encode up to the following values, per octet size
- int[] MaxCode = {0x7F, 0x7FF, 0xFFFF, 0x1FFFFF, 0x3FFFFFF, 0x7FFFFFFF};
-
- // mask off the original header bits
- ucs4 = ucs4 & MaxCode[numOctets - 1]; // array is zero-based
-
- // check for invalid sequence as suggested by RFC2279
- // (check that proper octet sequence size was used to encode character)
- // (if 0x7F was mapped to a 2-octet sequence, this is an improper coding)
- if ( (numOctets > 1) && (ucs4 <= MaxCode[numOctets -2]))
- throw new InvalidOperationException("Invalid UTF-8 sequence (invalid sequence) at position " + stream.Position.ToString());
-
- return ucs4;
- }
- else
- // 1-byte value, return it
- return buf[0];
- }
-
- public static char Utf16LowSurrogate(int val)
- {
- int val2 = 0xDC00 ^ (val & 0x03FF); // 0xdc00 xor (val and 0x03ff)
- return (char) val2;
- }
-
- public static char Utf16HighSurrogate(int val)
- {
- int value2 = 0xD7C0 + ( val >> 10 );
- return (char) value2;
- }
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml/XmlWhitespace.cs b/mcs/class/System.XML/System.Xml/XmlWhitespace.cs
deleted file mode 100644
index 7ab8c7727b5..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlWhitespace.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- ///
- /// </summary>
- public class XmlWhitespace
- {
- // Private data members
-
- // public properties
-
-
- // Public Methods
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlWriter.cs b/mcs/class/System.XML/System.Xml/XmlWriter.cs
deleted file mode 100644
index 0d7f00113b8..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlWriter.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlWriter
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Abstract class XmlWriter
- /// </summary>
- public abstract class XmlWriter
- {
- // Private data members
- //===========================================================================
-
- // public properties
- //===========================================================================
- /// <summary>
- /// Get the state of the writer.
- /// </summary>
- public abstract WriteState WriteState {get;}
-
- /// <summary>
- /// Get the current xml:lang scope, or null if not defined.
- /// </summary>
- public abstract string XmlLang {get;}
-
- /// <summary>
- /// get an XmlSpace representing the current xml:space scope
- /// </summary>
- public abstract XmlSpace XmlSpace {get;}
-
- // Public Methods
- //===========================================================================
- /// <summary>
- /// When overriden, closes this stream and the underlying stream.
- /// </summary>
- /// <exception cref="InvalidOperationException">A call is made to write more output when the stream is closed.</exception>
- public abstract void Close();
-
- /// <summary>
- /// Flushes whatever is in the buffer to the underlying streams, and flushes any underlying streams.
- /// </summary>
- public abstract void Flush();
-
- /// <summary>
- /// Returns closest prefix in current namespace, or null if none found.
- /// </summary>
- /// <param name="ns">namespace URI to find a prefix for.</param>
- /// <exception cref="ArgumentException">ns is null, or string.Empty</exception>
- /// <returns></returns>
- public abstract string LookupPrefix(string ns);
-
- /// <summary>
- /// Write out all the attributes found at the current position in the XmlReader
- /// </summary>
- /// <param name="reader">XmlReader to read from</param>
- /// <param name="defattr">true to copy default attributes</param>
- /// <exception cref="ArgumentException">Reader is a null reference</exception>
- public virtual void WriteAttributes(
- XmlReader reader,
- bool defattr
- )
- {
- //TODO - implement XmlWriter.WriteAttributes(XmlReader, bool)
- throw new NotImplementedException();
- }
-
-
- }
-}
diff --git a/mcs/class/System.XML/Test/.cvsignore b/mcs/class/System.XML/Test/.cvsignore
deleted file mode 100644
index 6a7461313bb..00000000000
--- a/mcs/class/System.XML/Test/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.dll
diff --git a/mcs/class/System.XML/Test/AllTests.cs b/mcs/class/System.XML/Test/AllTests.cs
deleted file mode 100644
index 05522af3132..00000000000
--- a/mcs/class/System.XML/Test/AllTests.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Author:
-// Mario Martinez (mariom925@home.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-
-namespace Ximian.Mono.Tests
-{
- /// <summary>
- /// Combines all unit tests for the System.XML.dll assembly
- /// into one test suite.
- /// </summary>
- public class AllTests : TestCase
- {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite();
- suite.AddTest(new TestSuite(typeof(XmlTextReaderTests)));
- suite.AddTest(new TestSuite(typeof(XmlNamespaceManagerTests)));
- suite.AddTest(new TestSuite(typeof(XmlDocumentTests)));
- suite.AddTest (new TestSuite (typeof (NameTableTests)));
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/ChangeLog b/mcs/class/System.XML/Test/ChangeLog
deleted file mode 100644
index c15e55a3248..00000000000
--- a/mcs/class/System.XML/Test/ChangeLog
+++ /dev/null
@@ -1,29 +0,0 @@
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * NameTableTests.cs: Test for System.Xml.NameTable.
-
-2002-02-26 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReaderTests.cs: Test for namespace declarations as
- attributes.
-
- * XmlNamespaceManagerTests.cs: Use the newly implemented NameTable
- when creating the XmlNamespaceManager. Properly test HasNamespace.
-
-2002-02-25 Jason Diamond <jason@injektilo.org>
-
- * XmlDocumentTests.cs: Added file.
-
-2002-02-23 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReaderTests.cs: Added tests for qualified attributes.
-
-2002-02-23 Jason Diamond <jason@injektilo.org>
-
- * ChangeLog: Added change log to this directory.
-
- * Test.cs: Renamed to XmlTextReaderTests.cs.
-
- * XmlTextReaderTests.cs: Added tests for NamespaceURI property.
-
- * XmlNamespaceManagerTests.cs: Initial tests.
diff --git a/mcs/class/System.XML/Test/NameTableTests.cs b/mcs/class/System.XML/Test/NameTableTests.cs
deleted file mode 100755
index 854ba9eac9c..00000000000
--- a/mcs/class/System.XML/Test/NameTableTests.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.Xml.NameTableTests.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Diagnostics;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace Ximian.Mono.Tests
-{
- public class NameTableTests : TestCase
- {
- NameTable table;
-
- public NameTableTests (string name)
- : base (name)
- {
- }
-
- protected override void SetUp ()
- {
- table = new NameTable ();
- }
-
- //
- // Tests System.Xml.NameTable.Add (string)
- //
- public void TestAdd1 ()
- {
- string testAdd = table.Add ("add1");
- AssertEquals ("add1", testAdd);
- }
-
- //
- // Tests System.Xml.NameTable.Add (char[], int, int)
- //
- public void TestAdd2 ()
- {
- char[] test = new char [4] { 'a', 'd', 'd', '2' };
- int index = 0;
- int length = 3; // "add"
-
- AssertEquals ("add", table.Add (test, index, length));
- }
-
- //
- // Tests System.Xml.NameTable.Get (string)
- //
- public void TestGet1 ()
- {
- string testGet = table.Add ("get1");
-
- AssertEquals (table.Get ("get1"), testGet);
- }
-
- //
- // Tests System.Xml.NameTable.Get (char[], int, int)
- //
- public void TestGet2 ()
- {
- char[] test = new char [4] { 'g', 'e', 't', '2' };
- int index = 0;
- int length = 3; // "get"
-
- string testGet = table.Add (test, index, length);
-
- AssertEquals (table.Get (test, index, length), testGet);
- }
-
- //
- // Tests System.Xml.NameTable.Get (char[], int, 0)
- //
- public void TestGet3 ()
- {
- char[] test = new char [4] { 't', 'e', 's', 't' };
- int index = 0;
- int length = 0;
-
- AssertEquals (table.Get (test, index, length), String.Empty);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/System.XML_test.build b/mcs/class/System.XML/Test/System.XML_test.build
deleted file mode 100644
index 012973138db..00000000000
--- a/mcs/class/System.XML/Test/System.XML_test.build
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.XML_test.dll -->
-<!-- Target build (default) builds tests -->
-<!-- Target test runs tests -->
-
-<project name="System.XML_test" default="build">
- <property name="debug" value="false"/>
- <property name="nunit_home" value="..\..\..\nunit"/>
-
- <target name="build">
- <csc target="library" output="System.XML_test.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <sources>
- <includes name="**/*.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/r:.\System.XML.dll"/>
- </csc>
- </target>
-
- <target name="test" depends="build">
- <exec program="..\..\..\nunit\NUnitConsole" commandline="Ximian.Mono.Tests.AllTests,System.XML_test.dll" failonerror="false"/>
- </target>
-
- <target name="clean">
- <delete file="System.XML.dll" failonerror="false"/>
- <delete file="System.XML_test.dll" failonerror="false"/>
- <delete file="System.XML_test.pdb" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System.XML/Test/XmlDocumentTests.cs b/mcs/class/System.XML/Test/XmlDocumentTests.cs
deleted file mode 100644
index 25bde9aa8c4..00000000000
--- a/mcs/class/System.XML/Test/XmlDocumentTests.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace Ximian.Mono.Tests
-{
- public class XmlDocumentTests : TestCase
- {
- public XmlDocumentTests(string name) : base(name) { }
-
- public void TestDocumentElement()
- {
- XmlDocument document = new XmlDocument();
- AssertNull(document.DocumentElement);
-
- XmlElement element = document.CreateElement("foo", "bar", "http://foo/");
- AssertNotNull(element);
-
- AssertEquals("foo", element.Prefix);
- AssertEquals("bar", element.LocalName);
- AssertEquals("http://foo/", element.NamespaceURI);
-
- AssertEquals("foo:bar", element.Name);
-
- AssertSame(element, document.AppendChild(element));
-
- AssertSame(element, document.DocumentElement);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs b/mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs
deleted file mode 100644
index 933291b2777..00000000000
--- a/mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.Test.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Diagnostics;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace Ximian.Mono.Tests
-{
- public class XmlNamespaceManagerTests : TestCase
- {
- public XmlNamespaceManagerTests(string name) : base(name) { }
-
- private XmlNamespaceManager _NamespaceManager;
-
- protected override void SetUp()
- {
- XmlNameTable nameTable = new NameTable();
- _NamespaceManager = new XmlNamespaceManager(nameTable);
- }
-
- public void TestNewNamespaceManager()
- {
- Assert(!_NamespaceManager.HasNamespace("xmlns"));
- Assert(!_NamespaceManager.HasNamespace("xml"));
- Assert(!_NamespaceManager.HasNamespace(String.Empty));
-
- AssertEquals("http://www.w3.org/2000/xmlns/", _NamespaceManager.LookupNamespace("xmlns"));
- AssertEquals("http://www.w3.org/XML/1998/namespace", _NamespaceManager.LookupNamespace("xml"));
- AssertEquals(String.Empty, _NamespaceManager.LookupNamespace(String.Empty));
-
- AssertNull(_NamespaceManager.LookupNamespace("foo"));
- }
-
- public void TestAddNamespace()
- {
- // add a new namespace.
- _NamespaceManager.AddNamespace("foo", "http://foo/");
- // make sure the new namespace is there.
- Assert(_NamespaceManager.HasNamespace("foo"));
- AssertEquals("http://foo/", _NamespaceManager.LookupNamespace("foo"));
- }
-
- public void TestPushScope()
- {
- // add a new namespace.
- _NamespaceManager.AddNamespace("foo", "http://foo/");
- // make sure the new namespace is there.
- Assert(_NamespaceManager.HasNamespace("foo"));
- AssertEquals("http://foo/", _NamespaceManager.LookupNamespace("foo"));
- // push a new scope.
- _NamespaceManager.PushScope();
- // add a new namespace.
- _NamespaceManager.AddNamespace("bar", "http://bar/");
- // make sure the old namespace is not in this new scope.
- Assert(!_NamespaceManager.HasNamespace("foo"));
- // but we're still supposed to be able to lookup the old namespace.
- AssertEquals("http://foo/", _NamespaceManager.LookupNamespace("foo"));
- // make sure the new namespace is there.
- Assert(_NamespaceManager.HasNamespace("bar"));
- AssertEquals("http://bar/", _NamespaceManager.LookupNamespace("bar"));
- }
-
- public void TestPopScope()
- {
- // add some namespaces and a scope.
- TestPushScope();
- // pop the scope.
- Assert(_NamespaceManager.PopScope());
- // make sure the first namespace is still there.
- Assert(_NamespaceManager.HasNamespace("foo"));
- AssertEquals("http://foo/", _NamespaceManager.LookupNamespace("foo"));
- // make sure the second namespace is no longer there.
- Assert(!_NamespaceManager.HasNamespace("bar"));
- AssertNull(_NamespaceManager.LookupNamespace("bar"));
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlTextReaderTests.cs b/mcs/class/System.XML/Test/XmlTextReaderTests.cs
deleted file mode 100644
index 159835addbf..00000000000
--- a/mcs/class/System.XML/Test/XmlTextReaderTests.cs
+++ /dev/null
@@ -1,1612 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.Test.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace Ximian.Mono.Tests
-{
- public class XmlTextReaderTests : TestCase
- {
- public XmlTextReaderTests(string name) : base(name) { }
-
- private void AssertStartDocument(XmlReader xmlReader)
- {
- Assert(xmlReader.ReadState == ReadState.Initial);
- Assert(xmlReader.NodeType == XmlNodeType.None);
- Assert(xmlReader.Depth == 0);
- Assert(!xmlReader.EOF);
- }
-
- private void AssertNode(
- XmlReader xmlReader,
- XmlNodeType nodeType,
- int depth,
- bool isEmptyElement,
- string name,
- string prefix,
- string localName,
- string namespaceURI,
- string value,
- int attributeCount)
- {
- Assert(xmlReader.Read());
- Assert(xmlReader.ReadState == ReadState.Interactive);
- Assert(!xmlReader.EOF);
-
- Assert(xmlReader.NodeType == nodeType);
- Assert(xmlReader.Depth == depth);
- Assert(xmlReader.IsEmptyElement == isEmptyElement);
-
- Assert(
- String.Format(
- "name was {0}, expected {1}",
- xmlReader.Name,
- name),
- xmlReader.Name == name);
-
- Assert(
- String.Format(
- "prefix was {0}, expected {1}",
- xmlReader.Prefix,
- prefix),
- xmlReader.Prefix == prefix);
-
- Assert(
- String.Format(
- "localName was {0}, expected {1}",
- xmlReader.LocalName,
- localName),
- xmlReader.LocalName == localName);
-
- Assert(
- String.Format(
- "namespaceURI was {0}, expected {1}",
- xmlReader.NamespaceURI,
- namespaceURI),
- xmlReader.NamespaceURI == namespaceURI);
-
- Assert(xmlReader.HasValue == (value != String.Empty));
- Assert(xmlReader.Value == value);
-
- Assert(
- String.Format(
- "hasAttributes was {0}, expected {1}",
- xmlReader.HasAttributes,
- (attributeCount > 0)),
- xmlReader.HasAttributes == (attributeCount > 0));
-
- Assert(
- String.Format(
- "attributeCount was {0}, expected {1}",
- xmlReader.AttributeCount,
- attributeCount),
- xmlReader.AttributeCount == attributeCount);
- }
-
- private void AssertAttribute(
- XmlReader xmlReader,
- string name,
- string prefix,
- string localName,
- string namespaceURI,
- string value)
- {
- Assert(
- String.Format(
- "value was {0}, expected {1}",
- xmlReader[name],
- value),
- xmlReader[name] == value);
-
- Assert(xmlReader.GetAttribute(name) == value);
-
- if (namespaceURI != String.Empty)
- {
- Assert(xmlReader[localName, namespaceURI] == value);
- Assert(xmlReader.GetAttribute(localName, namespaceURI) == value);
- }
- }
-
- private void AssertEndDocument(XmlReader xmlReader)
- {
- Assert(!xmlReader.Read());
- Assert(xmlReader.NodeType == XmlNodeType.None);
- Assert(xmlReader.Depth == 0);
- Assert(xmlReader.ReadState == ReadState.EndOfFile);
- Assert(xmlReader.EOF);
-
- xmlReader.Close();
- Assert(xmlReader.ReadState == ReadState.Closed);
- }
-
- public void TestEmptyElement()
- {
- string xml = "<foo/>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEmptyElementWithWhitespace()
- {
- string xml = "<foo />";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEmptyElementWithStartAndEndTag()
- {
- string xml = "<foo></foo>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEmptyElementWithStartAndEndTagWithWhitespace()
- {
- string xml = "<foo ></foo >";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestNestedEmptyTag()
- {
- string xml = "<foo><bar/></foo>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 1, //depth
- true, // isEmptyElement
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestNestedText()
- {
- string xml = "<foo>bar</foo>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "bar", // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEmptyElementWithAttribute()
- {
- string xml = @"<foo bar=""baz""/>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "baz" // value
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestStartAndEndTagWithAttribute()
- {
- string xml = @"<foo bar='baz'></foo>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "baz" // value
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEmptyElementWithTwoAttributes()
- {
- string xml = @"<foo bar=""baz"" quux='quuux'/>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 2 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "baz" // value
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "quux", // name
- String.Empty, // prefix
- "quux", // localName
- String.Empty, // namespaceURI
- "quuux" // value
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestProcessingInstructionBeforeDocumentElement()
- {
- string xml = "<?foo bar?><baz/>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.ProcessingInstruction, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- "bar", // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "baz", // name
- String.Empty, // prefix
- "baz", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestCommentBeforeDocumentElement()
- {
- string xml = "<!--foo--><bar/>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Comment, // nodeType
- 0, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "foo", // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestPredefinedEntities()
- {
- string xml = "<foo>&lt;&gt;&amp;&apos;&quot;</foo>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "<>&'\"", // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEntityReference()
- {
- string xml = "<foo>&bar;</foo>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EntityReference, // nodeType
- 1, //depth
- false, // isEmptyElement
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEntityReferenceInsideText()
- {
- string xml = "<foo>bar&baz;quux</foo>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "bar", // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EntityReference, // nodeType
- 1, //depth
- false, // isEmptyElement
- "baz", // name
- String.Empty, // prefix
- "baz", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "quux", // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestCharacterReferences()
- {
- string xml = "<foo>&#70;&#x4F;&#x4f;</foo>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "FOO", // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEntityReferenceInAttribute()
- {
- string xml = "<foo bar='&baz;'/>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "&baz;" // value
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestPredefinedEntitiesInAttribute()
- {
- string xml = "<foo bar='&lt;&gt;&amp;&apos;&quot;'/>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "<>&'\"" // value
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestCharacterReferencesInAttribute()
- {
- string xml = "<foo bar='&#70;&#x4F;&#x4f;'/>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "FOO" // value
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestCDATA()
- {
- string xml = "<foo><![CDATA[<>&]]></foo>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.CDATA, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "<>&", // value
- 0 // attributeCount
- );
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEmptyElementInNamespace()
- {
- string xml = @"<foo:bar xmlns:foo='http://foo/' />";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "xmlns:foo", // name
- "xmlns", // prefix
- "foo", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
-
- AssertEquals("http://foo/", xmlReader.LookupNamespace("foo"));
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestEmptyElementInDefaultNamespace()
- {
- string xml = @"<foo xmlns='http://foo/' />";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "xmlns", // name
- String.Empty, // prefix
- "xmlns", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
-
- AssertEquals("http://foo/", xmlReader.LookupNamespace(String.Empty));
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestChildElementInNamespace()
- {
- string xml = @"<foo:bar xmlns:foo='http://foo/'><baz:quux xmlns:baz='http://baz/' /></foo:bar>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "xmlns:foo", // name
- "xmlns", // prefix
- "foo", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
-
- AssertEquals("http://foo/", xmlReader.LookupNamespace("foo"));
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 1, // depth
- true, // isEmptyElement
- "baz:quux", // name
- "baz", // prefix
- "quux", // localName
- "http://baz/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "xmlns:baz", // name
- "xmlns", // prefix
- "baz", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://baz/" // value
- );
-
- AssertEquals("http://foo/", xmlReader.LookupNamespace("foo"));
- AssertEquals("http://baz/", xmlReader.LookupNamespace("baz"));
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEquals("http://foo/", xmlReader.LookupNamespace("foo"));
- AssertNull(xmlReader.LookupNamespace("baz"));
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestChildElementInDefaultNamespace()
- {
- string xml = @"<foo:bar xmlns:foo='http://foo/'><baz xmlns='http://baz/' /></foo:bar>";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "xmlns:foo", // name
- "xmlns", // prefix
- "foo", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
-
- AssertEquals("http://foo/", xmlReader.LookupNamespace("foo"));
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 1, // depth
- true, // isEmptyElement
- "baz", // name
- String.Empty, // prefix
- "baz", // localName
- "http://baz/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "xmlns", // name
- String.Empty, // prefix
- "xmlns", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://baz/" // value
- );
-
- AssertEquals("http://foo/", xmlReader.LookupNamespace("foo"));
- AssertEquals("http://baz/", xmlReader.LookupNamespace(String.Empty));
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEquals("http://foo/", xmlReader.LookupNamespace("foo"));
-
- AssertEndDocument(xmlReader);
- }
-
- public void TestAttributeInNamespace()
- {
- string xml = @"<foo bar:baz='quux' xmlns:bar='http://bar/' />";
- XmlReader xmlReader =
- new XmlTextReader(new StringReader(xml));
-
- AssertStartDocument(xmlReader);
-
- AssertNode(
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 2 // attributeCount
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "bar:baz", // name
- "bar", // prefix
- "baz", // localName
- "http://bar/", // namespaceURI
- "quux" // value
- );
-
- AssertAttribute(
- xmlReader, // xmlReader
- "xmlns:bar", // name
- "xmlns", // prefix
- "bar", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://bar/" // value
- );
-
- AssertEquals("http://bar/", xmlReader.LookupNamespace("bar"));
-
- AssertEndDocument(xmlReader);
- }
-
-// The following is #if'ed out because it's specific to the Mono
-// implementation and won't compile when testing Microsoft's code.
-// Feel free to turn it on if you want to test Mono's name tables.
-
-#if false
-
- public void TestIsFirstNameChar()
- {
- for (int ch = 0; ch <= 0xFFFF; ++ch)
- {
- Assert(
- XmlChar.IsFirstNameChar(ch) ==
- IsFirstNameChar(ch));
- }
- }
-
- public void TestIsNameChar()
- {
- for (int ch = 0; ch <= 0xFFFF; ++ch)
- {
- Assert(
- XmlChar.IsNameChar(ch) ==
- IsNameChar(ch));
- }
- }
-
- private static bool IsFirstNameChar(int ch)
- {
- return
- IsLetter(ch) ||
- (ch == '_') ||
- (ch == ':');
- }
-
- private static bool IsNameChar(int ch)
- {
- return
- IsLetter(ch) ||
- IsDigit(ch) ||
- (ch == '.') ||
- (ch == '-') ||
- (ch == '_') ||
- (ch == ':') ||
- IsCombiningChar(ch) ||
- IsExtender(ch);
- }
-
- private static bool IsLetter(int ch)
- {
- return
- IsBaseChar(ch) ||
- IsIdeographic(ch);
- }
-
- private static bool IsBaseChar(int ch)
- {
- return
- (ch >= 0x0041 && ch <= 0x005A) ||
- (ch >= 0x0061 && ch <= 0x007A) ||
- (ch >= 0x00C0 && ch <= 0x00D6) ||
- (ch >= 0x00D8 && ch <= 0x00F6) ||
- (ch >= 0x00F8 && ch <= 0x00FF) ||
- (ch >= 0x0100 && ch <= 0x0131) ||
- (ch >= 0x0134 && ch <= 0x013E) ||
- (ch >= 0x0141 && ch <= 0x0148) ||
- (ch >= 0x014A && ch <= 0x017E) ||
- (ch >= 0x0180 && ch <= 0x01C3) ||
- (ch >= 0x01CD && ch <= 0x01F0) ||
- (ch >= 0x01F4 && ch <= 0x01F5) ||
- (ch >= 0x01FA && ch <= 0x0217) ||
- (ch >= 0x0250 && ch <= 0x02A8) ||
- (ch >= 0x02BB && ch <= 0x02C1) ||
- (ch == 0x0386) ||
- (ch >= 0x0388 && ch <= 0x038A) ||
- (ch == 0x038C) ||
- (ch >= 0x038E && ch <= 0x03A1) ||
- (ch >= 0x03A3 && ch <= 0x03CE) ||
- (ch >= 0x03D0 && ch <= 0x03D6) ||
- (ch == 0x03DA) ||
- (ch == 0x03DC) ||
- (ch == 0x03DE) ||
- (ch == 0x03E0) ||
- (ch >= 0x03E2 && ch <= 0x03F3) ||
- (ch >= 0x0401 && ch <= 0x040C) ||
- (ch >= 0x040E && ch <= 0x044F) ||
- (ch >= 0x0451 && ch <= 0x045C) ||
- (ch >= 0x045E && ch <= 0x0481) ||
- (ch >= 0x0490 && ch <= 0x04C4) ||
- (ch >= 0x04C7 && ch <= 0x04C8) ||
- (ch >= 0x04CB && ch <= 0x04CC) ||
- (ch >= 0x04D0 && ch <= 0x04EB) ||
- (ch >= 0x04EE && ch <= 0x04F5) ||
- (ch >= 0x04F8 && ch <= 0x04F9) ||
- (ch >= 0x0531 && ch <= 0x0556) ||
- (ch == 0x0559) ||
- (ch >= 0x0561 && ch <= 0x0586) ||
- (ch >= 0x05D0 && ch <= 0x05EA) ||
- (ch >= 0x05F0 && ch <= 0x05F2) ||
- (ch >= 0x0621 && ch <= 0x063A) ||
- (ch >= 0x0641 && ch <= 0x064A) ||
- (ch >= 0x0671 && ch <= 0x06B7) ||
- (ch >= 0x06BA && ch <= 0x06BE) ||
- (ch >= 0x06C0 && ch <= 0x06CE) ||
- (ch >= 0x06D0 && ch <= 0x06D3) ||
- (ch == 0x06D5) ||
- (ch >= 0x06E5 && ch <= 0x06E6) ||
- (ch >= 0x0905 && ch <= 0x0939) ||
- (ch == 0x093D) ||
- (ch >= 0x0958 && ch <= 0x0961) ||
- (ch >= 0x0985 && ch <= 0x098C) ||
- (ch >= 0x098F && ch <= 0x0990) ||
- (ch >= 0x0993 && ch <= 0x09A8) ||
- (ch >= 0x09AA && ch <= 0x09B0) ||
- (ch == 0x09B2) ||
- (ch >= 0x09B6 && ch <= 0x09B9) ||
- (ch >= 0x09DC && ch <= 0x09DD) ||
- (ch >= 0x09DF && ch <= 0x09E1) ||
- (ch >= 0x09F0 && ch <= 0x09F1) ||
- (ch >= 0x0A05 && ch <= 0x0A0A) ||
- (ch >= 0x0A0F && ch <= 0x0A10) ||
- (ch >= 0x0A13 && ch <= 0x0A28) ||
- (ch >= 0x0A2A && ch <= 0x0A30) ||
- (ch >= 0x0A32 && ch <= 0x0A33) ||
- (ch >= 0x0A35 && ch <= 0x0A36) ||
- (ch >= 0x0A38 && ch <= 0x0A39) ||
- (ch >= 0x0A59 && ch <= 0x0A5C) ||
- (ch == 0x0A5E) ||
- (ch >= 0x0A72 && ch <= 0x0A74) ||
- (ch >= 0x0A85 && ch <= 0x0A8B) ||
- (ch == 0x0A8D) ||
- (ch >= 0x0A8F && ch <= 0x0A91) ||
- (ch >= 0x0A93 && ch <= 0x0AA8) ||
- (ch >= 0x0AAA && ch <= 0x0AB0) ||
- (ch >= 0x0AB2 && ch <= 0x0AB3) ||
- (ch >= 0x0AB5 && ch <= 0x0AB9) ||
- (ch == 0x0ABD) ||
- (ch == 0x0AE0) ||
- (ch >= 0x0B05 && ch <= 0x0B0C) ||
- (ch >= 0x0B0F && ch <= 0x0B10) ||
- (ch >= 0x0B13 && ch <= 0x0B28) ||
- (ch >= 0x0B2A && ch <= 0x0B30) ||
- (ch >= 0x0B32 && ch <= 0x0B33) ||
- (ch >= 0x0B36 && ch <= 0x0B39) ||
- (ch == 0x0B3D) ||
- (ch >= 0x0B5C && ch <= 0x0B5D) ||
- (ch >= 0x0B5F && ch <= 0x0B61) ||
- (ch >= 0x0B85 && ch <= 0x0B8A) ||
- (ch >= 0x0B8E && ch <= 0x0B90) ||
- (ch >= 0x0B92 && ch <= 0x0B95) ||
- (ch >= 0x0B99 && ch <= 0x0B9A) ||
- (ch == 0x0B9C) ||
- (ch >= 0x0B9E && ch <= 0x0B9F) ||
- (ch >= 0x0BA3 && ch <= 0x0BA4) ||
- (ch >= 0x0BA8 && ch <= 0x0BAA) ||
- (ch >= 0x0BAE && ch <= 0x0BB5) ||
- (ch >= 0x0BB7 && ch <= 0x0BB9) ||
- (ch >= 0x0C05 && ch <= 0x0C0C) ||
- (ch >= 0x0C0E && ch <= 0x0C10) ||
- (ch >= 0x0C12 && ch <= 0x0C28) ||
- (ch >= 0x0C2A && ch <= 0x0C33) ||
- (ch >= 0x0C35 && ch <= 0x0C39) ||
- (ch >= 0x0C60 && ch <= 0x0C61) ||
- (ch >= 0x0C85 && ch <= 0x0C8C) ||
- (ch >= 0x0C8E && ch <= 0x0C90) ||
- (ch >= 0x0C92 && ch <= 0x0CA8) ||
- (ch >= 0x0CAA && ch <= 0x0CB3) ||
- (ch >= 0x0CB5 && ch <= 0x0CB9) ||
- (ch == 0x0CDE) ||
- (ch >= 0x0CE0 && ch <= 0x0CE1) ||
- (ch >= 0x0D05 && ch <= 0x0D0C) ||
- (ch >= 0x0D0E && ch <= 0x0D10) ||
- (ch >= 0x0D12 && ch <= 0x0D28) ||
- (ch >= 0x0D2A && ch <= 0x0D39) ||
- (ch >= 0x0D60 && ch <= 0x0D61) ||
- (ch >= 0x0E01 && ch <= 0x0E2E) ||
- (ch == 0x0E30) ||
- (ch >= 0x0E32 && ch <= 0x0E33) ||
- (ch >= 0x0E40 && ch <= 0x0E45) ||
- (ch >= 0x0E81 && ch <= 0x0E82) ||
- (ch == 0x0E84) ||
- (ch >= 0x0E87 && ch <= 0x0E88) ||
- (ch == 0x0E8A) ||
- (ch == 0x0E8D) ||
- (ch >= 0x0E94 && ch <= 0x0E97) ||
- (ch >= 0x0E99 && ch <= 0x0E9F) ||
- (ch >= 0x0EA1 && ch <= 0x0EA3) ||
- (ch == 0x0EA5) ||
- (ch == 0x0EA7) ||
- (ch >= 0x0EAA && ch <= 0x0EAB) ||
- (ch >= 0x0EAD && ch <= 0x0EAE) ||
- (ch == 0x0EB0) ||
- (ch >= 0x0EB2 && ch <= 0x0EB3) ||
- (ch == 0x0EBD) ||
- (ch >= 0x0EC0 && ch <= 0x0EC4) ||
- (ch >= 0x0F40 && ch <= 0x0F47) ||
- (ch >= 0x0F49 && ch <= 0x0F69) ||
- (ch >= 0x10A0 && ch <= 0x10C5) ||
- (ch >= 0x10D0 && ch <= 0x10F6) ||
- (ch == 0x1100) ||
- (ch >= 0x1102 && ch <= 0x1103) ||
- (ch >= 0x1105 && ch <= 0x1107) ||
- (ch == 0x1109) ||
- (ch >= 0x110B && ch <= 0x110C) ||
- (ch >= 0x110E && ch <= 0x1112) ||
- (ch == 0x113C) ||
- (ch == 0x113E) ||
- (ch == 0x1140) ||
- (ch == 0x114C) ||
- (ch == 0x114E) ||
- (ch == 0x1150) ||
- (ch >= 0x1154 && ch <= 0x1155) ||
- (ch == 0x1159) ||
- (ch >= 0x115F && ch <= 0x1161) ||
- (ch == 0x1163) ||
- (ch == 0x1165) ||
- (ch == 0x1167) ||
- (ch == 0x1169) ||
- (ch >= 0x116D && ch <= 0x116E) ||
- (ch >= 0x1172 && ch <= 0x1173) ||
- (ch == 0x1175) ||
- (ch == 0x119E) ||
- (ch == 0x11A8) ||
- (ch == 0x11AB) ||
- (ch >= 0x11AE && ch <= 0x11AF) ||
- (ch >= 0x11B7 && ch <= 0x11B8) ||
- (ch == 0x11BA) ||
- (ch >= 0x11BC && ch <= 0x11C2) ||
- (ch == 0x11EB) ||
- (ch == 0x11F0) ||
- (ch == 0x11F9) ||
- (ch >= 0x1E00 && ch <= 0x1E9B) ||
- (ch >= 0x1EA0 && ch <= 0x1EF9) ||
- (ch >= 0x1F00 && ch <= 0x1F15) ||
- (ch >= 0x1F18 && ch <= 0x1F1D) ||
- (ch >= 0x1F20 && ch <= 0x1F45) ||
- (ch >= 0x1F48 && ch <= 0x1F4D) ||
- (ch >= 0x1F50 && ch <= 0x1F57) ||
- (ch == 0x1F59) ||
- (ch == 0x1F5B) ||
- (ch == 0x1F5D) ||
- (ch >= 0x1F5F && ch <= 0x1F7D) ||
- (ch >= 0x1F80 && ch <= 0x1FB4) ||
- (ch >= 0x1FB6 && ch <= 0x1FBC) ||
- (ch == 0x1FBE) ||
- (ch >= 0x1FC2 && ch <= 0x1FC4) ||
- (ch >= 0x1FC6 && ch <= 0x1FCC) ||
- (ch >= 0x1FD0 && ch <= 0x1FD3) ||
- (ch >= 0x1FD6 && ch <= 0x1FDB) ||
- (ch >= 0x1FE0 && ch <= 0x1FEC) ||
- (ch >= 0x1FF2 && ch <= 0x1FF4) ||
- (ch >= 0x1FF6 && ch <= 0x1FFC) ||
- (ch == 0x2126) ||
- (ch >= 0x212A && ch <= 0x212B) ||
- (ch == 0x212E) ||
- (ch >= 0x2180 && ch <= 0x2182) ||
- (ch >= 0x3041 && ch <= 0x3094) ||
- (ch >= 0x30A1 && ch <= 0x30FA) ||
- (ch >= 0x3105 && ch <= 0x312C) ||
- (ch >= 0xAC00 && ch <= 0xD7A3);
- }
-
- private static bool IsIdeographic(int ch)
- {
- return
- (ch >= 0x4E00 && ch <= 0x9FA5) ||
- (ch == 0x3007) ||
- (ch >= 0x3021 && ch <= 0x3029);
- }
-
- private static bool IsDigit(int ch)
- {
- return
- (ch >= 0x0030 && ch <= 0x0039) ||
- (ch >= 0x0660 && ch <= 0x0669) ||
- (ch >= 0x06F0 && ch <= 0x06F9) ||
- (ch >= 0x0966 && ch <= 0x096F) ||
- (ch >= 0x09E6 && ch <= 0x09EF) ||
- (ch >= 0x0A66 && ch <= 0x0A6F) ||
- (ch >= 0x0AE6 && ch <= 0x0AEF) ||
- (ch >= 0x0B66 && ch <= 0x0B6F) ||
- (ch >= 0x0BE7 && ch <= 0x0BEF) ||
- (ch >= 0x0C66 && ch <= 0x0C6F) ||
- (ch >= 0x0CE6 && ch <= 0x0CEF) ||
- (ch >= 0x0D66 && ch <= 0x0D6F) ||
- (ch >= 0x0E50 && ch <= 0x0E59) ||
- (ch >= 0x0ED0 && ch <= 0x0ED9) ||
- (ch >= 0x0F20 && ch <= 0x0F29);
- }
-
- private static bool IsCombiningChar(int ch)
- {
- return
- (ch >= 0x0300 && ch <= 0x0345) ||
- (ch >= 0x0360 && ch <= 0x0361) ||
- (ch >= 0x0483 && ch <= 0x0486) ||
- (ch >= 0x0591 && ch <= 0x05A1) ||
- (ch >= 0x05A3 && ch <= 0x05B9) ||
- (ch >= 0x05BB && ch <= 0x05BD) ||
- (ch == 0x05BF) ||
- (ch >= 0x05C1 && ch <= 0x05C2) ||
- (ch == 0x05C4) ||
- (ch >= 0x064B && ch <= 0x0652) ||
- (ch == 0x0670) ||
- (ch >= 0x06D6 && ch <= 0x06DC) ||
- (ch >= 0x06DD && ch <= 0x06DF) ||
- (ch >= 0x06E0 && ch <= 0x06E4) ||
- (ch >= 0x06E7 && ch <= 0x06E8) ||
- (ch >= 0x06EA && ch <= 0x06ED) ||
- (ch >= 0x0901 && ch <= 0x0903) ||
- (ch == 0x093C) ||
- (ch >= 0x093E && ch <= 0x094C) ||
- (ch == 0x094D) ||
- (ch >= 0x0951 && ch <= 0x0954) ||
- (ch >= 0x0962 && ch <= 0x0963) ||
- (ch >= 0x0981 && ch <= 0x0983) ||
- (ch == 0x09BC) ||
- (ch == 0x09BE) ||
- (ch == 0x09BF) ||
- (ch >= 0x09C0 && ch <= 0x09C4) ||
- (ch >= 0x09C7 && ch <= 0x09C8) ||
- (ch >= 0x09CB && ch <= 0x09CD) ||
- (ch == 0x09D7) ||
- (ch >= 0x09E2 && ch <= 0x09E3) ||
- (ch == 0x0A02) ||
- (ch == 0x0A3C) ||
- (ch == 0x0A3E) ||
- (ch == 0x0A3F) ||
- (ch >= 0x0A40 && ch <= 0x0A42) ||
- (ch >= 0x0A47 && ch <= 0x0A48) ||
- (ch >= 0x0A4B && ch <= 0x0A4D) ||
- (ch >= 0x0A70 && ch <= 0x0A71) ||
- (ch >= 0x0A81 && ch <= 0x0A83) ||
- (ch == 0x0ABC) ||
- (ch >= 0x0ABE && ch <= 0x0AC5) ||
- (ch >= 0x0AC7 && ch <= 0x0AC9) ||
- (ch >= 0x0ACB && ch <= 0x0ACD) ||
- (ch >= 0x0B01 && ch <= 0x0B03) ||
- (ch == 0x0B3C) ||
- (ch >= 0x0B3E && ch <= 0x0B43) ||
- (ch >= 0x0B47 && ch <= 0x0B48) ||
- (ch >= 0x0B4B && ch <= 0x0B4D) ||
- (ch >= 0x0B56 && ch <= 0x0B57) ||
- (ch >= 0x0B82 && ch <= 0x0B83) ||
- (ch >= 0x0BBE && ch <= 0x0BC2) ||
- (ch >= 0x0BC6 && ch <= 0x0BC8) ||
- (ch >= 0x0BCA && ch <= 0x0BCD) ||
- (ch == 0x0BD7) ||
- (ch >= 0x0C01 && ch <= 0x0C03) ||
- (ch >= 0x0C3E && ch <= 0x0C44) ||
- (ch >= 0x0C46 && ch <= 0x0C48) ||
- (ch >= 0x0C4A && ch <= 0x0C4D) ||
- (ch >= 0x0C55 && ch <= 0x0C56) ||
- (ch >= 0x0C82 && ch <= 0x0C83) ||
- (ch >= 0x0CBE && ch <= 0x0CC4) ||
- (ch >= 0x0CC6 && ch <= 0x0CC8) ||
- (ch >= 0x0CCA && ch <= 0x0CCD) ||
- (ch >= 0x0CD5 && ch <= 0x0CD6) ||
- (ch >= 0x0D02 && ch <= 0x0D03) ||
- (ch >= 0x0D3E && ch <= 0x0D43) ||
- (ch >= 0x0D46 && ch <= 0x0D48) ||
- (ch >= 0x0D4A && ch <= 0x0D4D) ||
- (ch == 0x0D57) ||
- (ch == 0x0E31) ||
- (ch >= 0x0E34 && ch <= 0x0E3A) ||
- (ch >= 0x0E47 && ch <= 0x0E4E) ||
- (ch == 0x0EB1) ||
- (ch >= 0x0EB4 && ch <= 0x0EB9) ||
- (ch >= 0x0EBB && ch <= 0x0EBC) ||
- (ch >= 0x0EC8 && ch <= 0x0ECD) ||
- (ch >= 0x0F18 && ch <= 0x0F19) ||
- (ch == 0x0F35) ||
- (ch == 0x0F37) ||
- (ch == 0x0F39) ||
- (ch == 0x0F3E) ||
- (ch == 0x0F3F) ||
- (ch >= 0x0F71 && ch <= 0x0F84) ||
- (ch >= 0x0F86 && ch <= 0x0F8B) ||
- (ch >= 0x0F90 && ch <= 0x0F95) ||
- (ch == 0x0F97) ||
- (ch >= 0x0F99 && ch <= 0x0FAD) ||
- (ch >= 0x0FB1 && ch <= 0x0FB7) ||
- (ch == 0x0FB9) ||
- (ch >= 0x20D0 && ch <= 0x20DC) ||
- (ch == 0x20E1) ||
- (ch >= 0x302A && ch <= 0x302F) ||
- (ch == 0x3099) ||
- (ch == 0x309A);
- }
-
- private static bool IsExtender(int ch)
- {
- return
- (ch == 0x00B7) ||
- (ch == 0x02D0) ||
- (ch == 0x02D1) ||
- (ch == 0x0387) ||
- (ch == 0x0640) ||
- (ch == 0x0E46) ||
- (ch == 0x0EC6) ||
- (ch == 0x3005) ||
- (ch >= 0x3031 && ch <= 0x3035) ||
- (ch >= 0x309D && ch <= 0x309E) ||
- (ch >= 0x30FC && ch <= 0x30FE);
- }
-
-#endif
-
- public void TestIsName()
- {
- Assert(XmlReader.IsName("foo"));
- Assert(!XmlReader.IsName("1foo"));
- Assert(!XmlReader.IsName(" foo"));
- }
-
- public void TestIsNameToken()
- {
- Assert(XmlReader.IsNameToken("foo"));
- Assert(XmlReader.IsNameToken("1foo"));
- Assert(!XmlReader.IsNameToken(" foo"));
- }
- }
-}
diff --git a/mcs/class/System/.cvsignore b/mcs/class/System/.cvsignore
deleted file mode 100644
index c5f30212276..00000000000
--- a/mcs/class/System/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-System.dll
-list
diff --git a/mcs/class/System/ChangeLog b/mcs/class/System/ChangeLog
deleted file mode 100644
index 54f38795b66..00000000000
--- a/mcs/class/System/ChangeLog
+++ /dev/null
@@ -1,13 +0,0 @@
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * System.build: Start build System.Net.Sockets.Socket.cs,
- TcpClient.cs and TcpListener.cs
-
-2001-12-07 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Add the change log to this directory
-
- * System.build: Add dependancy on linux target to test target. Need to
- have the dll before we can test it, right? Plus it encourages others
- to try 'make test'.
-
diff --git a/mcs/class/System/System.CodeDom.Compiler/ChangeLog b/mcs/class/System/System.CodeDom.Compiler/ChangeLog
deleted file mode 100755
index 8bbfdd12a26..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * CodeGenerator.cs : Mark bits with MonoTODO.
-
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * CodeGenerator.cs: moved using statement out of namespace
- declaration.
-
diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs b/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs
deleted file mode 100755
index 7cefc4f5709..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// System.CodeDom.Compiler CodeGenerator class
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.CodeDom;
-using System.Reflection;
-using System.IO;
-
-namespace System.CodeDom.Compiler {
-
- public abstract class CodeGenerator : ICodeGenerator {
- protected TextWriter output;
-
- protected virtual void ContinueOnNewLine (string st)
- {
- }
-
- CodeGenerator ()
- {
- indent = 8;
- }
-
- //
- // Code Generation methods
- //
- protected abstract void GenerateArrayCreateExpression (CodeArrayCreateExpression e);
- protected abstract void GenerateAssignStatement (CodeAssignStatement s);
- protected abstract void GenerateAttachEventStatement (CodeAttachEventStatement s);
- protected abstract void GenerateBaseReferenceExpression (CodeBaseReferenceExpression e);
- protected abstract void GenerateBinaryOperatorExpression (CodeBinaryOperatorExpression x);
- protected abstract void GenerateCastExpression (CodeCastExpression x);
- protected abstract void GenerateClasses (CodeNamespace x);
- protected abstract void GenerateCommentStatement (CodeCommentStatement x);
- protected abstract void GenerateConstructor (CodeConstructor x, CodeTypeDeclaration c);
- protected abstract void GenerateDelegateCreateExpression (CodeDelegateCreateExpression x);
- protected abstract void GenerateDelegateInvokeExpression (CodeDelegateInvokeExpression x);
- protected abstract void GenerateEvent (CodeMemberEvent x, CodeTypeDeclaration c);
- protected abstract void GenerateExpression (CodeExpression x);
- protected abstract void GenerateField (CodeMemberField x);
- protected abstract void GenerateFieldReferenceExpression (CodeFieldReferenceExpression x);
- protected abstract void GenerateIndexerExpression (CodeIndexerExpression x);
- protected abstract void GenerateLinePragmaStart (CodeLinePragma x);
- protected abstract void GenerateLinePragmaEnd (CodeLinePragma x);
- protected abstract void GenerateMethod (CodeMemberMethod m, CodeTypeDeclaration c);
- protected abstract void GenerateMethodInvokeExpression (CodeMethodInvokeExpression x);
- protected abstract void GenerateMethodReturnStatement (CodeMethodReturnStatement x);
- protected abstract void GenerateNamespace (CodeNamespace x);
- protected abstract void GenerateNamespaceStart (CodeNamespace x);
- protected abstract void GenerateNamespaceEnd (CodeNamespace x);
- protected abstract void GenerateNamespaceImport (CodeNamespaceImport i);
- protected abstract void GenerateNamespaceImports (CodeNamespace i);
- protected abstract void GenerateObjectCreateExpression (CodeObjectCreateExpression x);
- protected abstract void GenerateParameterDeclarationExpression (CodeParameterDeclarationExpression x);
- protected abstract void GeneratePrimitiveExpression (CodePrimitiveExpression x);
- protected abstract void GenerateProperty (CodeMemberProperty e, CodeTypeDeclaration c);
- protected abstract void GeneratePropertyReferenceExpression (CodePropertyReferenceExpression x);
- protected abstract void GenerateStatement (CodeStatement x);
- protected abstract void GenerateStatementCollection (CodeStatementCollection x);
- protected abstract void GenerateThisReferenceExpression (CodeThisReferenceExpression x);
- protected abstract void GenerateThrowExceptionStatement (CodeThrowExceptionStatement x);
- protected abstract void GenerateTryCatchFinallyStatement (CodeTryCatchFinallyStatement x);
- protected abstract void GenerateTypeOfExpression (CodeTypeOfExpression x);
- protected abstract void GenerateTypeReferenceExpression (CodeTypeReferenceExpression x);
- protected abstract void GenerateVariableDeclarationStatement (CodeVariableDeclarationStatement x);
-
- //
- // Other members
- //
- protected abstract string GetNullToken ();
-
- public abstract bool IsValidIdentifier (string value);
-
- [MonoTODO]
- public static bool IsValidLanguateIndependentIdentifier (string value)
- {
- /* FIXME: implement */
- return true;
- }
-
- //
- // Output functions
- //
- protected virtual void OutputAttributeArgument (CodeAttributeArgument arg)
- {
- }
-
- protected virtual void OutputDirection (FieldDirection dir)
- {
- }
-
- protected virtual void OutputExpressionList (CodeExpressionCollection c)
- {
- }
-
- protected virtual void OutputExpressionLIst (CodeExpressionCollection c, bool useNewlines)
- {
- }
-
- protected virtual void OutputFieldScopeModifier (MemberAttributes attrs)
- {
- }
-
- protected virtual void OutputIdentifier (string ident)
- {
- }
-
- protected virtual void OutputMemberAccessModifier (MemberAttributes attrs)
- {
- }
-
- protected virtual void OutputMemberScopeModifier (MemberAttributes attrs)
- {
- }
-
- protected virtual void OutputOperator (CodeBinaryOperatorType op)
- {
- }
-
- protected virtual void OutputParameters (CodeParameterDeclarationExpressionCollection pars)
- {
- }
-
- protected virtual void OutputType (string typeRef)
- {
- }
-
- protected virtual void OutputTypeAttributes (TypeAttributes attrs)
- {
- }
-
- protected virtual void OutputTypeNamePair (string typeRef, string name)
- {
- }
-
-
- protected abstract string QuoteLiteralString (string value);
-
- public virtual void ValidateIdentifier (string value)
- {
- }
-
- //
- // Properties
- //
- protected string currentClassName;
- protected string CurrentClassName {
- get {
- return currentClassName;
- }
- }
-
- protected CodeTypeMember codeClassMember;
- protected CodeTypeMember CurrentMember {
- get {
- return codeClassMember;
- }
- }
-
- protected string CurrentMemberName {
- get {
- return codeClassMember.Name;
- }
- }
-
- int indent;
- protected int Indent {
- get {
- return indent;
- }
-
- set {
- indent = value;
- }
- }
-
- //
- // This concept seems broken, I should not really be using
- // a flag, I should be "probing" what is being generated.
- // at least the Start/End
- // functions should not be abstract, or abstract could
- // have an implementation piece?
- //
- public bool isCurrentClass;
- protected bool IsCurrentClass {
- get {
- return isCurrentClass;
- }
- }
-
- public bool isCurrentDelegate;
- protected bool IsCurrentDelegate {
- get {
- return isCurrentDelegate;
- }
- }
- public bool isCurrentEnum;
- protected bool IsCurrentEnum {
- get {
- return isCurrentEnum;
- }
- }
- public bool isCurrentInterface;
- protected bool IsCurrentInterface {
- get {
- return isCurrentInterface;
- }
- }
-
- public bool isCurrentStruct;
- protected bool IsCurrentStruct {
- get {
- return isCurrentStruct;
- }
- }
-
- protected TextWriter Output {
- get {
- return output;
- }
-
- set {
- output = value;
- }
- }
-
- public abstract void GenerateCodeFromExpression (TextWriter output, CodeExpression expression);
-
- public abstract void GenerateCodeFromNamespace (TextWriter output, CodeExpression expression);
-
- public abstract void GenerateCodeFromStatement (TextWriter output, CodeStatement expression);
-
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/ICodeGenerator.cs b/mcs/class/System/System.CodeDom.Compiler/ICodeGenerator.cs
deleted file mode 100755
index 3cdbb32c7f6..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/ICodeGenerator.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.CodeDom.Compiler ICodeGenerator Interface
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler {
- using System.CodeDom;
- using System.IO;
-
- public interface ICodeGenerator {
-
-
- // <summary>
- // Generates code for @expression on @output
- // </summary>
- void GenerateCodeFromExpression (TextWriter output, CodeExpression expression);
-
- void GenerateCodeFromNamespace (TextWriter output, CodeExpression expression);
-
- void GenerateCodeFromStatement (TextWriter output, CodeStatement expression);
-
- bool IsValidIdentifier (string value);
-
- void ValidateIdentifier (string value);
- }
-}
diff --git a/mcs/class/System/System.CodeDom/ChangeLog b/mcs/class/System/System.CodeDom/ChangeLog
deleted file mode 100644
index 102e74825e3..00000000000
--- a/mcs/class/System/System.CodeDom/ChangeLog
+++ /dev/null
@@ -1,19 +0,0 @@
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * MemberAttributes.cs: Added so rest of classes would compile.
-
- * FieldDirection.cs: Added so rest of classes would compile.
-
- * CodeTypeMember.cs: Added so rest of classes would compile.
-
- * CodeTypeDeclaration.cs: Added so rest of classes would compile.
-
- * CodeObject.cs: Added so rest of classes would compile.
-
- * CodeBinaryOperatorType.cs: Added so rest of classes would compile.
-
-2001-07-12 Sean MacIsaac <macisaac@ximian.com>
-
- * All files implementing IList: Added IsFixedSize property.
-
- * All files: Changed CodeDOM to CodeDom.
diff --git a/mcs/class/System/System.CodeDom/Code-X-Collection.cs b/mcs/class/System/System.CodeDom/Code-X-Collection.cs
deleted file mode 100755
index 8e4731656b4..00000000000
--- a/mcs/class/System/System.CodeDom/Code-X-Collection.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// System.CodeDOM Code@CONTAINEE@Collection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDOM {
-
- using System.Collections;
-
- public class Code@CONTAINEE@Collection : IList, ICollection, IEnumerable {
-
- ArrayList @arrayname@;
-
- //
- // Constructors
- //
- public Code@CONTAINEE@Collection ()
- {
- @arrayname@ = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return @arrayname@.Count;
- }
- }
-
- //
- // Methods
- //
- public void Add (Code@CONTAINEE@ value)
- {
- @arrayname@.Add (value);
- }
-
- public void AddRange (Code@CONTAINEE@ [] values)
- {
- foreach (Code@CONTAINEE@ ca in values)
- @arrayname@.Add (ca);
-
- }
-
- public void Clear ()
- {
- @arrayname@.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private Code@CONTAINEE@Collection collection;
- private int currentIndex = -1;
-
- internal Enumerator (Code@CONTAINEE@Collection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new Code@CONTAINEE@Collection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return @arrayname@.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return @arrayname@.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return @arrayname@.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- @arrayname@ [index] = value;
- }
-
- public object this[int index] {
- get {
- return @arrayname@ [index];
- }
-
- set {
- @arrayname@ [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- @arrayname@.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- @arrayname@.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- @arrayname@.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return @arrayname@.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return @arrayname@.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs
deleted file mode 100755
index 17a4a455db3..00000000000
--- a/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// System.CodeDom CodeArrayCreateExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-namespace System.CodeDom {
-
- public class CodeArrayCreateExpression : CodeExpression {
- string createType;
- CodeExpressionCollection initializers;
- CodeExpression sizeExpression;
- int size;
-
- //
- // Constructors
- //
- public CodeArrayCreateExpression ()
- {
-
- }
-
- public CodeArrayCreateExpression (string createType, CodeExpression size)
- {
- this.createType = createType;
- this.sizeExpression = size;
- }
-
- public CodeArrayCreateExpression (string createType, int size)
- {
- this.createType = createType;
- this.size = size;
- }
-
- public CodeArrayCreateExpression (string createType, CodeExpression [] initializers)
- {
- this.createType = createType;
- this.initializers = new CodeExpressionCollection ();
-
- this.initializers.AddRange (initializers);
- }
-
- //
- // Properties
- //
- public CodeExpression SizeExpression {
- get {
- return sizeExpression;
- }
-
- set {
- sizeExpression = value;
- }
- }
-
- public int Size {
- get {
- return size;
- }
-
- set {
- size = value;
- }
- }
-
- public CodeExpressionCollection Initializers {
- get {
- return initializers;
- }
-
- set {
- initializers = value;
- }
- }
-
- public string CreateType {
- get {
- return createType;
- }
-
- set {
- createType = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeAssignStatement.cs b/mcs/class/System/System.CodeDom/CodeAssignStatement.cs
deleted file mode 100755
index 0e1bb9750ad..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAssignStatement.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.CodeDom CodeArrayCreateExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeAssignStatement : CodeStatement {
-
- CodeExpression left, right;
-
- //
- // Constructors
- //
- public CodeAssignStatement ()
- {
- }
-
- public CodeAssignStatement (CodeExpression left, CodeExpression right)
- {
- this.left = left;
- this.right = right;
- }
-
- //
- // Properties
- //
- public CodeExpression Left {
- get {
- return left;
- }
-
- set {
- left = value;
- }
- }
-
- public CodeExpression Right {
- get {
- return right;
- }
-
- set {
- right = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs b/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs
deleted file mode 100755
index d85a61d8ea9..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.CodeDom CodeAttachEventStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-namespace System.CodeDom {
-
- public class CodeAttachEventStatement : CodeStatement {
- CodeExpression targetObject;
- string eventName;
- CodeExpression newListener;
-
- public CodeAttachEventStatement ()
- {
- }
-
- public CodeAttachEventStatement (CodeExpression targetObject,
- string eventName,
- CodeExpression newListener)
- {
- this.targetObject = targetObject;
- this.eventName = eventName;
- this.newListener = newListener;
- }
-
- //
- // Properties
- //
- public string EventName {
- get {
- return eventName;
- }
-
- set {
- eventName = value;
- }
- }
-
- public CodeExpression NewListener {
- get {
- return newListener;
- }
-
- set {
- newListener = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
-
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs b/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs
deleted file mode 100755
index 50fa7efcd6e..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.CodeDom CodeAttributeArgument Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeAttributeArgument {
- string name;
- CodeExpression val;
-
- //
- // Constructors
- //
- public CodeAttributeArgument ()
- {
- }
-
- public CodeAttributeArgument (CodeExpression value)
- {
- }
-
- public CodeAttributeArgument (string name, CodeExpression val)
- {
- this.name = name;
- this.val = val;
- }
-
- //
- // Properties
- //
-
- public string Name {
- get {
- return name;
- }
-
- set {
- name = value;
- }
- }
-
- public CodeExpression Value {
- get {
- return val;
- }
-
- set {
- val = value;
- }
- }
-
-
- }
-
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs b/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs
deleted file mode 100755
index d318732320a..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// System.CodeDom CodeAttributeArgumentCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- using System.Collections;
-
- public class CodeAttributeArgumentCollection : IList, ICollection, IEnumerable {
-
- ArrayList attributeArgs;
-
- //
- // Constructors
- //
- public CodeAttributeArgumentCollection ()
- {
- attributeArgs = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return attributeArgs.Count;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
- //
- // Methods
- //
-
- public void Add (CodeAttributeArgument value)
- {
- attributeArgs.Add (value);
- }
-
- public void AddRange (CodeAttributeArgument [] values)
- {
- foreach (CodeAttributeArgument ca in values)
- attributeArgs.Add (ca);
-
- }
-
- public void Clear ()
- {
- attributeArgs.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private CodeAttributeArgumentCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (CodeAttributeArgumentCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new CodeAttributeArgumentCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return attributeArgs.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return attributeArgs.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return attributeArgs.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- attributeArgs [index] = value;
- }
-
- public object this[int index] {
- get {
- return attributeArgs [index];
- }
-
- set {
- attributeArgs [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- attributeArgs.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- attributeArgs.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- attributeArgs.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return attributeArgs.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return attributeArgs.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeBlock.cs b/mcs/class/System/System.CodeDom/CodeAttributeBlock.cs
deleted file mode 100755
index 16ed71265ba..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttributeBlock.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.CodeDom CodeAttributeBlock Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeAttributeBlock {
-
- CodeAttributeDeclarationCollection attributes;
-
- //
- // Constructors
- //
- public CodeAttributeBlock ()
- {
- }
-
- public CodeAttributeBlock (CodeAttributeDeclaration [] attributes)
- {
- this.attributes = new CodeAttributeDeclarationCollection ();
- this.attributes.AddRange (attributes);
- }
-
- //
- // Prpoperties
- //
- public CodeAttributeDeclarationCollection Attributes {
- get {
- return attributes;
- }
-
- set {
- attributes = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs
deleted file mode 100755
index 8c9105ce236..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.CodeDom CodeAttributeDeclaration Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeAttributeDeclaration {
-
- string name;
- CodeAttributeArgumentCollection arguments;
-
- //
- // Constructors
- //
- public CodeAttributeDeclaration ()
- {
- }
-
- public CodeAttributeDeclaration (string name)
- {
- this.name = name;
- }
-
- public CodeAttributeDeclaration (string name, CodeAttributeArgument [] arguments)
- {
- this.name = name;
- this.arguments = new CodeAttributeArgumentCollection ();
- this.arguments.AddRange (arguments);
- }
-
- //
- // Properties
- //
- public CodeAttributeArgumentCollection Arguments {
- get {
- return arguments;
- }
-
- set {
- arguments = value;
- }
- }
-
- public string Name {
- get {
- return name;
- }
-
- set {
- name = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs b/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs
deleted file mode 100755
index 48aa3b48965..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeAttributeDeclarationCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- using System.Collections;
-
- public class CodeAttributeDeclarationCollection : IList, ICollection, IEnumerable {
-
- ArrayList attributeDecls;
-
- //
- // Constructors
- //
- public CodeAttributeDeclarationCollection ()
- {
- attributeDecls = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return attributeDecls.Count;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
- //
- // Methods
- //
- public void Add (CodeAttributeDeclaration value)
- {
- attributeDecls.Add (value);
- }
-
- public void AddRange (CodeAttributeDeclaration [] values)
- {
- foreach (CodeAttributeDeclaration ca in values)
- attributeDecls.Add (ca);
-
- }
-
- public void Clear ()
- {
- attributeDecls.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private CodeAttributeDeclarationCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (CodeAttributeDeclarationCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new CodeAttributeDeclarationCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return attributeDecls.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return attributeDecls.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return attributeDecls.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- attributeDecls [index] = value;
- }
-
- public object this[int index] {
- get {
- return attributeDecls [index];
- }
-
- set {
- attributeDecls [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- attributeDecls.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- attributeDecls.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- attributeDecls.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return attributeDecls.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return attributeDecls.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs
deleted file mode 100755
index dee01e013af..00000000000
--- a/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.CodeDom CodeBaseReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeBaseReferenceExpression : CodeExpression {
- public CodeBaseReferenceExpression () {}
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs b/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs
deleted file mode 100755
index 775b29bf90f..00000000000
--- a/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.CodeDom CodeBinaryOperatorExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeBinaryOperatorExpression : CodeExpression {
-
- CodeExpression left, right;
- CodeBinaryOperatorType oper;
-
- public enum CodeBinaryOperatorType {
- Add,
- Substract,
- Multiply,
- Divide,
- Modulus,
- Assign,
- IdentityInequality,
- IdentityEquality,
- ValueEquality,
- BitwiseOr,
- BitwiseAnd,
- BooleanOr,
- BooleanAnd,
- LessThan,
- LessThanOrEqual,
- GreatherThan,
- GreatherThanOrEqual,
- }
-
- //
- // Constructors
- //
- public CodeBinaryOperatorExpression ()
- {
- }
-
-
- public CodeBinaryOperatorExpression (CodeExpression left,
- CodeBinaryOperatorType oper,
- CodeExpression right)
- {
- this.left = left;
- this.oper = oper;
- this.right = right;
- }
-
- //
- // Properties
- //
- public CodeExpression Left {
- get {
- return left;
- }
-
- set {
- left = value;
- }
- }
-
- public CodeExpression Right {
- get {
- return right;
- }
-
- set {
- right = value;
- }
- }
-
- public CodeBinaryOperatorType Operator {
- get {
- return oper;
- }
-
- set {
- oper = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs b/mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs
deleted file mode 100755
index eb2d31a02d4..00000000000
--- a/mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.CodeDom CodeBinaryOperatorType Enum implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
- public enum CodeBinaryOperatorType {
- Add,
- Assign,
- BitwiseAnd,
- BitwiseOr,
- BooleanAnd,
- BooleanOr,
- Divide,
- GreaterThan,
- GreaterThanOrEqual,
- IdentityEquality,
- IdentityInequality,
- LessThan,
- LessThanOrEqual,
- Modulus,
- Multiply,
- Subtract,
- ValueEquality
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCastExpression.cs b/mcs/class/System/System.CodeDom/CodeCastExpression.cs
deleted file mode 100755
index 3c3bef51042..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCastExpression.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.CodeDom CodeCastExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeCastExpression : CodeExpression {
- string targetType;
- CodeExpression expression;
-
- //
- // Constructors
- //
- public CodeCastExpression ()
- {
- }
-
- public CodeCastExpression (string targetType, CodeExpression expression)
- {
- this.targetType = targetType;
- this.expression = expression;
- }
-
- //
- // Properties
- //
- public CodeExpression Expression {
- get {
- return expression;
- }
-
- set {
- expression = value;
- }
- }
-
- public string TargetType {
- get {
- return targetType;
- }
-
- set {
- targetType = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCatchClause.cs b/mcs/class/System/System.CodeDom/CodeCatchClause.cs
deleted file mode 100755
index 4af7a18f4a2..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCatchClause.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.CodeDom CodeCatchClaus Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeCatchClause {
-
- CodeParameterDeclarationExpression condition;
- CodeStatementCollection statements;
-
- public CodeCatchClause ()
- {
- this.statements = new CodeStatementCollection ();
- }
-
- public CodeCatchClause (CodeParameterDeclarationExpression condition,
- CodeStatement [] statements)
- {
- this.condition = condition;
- this.statements = new CodeStatementCollection ();
- this.statements.AddRange (statements);
- }
-
- public CodeStatementCollection Statements {
- get {
- return statements;
- }
- }
-
- public CodeParameterDeclarationExpression Condition {
- get {
- return condition;
- }
-
- set {
- condition = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs b/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs
deleted file mode 100755
index 7b4a284bac5..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeCatchClauseCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- using System.Collections;
-
- public class CodeCatchClauseCollection : IList, ICollection, IEnumerable {
-
- ArrayList catchClauses;
-
- //
- // Constructors
- //
- public CodeCatchClauseCollection ()
- {
- catchClauses = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return catchClauses.Count;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
- //
- // Methods
- //
- public void Add (CodeCatchClause value)
- {
- catchClauses.Add (value);
- }
-
- public void AddRange (CodeCatchClause [] values)
- {
- foreach (CodeCatchClause ca in values)
- catchClauses.Add (ca);
-
- }
-
- public void Clear ()
- {
- catchClauses.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private CodeCatchClauseCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (CodeCatchClauseCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new CodeCatchClauseCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return catchClauses.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return catchClauses.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return catchClauses.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- catchClauses [index] = value;
- }
-
- public object this[int index] {
- get {
- return catchClauses [index];
- }
-
- set {
- catchClauses [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- catchClauses.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- catchClauses.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- catchClauses.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return catchClauses.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return catchClauses.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClass.cs b/mcs/class/System/System.CodeDom/CodeClass.cs
deleted file mode 100755
index 146cfb474ea..00000000000
--- a/mcs/class/System/System.CodeDom/CodeClass.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.CodeDom CodeClass Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Collections.Specialized;
-
-namespace System.CodeDom {
- using System.Reflection;
- using System.Collections;
-
- public class CodeClass : CodeClassMember {
- CodeClassMemberCollection members;
- TypeAttributes attrs;
- StringCollection baseTypes;
- bool isClass, isEnum, isInterface, isStruct;
-
- string name;
-
- //
- // Constructors
- //
- public CodeClass ()
- {
- }
-
- public CodeClass (string name)
- {
- this.name = name;
- }
-
- //
- // Properties
- //
- public TypeAttributes attributes {
- get {
- return attrs;
- }
-
- set {
- attrs = value;
- }
- }
-
- public StringCollection BaseTypes {
- get {
- return baseTypes;
- }
-
- set {
- baseTypes = value;
- }
- }
-
- public bool IsClass {
- get {
- return isClass;
- }
-
- set {
- isClass = value;
- }
- }
- public bool IsEnum {
- get {
- return isEnum;
- }
-
- set {
- isEnum = value;
- }
- }
-
- public bool IsInterface {
- get {
- return isInterface;
- }
-
- set {
- isInterface = value;
- }
- }
- public bool IsStruct {
- get {
- return isStruct;
- }
-
- set {
- isStruct = value;
- }
- }
-
- public CodeClassMemberCollection Members {
- get {
- return members;
- }
-
- set {
- members = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassCollection.cs b/mcs/class/System/System.CodeDom/CodeClassCollection.cs
deleted file mode 100755
index d38055a32b8..00000000000
--- a/mcs/class/System/System.CodeDom/CodeClassCollection.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeClassCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- using System.Collections;
-
- public class CodeClassCollection : IList, ICollection, IEnumerable {
-
- ArrayList classes;
-
- //
- // Constructors
- //
- public CodeClassCollection ()
- {
- classes = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return classes.Count;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
- //
- // Methods
- //
- public void Add (CodeClass value)
- {
- classes.Add (value);
- }
-
- public void AddRange (CodeClass [] values)
- {
- foreach (CodeClass ca in values)
- classes.Add (ca);
-
- }
-
- public void Clear ()
- {
- classes.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private CodeClassCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (CodeClassCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new CodeClassCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return classes.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return classes.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return classes.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- classes [index] = value;
- }
-
- public object this[int index] {
- get {
- return classes [index];
- }
-
- set {
- classes [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- classes.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- classes.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- classes.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return classes.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return classes.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassConstructor.cs b/mcs/class/System/System.CodeDom/CodeClassConstructor.cs
deleted file mode 100755
index a778cf5d82d..00000000000
--- a/mcs/class/System/System.CodeDom/CodeClassConstructor.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.CodeDom CodeClassConstructor Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
- public class CodeClassConstructor : CodeMemberMethod {
-
- public CodeClassConstructor ()
- {
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassDelegate.cs b/mcs/class/System/System.CodeDom/CodeClassDelegate.cs
deleted file mode 100755
index cf4be20b3fe..00000000000
--- a/mcs/class/System/System.CodeDom/CodeClassDelegate.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.CodeDom CodeClassDelegate Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeClassDelegate : CodeClass {
- CodeParameterDeclarationExpressionCollection parameters;
- string returnType;
- string name;
-
- //
- // Constructors
- //
- public CodeClassDelegate ()
- {
- }
-
- public CodeClassDelegate (string name)
- {
- this.name = name;
- }
-
- //
- // Properties
- //
- public CodeParameterDeclarationExpressionCollection Parameters {
- get {
- return parameters;
- }
-
- set {
- parameters = value;
- }
- }
-
- public string ReturnType {
- get {
- return returnType;
- }
-
- set {
- returnType = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassMember.cs b/mcs/class/System/System.CodeDom/CodeClassMember.cs
deleted file mode 100755
index 51d8b0476a7..00000000000
--- a/mcs/class/System/System.CodeDom/CodeClassMember.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.CodeDom CodeClassMember Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeClassMember : CodeStatement {
- MemberAttributes attributes;
- CodeAttributeBlock customAttributes;
-
- string name;
-
- //
- // Yeah, this is a strange way of defining this
- //
- public enum MemberAttributes {
- Abstract = 0x0001,
- Final = 0x0002,
- Override = 0x0004,
- Const = 0x0005,
- Assembly = 0x1000,
- AccessMask = 0xf000,
- FamANDAssem = 0x2000,
- Family = 0x3000,
- FamORAssem = 0x4000,
- New = 0x0010,
- Private = 0x5000,
- Public = 0x6000,
- ScopeMask = 0x000f,
- Static = 0x0003,
- VTableMask = 0x00f0
- }
-
- //
- // Constructors
- //
- public CodeClassMember ()
- {
- }
-
- //
- // Properties
- //
-
- public MemberAttributes Attributes {
- get {
- return attributes;
- }
-
- set {
- attributes = value;
- }
- }
-
- public CodeAttributeBlock CustomAttributes {
- get {
- return customAttributes;
- }
-
- set {
- customAttributes = value;
- }
- }
-
- public string Name {
- get {
- return name;
- }
-
- set {
- name = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeClassMemberCollection.cs b/mcs/class/System/System.CodeDom/CodeClassMemberCollection.cs
deleted file mode 100755
index f081ad3a45b..00000000000
--- a/mcs/class/System/System.CodeDom/CodeClassMemberCollection.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeClassMemberCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- using System.Collections;
-
- public class CodeClassMemberCollection : IList, ICollection, IEnumerable {
-
- ArrayList classMembers;
-
- //
- // Constructors
- //
- public CodeClassMemberCollection ()
- {
- classMembers = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return classMembers.Count;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
- //
- // Methods
- //
- public void Add (CodeClassMember value)
- {
- classMembers.Add (value);
- }
-
- public void AddRange (CodeClassMember [] values)
- {
- foreach (CodeClassMember ca in values)
- classMembers.Add (ca);
-
- }
-
- public void Clear ()
- {
- classMembers.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private CodeClassMemberCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (CodeClassMemberCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new CodeClassMemberCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return classMembers.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return classMembers.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return classMembers.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- classMembers [index] = value;
- }
-
- public object this[int index] {
- get {
- return classMembers [index];
- }
-
- set {
- classMembers [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- classMembers.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- classMembers.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- classMembers.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return classMembers.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return classMembers.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCommentStatement.cs b/mcs/class/System/System.CodeDom/CodeCommentStatement.cs
deleted file mode 100755
index 9dba6528a70..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCommentStatement.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.CodeDom CodeCommentStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeCommentStatement : CodeStatement {
- string text;
-
- //
- // Constructors
- //
- public CodeCommentStatement ()
- {
- }
-
- public CodeCommentStatement (string text)
- {
- this.text = text;
- }
-
- string Text {
- get {
- return text;
- }
-
- set {
- text = value;
- }
- }
- }
-}
-
-
diff --git a/mcs/class/System/System.CodeDom/CodeConstructor.cs b/mcs/class/System/System.CodeDom/CodeConstructor.cs
deleted file mode 100755
index 0d6a707ac15..00000000000
--- a/mcs/class/System/System.CodeDom/CodeConstructor.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.CodeDom CodeConstructor Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeConstructor : CodeMemberMethod {
- CodeExpressionCollection baseConstructorArgs;
- CodeExpressionCollection chainedConstructorArgs;
-
- //
- // Constructors
- //
- public CodeConstructor ()
- {
- }
-
- public CodeExpressionCollection BaseConstructorArgs {
- get {
- return baseConstructorArgs;
- }
-
- set {
- baseConstructorArgs = value;
- }
- }
-
- public CodeExpressionCollection ChainedConstructorArgs {
- get {
- return chainedConstructorArgs;
- }
-
- set {
- chainedConstructorArgs = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs
deleted file mode 100755
index 1be84cc27ad..00000000000
--- a/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.CodeDom CodeDelegateCreateExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeDelegateCreateExpression : CodeExpression {
- string delegateType, methodName;
- CodeExpression targetObject;
-
- //
- // Constructors
- //
- public CodeDelegateCreateExpression (string delegateType,
- CodeExpression targetObject,
- string methodName)
- {
- this.delegateType = delegateType;
- this.targetObject = targetObject;
- this.methodName = methodName;
- }
-
- public CodeDelegateCreateExpression ()
- {
- }
-
- //
- // Properties
- //
-
- string DelegateType {
- get {
- return delegateType;
- }
-
- set {
- delegateType = value;
- }
- }
-
- string MethodName {
- get {
- return methodName;
- }
-
- set {
- methodName = value;
- }
- }
-
- CodeExpression TargetObject {
- get {
- return targetObject;
- }
-
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs b/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs
deleted file mode 100755
index 9b918c4cd0b..00000000000
--- a/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.CodeDom CodeDelegateInvokeExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeDelegateInvokeExpression : CodeExpression {
- CodeExpressionCollection parameters;
- CodeExpression targetObject;
-
- //
- // Constructors
- //
- public CodeDelegateInvokeExpression ()
- {
- }
-
- public CodeDelegateInvokeExpression (CodeExpression targetObject,
- CodeExpression [] parameters)
- {
- this.targetObject = targetObject;
- this.parameters = new CodeExpressionCollection ();
- this.parameters.AddRange (parameters);
- }
-
- public CodeDelegateInvokeExpression (CodeExpression targetObject)
- {
- this.targetObject = targetObject;
- }
-
- //
- // Properties
- //
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
-
- set {
- targetObject = value;
- }
- }
-
- public CodeExpressionCollection Parameters {
- get {
- return parameters;
- }
-
- set {
- parameters = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs b/mcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs
deleted file mode 100755
index 299e107a8ed..00000000000
--- a/mcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.CodeDom CodeDelegateInvokeStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeDelegateInvokeStatement : CodeStatement {
- CodeStatementCollection parameters;
- CodeStatement targetObject;
- CodeDelegateInvokeExpression delegateInvoke;
-
- //
- // Constructors
- //
- public CodeDelegateInvokeStatement ()
- {
- }
-
- public CodeDelegateInvokeStatement (CodeStatement targetObject)
- {
- this.targetObject = targetObject;
- }
-
- public CodeDelegateInvokeStatement (CodeDelegateInvokeExpression delegateInvoke)
- {
- this.delegateInvoke = delegateInvoke;
- }
-
- public CodeDelegateInvokeStatement (CodeStatement targetObject,
- CodeStatement [] parameters)
- {
- this.targetObject = targetObject;
- this.parameters = new CodeStatementCollection ();
- this.parameters.AddRange (parameters);
- }
-
- //
- // Properties
- //
- public CodeDelegateInvokeExpression DelegateInvoke {
- get {
- return delegateInvoke;
- }
-
- set {
- delegateInvoke = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDetachEventStatement.cs b/mcs/class/System/System.CodeDom/CodeDetachEventStatement.cs
deleted file mode 100755
index 5998b73cf2d..00000000000
--- a/mcs/class/System/System.CodeDom/CodeDetachEventStatement.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.CodeDom CodeDetachEventStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeDetachEventStatement : CodeStatement {
- string eventName;
- CodeExpression targetObject, newListener;
-
- //
- // Constructors
- //
- public CodeDetachEventStatement ()
- {
- }
-
- public CodeDetachEventStatement (CodeExpression targetObject,
- string eventName,
- CodeExpression newListener)
- {
- this.targetObject = targetObject;
- this.eventName = eventName;
- this.newListener = newListener;
- }
-
- public string EventName {
- get {
- return eventName;
- }
-
- set {
- eventName = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
-
- set {
- targetObject = value;
- }
- }
-
- public CodeExpression NewListener {
- get {
- return newListener;
- }
-
- set {
- newListener = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeExpression.cs b/mcs/class/System/System.CodeDom/CodeExpression.cs
deleted file mode 100755
index f140c9d0d5e..00000000000
--- a/mcs/class/System/System.CodeDom/CodeExpression.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.CodeDom CodeExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeExpression {
- object userData;
-
- //
- // Constructors
- //
- public CodeExpression ()
- {
- }
-
- //
- // Properties
- //
- public object UserData {
- get {
- return userData;
- }
-
- set {
- userData = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs b/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs
deleted file mode 100755
index 10622c3b0e4..00000000000
--- a/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeExpressionCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- using System.Collections;
-
- public class CodeExpressionCollection : IList, ICollection, IEnumerable {
-
- ArrayList expressions;
-
- //
- // Constructors
- //
- public CodeExpressionCollection ()
- {
- expressions = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return expressions.Count;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
- //
- // Methods
- //
- public void Add (CodeExpression value)
- {
- expressions.Add (value);
- }
-
- public void AddRange (CodeExpression [] values)
- {
- foreach (CodeExpression ca in values)
- expressions.Add (ca);
-
- }
-
- public void Clear ()
- {
- expressions.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private CodeExpressionCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (CodeExpressionCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new CodeExpressionCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return expressions.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return expressions.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return expressions.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- expressions [index] = value;
- }
-
- public object this[int index] {
- get {
- return expressions [index];
- }
-
- set {
- expressions [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- expressions.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- expressions.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- expressions.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return expressions.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return expressions.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs
deleted file mode 100755
index 66581e84f22..00000000000
--- a/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// System.CodeDom CodeFieldReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeFieldReferenceExpression : CodeExpression {
- CodeExpression targetObject;
- string fieldName;
- FieldDirection direction;
-
- public enum FieldDirection {
- In,
- Out,
- Ref
- }
-
- //
- // Constructors
- //
- public CodeFieldReferenceExpression ()
- {
- }
-
- public CodeFieldReferenceExpression (CodeExpression targetObject,
- string fieldName)
- {
- this.targetObject = targetObject;
- this.fieldName = fieldName;
- }
-
- //
- // Properties
- //
- public FieldDirection Direction {
- get {
- return direction;
- }
-
- set {
- direction = value;
- }
- }
-
- public string FieldName {
- get {
- return fieldName;
- }
-
- set {
- fieldName = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
-
- set {
- targetObject = value;
- }
- }
-
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeForLoopStatement.cs b/mcs/class/System/System.CodeDom/CodeForLoopStatement.cs
deleted file mode 100755
index c0b0a46ea53..00000000000
--- a/mcs/class/System/System.CodeDom/CodeForLoopStatement.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.CodeDom CodeForLoopStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeForLoopStatement : CodeExpression {
- CodeStatement initStatement, incrementStatement;
- CodeExpression testExpression;
- CodeStatementCollection statements;
-
- //
- // Constructors
- //
- public CodeForLoopStatement ()
- {
- statements = new CodeStatementCollection ();
- }
-
- public CodeForLoopStatement (CodeStatement initStatement,
- CodeExpression testExpression,
- CodeStatement incrementStatement,
- CodeStatement [] statements)
- {
- this.initStatement = initStatement;
- this.testExpression = testExpression;
- this.incrementStatement = incrementStatement;
- this.statements = new CodeStatementCollection ();
- this.statements.AddRange (statements);
- }
-
- //
- // Properties
- //
-
- public CodeStatement InitStatement {
- get {
- return initStatement;
- }
-
- set {
- initStatement = value;
- }
- }
-
- public CodeStatement IncrementStatement {
- get {
- return incrementStatement;
- }
-
- set {
- incrementStatement = value;
- }
- }
-
- public CodeStatementCollection Statements {
- get {
- return statements;
- }
- }
-
- public CodeExpression TestExpression {
- get {
- return testExpression;
- }
-
- set {
- testExpression = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeIfStatement.cs b/mcs/class/System/System.CodeDom/CodeIfStatement.cs
deleted file mode 100755
index 4ca158416b6..00000000000
--- a/mcs/class/System/System.CodeDom/CodeIfStatement.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.CodeDom CodeIfStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeIfStatement : CodeStatement {
-
- CodeExpression condition;
- CodeStatementCollection trueStatements;
- CodeStatementCollection falseStatements;
-
- //
- // Constructors
- //
- public CodeIfStatement ()
- {
- trueStatements = new CodeStatementCollection ();
- falseStatements = new CodeStatementCollection ();
- }
-
- public CodeIfStatement (CodeExpression condition, CodeStatement [] trueStatements)
- {
- this.condition = condition;
- this.trueStatements = new CodeStatementCollection ();
- this.trueStatements.AddRange (trueStatements);
- this.falseStatements = new CodeStatementCollection ();
- }
-
- public CodeIfStatement (CodeExpression condition,
- CodeStatement [] trueStatements,
- CodeStatement [] falseStatements)
- {
- this.condition = condition;
-
- this.trueStatements = new CodeStatementCollection ();
- this.trueStatements.AddRange (trueStatements);
-
- this.falseStatements = new CodeStatementCollection ();
- this.falseStatements.AddRange (falseStatements);
- }
-
- //
- // Properties
- //
- public CodeExpression Condition {
- get {
- return condition;
- }
-
- set {
- condition = value;
- }
- }
-
- public CodeStatementCollection FalseStatements {
- get {
- return falseStatements;
- }
- }
-
- public CodeStatementCollection TrueStatements {
- get {
- return trueStatements;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs b/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs
deleted file mode 100755
index 8dbc95b44a2..00000000000
--- a/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.CodeDom CodeFieldReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeIndexerExpression : CodeExpression {
- CodeExpression targetObject;
- CodeExpression index;
-
- //
- // Constructors
- //
- public CodeIndexerExpression ()
- {
- }
-
- public CodeIndexerExpression (CodeExpression targetObject, CodeExpression index)
- {
- this.index = index;
- this.targetObject = targetObject;
- }
-
- //
- // Properties
- //
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeLinePragma.cs b/mcs/class/System/System.CodeDom/CodeLinePragma.cs
deleted file mode 100755
index d83a9f6c8c5..00000000000
--- a/mcs/class/System/System.CodeDom/CodeLinePragma.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.CodeDom CodeLinePragma Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-using System;
-
-namespace System.CodeDom {
-
- // <summary>
- // Use objects of this class to keep track of locations where
- // statements are defined
- // </summary>
- public class CodeLinePragma {
- string fileName;
- int lineNumber;
-
- public CodeLinePragma (string fileName, int lineNumber)
- {
- this.fileName = fileName;
- this.lineNumber = lineNumber;
- }
-
- //
- // Properties
- //
- public string FileName {
- get {
- return fileName;
- }
-
- set {
- fileName = value;
- }
- }
-
- public int LineNumber {
- get {
- return lineNumber;
- }
-
- set {
- lineNumber = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeLiteralClassMember.cs b/mcs/class/System/System.CodeDom/CodeLiteralClassMember.cs
deleted file mode 100755
index 0733b786a7f..00000000000
--- a/mcs/class/System/System.CodeDom/CodeLiteralClassMember.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.CodeDom CodeLiteralClassMember Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeLiteralClassMember : CodeClassMember {
- string text;
-
- //
- // Constructors
- //
- public CodeLiteralClassMember ()
- {
- }
-
- public CodeLiteralClassMember (string text)
- {
- this.text = text;
- }
-
- //
- // Properties
- //
- string Text {
- get {
- return text;
- }
-
- set {
- text = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeLiteralExpression.cs b/mcs/class/System/System.CodeDom/CodeLiteralExpression.cs
deleted file mode 100755
index 36ca6908b2c..00000000000
--- a/mcs/class/System/System.CodeDom/CodeLiteralExpression.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.CodeDom CodeLiteralExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeLiteralExpression : CodeExpression {
- string val;
-
- //
- // Constructors
- //
- public CodeLiteralExpression ()
- {
- }
-
- public CodeLiteralExpression (string value)
- {
- val = value;
- }
-
- //
- // Properties
- //
- string Value {
- get {
- return val;
- }
-
- set {
- val = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeLiteralNamespace.cs b/mcs/class/System/System.CodeDom/CodeLiteralNamespace.cs
deleted file mode 100755
index 7cbf4c46b9e..00000000000
--- a/mcs/class/System/System.CodeDom/CodeLiteralNamespace.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.CodeDom CodeLiteralNamespace Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeLiteralNamespace : CodeNamespace {
- CodeLinePragma linePragma;
- string value;
-
- //
- // Constructors
- //
- public CodeLiteralNamespace (string value)
- {
- this.value = value;
- }
-
- //
- // Properties
- //
- string Value {
- get {
- return value;
- }
-
- set {
- this.value = value;
- }
- }
-
- CodeLinePragma LinePragma {
- get {
- return linePragma;
- }
-
- set {
- linePragma = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeLiteralStatement.cs b/mcs/class/System/System.CodeDom/CodeLiteralStatement.cs
deleted file mode 100755
index 63e1fec6bbb..00000000000
--- a/mcs/class/System/System.CodeDom/CodeLiteralStatement.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.CodeDom CodeLiteralStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeLiteralStatement : CodeStatement {
- string value;
-
- //
- // Constructors
- //
- public CodeLiteralStatement (string value)
- {
- this.value = value;
- }
-
- //
- // Properties
- //
- string Value {
- get {
- return value;
- }
-
- set {
- this.value = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberEvent.cs b/mcs/class/System/System.CodeDom/CodeMemberEvent.cs
deleted file mode 100755
index 46f1fee42d9..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMemberEvent.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.CodeDom CodeMemberEvent Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeMemberEvent : CodeClassMember {
- string implementsType, type;
- bool privateImplements;
-
- public CodeMemberEvent ()
- {
- }
-
- public string ImplementsType {
- get {
- return implementsType;
- }
-
- set {
- implementsType = value;
- }
- }
-
- public bool PrivateImplements {
- get {
- return privateImplements;
- }
-
- set {
- privateImplements = value;
- }
- }
-
- public string Type {
- get {
- return type;
- }
-
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberField.cs b/mcs/class/System/System.CodeDom/CodeMemberField.cs
deleted file mode 100755
index ac8b1d3ab79..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMemberField.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.CodeDom CodeMemberField Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeMemberField : CodeClassMember {
- CodeExpression initExpression;
- string type, name;
-
- public CodeMemberField ()
- {
- }
-
- public CodeMemberField (string type, string name)
- {
- this.type = type;
- this.name = name;
- }
-
- //
- // Properties
- //
- public CodeExpression InitExpression {
- get {
- return initExpression;
- }
-
- set {
- initExpression = value;
- }
- }
-
- public string Type {
- get {
- return type;
- }
-
- set {
- type = name;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs b/mcs/class/System/System.CodeDom/CodeMemberMethod.cs
deleted file mode 100755
index aa417a2aeee..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.CodeDom CodeMemberMethod Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeMemberMethod : CodeClassMember {
- CodeParameterDeclarationExpressionCollection parameters;
- CodeStatementCollection statements;
- string implementsType;
- string returnType;
- bool privateImplements;
-
- public CodeMemberMethod ()
- {
- }
-
- public string ImplementsType {
- get {
- return implementsType;
- }
-
- set {
- implementsType = value;
- }
- }
-
- public bool PrivateImplements {
- get {
- return privateImplements;
- }
-
- set {
- privateImplements = value;
- }
- }
-
- public string ReturnType {
- get {
- return returnType;
- }
-
- set {
- returnType = value;
- }
- }
-
- public CodeParameterDeclarationExpressionCollection Parameters {
- get {
- return parameters;
- }
-
- set {
- parameters = value;
- }
- }
-
- public CodeStatementCollection Statements {
- get {
- return statements;
- }
-
- set {
- statements = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberProperty.cs b/mcs/class/System/System.CodeDom/CodeMemberProperty.cs
deleted file mode 100755
index 8889de098a0..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMemberProperty.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// System.CodeDom CodeMemberProperty Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeMemberProperty : CodeClassMember {
- CodeParameterDeclarationExpressionCollection parameters;
- CodeStatementCollection getStatements, setStatements;
- bool hasGet, hasSet;
- string implementsType, type;
- bool privateImplements;
-
- public CodeMemberProperty ()
- {
- }
-
- //
- // Properties
- //
-
- public string ImplementsType {
- get {
- return implementsType;
- }
-
- set {
- implementsType = value;
- }
- }
-
- public bool PrivateImplements {
- get {
- return privateImplements;
- }
-
- set {
- privateImplements = value;
- }
- }
-
- public CodeParameterDeclarationExpressionCollection Parameters {
- get {
- return parameters;
- }
-
- set {
- parameters = value;
- }
- }
-
- public CodeStatementCollection SetStatements {
- get {
- return setStatements;
- }
-
- set {
- setStatements = value;
- }
- }
-
- public CodeStatementCollection GetStatements {
- get {
- return getStatements;
- }
-
- set {
- getStatements = value;
- }
- }
-
- public string Type {
- get {
- return type;
- }
-
- set {
- type = value;
- }
- }
-
- public bool HasGet {
- get {
- return hasGet;
- }
-
- set {
- hasGet = value;
- }
- }
-
- public bool HasSet {
- get {
- return hasSet;
- }
-
- set {
- hasSet = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs b/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs
deleted file mode 100755
index cb51ff9b5d4..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.CodeDom CodeMethodInvokeExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeMethodInvokeExpression : CodeExpression {
- string methodName;
- CodeExpression targetObject;
- CodeExpressionCollection parameters;
-
- //
- // Constructors
- //
- public CodeMethodInvokeExpression () {}
-
- public CodeMethodInvokeExpression (CodeExpression targetObject, string methodName)
- {
- this.targetObject = targetObject;
- this.methodName = methodName;
- }
-
- public CodeMethodInvokeExpression (CodeExpression targetObject,
- string methodName,
- CodeExpression [] parameters)
- {
- this.targetObject = targetObject;
- this.methodName = methodName;
- this.parameters = new CodeExpressionCollection ();
- this.parameters.AddRange (parameters);
- }
-
- public string MethodName {
- get {
- return methodName;
- }
-
- set {
- methodName = value;
- }
- }
-
- public CodeExpressionCollection Parameters {
- get {
- return parameters;
- }
-
- set {
- parameters = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
-
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs b/mcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs
deleted file mode 100755
index 519e4164ad5..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.CodeDom CodeMethodInvokeStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeMethodInvokeStatement : CodeStatement {
- string methodName;
- CodeExpression targetObject;
- CodeExpressionCollection parameters;
- CodeMethodInvokeExpression methodInvoke;
-
- //
- // Constructors
- //
- public CodeMethodInvokeStatement () {}
-
- public CodeMethodInvokeStatement (CodeMethodInvokeExpression methodInvoke)
- {
- this.methodInvoke = methodInvoke;
- }
-
- public CodeMethodInvokeStatement (CodeExpression targetObject, string methodName)
- {
- this.targetObject = targetObject;
- this.methodName = methodName;
- }
-
- public CodeMethodInvokeStatement (CodeExpression targetObject,
- string methodName,
- CodeExpression [] parameters)
- {
- this.targetObject = targetObject;
- this.methodName = methodName;
- this.parameters = new CodeExpressionCollection ();
- this.parameters.AddRange (parameters);
- }
-
- public string MethodName {
- get {
- return methodName;
- }
-
- set {
- methodName = value;
- }
- }
-
- public CodeExpressionCollection Parameters {
- get {
- return parameters;
- }
-
- set {
- parameters = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
-
- set {
- targetObject = value;
- }
- }
-
- public CodeMethodInvokeExpression MethodInvoke {
- get {
- return methodInvoke;
- }
-
- set {
- methodInvoke = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs b/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs
deleted file mode 100755
index e54e605fa54..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.CodeDom CodeMethodReturnStatement class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom
-{
- public class CodeMethodReturnStatement : CodeStatement
- {
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespace.cs b/mcs/class/System/System.CodeDom/CodeNamespace.cs
deleted file mode 100755
index 0794653cfd8..00000000000
--- a/mcs/class/System/System.CodeDom/CodeNamespace.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.CodeDom CodeNamespace Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeNamespace {
- CodeClassCollection classes;
- CodeNamespaceImportCollection imports;
- bool allowLateBound, requireVariableDeclaration;
- string name;
- object userData;
-
- public CodeNamespace ()
- {
- }
-
- public CodeNamespace (string name)
- {
- this.name = name;
- }
-
- //
- // Properties
- //
-
- public bool AllowLateBound {
- get {
- return allowLateBound;
- }
-
- set {
- allowLateBound = value;
- }
- }
-
- public CodeClassCollection Classes {
- get {
- return classes;
- }
-
- set {
- classes = value;
- }
- }
-
- public CodeNamespaceImportCollection Imports {
- get {
- return imports;
- }
-
- set {
- imports = value;
- }
- }
-
- public string Name {
- get {
- return name;
- }
-
- set {
- name = value;
- }
- }
-
- public bool RequireVariableDeclaration {
- get {
- return requireVariableDeclaration;
- }
-
- set {
- requireVariableDeclaration = value;
- }
- }
-
- public object UserData {
- get {
- return userData;
- }
-
- set {
- userData = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs b/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs
deleted file mode 100755
index d13767c588e..00000000000
--- a/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.CodeDom CodeNamespaceImport Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeNamespaceImport : CodeStatement {
- string nameSpace;
-
- public CodeNamespaceImport () {}
-
- public CodeNamespaceImport (string nameSpace)
- {
- this.nameSpace = nameSpace;
- }
-
- //
- // Properties
- //
-
- public string Namespace {
- get {
- return nameSpace;
- }
-
- set {
- nameSpace = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs b/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs
deleted file mode 100755
index d65ee247c4d..00000000000
--- a/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeNamespaceImportCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- using System.Collections;
-
- public class CodeNamespaceImportCollection : IList, ICollection, IEnumerable {
-
- ArrayList namespaceImports;
-
- //
- // Constructors
- //
- public CodeNamespaceImportCollection ()
- {
- namespaceImports = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return namespaceImports.Count;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
- //
- // Methods
- //
- public void Add (CodeNamespaceImport value)
- {
- namespaceImports.Add (value);
- }
-
- public void AddRange (CodeNamespaceImport [] values)
- {
- foreach (CodeNamespaceImport ca in values)
- namespaceImports.Add (ca);
-
- }
-
- public void Clear ()
- {
- namespaceImports.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private CodeNamespaceImportCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (CodeNamespaceImportCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new CodeNamespaceImportCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return namespaceImports.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return namespaceImports.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return namespaceImports.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- namespaceImports [index] = value;
- }
-
- public object this[int index] {
- get {
- return namespaceImports [index];
- }
-
- set {
- namespaceImports [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- namespaceImports.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- namespaceImports.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- namespaceImports.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return namespaceImports.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return namespaceImports.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeObject.cs b/mcs/class/System/System.CodeDom/CodeObject.cs
deleted file mode 100755
index b337390eaf4..00000000000
--- a/mcs/class/System/System.CodeDom/CodeObject.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.CodeDom CodeObject class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom
-{
- public class CodeObject
- {
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs
deleted file mode 100755
index 421d2aa29de..00000000000
--- a/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.CodeDom CodeObjectCreateExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeObjectCreateExpression : CodeExpression {
- string createType;
- CodeExpressionCollection parameters;
-
- public CodeObjectCreateExpression () {}
-
- public CodeObjectCreateExpression (string createType)
- {
- this.createType = createType;
- }
-
- public CodeObjectCreateExpression (string createType, CodeExpression [] parameters)
- {
- this.createType = createType;
- this.parameters = new CodeExpressionCollection ();
- this.parameters.AddRange (parameters);
- }
-
- //
- // Properties
- //
- public string CreateType {
- get {
- return createType;
- }
-
- set {
- createType = value;
- }
- }
-
- public CodeExpressionCollection Parameters {
- get {
- return parameters;
- }
-
- set {
- parameters = value;
- }
- }
-
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs
deleted file mode 100755
index 93f4b0ee7b0..00000000000
--- a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.CodeDom CodeParameterDeclarationExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeParameterDeclarationExpression : CodeExpression {
- FieldDirection direction;
- CodeAttributeBlock customAttributes;
- string type, name;
-
- public CodeParameterDeclarationExpression ()
- {
- }
-
- public CodeParameterDeclarationExpression (string type, string name)
- {
- this.type = type;
- this.name = name;
- }
-
- public string Type {
- get {
- return type;
- }
-
- set {
- type = value;
- }
- }
-
- public string Name {
- get {
- return name;
- }
-
- set {
- name = value;
- }
- }
-
- public CodeAttributeBlock CustomAttributes {
- get {
- return customAttributes;
- }
-
- set {
- customAttributes = value;
- }
- }
-
- public FieldDirection Direction {
- get {
- return direction;
- }
-
- set {
- direction = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
deleted file mode 100755
index 970e9ec78e7..00000000000
--- a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeParameterDeclarationExpressionCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- using System.Collections;
-
- public class CodeParameterDeclarationExpressionCollection : IList, ICollection, IEnumerable {
-
- ArrayList parameterDeclExprs;
-
- //
- // Constructors
- //
- public CodeParameterDeclarationExpressionCollection ()
- {
- parameterDeclExprs = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return parameterDeclExprs.Count;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
- //
- // Methods
- //
- public void Add (CodeParameterDeclarationExpression value)
- {
- parameterDeclExprs.Add (value);
- }
-
- public void AddRange (CodeParameterDeclarationExpression [] values)
- {
- foreach (CodeParameterDeclarationExpression ca in values)
- parameterDeclExprs.Add (ca);
-
- }
-
- public void Clear ()
- {
- parameterDeclExprs.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private CodeParameterDeclarationExpressionCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (CodeParameterDeclarationExpressionCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new CodeParameterDeclarationExpressionCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return parameterDeclExprs.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return parameterDeclExprs.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return parameterDeclExprs.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- parameterDeclExprs [index] = value;
- }
-
- public object this[int index] {
- get {
- return parameterDeclExprs [index];
- }
-
- set {
- parameterDeclExprs [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- parameterDeclExprs.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- parameterDeclExprs.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- parameterDeclExprs.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return parameterDeclExprs.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return parameterDeclExprs.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs b/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs
deleted file mode 100755
index 98d64e3ae0a..00000000000
--- a/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.CodeDom CodePrimitiveExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodePrimitiveExpression : CodeExpression {
- object value;
-
- public CodePrimitiveExpression () {}
-
- public CodePrimitiveExpression (Object value)
- {
- this.value = value;
- }
-
- public object Value {
- get {
- return value;
- }
-
- set {
- this.value = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs
deleted file mode 100755
index 13f4471ce0c..00000000000
--- a/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.CodeDom CodePropertyReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodePropertyReferenceExpression : CodeExpression {
- CodeExpressionCollection parameters;
- CodeExpression targetObject;
- string propertyName;
-
- public CodePropertyReferenceExpression () {}
-
- public CodePropertyReferenceExpression (CodeExpression targetObject,
- string propertyName)
- {
- this.targetObject = targetObject;
- this.propertyName = propertyName;
- }
-
- //
- // Properties
- //
- public CodeExpressionCollection Parameter {
- get {
- return parameters;
- }
-
- set {
- parameters = value;
- }
- }
-
- public string PropertyName {
- get {
- return propertyName;
- }
-
- set {
- propertyName = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
-
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeStatement.cs b/mcs/class/System/System.CodeDom/CodeStatement.cs
deleted file mode 100755
index d75c9b4c1a4..00000000000
--- a/mcs/class/System/System.CodeDom/CodeStatement.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.CodeDom CodeStatement class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom
-{
- public class CodeStatement : CodeObject
- {
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeStatementCollection.cs b/mcs/class/System/System.CodeDom/CodeStatementCollection.cs
deleted file mode 100755
index 6a70aeafd2a..00000000000
--- a/mcs/class/System/System.CodeDom/CodeStatementCollection.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.CodeDom CodeStatementCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- using System.Collections;
-
- public class CodeStatementCollection : IList, ICollection, IEnumerable {
-
- ArrayList statements;
-
- //
- // Constructors
- //
- public CodeStatementCollection ()
- {
- statements = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return statements.Count;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
- //
- // Methods
- //
- public void Add (CodeStatement value)
- {
- statements.Add (value);
- }
-
- public void AddRange (CodeStatement [] values)
- {
- foreach (CodeStatement ca in values)
- statements.Add (ca);
-
- }
-
- public void Clear ()
- {
- statements.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private CodeStatementCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (CodeStatementCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new CodeStatementCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return statements.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return statements.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return statements.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- statements [index] = value;
- }
-
- public object this[int index] {
- get {
- return statements [index];
- }
-
- set {
- statements [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- statements.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- statements.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- statements.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return statements.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return statements.IsSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs
deleted file mode 100755
index 4084e04f7b2..00000000000
--- a/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.CodeDom CodeParameterDeclarationExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeThisReferenceExpression : CodeExpression {
- public CodeThisReferenceExpression () { }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs b/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs
deleted file mode 100755
index 4b3071515be..00000000000
--- a/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.CodeDom CodeThrowExceptionStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeThrowExceptionStatement : CodeStatement {
- CodeExpression toThrow;
-
- public CodeThrowExceptionStatement () {}
- public CodeThrowExceptionStatement (CodeExpression toThrow)
- {
- this.toThrow = toThrow;
- }
-
- public CodeExpression ToThrow {
- get {
- return toThrow;
- }
-
- set {
- toThrow = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs b/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs
deleted file mode 100755
index 2ad078a9d4e..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// System.CodeDom CodeTryCatchFinallyStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeTryCatchFinallyStatement : CodeStatement {
- CodeStatementCollection tryStatements, finallyStatements;
- CodeCatchClauseCollection catchClauses;
-
- public CodeTryCatchFinallyStatement () {}
-
- public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
- CodeCatchClause [] catchClauses)
- {
- this.tryStatements = new CodeStatementCollection ();
- this.catchClauses = new CodeCatchClauseCollection ();
-
- this.tryStatements.AddRange (tryStatements);
- this.catchClauses.AddRange (catchClauses);
- }
-
- public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
- CodeCatchClause [] catchClauses,
- CodeStatement [] finallyStatements)
- {
- this.tryStatements = new CodeStatementCollection ();
- this.catchClauses = new CodeCatchClauseCollection ();
- this.finallyStatements = new CodeStatementCollection ();
-
- this.tryStatements.AddRange (tryStatements);
- this.catchClauses.AddRange (catchClauses);
- this.finallyStatements.AddRange (finallyStatements);
- }
-
- public CodeStatementCollection FinallyStatements{
- get {
- return finallyStatements;
- }
-
- set {
- finallyStatements = value;
- }
- }
-
- public CodeStatementCollection TryStatements {
- get {
- return tryStatements;
- }
-
- set {
- tryStatements = value;
- }
- }
- public CodeCatchClauseCollection CatchClauses {
- get {
- return catchClauses;
- }
-
- set {
- catchClauses = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
deleted file mode 100755
index df75140f8b5..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.CodeDom CodeTypeDeclaration Class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom
-{
- public class CodeTypeDeclaration : CodeTypeMember
- {
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeMember.cs b/mcs/class/System/System.CodeDom/CodeTypeMember.cs
deleted file mode 100755
index 0aafef744d7..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeMember.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.CodeDom CodeTypeMember Class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom
-{
- public class CodeTypeMember : CodeObject {
- private string name;
-
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs b/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs
deleted file mode 100755
index 3a496f95923..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.CodeDom CodeTypeOfExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeTypeOfExpression : CodeExpression {
- string type;
-
- public CodeTypeOfExpression () {}
-
- public CodeTypeOfExpression (string type)
- {
- this.type = type;
- }
-
- public string Type {
- get {
- return type;
- }
-
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs
deleted file mode 100755
index 8fcbc04ef77..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.CodeDom CodeTypeReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeTypeReferenceExpression : CodeExpression {
- string type;
-
- public CodeTypeReferenceExpression () {}
-
- public CodeTypeReferenceExpression (string type)
- {
- this.type = type;
- }
-
- public string Type {
- get {
- return type;
- }
-
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs b/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs
deleted file mode 100755
index faff810835f..00000000000
--- a/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.CodeDom CodeVariableDeclarationStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
-
- public class CodeVariableDeclarationStatement : CodeStatement {
- CodeExpression initExpression;
- string type, name;
-
- public CodeVariableDeclarationStatement () {}
-
- public CodeVariableDeclarationStatement (string type, string name)
- {
- this.type = type;
- this.name = name;
- }
-
- public CodeVariableDeclarationStatement (string type, string name,
- CodeExpression initExpression)
- {
- this.type = type;
- this.name = name;
- this.initExpression = initExpression;
- }
-
- public CodeExpression InitExpression {
- get {
- return initExpression;
- }
-
- set {
- initExpression = value;
- }
- }
-
- public string Name {
- get {
- return name;
- }
-
- set {
- name = value;
- }
- }
-
- public string Type {
- get {
- return type;
- }
-
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/FieldDirection.cs b/mcs/class/System/System.CodeDom/FieldDirection.cs
deleted file mode 100755
index 669bf377c4a..00000000000
--- a/mcs/class/System/System.CodeDom/FieldDirection.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.CodeDom FieldDirection Enum implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
- public enum FieldDirection {
- In, Out, Ref
- }
-}
diff --git a/mcs/class/System/System.CodeDom/MemberAttributes.cs b/mcs/class/System/System.CodeDom/MemberAttributes.cs
deleted file mode 100755
index d851f92f5d6..00000000000
--- a/mcs/class/System/System.CodeDom/MemberAttributes.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.CodeDom MemberAttributes Enum implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom {
- public enum MemberAttributes {
- Abstract,
- AccessMask,
- Assembly,
- Const,
- Family,
- FamilyAndAssembly,
- FamilyOrAssembly,
- Final,
- New,
- Overloaded,
- Override,
- Private,
- Public,
- ScopeMask,
- Static,
- VTableMask
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/BitVector32.cs b/mcs/class/System/System.Collections.Specialized/BitVector32.cs
deleted file mode 100644
index e176a220f8c..00000000000
--- a/mcs/class/System/System.Collections.Specialized/BitVector32.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.Collections.Specialized.BitVector32.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Collections.Specialized {
-
- public struct BitVector32 {
- int value;
-
- public struct Section {
- public short maxval;
- }
-
- [MonoTODO]
- public static Section CreateSection (short maxval)
- {
- Section s = new Section();
-
- // FIXME: Imeplemtn me
-
- return s;
- }
-
- public static int CreateMask ()
- {
- return 1;
- }
-
- public static int CreateMask (int prev)
- {
- return prev << 1;
- }
-
- public BitVector32 (BitVector32 source)
- {
- value = source.value;
- }
-
- public BitVector32 (int init)
- {
- value = init;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is BitVector32))
- return false;
-
- return value == ((BitVector32) o).value;
- }
-
- public override int GetHashCode ()
- {
- return 0;
- }
-
- public int Data {
- get {
- return value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/ChangeLog b/mcs/class/System/System.Collections.Specialized/ChangeLog
deleted file mode 100755
index e582af13fa2..00000000000
--- a/mcs/class/System/System.Collections.Specialized/ChangeLog
+++ /dev/null
@@ -1,41 +0,0 @@
-
-Fri Feb 8 18:02:50 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * NameObjectCollectionBase.cs, NameValueCollection.cs: tweaks to make
- it compile and provide the constructor needed by nunitcore.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * BitVector32.cs, ListDictionary.cs : MonoTODO everywhere!
-
- * NameObjectCollectionBase.cs, NameValueCollection.cs : Ditto.
-
-2001-08-24 Nick Drochak <ndrochak@gol.com>
- * NameObjectCollectionBase.cs: Add stub implementation
- * common.src: Add NameObjectCollectionBase to the build
- * NameValueCollection.cs: add 'override' to CopyTo(). Maybe
- this code actually belongs in the superclass.
-
-2001-08-24 Miguel de Icaza <miguel@ximian.com>
-
- * common.src: Add NameValueCollection.cs to the build
-
-2001-08-22 John Barnette <jbarn@httcb.net>
- * StringDictionary.cs:
- Initial working implementation.
- * ListDictionary.cs:
- Initial working implementation.
-
-2001-07-17 John Barnette <jbarn@httcb.net>
- * StringCollection.cs:
- Implemented and working according to spec.
- * StringIterator.cs:
- (ADDED) Implemented and working according to spec.
- * StringCollectionTest.cs:
- (ADDED) Initial revision contains 17 tests; all of 'em
- run correctly. More complicated tests to follow.
-
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * StringCollection.cs: Added so that CodeDom.* would compile.
-
diff --git a/mcs/class/System/System.Collections.Specialized/ListDictionary.cs b/mcs/class/System/System.Collections.Specialized/ListDictionary.cs
deleted file mode 100644
index bb305f26e64..00000000000
--- a/mcs/class/System/System.Collections.Specialized/ListDictionary.cs
+++ /dev/null
@@ -1,434 +0,0 @@
-namespace System.Collections.Specialized
-{
- public class ListDictionary : IDictionary, ICollection, IEnumerable
- {
- private int count;
- private int modCount;
- private ListEntry root;
- private IComparer comparer;
-
-
- public ListDictionary()
- {
- count = 0;
- modCount = 0;
- comparer = null;
- root = null;
- }
-
- public ListDictionary(IComparer comparer) : this()
- {
- this.comparer = comparer;
- }
-
- private bool AreEqual(object obj1, object obj2)
- {
- if (comparer != null) {
- if (comparer.Compare(obj1, obj2) == 0) {
- return true;
- }
- } else {
- if (obj1.Equals(obj2)) {
- return true;
- }
- }
-
- return false;
- }
-
- private ListEntry FindEntry(object key)
- {
- if (key == null) {
- throw new ArgumentNullException("Attempted lookup for a null key.");
- }
-
- if (root == null) {
- return null;
- } else {
- ListEntry entry = root;
-
- while (entry != null) {
- if (AreEqual(key, entry.key)) {
- return entry;
- }
-
- entry = entry.next;
- }
- }
-
- return null;
- }
-
- private void AddImpl(object key, object value)
- {
- if (key == null) {
- throw new ArgumentNullException("Attempted add with a null key.");
- }
-
- if (root == null) {
- root = new ListEntry();
- root.key = key;
- root.value = value;
- } else {
- ListEntry entry = root;
-
- while (entry != null) {
- if (AreEqual(key, entry.key)) {
- throw new ArgumentException("Duplicate key in add.");
- }
-
- if (entry.next == null) {
- break;
- }
-
- entry = entry.next;
- }
-
- entry.next = new ListEntry();
- entry.next.key = key;
- entry.next.value = value;
- }
-
- count++;
- modCount++;
- }
-
- // IEnumerable Interface
- IEnumerator IEnumerable.GetEnumerator()
- {
- return new ListEntryEnumerator(this);
- }
-
- // ICollection Interface
- public int Count
- {
- get {
- return count;
- }
- }
-
- public bool IsSynchronized
- {
- get {
- return false;
- }
- }
-
- public object SyncRoot
- {
- get {
- return this;
- }
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- // FIXME
- }
-
- // IDictionary Interface
- public bool IsFixedSize
- {
- get {
- return false;
- }
- }
-
- public bool IsReadOnly
- {
- get {
- return false;
- }
- }
-
- // Indexer
- public object this[object key]
- {
- get {
- ListEntry entry = FindEntry(key);
- return entry == null ? entry : entry.value;
- }
-
- set {
- ListEntry entry = FindEntry(key);
-
- if (entry != null) {
- entry.value = value;
- count++;
- modCount++;
- } else {
- AddImpl(key, value);
- }
- }
- }
-
- public ICollection Keys
- {
- get {
- return new ListEntryCollection(this, true);
- }
- }
-
- public ICollection Values
- {
- get {
- return new ListEntryCollection(this, false);
- }
- }
-
- public void Add(object key, object value)
- {
- AddImpl(key, value);
- }
-
- public void Clear()
- {
- root = null;
- count = 0;
- modCount++;
- }
-
- public bool Contains(object key)
- {
- return FindEntry(key) != null ? true : false;
- }
-
- IDictionaryEnumerator IDictionary.GetEnumerator()
- {
- return new ListEntryEnumerator(this);
- }
-
- public void Remove(object key)
- {
- ListEntry entry = root;
-
- for (ListEntry prev = null; entry != null; prev = entry, entry = entry.next) {
- if (AreEqual(key, entry.key)) {
- if (prev != null) {
- prev.next = entry.next;
- } else {
- root = entry.next;
- }
-
- entry.value = null;
- count--;
- modCount++;
- }
- }
- }
-
-
- private class ListEntry
- {
- public object key = null;
- public object value = null;
- public ListEntry next = null;
- }
-
-
- private class ListEntryEnumerator : IEnumerator, IDictionaryEnumerator
- {
- private ListDictionary dict;
- private bool isAtStart;
- private ListEntry current;
- private int version;
-
- public ListEntryEnumerator(ListDictionary dict)
- {
- this.dict = dict;
- version = dict.modCount;
- Reset();
- }
-
- private void FailFast()
- {
- if (version != dict.modCount) {
- throw new InvalidOperationException(
- "The ListDictionary's contents changed after this enumerator was instantiated.");
- }
- }
-
- public bool MoveNext()
- {
- FailFast();
-
- if (isAtStart) {
- current = dict.root;
- isAtStart = false;
- } else {
- current = current.next;
- }
-
- return current != null ? true : false;
- }
-
- public void Reset()
- {
- FailFast();
-
- isAtStart = true;
- current = null;
- }
-
- public object Current
- {
- get {
- FailFast();
-
- if (isAtStart || current == null) {
- throw new InvalidOperationException(
- "Enumerator is positioned before the collection's first element or after the last element.");
- }
-
- return new DictionaryEntry(current.key, current.value);
- }
- }
-
- // IDictionaryEnumerator
- public DictionaryEntry Entry
- {
- get {
- FailFast();
- return (DictionaryEntry) Current;
- }
- }
-
- public object Key
- {
- get {
- FailFast();
-
- if (isAtStart || current == null) {
- throw new InvalidOperationException(
- "Enumerator is positioned before the collection's first element or after the last element.");
- }
-
- return current.key;
- }
- }
-
- public object Value
- {
- get {
- FailFast();
-
- if (isAtStart || current == null) {
- throw new InvalidOperationException(
- "Enumerator is positioned before the collection's first element or after the last element.");
- }
-
- return current.value;
- }
- }
- }
-
- private class ListEntryCollection : ICollection
- {
- private ListDictionary dict;
- private bool isKeyList;
-
- public ListEntryCollection(ListDictionary dict, bool isKeyList)
- {
- this.dict = dict;
- this.isKeyList = isKeyList;
- }
-
- // ICollection Interface
- public int Count
- {
- get {
- return dict.Count;
- }
- }
-
- public bool IsSynchronized
- {
- get {
- return false;
- }
- }
-
- public object SyncRoot
- {
- get {
- return dict.SyncRoot;
- }
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- // FIXME
- }
-
- // IEnumerable Interface
- public IEnumerator GetEnumerator()
- {
- return new ListEntryCollectionEnumerator(dict, isKeyList);
- }
-
- private class ListEntryCollectionEnumerator : IEnumerator
- {
- private ListDictionary dict;
- private bool isKeyList;
- private bool isAtStart;
- private int version;
- private ListEntry current;
-
- public ListEntryCollectionEnumerator(ListDictionary dict, bool isKeyList)
- {
- this.dict = dict;
- this.isKeyList = isKeyList;
- isAtStart = true;
- version = dict.modCount;
- }
-
- private void FailFast()
- {
- if (version != dict.modCount) {
- throw new InvalidOperationException(
- "The Collection's contents changed after this " +
- "enumerator was instantiated.");
- }
- }
-
- public object Current
- {
- get {
- FailFast();
-
- if (isAtStart || current == null) {
- throw new InvalidOperationException(
- "Enumerator is positioned before the collection's " +
- "first element or after the last element.");
- }
-
- return isKeyList ? current.key : current.value;
- }
- }
-
- public bool MoveNext()
- {
- FailFast();
-
- if (isAtStart) {
- current = dict.root;
- isAtStart = false;
- } else {
- current = current.next;
- }
-
- return current != null ? true : false;
- }
-
- public void Reset()
- {
- FailFast();
- isAtStart = true;
- current = null;
- }
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs b/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
deleted file mode 100644
index 8a70ae7392d..00000000000
--- a/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
+++ /dev/null
@@ -1,513 +0,0 @@
-/**
- * System.Collections.Specialized.NamaValueCollection class implementation
- *
- * Author: Gleb Novodran
- */
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace System.Collections.Specialized
-{
- public abstract class NameObjectCollectionBase : ICollection, IEnumerable, ISerializable, IDeserializationCallback
- {
- private Hashtable m_ItemsContainer;
- /// <summary>
- /// Extends Hashtable based Items container to support storing null-key pairs
- /// </summary>
- private _Item m_NullKeyItem;
- private ArrayList m_ItemsArray;
- private IHashCodeProvider m_hashprovider;
- private IComparer m_comparer;
- private int m_defCapacity;
- private bool m_readonly;
-
- internal protected IComparer Comparer {
- get {return m_comparer;}
- }
-
- internal protected IHashCodeProvider HashCodeProvider {
- get {return m_hashprovider;}
- }
-
- internal protected /*?*/ class _Item
- {
- public string key;
- public object value;
- public _Item(string key, object value)
- {
- this.key = key;
- this.value = value;
- }
- }
- /// <summary>
- /// Implements IEnumerable interface for KeysCollection
- /// </summary>
- internal protected /*?*/ class _KeysEnumerator : IEnumerator
- {
- private NameObjectCollectionBase m_collection;
- private int m_position;
- /*private*/internal _KeysEnumerator(NameObjectCollectionBase collection)
- {
- m_collection = collection;
- Reset();
- }
- public object Current
- {
-
- get{
- if ((m_position<m_collection.Count)||(m_position<0))
- return m_collection.BaseGetKey(m_position);
- else
- throw new InvalidOperationException();
- }
-
- }
- public bool MoveNext()
- {
- return ((++m_position)<m_collection.Count)?true:false;
- }
- public void Reset()
- {
- m_position = -1;
- }
- }
-
- /// <summary>
- /// SDK: Represents a collection of the String keys of a collection.
- /// </summary>
- public class KeysCollection : ICollection, IEnumerable
- {
- private NameObjectCollectionBase m_collection;
-
- internal/*protected?*/ KeysCollection(NameObjectCollectionBase collection)
- {
- this.m_collection = collection;
- }
- public virtual string Get( int index )
- {
- return m_collection.BaseGetKey(index);
- //throw new Exception("Not implemented yet");
- }
-
- // ICollection methods -----------------------------------
- /// <summary>
- ///
- /// </summary>
- /// <param name="arr"></param>
- /// <param name="index"></param>
- public virtual void /*ICollection*/ CopyTo(Array arr, int index)
- {
- if (arr==null)
- throw new ArgumentNullException("array can't be null");
- IEnumerator en = this.GetEnumerator();
- int i = index;
- while (en.MoveNext())
- {
- arr.SetValue(en.Current,i);
- i++;
- }
- }
-
- public virtual bool IsSynchronized
- {
- get{
- throw new Exception("Not implemented yet");
- }
- }
- public virtual object SyncRoot
- {
- get{
- throw new Exception("Not implemented yet");
- }
- }
- /// <summary>
- /// Gets the number of keys in the NameObjectCollectionBase.KeysCollection
- /// </summary>
- public virtual int Count
- {
- get{
- return m_collection.Count;
- //throw new Exception("Not implemented yet");
- }
- }
- // IEnumerable methods --------------------------------
- /// <summary>
- /// SDK: Returns an enumerator that can iterate through the NameObjectCollectionBase.KeysCollection.
- /// </summary>
- /// <returns></returns>
- public IEnumerator GetEnumerator()
- {
- return new _KeysEnumerator(m_collection);
-// throw new Exception("Not implemented yet");
- }
- }
-
-
-
- //--------------- Protected Instance Constructors --------------
-
- /// <summary>
- /// SDK: Initializes a new instance of the NameObjectCollectionBase class that is empty.
- /// </summary>
- [MonoTODO]
- protected NameObjectCollectionBase():base()
- {
- m_readonly = false;
-
- m_hashprovider = CaseInsensitiveHashCodeProvider.Default;
- m_comparer = CaseInsensitiveComparer.Default;
- m_defCapacity = 0;
- Init();
- /*m_ItemsContainer = new Hashtable(m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null;*/
- //TODO: consider common Reset() method
- }
-
- protected NameObjectCollectionBase( int capacity )
- {
- m_readonly = false;
-
- m_hashprovider = CaseInsensitiveHashCodeProvider.Default;
- m_comparer = CaseInsensitiveComparer.Default;
- m_defCapacity = capacity;
- Init();
- /*m_ItemsContainer = new Hashtable(m_defCapacity, m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null; */
- //throw new Exception("Not implemented yet");
- }
- protected NameObjectCollectionBase( IHashCodeProvider hashProvider, IComparer comparer )
- {
- m_readonly = false;
-
- m_hashprovider = hashProvider;
- m_comparer = comparer;
- m_defCapacity = 0;
- Init();
- /*m_ItemsContainer = new Hashtable(m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null; */
- //throw new Exception("Not implemented yet");
- }
- protected NameObjectCollectionBase( SerializationInfo info, StreamingContext context )
- {
- throw new Exception("Not implemented yet");
- }
- protected NameObjectCollectionBase( int capacity, IHashCodeProvider hashProvider, IComparer comparer )
- {
- m_readonly = false;
-
- m_hashprovider = hashProvider;
- m_comparer = comparer;
- m_defCapacity = capacity;
- Init();
- /*m_ItemsContainer = new Hashtable(m_defCapacity,m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null; */
-
- //throw new Exception("Not implemented yet");
- }
-
- private void Init(){
- m_ItemsContainer = new Hashtable(m_defCapacity,m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null;
- }
- //--------------- Public Instance Properties -------------------
- public virtual NameObjectCollectionBase.KeysCollection Keys
- {
- get
- {
- return new KeysCollection(this);
- //throw new Exception("Not implemented yet");
- }
- }
-
- //--------------- Public Instance Methods ----------------------
- //
- /// <summary>
- /// SDK: Returns an enumerator that can iterate through the NameObjectCollectionBase.
- ///
- /// <remark>This enumerator returns the keys of the collection as strings.</remark>
- /// </summary>
- /// <returns></returns>
- public IEnumerator GetEnumerator()
- {
- return new _KeysEnumerator(this);
- }
- // GetHashCode
-
- // ISerializable
- public virtual void /*ISerializable*/ GetObjectData( SerializationInfo info, StreamingContext context )
- {
- throw new Exception("Not implemented yet");
- }
- public/*?*/ virtual void /*ISerializable*/ CopyTo(Array arr, int index)
- {
- throw new Exception("Not implemented yet");
- }
-
- // ICollection
- public virtual int Count
- {
- get{
- return m_ItemsArray.Count;
- //throw new Exception("Not implemented yet");
- }
- }
- public virtual bool IsSynchronized
- {
- get{
- throw new Exception("Not implemented yet");
- }
- }
- public virtual object SyncRoot
- {
- get
- {
- throw new Exception("Not implemented yet");
- }
- }
-
- // IDeserializationCallback
- public virtual void OnDeserialization( object sender)
- {
- throw new Exception("Not implemented yet");
- }
-
- //--------------- Protected Instance Properties ----------------
- /// <summary>
- /// SDK: Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only.
- /// </summary>
- protected bool IsReadOnly
- {
- get{
- return m_readonly;
- }
- set{
- m_readonly=value;
- }
- }
-
- //--------------- Protected Instance Methods -------------------
- /// <summary>
- /// Adds an Item with the specified key and value into the <see cref="NameObjectCollectionBase"/>NameObjectCollectionBase instance.
- /// </summary>
- /// <param name="name"></param>
- /// <param name="value"></param>
- protected void BaseAdd( string name, object value )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
-
- _Item newitem=new _Item(name, value);
-
- if (name==null){
- //todo: consider nullkey entry
- if (m_NullKeyItem==null)
- m_NullKeyItem = newitem;
- }
- else
- if (m_ItemsContainer[name]==null){
- m_ItemsContainer.Add(name,newitem);
- }
- m_ItemsArray.Add(newitem);
-
-// throw new Exception("Not implemented yet");
- }
- protected void BaseClear()
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- Init();
- //throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// SDK: Gets the value of the entry at the specified index of the NameObjectCollectionBase instance.
- /// </summary>
- /// <param name="index"></param>
- /// <returns></returns>
- protected object BaseGet( int index )
- {
- return ((_Item)m_ItemsArray[index]).value;
- //throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// SDK: Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.
- /// </summary>
- /// <remark>CAUTION: The BaseGet method does not distinguish between a null reference which is returned because the specified key is not found and a null reference which is returned because the value associated with the key is a null reference.</remark>
- /// <param name="name"></param>
- /// <returns></returns>
- protected object BaseGet( string name )
- {
- _Item item = FindFirstMatchedItem(name);
- /// CAUTION: The BaseGet method does not distinguish between a null reference which is returned because the specified key is not found and a null reference which is returned because the value associated with the key is a null reference.
- if (item==null)
- return null;
- else
- return item.value;
- }
-
- /// <summary>
- /// SDK:Returns a String array that contains all the keys in the NameObjectCollectionBase instance.
- /// </summary>
- /// <returns>A String array that contains all the keys in the NameObjectCollectionBase instance.</returns>
- protected string[] BaseGetAllKeys()
- {
- int cnt = m_ItemsArray.Count;
- string[] allKeys = new string[cnt];
- for(int i=0; i<cnt; i++)
- allKeys[i] = BaseGetKey(i);//((_Item)m_ItemsArray[i]).key;
-
- return allKeys;
- }
-
- /// <summary>
- /// SDK: Returns an Object array that contains all the values in the NameObjectCollectionBase instance.
- /// </summary>
- /// <returns>An Object array that contains all the values in the NameObjectCollectionBase instance.</returns>
- protected object[] BaseGetAllValues()
- {
- int cnt = m_ItemsArray.Count;
- object[] allValues = new object[cnt];
- for(int i=0; i<cnt; i++)
- allValues[i] = BaseGet(i);
-
- return allValues;
-// throw new Exception("Not implemented yet");
- }
- [MonoTODO]
- protected object[] BaseGetAllValues( Type type )
- {
- if (type == null)
- throw new ArgumentNullException("'type' argument can't be null");
- // TODO: implements this
-
- throw new Exception("Not implemented yet");
- }
-
- protected string BaseGetKey( int index )
- {
- return ((_Item)m_ItemsArray[index]).key;
- //throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not a null reference
- /// </summary>
- /// <returns>true if the NameObjectCollectionBase instance contains entries whose keys are not a null reference otherwise, false.</returns>
- protected bool BaseHasKeys()
- {
- return (m_ItemsContainer.Count>0);
-// throw new Exception("Not implemented yet");
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="name"></param>
- [MonoTODO]
- protected void BaseRemove( string name )
- {
- int cnt = 0;
- String key;
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- if (name!=null)
- {
- m_ItemsContainer.Remove(name);
- }
- else {
- m_NullKeyItem = null;
- }
-
- cnt = m_ItemsArray.Count;
- for (int i=0 ; i< cnt; ){
- key=BaseGetKey(i);
- // TODO: consider case-sensivity
- if (String.Compare(key,name)==0){
- m_ItemsArray.RemoveAt(i);
- cnt--;
- }
- else
- i++;
-
- }
-// throw new Exception("Not implemented yet");
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="index"></param>
- /// <LAME>This function implemented the way Microsoft implemented it -
- /// item is removed from hashtable and array without considering the case when there are two items with the same key but different values in array.
- /// E.g. if
- /// hashtable is [("Key1","value1")] and array contains [("Key1","value1")("Key1","value2")] then
- /// after RemoveAt(1) the collection will be in following state:
- /// hashtable:[]
- /// array: [("Key1","value1")]
- /// It's ok only then the key is uniquely assosiated with the value
- /// To fix it a comparsion of objects stored under the same key in the hashtable and in the arraylist should be added
- /// </LAME>>
- [MonoTODO]
- protected void BaseRemoveAt( int index )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- string key = BaseGetKey(index);
- if (key!=null){
- // TODO: see LAME description above
- m_ItemsContainer.Remove(key);
- }
- else
- m_NullKeyItem = null;
- m_ItemsArray.RemoveAt(index);
-// throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// SDK: Sets the value of the entry at the specified index of the NameObjectCollectionBase instance.
- /// </summary>
- /// <param name="index"></param>
- /// <param name="value"></param>
- protected void BaseSet( int index, object value )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- _Item item = (_Item)m_ItemsArray[index];
- item.value = value;
- //throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// Sets the value of the first entry with the specified key in the NameObjectCollectionBase instance, if found; otherwise, adds an entry with the specified key and value into the NameObjectCollectionBase instance.
- /// </summary>
- /// <param name="name">The String key of the entry to set. The key can be a null reference </param>
- /// <param name="value">The Object that represents the new value of the entry to set. The value can be a null reference</param>
- protected void BaseSet( string name, object value )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- _Item item = FindFirstMatchedItem(name);
- if (item!=null)
- item.value=value;
- else
- BaseAdd(name, value);
-
- //throw new Exception("Not implemented yet");
- }
- [MonoTODO]
- private _Item FindFirstMatchedItem(string name)
- {
- if (name!=null)
- return (_Item)m_ItemsContainer[name];
- else {
- //TODO: consider null key case
- return m_NullKeyItem;
- //throw new Exception("Not implemented yet");
- }
-
- }
- //~Object();
-
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs b/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
deleted file mode 100644
index 1b288b2d06d..00000000000
--- a/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
+++ /dev/null
@@ -1,364 +0,0 @@
-/**
- * System.Collections.Specialized.NamaValueCollection class implementation
- *
- * Author: Gleb Novodran
- */
-// created on 7/21/2001 at 5:15 PM
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Runtime.Serialization;
-using System.Text;
-
-namespace System.Collections.Specialized{
- public class NameValueCollection : NameObjectCollectionBase
- {
- string[] cachedAllKeys = null;
- string[] cachedAll = null;
-
- //--------------------- Constructors -----------------------------
-
- /// <summary> SDK: Initializes a new instance of the NameValueCollection class that is empty,
- /// has the default initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.
- /// </summary>
- public NameValueCollection() : base()
- {
-
- }
-
- /// <summary> SDK: Initializes a new instance of the NameValueCollection class that is empty,
- /// has the specified initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.
- ///</summary>
- public NameValueCollection( int capacity ) : base(capacity)
- {
-
- }
-
- /// <summary> SDK: Copies the entries from the specified NameValueCollection to a new
- /// NameValueCollection with the same initial capacity as the number of entries copied
- /// and using the same case-insensitive hash code provider and the same case-insensitive
- /// comparer as the source collection.
- /// </summary>
- /// TODO: uncomment constructor below after it will be possible to compile NameValueCollection and
- /// NameObjectCollectionBase to the same assembly
-
- public NameValueCollection( NameValueCollection col ) : base(col.HashCodeProvider,col.Comparer)
- {
- if (col==null)
- throw new ArgumentNullException("Null argument is not allowed");
- Add(col);
- }
-
- ///<summary>SDK: Initializes a new instance of the NameValueCollection class that is empty,
- ///has the default initial capacity and uses the specified hash code provider and
- ///the specified comparer.</summary>
- public NameValueCollection( IHashCodeProvider hashProvider, IComparer comparer )
- : base(hashProvider, comparer)
- {
-
- }
-
- /// <summary>
- /// SDK: Copies the entries from the specified NameValueCollection to a new NameValueCollection
- /// with the specified initial capacity or the same initial capacity as the number of entries
- /// copied, whichever is greater, and using the default case-insensitive hash code provider and
- /// the default case-insensitive comparer.
- /// </summary>
- /// TODO: uncomment constructor below after it will be possible to compile NameValueCollection and
- /// NameObjectCollectionBase to the same assembly
-
-/* public NameValueCollection( int capacity, NameValueCollection col )
- : base(capacity, col.get_HashCodeProvider(),col.Comparer)
- {
- if (col==null)
- throw new ArgumentNullException("Null argument is not allowed");
- Add(col);
- }
-*/
- /// <summary>
- /// SDK: Initializes a new instance of the NameValueCollection class that is serializable
- /// and uses the specified System.Runtime.Serialization.SerializationInfo and
- /// System.Runtime.Serialization.StreamingContext.
- /// </summary>
- protected NameValueCollection( SerializationInfo info, StreamingContext context )
- :base(info, context)
- {
-
- }
-
- /// <summary>
- /// SDK: Initializes a new instance of the NameValueCollection class that is empty,
- /// has the specified initial capacity and uses the specified hash code provider and
- /// the specified comparer.
- /// </summary>
- public NameValueCollection( int capacity, IHashCodeProvider hashProvider, IComparer comparer )
- :base(capacity, hashProvider, comparer)
- {
-
- }
-
- //----------------------- Public Instance Properties -------------------------------
-
-
- ///<summary> SDK:
- /// Gets all the keys in the NameValueCollection.
- /// The arrays returned by AllKeys are cached for better performance and are
- /// automatically refreshed when the collection changes. A derived class can
- /// invalidate the cached version by calling InvalidateCachedArrays, thereby
- /// forcing the arrays to be recreated.
- /// </summary>
- public virtual string[] AllKeys
- {
- get {
- if (cachedAllKeys==null)
- cachedAllKeys = BaseGetAllKeys();
- return this.cachedAllKeys;
- }
- }
-
- public string this[ int index ]
- {
- get{
- return this.Get(index);
- }
- }
-
- public string this[ string name ] {
- get{
- return this.Get(name);
- }
- set{
- this.Set(name,value);
- }
- }
-
-/////////////////////////////// Public Instance Methods //////////////////////////////
-
- /// <summary> SDK: Copies the entries in the specified NameValueCollection
- /// to the current NameValueCollection.</summary>
- /// LAMESPEC: see description that comes this Add(string, string)
-
- public void Add( NameValueCollection c ){
-
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- if (c==null)
- throw new ArgumentNullException();
-
- InvalidateCachedArrays();
- ArrayList values = null;
-
- int max = c.Count;
- for(int i=0; i<max; i++){
- values=(ArrayList)BaseGet(c.GetKey(i));
- if (values==null)
- values = new ArrayList();
- values.AddRange((ArrayList)c.BaseGet(i));
- }
-
- }
-
-
- /// <summary> SDK: Adds an entry with the specified name and value to the
- /// NameValueCollection. </summary>
- ///
- /// LAMESPEC:
- /// in SDK doc: If the same value already exists under the same key in the collection,
- /// the new value overwrites the old value.
- /// however the Microsoft implemenatation in this case just adds one more value
- /// in other words after
- /// <code>
- /// NameValueCollection nvc;
- /// nvc.Add("LAZY","BASTARD")
- /// nvc.Add("LAZY","BASTARD")
- /// </code>
- /// nvc.Get("LAZY") will be "BASTARD,BASTARD" instead of "BASTARD"
-
- public virtual void Add( string name, string val )
- {
-
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
-
- InvalidateCachedArrays();
- ArrayList values = (ArrayList)BaseGet(name);
- if (values==null){
- values = new ArrayList();
- if (val!=null)
- values.Add(val);
- BaseAdd(name,values);
- }
- else {
- if (val!=null)
- values.Add(val);
- }
-
- }
-
- /// <summary> SDK: Invalidates the cached arrays and removes all entries from
- /// the NameValueCollection.</summary>
-
- public void Clear(){
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- InvalidateCachedArrays();
- BaseClear();
- }
-
- /// <summary> SDK: Copies the entire NameValueCollection to a compatible one-dimensional Array,
- /// starting at the specified index of the target array.</summary>
-
- [MonoTODO]
- override public void CopyTo( Array dest, int index )
- {
- if (dest==null)
- throw new ArgumentNullException("Null argument - dest");
- if (index<0)
- throw new ArgumentOutOfRangeException("index is less than 0");
-// throw new Exception("Not implemented yet");
-
- //TODO: add implementation here
- if (cachedAll==null)
- RefreshCachedAll();
- cachedAll.CopyTo(dest, index);
- }
- protected void RefreshCachedAll()
- {
- this.cachedAll=null;
- int max = this.Count;
- cachedAll = new string[max];
- for(int i=0;i<max;i++){
- cachedAll[i] = this.Get(i);
- }
-
- }
-
- /// <summary> SDK: Gets the values at the specified index of the NameValueCollection combined
- /// into one comma-separated list.</summary>
-
- public virtual string Get( int index )
- {
- ArrayList values = (ArrayList)BaseGet(index);
- // if index is out of range BaseGet throws an ArgumentOutOfRangeException
-
- return AsSingleString(values);
-
- }
-
- /**
- * SDK: Gets the values associated with the specified key from the NameValueCollection
- * combined into one comma-separated list.
- */
- public virtual string Get( string name )
- {
- ArrayList values = (ArrayList)BaseGet(name);
-/* if (values==null)
- Console.WriteLine("BaseGet returned null");*/
- return AsSingleString(values);
-// -------------------------------------------------------------
-
- }
- /// <summary></summary>
- [MonoTODO]
- private static string AsSingleString(ArrayList values)
- {
- const char separator = ',';
-
- if (values==null)
- return null;
- int max = values.Count;
-
- if (max==0)
- return null;
- //TODO: reimplement this
- StringBuilder sb = new StringBuilder((string)values[0]);
- for (int i=1; i<max; i++){
- sb.Append(separator);
- sb.Append(values[i]);
- }
-
- return sb.ToString();
- }
-
-
- /// <summary>SDK: Gets the key at the specified index of the NameValueCollection.</summary>
- public virtual string GetKey( int index )
- {
- return BaseGetKey(index);
- }
-
-
- /// <summary>SDK: Gets the values at the specified index of the NameValueCollection.</summary>
-
- public virtual string[] GetValues( int index )
- {
- ArrayList values = (ArrayList)BaseGet(index);
-
- return AsStringArray(values);
- }
-
-
- public virtual string[] GetValues( string name )
- {
- ArrayList values = (ArrayList)BaseGet(name);
-
- return AsStringArray(values);
- }
-
- private static string[] AsStringArray(ArrayList values){
-
- int max = values.Count;//get_Count();
- if (max==0)
- return null;
-
- string[] valArray =new string[max];
- values.CopyTo(valArray);
- return valArray;
- }
-
-
- /// <summary>
- /// SDK: Gets a value indicating whether the NameValueCollection contains keys that
- /// are not a null reference
- /// </summary>
-
- public bool HasKeys()
- {
- return BaseHasKeys();
- }
-
- public virtual void Remove( string name )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- InvalidateCachedArrays();
- BaseRemove(name);
-
- }
-
- /// <summary>
- /// Sets the value of an entry in the NameValueCollection.
- /// </summary>
- public virtual void Set( string name, string value )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- InvalidateCachedArrays();
-
- ArrayList values = new ArrayList();
- values.Add(value);
- BaseSet(name,values);
-
- }
-
-
-//---------------------- Protected Instance Methods ----------------------
-
- protected void InvalidateCachedArrays()
- {
- cachedAllKeys = null;
- cachedAll = null;
- }
-
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/StringCollection.cs b/mcs/class/System/System.Collections.Specialized/StringCollection.cs
deleted file mode 100755
index d1c8410030d..00000000000
--- a/mcs/class/System/System.Collections.Specialized/StringCollection.cs
+++ /dev/null
@@ -1,292 +0,0 @@
-/* System.Collections.Specialized.StringCollection.cs
- * Authors:
- * John Barnette (jbarn@httcb.net)
- * Sean MacIsaac (macisaac@ximian.com)
- *
- * Copyright (C) 2001 John Barnette
- * (C) Ximian, Inc. http://www.ximian.com
- *
- * NOTES:
- * I bet Microsoft uses ArrayList as a backing store for this; I wonder what
- * the performance difference will be.
-*/
-
-using System;
-
-namespace System.Collections.Specialized {
- public class StringCollection : IList, ICollection, IEnumerable {
- private static int InitialCapacity = 11;
- private static float CapacityMultiplier = 2.0f;
-
- private int count;
- private int modCount;
-
- private string[] entries;
-
- // Public Constructor
- public StringCollection() {
- entries = new string[InitialCapacity];
- count = 0;
- modCount = 0;
- }
-
- // Public Instance Properties
- public int Count {
- get { return count; }
- }
-
- public bool IsFixedSize {
- get { return false; }
- }
-
- public bool IsReadOnly {
- get { return false; }
- }
-
- public bool IsSynchronized {
- get { return false; }
- }
-
- object IList.this[int index] {
- get { return this[index]; }
- set { this[index] = value.ToString(); }
- }
-
- public string this[int index] {
- get {
- if (index < 0 || index >= count) {
- throw new ArgumentOutOfRangeException("index");
- }
-
- return entries[index];
- }
-
- set {
- if (index < 0 || index >= count) {
- throw new ArgumentOutOfRangeException("index");
- }
-
- modCount++;
- entries[index] = value;
- }
- }
-
- public object SyncRoot {
- get { return this; }
- }
-
-
- // Public Instance Methods
-
- int IList.Add(object value) {
- return Add(value.ToString());
- }
-
- public int Add(string value) {
- modCount++;
- Resize(count + 1);
- int index = count++;
- entries[index] = value;
-
- return index;
- }
-
- public void AddRange(string[] value) {
- int numEntries = value.Length;
-
- modCount++;
- Resize(count + numEntries);
- Array.Copy(value, 0, entries, count, numEntries);
- count += numEntries;
- }
-
- public void Clear() {
- modCount++;
- count = 0;
- }
-
- bool IList.Contains(object value) {
- return Contains(value.ToString());
- }
-
- public bool Contains(string value) {
- foreach (string entry in entries) {
- if (value.Equals(entry)) {
- return true;
- }
- }
-
- return false;
- }
-
- void ICollection.CopyTo(Array array, int index) {
- if (array == null) {
- throw new ArgumentNullException("array");
- } else if (index < 0) {
- throw new ArgumentOutOfRangeException("index");
- } else if (array.Rank > 1) {
- throw new ArgumentException("array");
- } else if (index >= array.Length) {
- throw new ArgumentException("index");
- } else if (array.Length - index < count) {
- throw new ArgumentException("array");
- }
-
- Array.Copy(entries, 0, array, index, count);
- }
-
- public void CopyTo(string[] array, int index) {
- if (array == null) {
- throw new ArgumentNullException("array");
- } else if (index < 0) {
- throw new ArgumentOutOfRangeException("index");
- } else if (array.Rank > 1) {
- throw new ArgumentException("array");
- } else if (index >= array.Length) {
- throw new ArgumentException("index");
- } else if (array.Length - index < count) {
- throw new ArgumentException("array");
- }
-
- Array.Copy(entries, 0, array, index, count);
- }
-
- IEnumerator IEnumerable.GetEnumerator() {
- return new InternalEnumerator(this);
- }
-
- public StringEnumerator GetEnumerator() {
- return new StringEnumerator(this);
- }
-
- int IList.IndexOf(object value) {
- return IndexOf(value.ToString());
- }
-
- public int IndexOf(string value) {
- for (int i = 0; i < count; i++) {
- if (value.Equals(entries[i])) {
- return i;
- }
- }
-
- return -1;
- }
-
- void IList.Insert(int index, object value) {
- Insert(index, value.ToString());
- }
-
- public void Insert(int index, string value) {
- if (index < 0 || index > count) {
- throw new ArgumentOutOfRangeException("index");
- }
-
- modCount++;
- Resize(count + 1);
- Array.Copy(entries, index, entries, index + 1, count - index);
- entries[index] = value;
- count++;
- }
-
-
- void IList.Remove(object value) {
- Remove(value.ToString());
- }
-
- public void Remove(string value) {
- for (int i = 0; i < count; i++) {
- if (value.Equals(entries[i])) {
- RemoveAt(i);
- return;
- }
- }
- }
-
- public void RemoveAt(int index) {
- if (index < 0 || index >= count) {
- throw new ArgumentOutOfRangeException("index");
- }
-
- int remaining = count - index - 1;
-
- modCount++;
-
- if (remaining > 0) {
- Array.Copy(entries, index + 1, entries, index, remaining);
- }
-
- count--;
- entries[count] = null;
- }
-
-
- // Private Instance Methods
-
- private void Resize(int minSize) {
- int oldSize = entries.Length;
-
- if (minSize > oldSize) {
- string[] oldEntries = entries;
- int newSize = (int) (oldEntries.Length * CapacityMultiplier);
-
- if (newSize < minSize) newSize = minSize;
- entries = new string[newSize];
- Array.Copy(oldEntries, 0, entries, 0, count);
- }
- }
-
-
- // Private classes
-
- private class InternalEnumerator : IEnumerator {
- private StringCollection data;
- private int index;
- private int myModCount;
-
- public InternalEnumerator(StringCollection data) {
- this.data = data;
- myModCount = data.modCount;
- index = -1;
- }
-
-
- // Public Instance Properties
-
- public object Current {
- get {
- if (myModCount != data.modCount) {
- throw new InvalidOperationException();
- } else if (index < 0 || index > data.count - 1) {
- throw new InvalidOperationException();
- }
-
- return data[index];
- }
- }
-
-
- // Public Instance Methods
-
- public bool MoveNext() {
- if (myModCount != data.modCount) {
- throw new InvalidOperationException();
- }
-
- if (++index >= data.count - 1) {
- return false;
- }
-
- return true;
- }
-
- public void Reset() {
- if (myModCount != data.modCount) {
- throw new InvalidOperationException();
- }
-
- index = -1;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/StringDictionary.cs b/mcs/class/System/System.Collections.Specialized/StringDictionary.cs
deleted file mode 100644
index 2e5bc2bfe10..00000000000
--- a/mcs/class/System/System.Collections.Specialized/StringDictionary.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-namespace System.Collections.Specialized
-{
- public class StringDictionary : IEnumerable
- {
- protected Hashtable table;
-
- public StringDictionary()
- {
- table = new Hashtable();
- }
-
- // Public Instance Properties
-
- public virtual int Count
- {
- get {
- return table.Count;
- }
- }
-
- public virtual bool IsSynchronized
- {
- get {
- return false;
- }
- }
-
- public virtual string this[string key]
- {
- get {
- return (string) table[key.ToLower()];
- }
-
- set {
- table[key.ToLower()] = value;
- }
- }
-
- public virtual ICollection Keys
- {
- get {
- return table.Keys;
- }
- }
-
- public virtual ICollection Values
- {
- get {
- return table.Values;
- }
- }
-
- public virtual object SyncRoot
- {
- get {
- return table.SyncRoot;
- }
- }
-
- // Public Instance Methods
-
- public virtual void Add(string key, string value)
- {
- table.Add(key.ToLower(), value);
- }
-
- public virtual void Clear()
- {
- table.Clear();
- }
-
- public virtual bool ContainsKey(string key)
- {
- return table.ContainsKey(key.ToLower());
- }
-
- public virtual bool ContainsValue(string value)
- {
- return table.ContainsValue(value);
- }
-
- public virtual void CopyTo(Array array, int index)
- {
- table.CopyTo(array, index);
- }
-
- public virtual IEnumerator GetEnumerator()
- {
- return table.GetEnumerator();
- }
-
- public virtual void Remove(string key)
- {
- table.Remove(key.ToLower());
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Collections.Specialized/StringEnumerator.cs b/mcs/class/System/System.Collections.Specialized/StringEnumerator.cs
deleted file mode 100644
index 8be9d7c5a6e..00000000000
--- a/mcs/class/System/System.Collections.Specialized/StringEnumerator.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/* System.Collections.Specialized.StringEnumerator.cs
- * Authors:
- * John Barnette (jbarn@httcb.net)
- *
- * Copyright (C) 2001 John Barnette
-*/
-
-namespace System.Collections.Specialized {
- public class StringEnumerator {
- private StringCollection coll;
- private IEnumerator enumerable;
-
- // assembly-scoped constructor
- internal StringEnumerator(StringCollection coll) {
- this.coll = coll;
- this.enumerable = ((IEnumerable)coll).GetEnumerator();
- }
-
- // Public Instance Properties
-
- public string Current {
- get { return (string) enumerable.Current; }
- }
-
-
- // Public Instance Methods
-
- public bool MoveNext() {
- return enumerable.MoveNext();
- }
-
- public void Reset() {
- enumerable.Reset();
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/BrowsableAttribute.cs b/mcs/class/System/System.ComponentModel/BrowsableAttribute.cs
deleted file mode 100755
index e56beb2f809..00000000000
--- a/mcs/class/System/System.ComponentModel/BrowsableAttribute.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ComponentModel.BrowsableAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property | AttributeTargets.Event)]
- public sealed class BrowsableAttribute : Attribute {
- bool browsable;
-
- public static readonly BrowsableAttribute No;
- public static readonly BrowsableAttribute Yes;
-
- static BrowsableAttribute ()
- {
- No = new BrowsableAttribute (false);
- Yes = new BrowsableAttribute (false);
- }
-
- public BrowsableAttribute (bool browsable)
- {
- this.browsable = browsable;
- }
-
- public bool Browsable {
- get {
- return browsable;
- }
- }
-
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/CategoryAttribute.cs b/mcs/class/System/System.ComponentModel/CategoryAttribute.cs
deleted file mode 100755
index b6ffec33364..00000000000
--- a/mcs/class/System/System.ComponentModel/CategoryAttribute.cs
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// System.ComponentModel.CategoryAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property | AttributeTargets.Event)]
- public class CategoryAttribute : Attribute {
- string category;
-
- static CategoryAttribute action, appearance, behaviour, data, def;
- static CategoryAttribute design, drag_drop, focus, format, key;
- static CategoryAttribute layout, mouse, window_style;
-
- public CategoryAttribute (string category)
- {
- this.category = category;
- }
-
- public CategoryAttribute ()
- {
- this.category = "Misc";
- }
-
- [MonoTODO]
- protected virtual string GetLocalizedString (string value)
- {
- // FIXME: IMPLEMENT
-
- return category;
- }
-
- public string Category {
- get {
- return category;
- }
- }
-
- public static CategoryAttribute Action {
- get {
- if (action != null)
- return action;
-
- lock (typeof (CategoryAttribute)){
- if (action == null)
- action = new CategoryAttribute ("Action");
-
- return action;
- }
- }
- }
-
- public static CategoryAttribute Appearance {
- get {
- if (appearance != null)
- return appearance;
-
- lock (typeof (CategoryAttribute)){
- if (appearance == null)
- appearance = new CategoryAttribute ("Appearance");
-
- return appearance;
- }
- }
- }
-
- public static CategoryAttribute Behaviour {
- get {
- if (behaviour != null)
- return behaviour;
-
- lock (typeof (CategoryAttribute)){
- if (behaviour == null)
- behaviour = new CategoryAttribute ("Action");
-
- return behaviour;
- }
- }
- }
-
- public static CategoryAttribute Data {
- get {
- if (data != null)
- return data;
-
- lock (typeof (CategoryAttribute)){
- if (data == null)
- data = new CategoryAttribute ("Data");
-
- return data;
- }
- }
- }
-
- public static CategoryAttribute Default {
- get {
- if (def != null)
- return def;
-
- lock (typeof (CategoryAttribute)){
- if (def == null)
- def = new CategoryAttribute ("Default");
-
- return def;
- }
- }
- }
-
- public static CategoryAttribute Design {
- get {
- if (design != null)
- return design;
-
- lock (typeof (CategoryAttribute)){
- if (design == null)
- design = new CategoryAttribute ("Design");
-
- return design;
- }
- }
- }
-
- public static CategoryAttribute DragDrop {
- get {
- if (drag_drop != null)
- return drag_drop;
-
- lock (typeof (CategoryAttribute)){
- if (drag_drop == null)
- drag_drop = new CategoryAttribute ("Drag Drop");
-
- return drag_drop;
- }
- }
- }
-
- public static CategoryAttribute Focus {
- get {
- if (focus != null)
- return focus;
-
- lock (typeof (CategoryAttribute)){
- if (focus == null)
- focus = new CategoryAttribute ("Focus");
-
- return focus;
- }
- }
- }
-
- public static CategoryAttribute Format {
- get {
- if (format != null)
- return format;
-
- lock (typeof (CategoryAttribute)){
- if (format == null)
- format = new CategoryAttribute ("Format");
-
- return format;
- }
- }
- }
-
- public static CategoryAttribute Key {
- get {
- if (key != null)
- return key;
-
- lock (typeof (CategoryAttribute)){
- if (key == null)
- key = new CategoryAttribute ("Key");
-
- return key;
- }
- }
- }
-
- public static CategoryAttribute Layout {
- get {
- if (layout != null)
- return layout;
-
- lock (typeof (CategoryAttribute)){
- if (layout == null)
- layout = new CategoryAttribute ("Layout");
-
- return layout;
- }
- }
- }
-
- public static CategoryAttribute Mouse {
- get {
- if (mouse != null)
- return mouse;
-
- lock (typeof (CategoryAttribute)){
- if (mouse == null)
- mouse = new CategoryAttribute ("Mouse");
-
- return mouse;
- }
- }
- }
-
- public static CategoryAttribute WindowStyle {
- get {
- if (window_style != null)
- return window_style;
-
- lock (typeof (CategoryAttribute)){
- if (window_style == null)
- window_style = new CategoryAttribute ("Window Style");
-
- return window_style;
- }
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ChangeLog b/mcs/class/System/System.ComponentModel/ChangeLog
deleted file mode 100644
index 55132db9f16..00000000000
--- a/mcs/class/System/System.ComponentModel/ChangeLog
+++ /dev/null
@@ -1,46 +0,0 @@
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * Win32Exception.cs: implement, with support for looking up
- runtime errors.
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * Win32Exception.cs: Add.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * CategoryAttribute.cs, Component.cs, ComponentCollection.cs: MonoTODO.
-
- * Container.cs, MemberDescriptor.cs, PropertyDescriptor.cs : Ditto.
-
-2001-10-27 Miguel de Icaza <miguel@ximian.com>
-
- * DesignerSerializationVisibilityAttribute.cs: Implemented.
-
- * DesignerSerializationVisibility.cs: New enumeration.
-
- * LocalizableAttribute.cs: Implemented.
-
- * BrowsableAttribute.cs: Implemented.
-
- * DesignOnlyAttribute.cs: Implemented.
-
- * DescriptionAttribute.cs: Implement.
-
- * MemberDescriptor.cs: Implemented.
-
- * CategoryAttribute.cs: implemented.
-
-2001-08-21 Nick Drochak <ndrochak@gol.com>
-
- * Component.cs: Eliminated compile errors by removing redundant fields and
- using the ISite member instead. Also raised the Disposed event, but not
- sure if it's correct now. Look for FIXME in the comments.
-
-2001-08-02 Miguel de Icaza <miguel@ximian.com>
-
- * EventHandlerList.cs: New file.
-
- * Container.cs, Component.cs, IContainer.cs, IComponent.cs,
- ComponentCollection.cs, ISite.cs: New classes
-
diff --git a/mcs/class/System/System.ComponentModel/Component.cs b/mcs/class/System/System.ComponentModel/Component.cs
deleted file mode 100644
index 37649d05e8f..00000000000
--- a/mcs/class/System/System.ComponentModel/Component.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// System.ComponentModel.Component.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.ComponentModel {
-
- // <summary>
- // Component class.
- // </summary>
- //
- // <remarks>
- // Longer description
- // </remarks>
- public class Component : MarshalByRefObject, IComponent, IDisposable {
-
- EventHandlerList event_handlers;
- ISite mySite;
-
- // <summary>
- // Component Constructor
- // </summary>
- public Component ()
- {
- event_handlers = null;
- }
-
- // <summary>
- // Get IContainer of this Component
- // </summary>
- public IContainer Container {
- get {
- return mySite.Container;
- }
- }
-
- protected bool DesignMode {
- get {
- return mySite.DesignMode;
- }
- }
-
- protected EventHandlerList Events {
- get {
- // Note: space vs. time tradeoff
- // We create the object here if it's never be accessed before. This potentially
- // saves space. However, we must check each time the propery is accessed to
- // determine whether we need to create the object, which increases overhead.
- // We could put the creation in the contructor, but that would waste space
- // if it were never used. However, accessing this property would be faster.
- if (null == event_handlers)
- {
- event_handlers = new EventHandlerList();
- }
- return event_handlers;
- }
- }
-
- public virtual ISite Site {
- get {
- return mySite;
- }
-
- set {
- mySite = value;
- }
- }
-
- [MonoTODO]
- ~Component()
- {
- // FIXME: Not sure this is correct.
- Dispose(true);
- Disposed(this, EventArgs.Empty);
- }
-
- // <summary>
- // Dispose resources used by this component
- // </summary>
- [MonoTODO]
- public virtual void Dispose ()
- {
- // FIXME: Not sure this is correct.
- Dispose(false);
- Disposed(this, EventArgs.Empty);
- }
-
- // <summary>
- // Controls disposal of resources used by this.
- // </summary>
- //
- // <param name="release_all"> Controls which resources are released</param>
- //
- // <remarks>
- // if release_all is set to true, both managed and unmanaged
- // resources should be released. If release_all is set to false,
- // only unmanaged resources should be disposed
- // </remarks>
- protected virtual void Dispose (bool release_all)
- {
- }
-
- // <summary>
- // Implements the IServiceProvider interface
- // </summary>
- [MonoTODO]
- protected virtual object GetService (Type service)
- {
- // FIXME: Not sure what this should do.
- return null;
- }
-
- // <summary>
- // FIXME: Figure out this one.
- // </summary>
- [MonoTODO ("Figure this out")]
- public event EventHandler Disposed;
- }
-
-}
diff --git a/mcs/class/System/System.ComponentModel/ComponentCollection.cs b/mcs/class/System/System.ComponentModel/ComponentCollection.cs
deleted file mode 100644
index 90fb081887d..00000000000
--- a/mcs/class/System/System.ComponentModel/ComponentCollection.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.ComponentModel.ComponentCollection.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- [MonoTODO]
- public class ComponentCollection { // FIXME: ReadOnlyCollectionBase
-
- public void Dispose ()
- {
- }
-
- }
-}
-
diff --git a/mcs/class/System/System.ComponentModel/Container.cs b/mcs/class/System/System.ComponentModel/Container.cs
deleted file mode 100644
index aec2ec4a3c6..00000000000
--- a/mcs/class/System/System.ComponentModel/Container.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// System.ComponentModel.Container.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- // <summary>
- // Container class: encapsulates components.
- // </summary>
- //
- // <remarks>
- //
- // </remarks>
- public class Container : IContainer, IDisposable {
- ComponentCollection cc;
-
- // <summary>
- // Auxiliary class to support the default behaviour of CreateSite
- // </summary>
- //
- // <remarks>
- // This is an internal class that is used to provide a
- // default implementation of an ISite class. Container
- // is just a default implementation of IContainer, and
- // provides this as a way of getting started
- // </remarks>
-
- class DefaultSite : ISite {
- IComponent component;
- IContainer container;
- string name;
-
- public DefaultSite (string name, IComponent component, IContainer container)
- {
- this.component = component;
- this.container = container;
- this.name = name;
- }
-
- public IComponent Component {
- get {
- return component;
- }
- }
-
- public IContainer Container {
- get {
- return container;
- }
- }
-
- [MonoTODO]
- public bool DesignMode {
- get {
- // FIXME: should we provide a way to set
- // this value?
- return false;
- }
- }
-
- public string Name {
- get {
- return name;
- }
-
- set {
- name = value;
- }
- }
-
- [MonoTODO]
- public virtual object GetService (Type t)
- {
- // FIXME: do not know what this is supposed to do.
- return null;
- }
- }
-
- // <summary>
- // Container constructor
- // </summary>
- public Container ()
- {
- }
-
- public virtual ComponentCollection Components {
- get {
- return cc;
- }
- }
-
- // <summary>
- // Adds an IComponent to the Container
- // </summary>
- [MonoTODO]
- public virtual void Add (IComponent component)
- {
- // FIXME: Add this component to the ComponentCollection.cc
- }
-
- // <summary>
- // Adds an IComponent to the Container. With a name binding.
- // </summary>
- [MonoTODO]
- public virtual void Add (IComponent component, string name)
- {
- // FIXME: Add this component to the ComponentCollection.cc
- }
-
- // <summary>
- // Returns an ISite for a component.
- // <summary>
- protected virtual ISite CreateSite (IComponent component, string name)
- {
- return new DefaultSite (name, component, this);
- }
-
- public virtual void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- bool disposed = false;
-
- public virtual void Dispose (bool release_all)
- {
- if (disposed)
- return;
-
- if (release_all){
- cc.Dispose ();
- cc = null;
- }
-
- disposed = true;
- }
-
- [MonoTODO]
- protected virtual object GetService (Type service)
- {
- // FIXME: Not clear what GetService does.
-
- return null;
- }
-
- [MonoTODO]
- public virtual void Remove (IComponent component)
- {
- // FIXME: Add this component to the ComponentCollection.cc
- }
- }
-
-}
diff --git a/mcs/class/System/System.ComponentModel/DescriptionAttribute.cs b/mcs/class/System/System.ComponentModel/DescriptionAttribute.cs
deleted file mode 100755
index 03e6f411d78..00000000000
--- a/mcs/class/System/System.ComponentModel/DescriptionAttribute.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.ComponentModel.DescriptionAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property | AttributeTargets.Event)]
- public class DescriptionAttribute : Attribute {
- string desc;
-
- public DescriptionAttribute (string name)
- {
- desc = name;
- }
-
- public DescriptionAttribute ()
- {
- desc = "";
- }
-
- public virtual string Description {
- get {
- return DescriptionValue;
- }
- }
-
- //
- // Notice that the default Description implementation uses this by default
- //
- protected string DescriptionValue {
- get {
- return desc;
- }
-
- set {
- desc = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/DesignOnlyAttribute.cs b/mcs/class/System/System.ComponentModel/DesignOnlyAttribute.cs
deleted file mode 100755
index 2cb9e77a6c8..00000000000
--- a/mcs/class/System/System.ComponentModel/DesignOnlyAttribute.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.ComponentModel.DesignOnlyAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property)]
- public class DesignOnlyAttribute : Attribute {
- bool design_only;
-
- public static readonly DesignOnlyAttribute No;
- public static readonly DesignOnlyAttribute Yes;
-
- static DesignOnlyAttribute ()
- {
- No = new DesignOnlyAttribute (false);
- Yes = new DesignOnlyAttribute (false);
- }
-
- public DesignOnlyAttribute (bool design_only)
- {
- this.design_only = design_only;
- }
-
- public bool IsDesignOnly {
- get {
- return design_only;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/DesignerSerializationVisibility.cs b/mcs/class/System/System.ComponentModel/DesignerSerializationVisibility.cs
deleted file mode 100755
index d4291a842c8..00000000000
--- a/mcs/class/System/System.ComponentModel/DesignerSerializationVisibility.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.ComponentModel.DesignerSerializationVisibility.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- public enum DesignerSerializationVisibility {
- Hidden, Visible, Content
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/DesignerSerializationVisibilityAttribute.cs b/mcs/class/System/System.ComponentModel/DesignerSerializationVisibilityAttribute.cs
deleted file mode 100755
index 4063238a8aa..00000000000
--- a/mcs/class/System/System.ComponentModel/DesignerSerializationVisibilityAttribute.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.ComponentModel.DesignerSerializationVisibilityAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property)]
- public sealed class DesignerSerializationVisibilityAttribute : Attribute {
- DesignerSerializationVisibility visibility;
-
- static DesignerSerializationVisibilityAttribute ()
- {
- Content = new DesignerSerializationVisibilityAttribute (
- DesignerSerializationVisibility.Content);
- Hidden = new DesignerSerializationVisibilityAttribute (
- DesignerSerializationVisibility.Hidden);
- Visible = new DesignerSerializationVisibilityAttribute (
- DesignerSerializationVisibility.Visible);
- }
-
- DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility vis)
- {
- visibility = vis;
- }
-
- public static readonly DesignerSerializationVisibilityAttribute Content;
- public static readonly DesignerSerializationVisibilityAttribute Hidden;
- public static readonly DesignerSerializationVisibilityAttribute Visible;
-
- public DesignerSerializationVisibility Visibility {
- get {
- return visibility;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/EventHandlerList.cs b/mcs/class/System/System.ComponentModel/EventHandlerList.cs
deleted file mode 100644
index 2c610702f40..00000000000
--- a/mcs/class/System/System.ComponentModel/EventHandlerList.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.ComponentModel.EventHandlerList.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-
-namespace System.ComponentModel {
-
- // <summary>
- // List of Event delegates.
- // </summary>
- //
- // <remarks>
- // Longer description
- // </remarks>
- public class EventHandlerList : IDisposable {
- Hashtable table;
-
- public EventHandlerList ()
- {
- }
-
- public Delegate this [object key] {
- get {
- if (table == null)
- return null;
-
- return (Delegate) table [key];
- }
-
- set {
- if (table == null)
- table = new Hashtable ();
-
- table.Add (key, value);
- }
- }
-
- public void AddHandler (object key, Delegate value)
- {
- if (table == null)
- table = new Hashtable ();
-
- table.Add (key, value);
- }
-
- public void RemoveHandler (object key, Delegate value)
- {
- table.Remove (key);
- }
-
- public void Dispose ()
- {
- table = null;
- }
- }
-
-}
diff --git a/mcs/class/System/System.ComponentModel/IComponent.cs b/mcs/class/System/System.ComponentModel/IComponent.cs
deleted file mode 100644
index 8b8fece74f1..00000000000
--- a/mcs/class/System/System.ComponentModel/IComponent.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.ComponentModel.IComponent.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- public interface IComponent : IDisposable {
-
- ISite Site {
- get; set;
- }
-
- event EventHandler Disposed;
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/IContainer.cs b/mcs/class/System/System.ComponentModel/IContainer.cs
deleted file mode 100644
index fb5d34f1ab6..00000000000
--- a/mcs/class/System/System.ComponentModel/IContainer.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.ComponentModel.IContainer.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- public interface IContainer {
-
- ComponentCollection Components {
- get;
- }
-
- void Add (IComponent component);
-
- void Add (IComponent component, string name);
-
- void Remove (IComponent component);
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ISite.cs b/mcs/class/System/System.ComponentModel/ISite.cs
deleted file mode 100644
index 0a7e09e8252..00000000000
--- a/mcs/class/System/System.ComponentModel/ISite.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.ComponentModel.Component.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- public interface ISite : IServiceProvider {
- IComponent Component { get; }
-
- IContainer Container { get; }
-
- bool DesignMode { get; }
-
- string Name { get; set; }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/LocalizableAttribute.cs b/mcs/class/System/System.ComponentModel/LocalizableAttribute.cs
deleted file mode 100755
index b5425ef8e53..00000000000
--- a/mcs/class/System/System.ComponentModel/LocalizableAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.ComponentModel.LocalizableAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-using System;
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property)]
- public sealed class LocalizableAttribute : Attribute {
- bool localizable;
-
- public static readonly LocalizableAttribute No;
- public static readonly LocalizableAttribute Yes;
-
- static LocalizableAttribute ()
- {
- No = new LocalizableAttribute (false);
- Yes = new LocalizableAttribute (false);
- }
-
- public LocalizableAttribute (bool localizable)
- {
- this.localizable = localizable;
- }
-
- public bool IsLocalizable {
- get {
- return localizable;
- }
- }
-
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/MemberDescriptor.cs b/mcs/class/System/System.ComponentModel/MemberDescriptor.cs
deleted file mode 100755
index 51cb853ffca..00000000000
--- a/mcs/class/System/System.ComponentModel/MemberDescriptor.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// System.ComponentModel.MemberDescriptor.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- public class MemberDescriptor {
- string name;
- Attribute [] attrs;
-
- protected MemberDescriptor (string name, Attribute [] attrs)
- {
- this.name = name;
- this.attrs = attrs;
- }
-
- protected MemberDescriptor (MemberDescriptor reference, Attribute [] attrs)
- {
- name = reference.name;
- this.attrs = attrs;
- }
-
- protected MemberDescriptor (string name)
- {
- this.name = name;
- }
-
- protected MemberDescriptor (MemberDescriptor reference)
- {
- name = reference.name;
- attrs = reference.attrs;
- }
-
- protected virtual Attribute [] AttributeArray {
- get {
- return attrs;
- }
-
- set {
- attrs = value;
- }
- }
-
- // FIXME: Implement Attributes property
- [MonoTODO ("Implement Attributes property too")]
- public virtual string Category {
- get {
- foreach (Attribute attr in attrs){
-
-
-
- if (attr is CategoryAttribute){
- return ((CategoryAttribute) attr).Category;
- }
- }
- return "Misc";
- }
- }
-
- public virtual string Description {
- get {
- foreach (Attribute attr in attrs){
- if (attr is DescriptionAttribute)
- return ((DescriptionAttribute) attr).Description;
- }
-
- return "";
- }
- }
-
- public virtual bool DesignTimeOnly {
- get {
- foreach (Attribute attr in attrs){
- if (attr is DesignOnlyAttribute)
- return ((DesignOnlyAttribute) attr).IsDesignOnly;
- }
-
- return false;
- }
- }
-
- //
- // FIXME: Is there any difference between DisplayName and Name?
- //
- [MonoTODO ("Does this diff from Name ?")]
- public virtual string DisplayName {
- get {
- return name;
- }
- }
-
- public virtual string Name {
- get {
- return name;
- }
- }
-
- public virtual bool IsBrowsable {
- get {
- foreach (Attribute attr in attrs){
- if (attr is BrowsableAttribute)
- return ((BrowsableAttribute) attr).Browsable;
- }
-
- return false;
- }
- }
-
- protected virtual int NameHashCode {
- get {
- return name.GetHashCode ();
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs b/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs
deleted file mode 100755
index be061a6da4a..00000000000
--- a/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// System.ComponentModel.PropertyDescriptor.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-
-namespace System.ComponentModel {
-
- public abstract class PropertyDescriptor : MemberDescriptor {
-
- public PropertyDescriptor (MemberDescriptor reference)
- : base (reference)
- {
- }
-
- public PropertyDescriptor (MemberDescriptor reference, Attribute [] attrs)
- : base (reference, attrs)
- {
- }
-
- public PropertyDescriptor (string name, Attribute [] attrs)
- : base (name, attrs)
- {
- }
-
- public abstract Type ComponentType { get; }
-
- [MonoTODO]
- public virtual TypeConverter Converter {
- get {
- // FIXME: Implement me.
-
- return null;
- }
- }
-
- public virtual bool IsLocalizable {
- get {
- foreach (Attribute attr in AttributeArray){
- if (attr is LocalizableAttribute){
- return ((LocalizableAttribute) attr).IsLocalizable;
- }
- }
-
- return false;
- }
- }
-
- public abstract bool IsReadOnly { get; }
-
- public abstract Type PropertyType { get; }
-
- public DesignerSerializationVisibility SerializationVisibility {
- get {
- foreach (Attribute attr in AttributeArray){
- if (attr is DesignerSerializationVisibilityAttribute){
- DesignerSerializationVisibilityAttribute a;
-
- a = (DesignerSerializationVisibilityAttribute) attr;
-
- return a.Visibility;
- }
- }
-
- //
- // Is this a good default if we cant find the property?
- //
- return DesignerSerializationVisibility.Hidden;
- }
- }
-
- Hashtable notifiers;
-
- public virtual void AddValueChanged (object component, EventHandler handler)
- {
- EventHandler component_notifiers;
-
- if (component == null)
- throw new ArgumentNullException ("component");
-
- if (handler == null)
- throw new ArgumentNullException ("handler");
-
- if (notifiers == null)
- notifiers = new Hashtable ();
-
- component_notifiers = (EventHandler) notifiers [component];
-
- if (component_notifiers != null)
- component_notifiers += handler;
- else
- notifiers [component] = handler;
- }
-
- protected virtual void OnValueChanged (object component, EventArgs e)
- {
- if (notifiers == null)
- return;
-
- EventHandler component_notifiers = (EventHandler) notifiers [component];
-
- if (component_notifiers == null)
- return;
-
- component_notifiers (component, e);
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/TypeConverter.cs b/mcs/class/System/System.ComponentModel/TypeConverter.cs
deleted file mode 100755
index caeb21a138d..00000000000
--- a/mcs/class/System/System.ComponentModel/TypeConverter.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-//
-// Nothing implemented yet
-//
-namespace System.ComponentModel {
-
- public class TypeConverter {
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/Win32Exception.cs b/mcs/class/System/System.ComponentModel/Win32Exception.cs
deleted file mode 100755
index b6125ddd274..00000000000
--- a/mcs/class/System/System.ComponentModel/Win32Exception.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.ComponentModel.Win32Exceptioncs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-using System.Collections;
-using System.Globalization;
-
-namespace System.ComponentModel
-{
- [Serializable]
- public class Win32Exception : ExternalException
- {
- private int native_error_code;
-
- public Win32Exception ()
- : base (W32ErrorMessage(Marshal.GetLastWin32Error()),
- Marshal.GetLastWin32Error()) {
- native_error_code=Marshal.GetLastWin32Error();
- }
-
- public Win32Exception(int error)
- : base (W32ErrorMessage(error), error) {
- native_error_code=error;
- }
-
- public Win32Exception(int error, string message)
- : base (message, error) {
- native_error_code=error;
- }
-
- protected Win32Exception(SerializationInfo info,
- StreamingContext context)
- : base (info, context) {
- }
-
- public int NativeErrorCode {
- get {
- return(native_error_code);
- }
- }
-
- [MonoTODO]
- public override void GetObjectData(SerializationInfo info,
- StreamingContext context) {
- if(info==null) {
- throw new ArgumentNullException();
- }
-
- throw new NotImplementedException();
- }
-
- private static Hashtable w32_errors = new Hashtable();
-
- /* Initialise the list of error strings */
- static Win32Exception() {
- /* No need to list everything, just the ones
- * the runtime can throw
- */
- w32_errors.Add(10047,
- Locale.GetText("AF not supported"));
- w32_errors.Add(10043,
- Locale.GetText("proto no supported"));
- w32_errors.Add(10044,
- Locale.GetText("socket not supproted"));
- }
-
- private static string W32ErrorMessage(int error_code) {
- string message=(string)w32_errors[error_code];
-
- if(message==null) {
- return(Locale.GetText("Some sort of w32 error occurred"));
- } else {
- return(message);
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Configuration/ChangeLog b/mcs/class/System/System.Configuration/ChangeLog
deleted file mode 100644
index acc2a035a7e..00000000000
--- a/mcs/class/System/System.Configuration/ChangeLog
+++ /dev/null
@@ -1,25 +0,0 @@
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * ConfigurationException.cs: Rewrote most of the file and added
- serialization bits.
-
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * ConfigurationSettings.cs, IgnoreSectionHandler.cs : MonoTODO decoration
-
- * SingleTagSectionHandler.cs, DictionarySectionHandler.cs,
- NameValueSectionHandler.cs : Ditto.
-
-2001-08-28 Christopher Podurgiel <cpodurgiel@msn.com>
- * IConfigurationSectionHandler.cs: Added reference to System.Xml.
-
- * SingleTagSectionHandler.cs: Added Implementation of Create() method.
-
- * NameValueSectionHandler.cs: Added Implementation of Create() method.
-
- * ConfigurationException.cs: Now returns proper message rather than "System Exception".
-
-2001-08-26 Christopher Podurgiel <cpodurgiel@msn.com>
-
- * ConfigurationSettings.cs: No longer references the NameValueSectionHandler directly. Instead it uses System.Reflection to call the Create() method for the appropriate SectionHandler as defined in the .config file.
-
diff --git a/mcs/class/System/System.Configuration/ConfigurationException.cs b/mcs/class/System/System.Configuration/ConfigurationException.cs
deleted file mode 100644
index 9b23ee88352..00000000000
--- a/mcs/class/System/System.Configuration/ConfigurationException.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// System.Configuration.ConfigurationException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Xml;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Configuration
-{
- [Serializable]
- public class ConfigurationException : SystemException
- {
- // Fields
- string bareMessage;
- string filename;
- int line;
-
- //
- // Constructors
- //
- public ConfigurationException ()
- : base (Locale.GetText ("There is an error in a configuration setting."))
- {
- filename = null;
- bareMessage = Locale.GetText ("There is an error in a configuration setting.");
- line = 0;
- }
-
- public ConfigurationException (string message)
- : base (message)
- {
- bareMessage = message;
- }
-
- protected ConfigurationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- filename = info.GetString ("filename");
- line = info.GetInt32 ("line");
- }
-
- public ConfigurationException (string message, Exception inner)
- : base (message, inner)
- {
- bareMessage = message;
- }
-
- public ConfigurationException (string message, XmlNode node)
- : base (message)
- {
- filename = GetXmlNodeFilename(node);
- line = GetXmlNodeLineNumber(node);
- bareMessage = message;
- }
-
- public ConfigurationException (string message, Exception inner, XmlNode node)
- : base (message, inner)
- {
- filename = GetXmlNodeFilename (node);
- line = GetXmlNodeLineNumber (node);
- bareMessage = message;
- }
-
- public ConfigurationException (string message, string filename, int line)
- : base (message)
- {
- bareMessage = message;
- this.filename = filename;
- this.line= line;
- }
-
- public ConfigurationException (string message, Exception inner, string filename, int line)
- : base (message)
- {
- bareMessage = message;
- this.filename = filename;
- this.line = line;
- }
- //
- // Properties
- //
- public string BareMessage
- {
- get { return bareMessage; }
- }
-
- public string Filename
- {
- get { return filename; }
- }
-
- public int Line
- {
- get { return line; }
- }
-
- public override string Message
- {
- get { return filename + " " + line; }
- }
-
- //
- // Methods
- //
- [MonoTODO]
- // Not sure if that's the correct return value.
- public static string GetXmlNodeFilename (XmlNode node)
- {
- return node.OwnerDocument.Name;
- }
-
- [MonoTODO]
- public static int GetXmlNodeLineNumber (XmlNode node)
- {
- return 0;
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("filename", filename);
- info.AddValue ("line", line);
- }
- }
-}
diff --git a/mcs/class/System/System.Configuration/ConfigurationSettings.cs b/mcs/class/System/System.Configuration/ConfigurationSettings.cs
deleted file mode 100644
index 909dcdf6992..00000000000
--- a/mcs/class/System/System.Configuration/ConfigurationSettings.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// System.Configuration.ConfigurationSettings.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// C) Christopher Podurgiel
-//
-
-using System;
-using System.Collections.Specialized;
-using System.Reflection;
-using System.Xml;
-using System.Xml.XPath;
-
-namespace System.Configuration
-{
- /// <summary>
- /// Component class.
- /// </summary>
- /// <remarks>
- /// Longer description
- /// </remarks>
-
- public sealed class ConfigurationSettings
- {
-
- private static string applicationConfigFileName;
-
- /// <summary>
- /// ConfigurationSettings Constructor.
- /// </summary>
- public ConfigurationSettings ()
- {
-
- }
-
- /// <summary>
- /// Returns configuration settings for a user-defined configuration section.
- /// </summary>
- /// <param name="sectionName">The name of the configuration section that configuration settings are read from.</param>
- /// <returns></returns>
- public static object GetConfig(string sectionName)
- {
- //Create an instance of an XML Document.
- XmlDocument ConfigurationDocument = new XmlDocument();
-
- /*
- * LAMESPEC: The .config file that needs to be parsed is the name of the application, plus ".config"
- * ie. "Myapplication.exe.config"
- * The only way I could find to get the name of the application is through System.Forms.Application.ExecutablePath, this
- * may be an incorrect way to get this information. It works properly on a windows machine when building an executable,
- * however, I'm not sure how this would work under other platforms.
- */
- //Get the full path to the Applicaton Configuration File.
- applicationConfigFileName = "FIXME:ConfigurationSettings" + ".config";
-
- //Try to load the XML Document.
- try
- {
- ConfigurationDocument.Load(applicationConfigFileName);
- }
- catch(XmlException e)
- {
- //Error loading the XML Document. Throw a ConfigurationException.
- throw(new ConfigurationException(e.Message, applicationConfigFileName, e.LineNumber));
- }
-
- string sectionHandlerName = GetSectionHanderType(ConfigurationDocument, sectionName);
-
- XmlNode sectionNode = ConfigurationDocument.SelectSingleNode("/configuration/" + sectionName);
-
-
-
- //If the specified sectionName is not found, then sectionNode will be null. When calling objNVSHandler.Create(),
- //sectionNode cannot be null.
- if(sectionNode == null)
- {
- return null;
- }
-
-
- //Create a new SectionHandler
-
- //According to the Docs provided by Microsoft, the user can create their own configuration sections, and create a custom
- //handler class for it. The user would specify the class and its assebly in the <configSections> section. These would be
- //seperated by a comma.
-
- string sectionHandlerClassName = sectionHandlerName;
- string sectionHandlerAssemblyName = "System";
-
- //Split the SectionHandler Class Name from the Assembly Name (if provided).
- string[] sectionHandlerArray = sectionHandlerName.Split(new char[]{','}, 2);
- if(sectionHandlerArray.Length == 2)
- {
- sectionHandlerClassName = sectionHandlerArray[0];
- sectionHandlerAssemblyName = sectionHandlerArray[1];
- }
-
- // Load the assembly to use.
- Assembly assem = Assembly.Load(sectionHandlerAssemblyName);
- //Get the class type.
- Type handlerObjectType = assem.GetType(sectionHandlerClassName);
- //Get a reference to the method "Create"
- MethodInfo createMethod = handlerObjectType.GetMethod("Create");
- //Create an Instance of this SectionHandler.
- Object objSectionHandler = Activator.CreateInstance(handlerObjectType);
-
- //define the arguments to be passed to the "Create" Method.
- Object[] args = new Object[3];
- args[0] = null;
- args[1] = null;
- args[2] = sectionNode;
-
- object sectionHandlerCollection = createMethod.Invoke(objSectionHandler, args);
-
- //Return the collection
- return sectionHandlerCollection;
-
- }
-
-
- /// <summary>
- /// Gets the name of the SectionHander Class that will handle this section.
- /// </summary>
- /// <param name="xmlDoc">An xml Configuration Document.</param>
- /// <param name="sectionName">The name of the configuration section that configuration settings are read from.</param>
- /// <returns>The name of the Handler Object for this configuration section, including the name if its Assembly.</returns>
- [MonoTODO]
- private static string GetSectionHanderType(XmlDocument xmlDoc, string sectionName)
- {
- //TODO: This method does not account for sectionGroups yet.
- string handlerName = null;
-
- //<appSettings> is a predefined configuration section. It does not have a definition
- // in the <configSections> section, and will always be handled by the NameValueSectionHandler.
- if(sectionName == "appSettings")
- {
- handlerName = "System.Configuration.NameValueSectionHandler";
- }
- else
- {
-
- string[] sectionPathArray = sectionName.Split(new char[]{'/'});
-
- //Build an XPath statement.
- string xpathStatement = "/configuration/configSections";
- for (int i=0; i < sectionPathArray.Length; i++)
- {
- if(i < sectionPathArray.Length - 1)
- {
- xpathStatement = xpathStatement + "/sectionGroup[@name='" + sectionPathArray[i] + "']";
- }
- else
- {
- xpathStatement = xpathStatement + "/section[@name='" + sectionPathArray[i] + "']";
- }
- }
-
- //Get all of the <section> node using the xpath statement.
- XmlNode sectionNode = xmlDoc.SelectSingleNode(xpathStatement);
-
- // if this section isn't found, then there was something wrong with the config document,
- // or the sectionName didn't have a proper definition.
- if(sectionNode == null)
- {
-
- throw (new ConfigurationException("Unrecognized element."));
- }
-
- handlerName = sectionNode.Attributes["type"].Value;
-
- }
-
- //Return the name of the handler.
- return handlerName;
- }
-
-
-
- /// <summary>
- /// Get the Application Configuration Settings.
- /// </summary>
- public static NameValueCollection AppSettings
- {
- get
- {
- //Get the Configuration Settings for the "appSettings" section.
- NameValueCollection appSettings = (NameValueCollection)GetConfig("appSettings");;
-
- return appSettings;
- }
- }
-
- }
-}
-
-
diff --git a/mcs/class/System/System.Configuration/DictionarySectionHandler.cs b/mcs/class/System/System.Configuration/DictionarySectionHandler.cs
deleted file mode 100644
index 14eb65af6bc..00000000000
--- a/mcs/class/System/System.Configuration/DictionarySectionHandler.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-
-//
-// System.Configuration.DictionarySectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-using System;
-using System.Collections.Specialized;
-using System.Xml;
-
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for DictionarySectionHandler.
- /// </summary>
- public class DictionarySectionHandler : IConfigurationSectionHandler
- {
- private static string _stringKeyName;
- private static string _stringValueName;
-
- /// <summary>
- /// DictionarySectionHandler Constructor
- /// </summary>
- public DictionarySectionHandler()
- {
- //Set Default Values.
- _stringKeyName = "key";
- _stringValueName = "value";
- }
-
- /// <summary>
- /// Creates a new DictionarySectionHandler object and adds the object to the collection.
- /// </summary>
- /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
- /// <param name="context">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
- /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
- /// <returns></returns>
- [MonoTODO]
- public object Create(object parent, object context, XmlNode section)
- {
- //FIXME: Enter a meaningful error message
- if(section == null)
- { throw new ConfigurationException("XML Node can not be null."); }
-
- //FIXME: Enter a meaningful error message
- if(parent == null)
- { throw new ConfigurationException("", section); }
-
-
- DictionarySectionHandler objHandler = new DictionarySectionHandler();
- NameValueCollection objCollection;
-
- //Unbox parent as a NameValueCollection type.
- objCollection=(NameValueCollection)parent;
-
- objCollection.Add(section.Attributes[_stringKeyName].Value, section.Attributes[_stringValueName].Value);
-
- return null;
-
- //FIXME: this code is far form complete, probably not even correct.
-
- }
-
- /// <summary>
- /// Gets the name of the key attribute tag. This property is overidden by derived classes to change
- /// the name of the key attribute tag. The default is "key".
- /// </summary>
- protected virtual string KeyAttributeName
- {
- get
- {
- return _stringKeyName;
- }
- }
-
- /// <summary>
- /// Gets the name of the value tag. This property may be overidden by derived classes to change
- /// the name of the value tag. The default is "value".
- /// </summary>
- protected virtual string ValueAttributeName
- {
- get
- {
- return _stringValueName;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Configuration/IConfigurationSectionHandler.cs b/mcs/class/System/System.Configuration/IConfigurationSectionHandler.cs
deleted file mode 100644
index d3eae0ad018..00000000000
--- a/mcs/class/System/System.Configuration/IConfigurationSectionHandler.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Configuration.IConfigurationSectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-using System;
-using System.Xml;
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for IConfigurationSectionHandler.
- /// </summary>
- public interface IConfigurationSectionHandler
- {
- /// <summary>
- /// Creates a new configuration handler and adds the specified configuration object to the collection.
- /// </summary>
- /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
- /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
- /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
- /// <returns></returns>
- object Create(object parent, object configContext, XmlNode section);
- }
-}
diff --git a/mcs/class/System/System.Configuration/IgnoreSectionHandler.cs b/mcs/class/System/System.Configuration/IgnoreSectionHandler.cs
deleted file mode 100644
index 4a0f558b395..00000000000
--- a/mcs/class/System/System.Configuration/IgnoreSectionHandler.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Configuration.IgnoreSectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-using System.Xml;
-
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for IgnoreSectionHandler.
- /// </summary>
- public class IgnoreSectionHandler : IConfigurationSectionHandler
- {
- /// <summary>
- /// IgnoreSectionHandler Constructor
- /// </summary>
- [MonoTODO]
- public IgnoreSectionHandler()
- {
- //
- // TODO: Add constructor logic here
- //
- }
-
- /// <summary>
- /// Creates a new configuration handler and adds the specified configuration object to the collection.
- /// </summary>
- /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
- /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
- /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
- /// <returns></returns>
- [MonoTODO]
- public virtual object Create(object parent, object configContext, XmlNode section)
- {
- //FIXME: Add Implemetation code here.
- return null;
- }
- }
-}
diff --git a/mcs/class/System/System.Configuration/NameValueSectionHandler.cs b/mcs/class/System/System.Configuration/NameValueSectionHandler.cs
deleted file mode 100644
index 0e88bf44950..00000000000
--- a/mcs/class/System/System.Configuration/NameValueSectionHandler.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.Configuration.NameValueSectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-using System;
-using System.Xml;
-using System.Collections.Specialized;
-
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for NameValueSectionHandler.
- /// </summary>
- public class NameValueSectionHandler
- {
- private static string keyName;
- private static string valueName;
- private static NameValueCollection settingsCollection;
-
-
- /// <summary>
- /// NameValueSectionHandler Constructor
- /// </summary>
- public NameValueSectionHandler()
- {
- //Set Default Values.
- keyName = "key";
- valueName = "value";
-
- settingsCollection = new NameValueCollection();
-
- }
-
- /// <summary>
- /// Creates a new configuration handler and adds the specified configuration object to the collection.
- /// </summary>
- /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
- /// <param name="context">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
- /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
- /// <returns></returns>
- [MonoTODO]
- public object Create(object parent, object context, XmlNode section)
- {
- //FIXME: I'm not quite sure how to implement 'parent' or 'context'.
-
-
- //Get all of the ChildNodes in the XML section.
- XmlNodeList childNodeList = section.ChildNodes;
-
- //loop throught the ChildNodes
- for (int i=0; i < childNodeList.Count; i++)
- {
- XmlNode childNode = childNodeList[i];
-
- //if the name of this childNode is not 'add' then throw a ConfigurationException.
- if(childNode.Name != "add")
- {
- throw (new ConfigurationException("Unrecognized element"));
- }
-
- //Get the attributes for the childNode
- XmlAttributeCollection xmlAttributes = childNode.Attributes;
-
- //Get the key and value Attributes by their Name
- XmlAttribute keyAttribute = xmlAttributes[keyName];
- XmlAttribute valueAttribute = xmlAttributes[valueName];
-
- //Add this Key/Value Pair to the collection
- settingsCollection.Add(keyAttribute.Value, valueAttribute.Value);
-
- }
-
-
- //FIXME: Something is missing here. MS's version of this method returns a System.Configuration.ReadOnlyNameValueCollection type,
- //this class id not documented ANYWHERE. This method is curretly returning a NameValueCollection, but it should be ReadOnly.
-
- return settingsCollection;
- }
-
- /// <summary>
- /// Gets the name of the key in the key-value pair.
- /// </summary>
- protected virtual string KeyAttributeName
- {
- get
- {
- return keyName;
- }
- }
-
- /// <summary>
- /// Gets the value for the key in the key-value pair.
- /// </summary>
- protected virtual string ValueAttributeName
- {
- get
- {
- return valueName;
- }
- }
-
- }
-}
diff --git a/mcs/class/System/System.Configuration/SingleTagSectionHandler.cs b/mcs/class/System/System.Configuration/SingleTagSectionHandler.cs
deleted file mode 100644
index d01b3f893d2..00000000000
--- a/mcs/class/System/System.Configuration/SingleTagSectionHandler.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Configuration.SingleTagSectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-using System.Xml;
-using System.Collections;
-
-
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for SingleTagSectionHandler.
- /// </summary>
- public class SingleTagSectionHandler : IConfigurationSectionHandler
- {
-
- [MonoTODO]
- public SingleTagSectionHandler()
- {
- //
- // TODO: Add constructor logic here
- //
- }
-
- /// <summary>
- /// Returns a collection of configuration section values.
- /// </summary>
- /// <param name="parent"></param>
- /// <param name="context"></param>
- /// <param name="section">The name of the configuration section.</param>
- /// <returns></returns>
- [MonoTODO]
- public object Create(object parent, object context, XmlNode section)
- {
- //FIXME: I'm not quite sure how to implement 'parent' or 'context'.
- //TODO: Add in proper Error Handling.
-
- //Get all of the ChildNodes in the XML section.
- if(section.HasChildNodes)
- {
- throw (new ConfigurationException("Child Nodes not allowed."));
- }
-
-
- //Get the attributes for the childNode
- XmlAttributeCollection xmlAttributes = section.Attributes;
-
- Hashtable settingsCollection = new Hashtable();
-
- for(int i=0; i < xmlAttributes.Count; i++)
- {
- settingsCollection.Add(xmlAttributes[i].Name, xmlAttributes[i].Value);
- }
-
- return settingsCollection;
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/BooleanSwitch.cs b/mcs/class/System/System.Diagnostics/BooleanSwitch.cs
deleted file mode 100755
index e4f83292d55..00000000000
--- a/mcs/class/System/System.Diagnostics/BooleanSwitch.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Diagnostics.BooleanSwitch.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-
-namespace System.Diagnostics
-{
- /// <summary>
- /// Provides a simple on/off switch that controls debuggina
- /// and tracing output
- /// </summary>
- public class BooleanSwitch : Switch
- {
- /// <summary>
- /// Initializes a new instance
- /// </summary>
- public BooleanSwitch(string displayName, string description)
- : base(displayName, description)
- {
- SwitchSetting = (int)BooleanSwitchSetting.False;
- }
-
- // =================== Properties ===================
-
- /// <summary>
- /// Specifies whether the switch is enabled or disabled
- /// </summary>
- public bool Enabled
- {
- get
- {
- if((int)BooleanSwitchSetting.False == SwitchSetting) {
- return false;
- }
- else {
- return true;
- }
- }
- set
- {
- if(value) {
- SwitchSetting = (int)BooleanSwitchSetting.True;
- }
- else {
- SwitchSetting = (int)BooleanSwitchSetting.False;
- }
- }
- }
-
- private enum BooleanSwitchSetting : int {
- True = 1, False = 0
- }
- }
-
-}
diff --git a/mcs/class/System/System.Diagnostics/ChangeLog b/mcs/class/System/System.Diagnostics/ChangeLog
deleted file mode 100644
index dc66ddee81d..00000000000
--- a/mcs/class/System/System.Diagnostics/ChangeLog
+++ /dev/null
@@ -1,31 +0,0 @@
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * TraceListenerCollection.cs: Remove Warnings.
-
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * Switch.cs, TraceListenerCollection.cs : Decorate incomplete bits
- with the MonoTODO attribute.
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added Debug.cs to the build.
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added preliminary TraceListenerCollection.cs to the build.
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added TraceListener.cs, TextWriterTraceListener.cs, and
- DefaultTraceListener.cs to the build and moved them into the
- proper assembly.
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added DiagnosticsConfigurationHandler.cs to the build.
-
-2001-09-09 Nick Drochak <ndrochak@gol.com>
-
- * BooleanSwitch.cs: Make this class use it's parent class's features. Namely, use SwitchSetting
- so that we can get OnSwitchSettingChanged() to fire for free.
-
-2001-09-09 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: added this file
-
- * Switch.cs: call OnSwitchSettingChanged() when the switch setting is, yes you gessed it, changed.
-
diff --git a/mcs/class/System/System.Diagnostics/Debug.cs b/mcs/class/System/System.Diagnostics/Debug.cs
deleted file mode 100644
index 5c48908dba3..00000000000
--- a/mcs/class/System/System.Diagnostics/Debug.cs
+++ /dev/null
@@ -1,407 +0,0 @@
-//
-// System.Diagnostics.Debug.cs
-//
-// Author: John R. Hicks <angryjohn69@nc.rr.com>
-//
-// (C) 2002
-//
-using System;
-
-namespace System.Diagnostics
-{
-
- /// <summary>
- /// Provides a set of methods to help debug code
- /// </summary>
- public sealed class Debug
- {
- private static bool autoFlush;
- private static int indentLevel;
- private static int indentSize;
- private static TraceListenerCollection listeners;
-
- static Debug()
- {
- autoFlush = false;
- indentLevel = 0;
- indentSize = 4;
- listeners = new TraceListenerCollection();
- }
-
- /// <summary>
- /// Gets or sets value indicating whether Flush should
- /// be called on the listeners.
- /// </summary>
- public static bool AutoFlush
- {
- get
- {
- return autoFlush;
- }
- set
- {
- autoFlush = value;
- }
- }
-
- /// <summary>
- /// Gets or sets indent level
- /// </summary>
- public static int IndentLevel
- {
- get
- {
- return indentLevel;
- }
- set
- {
- indentLevel = value;
- }
- }
-
- /// <summary>
- /// The number of spaces in an indent.
- /// </summary>
- public static int IndentSize
- {
- get
- {
- return indentSize;
- }
- set
- {
- indentSize = value;
- }
- }
-
- /// <summary>
- /// Returns the listeners collection
- /// </summary>
- public static TraceListenerCollection Listeners
- {
- get
- {
- return listeners;
- }
- }
-
- /// <summary>
- /// Checks for a condition, and prints a stack trace
- /// if the condition is false.
- /// </summary>
- public static void Assert(bool condition)
- {
- if(!condition) {
- WriteLine(new StackTrace().ToString());
- }
-
- }
-
- /// <summary>
- /// Checks for a condition, and displays a message if the condition
- /// is false.
- /// </summary>
- public static void Assert(bool condition, string message)
- {
- if(!condition) {
- WriteLine(message);
-
- }
-
- }
-
- /// <summary>
- /// Checks for a condtion, and displays a message and a detailed message
- /// string if the condition is false.
- /// </summary>
- public static void Assert(bool condition, string message, string detailMessage)
- {
- if(!condition) {
- WriteLine(message);
- Indent();
- WriteLine(detailMessage);
- Unindent();
-
- }
- }
-
- /// <summary>
- /// Closes the Debug buffer
- /// </summary>
- public static void Close()
- {
- foreach(TraceListener l in listeners)
- {
- l.Close();
- }
- }
-
- /// <summary>
- /// Emits the specified error message.
- /// </summary>
- public static void Fail(string message)
- {
- WriteLine(message);
-
- }
-
- /// <summary>
- /// Emits the specified error message and detailed error message.
- /// </summary>
- public static void Fail(string message, string detailMessage)
- {
- WriteLine(message);
- Indent();
- WriteLine(detailMessage);
- Unindent();
-
- }
-
- /// <summary>
- /// Flushes the listeners
- /// </summary>
- public static void Flush()
- {
- foreach(TraceListener l in listeners)
- {
- l.Flush();
- }
- }
-
- /// <summary>
- /// Increments the indent level
- /// </summary>
- public static void Indent()
- {
- indentLevel++;
- }
-
- /// <summary>
- /// Decrements the indent level
- /// </summary>
- public static void Unindent()
- {
- if(indentLevel == 0)
- return;
- else
- indentLevel--;
- }
-
- /// <summary>
- /// Writes the value of the specified object's ToString method
- /// to the listeners.
- /// </summary>
- public static void Write(object value)
- {
- foreach(TraceListener l in listeners)
- {
- l.Write(value.ToString());
- }
- }
-
- /// <summary>
- /// Writes the specified message to each listener in the Listeners collection.
- /// </summary>
- public static void Write(string message)
- {
- foreach(TraceListener l in listeners)
- {
- l.Write(message);
- }
- }
-
- /// <summary>
- /// Writes the category name and value of the specified object's
- /// ToString method to each listener in the Listeners collection.
- /// </summary>
- public static void Write(object value, string category)
- {
- foreach(TraceListener l in listeners)
- {
- l.Write("[" + category + "] " + value.ToString());
- }
- }
-
- /// <summary>
- /// Writes the category name and the specified message
- /// to each listener in the Listeners collection.
- /// </summary>
- public static void Write(string message, string category)
- {
- foreach(TraceListener l in listeners)
- {
- l.Write("[" + category + "] " + message);
- }
- }
-
- /// <summary>
- /// Writes the value of the specified object's ToString method
- /// to each of the listeners if the condition is true.
- /// </summary>
- public static void WriteIf(bool condition, object value)
- {
- if(condition)
- {
- foreach(TraceListener l in listeners)
- {
- l.Write(value.ToString());
- }
- }
- }
-
- /// <summary>
- /// Writes the specified message to each of the listeners
- /// if the specified condition is true.
- /// </summary>
- public static void WriteIf(bool condition, string message)
- {
- if(condition)
- {
- foreach(TraceListener l in listeners)
- {
- l.Write(message);
- }
- }
- }
-
- /// <summary>
- /// Writes the value of the specified object's ToString message
- /// and category to each of the listeners if the condition is true.
- /// </summary>
- public static void WriteIf(bool condition, object value, string category)
- {
- if(condition)
- {
- foreach(TraceListener l in listeners)
- {
- l.Write("[" + category + "] " + value.ToString());
- }
- }
- }
-
- /// <summary>
- /// Writes the category and specified message to each listener
- /// if the specified condition is true.
- /// </summary>
- public static void WriteIf(bool condition, string message, string category)
- {
- if(condition)
- {
- foreach(TraceListener l in listeners)
- {
- l.Write("[" + category + "] " + message);
- }
- }
-
- }
-
- /// <summary>
- /// Writes the value of the object's ToString method,
- /// followed by a line terminator, to each listener.
- /// </summary>
- public static void WriteLine(object value)
- {
- foreach(TraceListener l in listeners)
- {
- l.WriteLine(value.ToString());
- }
- }
-
- /// <summary>
- /// Writes the specified message, followed by a line terminator,
- /// to each listener.
- /// </summary>
- public static void WriteLine(string message)
- {
- foreach(TraceListener l in listeners)
- {
- l.WriteLine(message);
- }
- }
-
- /// <summary>
- /// Writes the value of the specified object's ToString method,
- /// along with a category, followed by a line terminator, to each listener.
- /// </summary>
- public static void WriteLine(object value, string category)
- {
- foreach(TraceListener l in listeners)
- {
- l.WriteLine("[" + category + "] " + value.ToString());
- }
- }
-
- /// <summary>
- /// Writes the specified category and message, followed by a line terminator,
- /// to each listener.
- /// </summary>
- public static void WriteLine(string message, string category)
- {
- foreach(TraceListener l in listeners)
- {
- l.WriteLine("[" + category + "] " + message);
- }
- }
-
- /// <summary>
- /// Writes the value of the object's ToString method
- /// to each listener if the specified condition is true.
- /// </summary>
- public static void WriteLineIf(bool condition, object value)
- {
- if(condition)
- {
- foreach(TraceListener l in listeners)
- {
- l.WriteLine(value.ToString());
- }
- }
- }
-
- /// <summary>
- /// Writes the specified message to each listener
- /// if the specified condition is true.
- /// </summary>
- public static void WriteLineIf(bool condition, string message)
- {
- if(condition)
- {
- foreach(TraceListener l in listeners)
- {
- l.WriteLine(message);
- }
- }
- }
-
- /// <summary>
- /// Writes the value of the object's ToString method, and a category
- /// to each listener if the specified condition is true.
- /// </summary>
- public static void WriteLineIf(bool condition, object value, string category)
- {
- if(condition)
- {
- foreach(TraceListener l in listeners)
- {
- l.WriteLine("[" + category + "] " + value.ToString());
- }
- }
- }
-
- /// <summary>
- /// Writes the specified category and message to each listener, followed by a line
- /// terminator, if the specified condition is true.
- /// </summary>
- public static void WriteLineIf(bool condition, string message, string category)
- {
- if(condition)
- {
- foreach(TraceListener l in listeners)
- {
- l.WriteLine("[" + category + "] " + message);
- }
- }
-
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs b/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs
deleted file mode 100644
index fc0ee84a3f1..00000000000
--- a/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// System.Diagnostics.DefaultTraceListener.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-using System;
-
-namespace System.Diagnostics
-{
- /// <summary>
- /// Provides the default output methods and behavior for tracing.
- /// </summary>
- /// <remarks>
- /// Since there is no debugging API ala Win32 on Mono, <see cref="System.Console.Out">
- /// Console.Out</see> is being used as the default output method.
- /// </remarks>
- public class DefaultTraceListener : TraceListener
- {
- private string logFileName;
-
- public DefaultTraceListener() : base("Default")
- {
- logFileName = "";
- }
-
- /// <summary>
- /// Gets or sets name of a log file to write trace or debug messages to.
- /// </summary>
- /// <value>
- /// The name of a log file to write trace or debug messages to.
- /// </value>
- public String LogFileName
- {
- get
- {
- return logFileName;
- }
- set
- {
- logFileName = value;
- }
- }
-
- /// <summary>
- /// Emits or displays a message and a stack trace for an assertion that
- /// always fails.
- /// </summary>
- /// <param name="message">
- /// The message to emit or display.
- /// </param>
- public override void Fail(string message)
- {
- Console.Out.WriteLine(message);
- new StackTrace().ToString();
- }
-
- /// <summary>
- /// Emits or displays detailed messages and a stack trace
- /// for an assertion that always fails.
- /// </summary>
- /// <param name="message">
- /// The message to emit or display
- /// </param>
- /// <param name="detailMessage">
- /// The detailed message to emit or display.
- /// </param>
- public override void Fail(string message, string detailMessage)
- {
- Console.Out.WriteLine(message + ": " + detailMessage);
- new StackTrace().ToString();
- }
-
- /// <summary>
- /// Writes the output to the Console
- /// </summary>
- /// <param name="message">
- /// The message to write
- /// </param>
- public override void Write(string message)
- {
- Console.Out.Write(message);
- }
-
- /// <summary>
- /// Writes the output to the Console, followed by a newline
- /// </summary>
- /// <param name="message">
- /// The message to write
- /// </param>
- public override void WriteLine(string message)
- {
- Console.Out.WriteLine(message);
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs b/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
deleted file mode 100644
index 37d6e6a88ec..00000000000
--- a/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.Diagnostics.DiagnosticsConfigurationHandler.cs
-//
-// Author:
-// John R. Hicks <angryjohn69@nc.rr.com>
-//
-// (C) 2002
-//
-using System;
-using System.Configuration;
-using System.Xml;
-
-namespace System.Diagnostics
-{
- /// <summary>
- /// The configuration section handler for the diagnostics section of
- /// the configuration file. The section handler participates in the
- /// resolution of configuration settings between the &lt;diagnostics&gt;
- /// and &lt;/diagnostics&gt; portion of the .config file.
- /// </summary>
- public class DiagnosticsConfigurationHandler :
- IConfigurationSectionHandler
- {
- /// <summary>
- /// Initializes a new instance of the
- /// <see cref="DiagnosticsConfigurationHandler">
- /// DiagnosticsConfigurationHandler</see> class.
- /// </summary>
- public DiagnosticsConfigurationHandler()
- {
-
- }
-
- /// <summary>
- /// Parses the configuration settings between the
- /// &lt;diagnostics&gt; and &lt;/diagnostics&gt; portion of the
- /// .config file to populate the values of the object and return it.
- /// </summary>
- /// <param name="parent">
- /// Reference to the &quot;default&quot; value provided by the parent
- /// IConfigurationSectionHandler.
- /// </param>
- /// <param name="configContext">
- /// [To be supplied]
- /// </param>
- /// <param name="section">
- /// [To be supplied]
- /// </param>
- public virtual object Create(
- object parent,
- object configContext,
- XmlNode section)
- {
- throw new NotImplementedException();
- }
-
-
- ~DiagnosticsConfigurationHandler()
- {
-
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/Switch.cs b/mcs/class/System/System.Diagnostics/Switch.cs
deleted file mode 100755
index 90efcc258e8..00000000000
--- a/mcs/class/System/System.Diagnostics/Switch.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// System.Diagnostics.Switch.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-
-namespace System.Diagnostics
-{
- /// <summary>
- /// Abstract base class to create new debugging and tracing switches
- /// </summary>
- public abstract class Switch
- {
- private string desc = "";
- private string display_name = "";
- private int iSwitch;
-
- // ================= Constructors ===================
- /// <summary>
- /// Initialize a new instance
- /// </summary>
- protected Switch(string displayName, string description)
- {
- display_name = displayName;
- desc = description;
- }
-
- /// <summary>
- /// Allows an Object to attempt to free resources and
- /// perform cleanup before the Object is reclaimed
- /// by the Garbage Collector
- /// </summary>
- ~Switch()
- {
- }
-
- // ================ Instance Methods ================
-
- // ==================== Properties ==================
-
- /// <summary>
- /// Returns a description of the switch
- /// </summary>
- public string Description
- {
- get
- {
- return desc;
- }
- }
-
- /// <summary>
- /// Returns a name used to identify the switch
- /// </summary>
- public string DisplayName
- {
- get
- {
- return display_name;
- }
- }
-
- /// <summary>
- /// Gets or sets the current setting for this switch
- /// </summary>
- protected int SwitchSetting
- {
- get
- {
- return iSwitch;
- }
- set
- {
- if(iSwitch != value)
- {
- iSwitch = value;
- OnSwitchSettingChanged();
- }
- }
- }
-
- /// <summary>
- /// Raises the SwitchSettingChanged event
- /// </summary>
- [MonoTODO]
- protected virtual void OnSwitchSettingChanged()
- {
- // TODO: implement me
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/TextWriterTraceListener.cs b/mcs/class/System/System.Diagnostics/TextWriterTraceListener.cs
deleted file mode 100644
index fe362d68520..00000000000
--- a/mcs/class/System/System.Diagnostics/TextWriterTraceListener.cs
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// System.Diagnostics.TextWriterTraceListener.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-namespace System.Diagnostics
-{
- using System;
- using System.IO;
- using System.Text;
-
- /// <summary>
- /// Directs tracing or debugging output to a <see cref="System.IO.TextWriter">
- /// TextWriter</see> or to a <see cref="System.IO.Stream">Stream</see>,
- /// such as <see cref="System.Console.Out">Console.Out</see> or
- /// <see cref="System.IO.FileStream">FileStream</see>.
- /// </summary>
- public class TextWriterTraceListener : TraceListener
- {
-
- private TextWriter writer;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TextWriterTraceListener">
- /// TextWriterTraceListener</see> class with <see cref="System.IO.TextWriter">
- /// TextWriter</see> as the output recipient.
- /// </summary>
- public TextWriterTraceListener() : base("TextWriter")
- {
- writer = Console.Out;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TextWriterTraceListener">
- /// TextWriterTraceListener</see> class, using the stream as the output
- /// recipient of the debugging and tracing output.
- /// </summary>
- /// <param name="stream">
- /// A <see cref="System.IO.Stream">Stream</see> that represents the stream the
- /// <see cref="TextWriterTraceListener">TextWriterTraceListener</see> writes to.
- /// </param>
- /// <exception cref="System.ArgumentNullException">
- /// The stream is a null reference.
- /// </exception>
- public TextWriterTraceListener(Stream stream) : base("")
- {
- if(stream == null)
- throw new ArgumentNullException("Stream is null");
-
- writer = new StreamWriter(stream);
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TextWriterTraceListener">
- /// TextWriterTraceListener</see> class, using the file as the recipient
- /// of the debugging and tracing output.
- /// </summary>
- /// <param name="fileName">
- /// The name of the file the <see cref="TextWriterTraceListener">
- /// TextWriterTraceListener</see> writes to.
- /// </param>
- /// <exception cref="System.ArgumentNullException">
- /// The fileName is null.
- /// </exception>
- public TextWriterTraceListener(string fileName) : base("")
- {
- if(fileName == null)
- throw new ArgumentNullException("Filename is null");
-
- FileStream fileStream = new FileStream(fileName, FileMode.Create);
- writer = new StreamWriter(fileStream);
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TextWriterTraceListener">
- /// TextWriterTraceListener</see> class using the specified writer as the
- /// recipient of the tracing or debugging output.
- /// </summary>
- /// <param name="writer">
- /// A <see cref="System.IO.TextWriter">TextWriter</see> that receives output
- /// from the <see cref="TextWriterTraceListener">TextWriterTraceListener</see>.
- /// </param>
- /// <exception cref="System.ArgumentNullException">
- /// The writer is a null reference
- /// </exception>
- public TextWriterTraceListener(TextWriter writer) : base("")
- {
- if(writer == null)
- throw new ArgumentNullException("Given TextWriter is null");
- this.writer = writer;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TextWriterTraceListener">
- /// TextWriterTraceListener</see> class with the specified name, using the
- /// stream as the recipient of the tracing or debugging output.
- /// </summary>
- /// <param name="stream">
- /// A <see cref="System.IO.Stream">Stream</see> that represents the stream the
- /// <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- /// writes to.
- /// </param>
- /// <param name="name">
- /// The name of the new instance
- /// </param>
- /// <exception cref="System.ArgumentNullException">
- /// The stream is a null reference
- /// </exception>
- public TextWriterTraceListener(Stream stream, string name) : base(name)
- {
- if(stream == null)
- throw new ArgumentNullException("Supplied Stream is null");
- writer = new StreamWriter(stream);
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TextWriterTraceListener">
- /// TextWriterTraceListener</see> class with the specified name, using the
- /// file as the recipient of the tracing or debugging output.
- /// </summary>
- /// <param name="fileName">
- /// The name of the file the <see cref="TextWriterTraceListener">
- /// TextWriterTraceListener</see> writes to.
- /// </param>
- /// <param name="name">
- /// The name of the new instance
- /// </param>
- /// <exception cref="System.ArgumentNullException">
- /// The file is a null reference.
- /// </exception>
- public TextWriterTraceListener(string fileName, string name) : base(name)
- {
- if(fileName == null)
- throw new ArgumentNullException("Supplied file name is null");
- FileStream fileStream = new FileStream(fileName, FileMode.Create);
- writer = new StreamWriter(fileStream);
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TextWriterTraceListener">
- /// TextWriterTraceListener</see> class with the specified name, using
- /// the specified writer as the recipient of the tracing or debugging output.
- /// </summary>
- /// <param name="writer">
- /// A <see cref="System.IO.TextWriter">TextWriter</see> that receives the output
- /// from the <see cref="TextWriterTraceListener">TextWriterTraceListener</see>.
- /// </param>
- /// <param name="name">
- /// The name of the new instance.
- /// </param>
- /// <exception cref="System.ArgumentNullException">
- /// The writer is a null reference.
- /// </exception>
- public TextWriterTraceListener(TextWriter writer, string name) : base(name)
- {
- if(writer == null)
- throw new ArgumentNullException("The supplied writer is null");
- this.writer = writer;
- }
-
- /// <summary>
- /// Gets or sets the writer that receives the debugging or tracing output.
- /// </summary>
- /// <value>
- /// A <see cref="System.IO.TextWriter">TextWriter</see> that represents the writer
- /// that receives the tracing or debugging output.
- /// </value>
- public TextWriter Writer
- {
- get
- {
- return writer;
- }
- set
- {
- writer = value;
- }
- }
-
- /// <summary>
- /// Closes the <see cref="System.IO.Writer">Writer</see> so that it no longer
- /// receives tracing or debugging output.
- /// </summary>
- public override void Close()
- {
- writer.Close();
- }
-
- /// <summary>
- /// Flushes the output buffer for the <see cref="System.IO.Writer">Writer</see>.
- /// </summary>
- public override void Flush()
- {
- writer.Flush();
- }
-
- /// <summary>
- /// Writes a message to this instance's <see cref="System.IO.Writer">Writer</see>.
- /// </summary>
- /// <param name="message">
- /// A message to write.
- /// </param>
- public override void Write(string message)
- {
- Console.Error.WriteLine("We should be getting output here");
- writer.Write(message);
-
- }
-
- /// <summary>
- /// Writes a message to this instance's <see cref="System.IO.Writer">Writer</see>
- /// followed by a line terminator.
- /// </summary>
- /// <param name="message">
- /// A message to write.
- /// </param>
- public override void WriteLine(string message)
- {
- Console.Error.WriteLine("We should be getting output here, too");
- writer.WriteLine(message);
-
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/TraceLevel.cs b/mcs/class/System/System.Diagnostics/TraceLevel.cs
deleted file mode 100755
index ddd88595ff3..00000000000
--- a/mcs/class/System/System.Diagnostics/TraceLevel.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// TraceLevel.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:34:29 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Diagnostics {
-
-
- /// <summary>
- /// </summary>
- public enum TraceLevel {
-
- /// <summary>
- /// </summary>
- Off = 0,
-
- /// <summary>
- /// </summary>
- Error = 1,
-
- /// <summary>
- /// </summary>
- Warning = 2,
-
- /// <summary>
- /// </summary>
- Info = 3,
-
- /// <summary>
- /// </summary>
- Verbose = 4,
- } // TraceLevel
-
-} // System.Diagnostics
diff --git a/mcs/class/System/System.Diagnostics/TraceListener.cs b/mcs/class/System/System.Diagnostics/TraceListener.cs
deleted file mode 100644
index f7508fa1452..00000000000
--- a/mcs/class/System/System.Diagnostics/TraceListener.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-//
-// System.Diagnostics.TraceListener.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-namespace System.Diagnostics
-{
- using System;
- using System.IO;
- using System.Text;
-
- /// <summary>
- /// Provides the abstract base class for the listeners who monitor
- /// trace and debug output
- /// </summary>
- public abstract class TraceListener : MarshalByRefObject, IDisposable
- {
- private int indentLevel;
- private int indentSize;
- private string name;
- private bool needIndent;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TraceListener">
- /// TraceListener</see> class.
- /// </summary>
- protected TraceListener()
- {
- indentLevel = 0;
- indentSize = 4;
- needIndent = false;
- name = "";
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TraceListener">
- /// TraceListener</see> class using the specified name as the listener.
- /// </summary>
- protected TraceListener(string name) : this()
- {
- if(name == null)
- this.name = "";
- this.name = name;
- }
-
- /// <summary>
- /// Gets or sets the indent level.
- /// </summary>
- /// <value>
- /// The indent level. The default is zero.
- /// </value>
- public int IndentLevel
- {
- get
- {
- return indentLevel;
- }
- set
- {
- indentLevel = value;
- }
- }
-
- /// <summary>
- /// Gets or sets the number of spaces in an indent.
- /// </summary>
- /// <value>
- /// The number of spaces in an indent. The default is four spaces.
- /// </value>
- public int IndentSize
- {
- get
- {
- return indentSize;
- }
- set
- {
- indentSize = value;
- }
- }
-
- /// <summary>
- /// Gets or sets a name for this <see cref="TraceListener">TraceListener</see>.
- /// </summary>
- /// <value>
- /// A name for this <see cref="TraceListener">TraceListener</see>.
- /// The default is the empty string ("")
- /// </value>
- public string Name
- {
- get
- {
- return name;
- }
- set
- {
- name = value;
- }
- }
-
- /// <summary>
- /// Gets or sets a value indicating whether to indent the output.
- /// </summary>
- /// <value>
- /// <b>true</b> if the output should be indented; otherwise <b>false</b>.
- /// </value>
- protected bool NeedIndent
- {
- get
- {
- return needIndent;
- }
- set
- {
- needIndent = value;
- }
- }
-
- /// <summary>
- /// When overridden in a derived class, closes the output stream so it no longer
- /// receives tracing or debugging output.
- /// </summary>
- public virtual void Close() {}
-
- /// <summary>
- /// Releases all resources used by the <see cref="TraceListener">TraceListener</see>.
- /// </summary>
- public virtual void Dispose() {}
-
- /// <summary>
- /// Releases the unmanaged resources used by the
- /// <see cref="TraceListener">TraceListener</see> and optionally releases the
- /// managed resources.
- /// </summary>
- /// <param name="disposing">
- /// <b>true</b> to release both managed and unmanaged resources;
- /// <b>false</b> to release only unmanaged resources.
- /// </param>
- protected virtual void Dispose(bool disposing) {}
-
- /// <summary>
- /// Emits an error message to the listener you create when you
- /// implement the <see cref="TraceListener">TraceListener</see> class.
- /// </summary>
- /// <param name="message">
- /// A message to emit.
- /// </param>
- public virtual void Fail(string message)
- {
-
- }
-
- /// <summary>
- /// Emits an error message, and a detailed error message to the listener
- /// you create when you implement the <see cref="TraceListener">TraceListener</see>
- /// class.
- /// </summary>
- /// <param name="message">
- /// A message to emit.
- /// </param>
- /// <param name="detailMessage">
- /// A detailed message to emit.
- /// </param>
- public virtual void Fail(string message, string detailMessage)
- {
-
- }
-
- /// <summary>
- /// When overridden in a derived class, flushes the output buffer.
- /// </summary>
- public virtual void Flush() {}
-
- /// <summary>
- /// Writes the value of the object's <see cref="System.Object.ToString">ToString</see>
- /// method to the listener you create when you implement the
- /// <see cref="TraceListener">TraceListener</see> class.
- /// </summary>
- /// <param name="o">
- /// An <see cref="System.Object">Object</see> whose fully qualified
- /// class name you want to write.
- /// </param>
- public virtual void Write(object o)
- {
-
- }
-
- /// <summary>
- /// When overridden in a derived class, writes the specified message to
- /// the listener you create in the derived class.
- /// </summary>
- /// <param name="message">
- /// A message to write.
- /// </param>
- public abstract void Write(string message);
-
- /// <summary>
- /// Writes a category name and the value of the object's
- /// <see cref="System.Object.ToString">ToString</see>
- /// method to the listener you create when you implement the
- /// <see cref="TraceListener">TraceListener</see> class.
- /// </summary>
- /// <param name="o">
- /// An <see cref="System.Object">Object</see> whose fully qualified
- /// class name you wish to write.
- /// </param>
- /// <param name="category">
- /// A category name used to organize the output.
- /// </param>
- public virtual void Write(object o, string category)
- {
-
- }
-
- /// <summary>
- /// Writes a category name and a message to the listener you create when
- /// you implement the <see cref="TraceListener">TraceListener</see> class.
- /// </summary>
- /// <param name="message">
- /// A message to write.
- /// </param>
- /// <param name="category">
- /// A category name used to organize the output.
- /// </param>
- public virtual void Write(string message, string category)
- {
-
- }
-
- /// <summary>
- /// Writes the value of the object's <see cref="System.Object.ToString">ToString</see>
- /// method to the listener you create when you implement the
- /// <see cref="TraceListener">TraceListener</see> class, followed by a line terminator.
- /// </summary>
- /// <param name="o">
- /// An <see cref="System.Object">Object</see> whose fully qualified
- /// class name you want to write.
- /// </param>
- public virtual void WriteLine(object o)
- {
-
- }
-
- /// <summary>
- /// When overridden in a derived class, writes the specified message to
- /// the listener you create in the derived class, followed by a line terminator.
- /// </summary>
- /// <param name="message">
- /// A message to write.
- /// </param>
- public abstract void WriteLine(string message);
-
- /// <summary>
- /// Writes a category name and the value of the object's
- /// <see cref="System.Object.ToString">ToString</see>
- /// method to the listener you create when you implement the
- /// <see cref="TraceListener">TraceListener</see> class, followed by a
- /// line terminator.
- /// </summary>
- /// <param name="o">
- /// An <see cref="System.Object">Object</see> whose fully qualified
- /// class name you wish to write.
- /// </param>
- /// <param name="category">
- /// A category name used to organize the output.
- /// </param>
- public virtual void WriteLine(object o, string category)
- {
-
- }
-
- /// <summary>
- /// Writes a category name and a message to the listener you create when
- /// you implement the <see cref="TraceListener">TraceListener</see> class,
- /// followed by a line terminator.
- /// </summary>
- /// <param name="message">
- /// A message to write.
- /// </param>
- /// <param name="category">
- /// A category name used to organize the output.
- /// </param>
- public virtual void WriteLine(string message, string category)
- {
-
- }
-
- /// <summary>
- /// Writes the indent to the listener you create when you implement this class,
- /// and resets the <see cref="NeedIndent">NeedIndent</see> Property to <b>false</b>.
- /// </summary>
- protected virtual void WriteIndent()
- {
-
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs b/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs
deleted file mode 100644
index 452b1b6c107..00000000000
--- a/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs
+++ /dev/null
@@ -1,290 +0,0 @@
-//
-// System.Diagnostics.TraceListenerCollection.cs
-//
-// Author: John R. Hicks <angryjohn69@nc.rr.com>
-//
-// (C) 2001
-//
-using System;
-using System.Collections;
-
-namespace System.Diagnostics
-{
-
- /// <summary>
- /// Provides a list of TraceListener objects.
- /// </summary>
- public class TraceListenerCollection : IList, ICollection,
- IEnumerable
- {
- private int count;
- private bool isReadOnly;
- private bool isFixedSize;
- private bool isSynchronized;
- private ArrayList listeners;
-
- /// <summary>
- /// Gets the first TraceListener in the list with the
- /// specified name.
- /// </summary>
- public TraceListener this[string name]
- {
- get
- {
- int index = listeners.IndexOf(name);
- return (TraceListener)listeners[index];
- }
- }
-
- public object this[int index]
- {
- get
- {
- return listeners[index];
- }
- set
- {
- listeners[index] = value;
- }
- }
-
- internal TraceListenerCollection()
- {
- count = 0;
- isReadOnly = false;
- isFixedSize = false;
- isSynchronized = false;
- listeners = new ArrayList();
- listeners.Add(new DefaultTraceListener());
- }
-
- /// <summary>
- /// Returns the number of items in the list
- /// </summary>
- /// <value>
- /// The number of items
- /// </value>
- public int Count
- {
- get
- {
- return count;
- }
- set
- {
- count = value;
- }
- }
-
- /// <summary>
- /// Adds a TraceListener to the list.
- /// </summary>
- /// <param name="listener">
- /// The TraceListener being added to the list.
- /// </param>
- /// <return>
- /// The position in the list where the listener was inserted.
- /// </return>
- public int Add(object listener)
- {
- return listeners.Add(listener);
- }
-
- /// <summary>
- /// Adds an array of TraceListeners to the list.
- /// </summary>
- /// <param name="value">
- /// Array of TraceListeners to add
- /// </param>
- public void AddRange(TraceListener[] value)
- {
- listeners.AddRange(value);
- }
-
- /// <summary>
- /// Adds the contents of another TraceListenerCollection to this one.
- /// </summary>
- /// <param name="value">
- /// The TraceListenerCollection to copy values from.
- /// </param>
- [MonoTODO]
- public void AddRange(TraceListenerCollection value)
- {
- // TODO: use an iterator to copy the objects.
- for(int i = 0; i < value.count; i++)
- {
- listeners.Add(value[i]);
- }
- }
-
- /// <summary>
- /// Clears all listeners from the list.
- /// </summary>
- public void Clear()
- {
- listeners.Clear();
- }
-
- /// <summary>
- /// Checks to see if the list contains the specified listener
- /// </summary>
- /// <param name="listener">
- /// The listener to search for.
- /// </param>
- /// <return>
- /// true if list contains listener; false otherwise.
- /// </return>
- public bool Contains(object listener)
- {
- return listeners.Contains(listener);
- }
-
- /// <summary>
- /// Copies a section of the current TraceListenerCollection to
- /// the specified array at the specified index.
- /// </summary>
- /// <param name="listeners">
- /// Array to copy listeners to.
- /// </param>
- /// <param name="index">
- /// Starting index of copy
- /// </param>
- [MonoTODO]
- public void CopyTo(Array listeners, int index)
- {
- try {
- this.listeners.CopyTo(listeners, index);
- } catch {
-
- }
- }
-
- /// <summary>
- /// Returns an enumerator for the list of listeners.
- /// </summary>
- /// <return>
- /// List Enumerator of type IEnumerator.
- /// </return>
- public IEnumerator GetEnumerator()
- {
- return listeners.GetEnumerator();
- }
-
- /// <summary>
- /// Gets the index of the specified listener.
- /// </summary>
- /// <param name="listener">
- /// The listener to search for
- /// </param>
- /// <return>
- /// The index of the listener in the list, if it exists.
- /// </return>
- [MonoTODO]
- public int IndexOf(object listener)
- {
- // TODO: we may have to add in some type-checking here.
- return listeners.IndexOf(listener);
- }
-
- /// <summary>
- /// Inserts the specified listener into the list at the specified index.
- /// </summary>
- /// <param name="index">
- /// Location in the list to insert the listener.
- /// </param>
- /// <param name="listener">
- /// The TraceListener to insert into the list.
- /// </param>
- public void Insert(int index, object listener)
- {
- listeners.Insert(index, listener);
- }
-
- /// <summary>
- /// Removes the listener with the specified name from the list, if it exists.
- /// </summary>
- /// <param name="name">
- /// Name of listener to remove
- /// </param>
- [MonoTODO]
- public void Remove(object name)
- {
- try {
- // TODO: may use an enumerator here.
- for(int i = 0; i < listeners.Count; i++)
- {
- TraceListener listener = (TraceListener) listeners[i];
- if(listener == null)
- continue;
- if(listener.Name.Equals(name))
- listeners.Remove(listener);
- }
- } catch {
- throw new ArgumentException("Listener is not in list.");
- }
- }
-
- /// <summary>
- /// Removes the specified listener from the list
- /// </summary>
- /// <param name="listener">
- /// The listener to remove.
- /// </param>
- public void Remove(TraceListener listener)
- {
- listeners.Remove(listener);
- }
-
- /// <summary>
- /// Removes the listener at the specified index.
- /// </summary>
- /// <param name="index">
- /// Location of the listener to remove.
- /// </param>
- public void RemoveAt(int index)
- {
- try {
- listeners.RemoveAt(index);
- } catch(Exception e) {
- throw new ArgumentOutOfRangeException(e.ToString());
- }
- }
-
- ~TraceListenerCollection()
- {
- listeners = null;
- }
-
- public bool IsReadOnly
- {
- get
- {
- return isReadOnly;
- }
- }
-
- public bool IsFixedSize
- {
- get
- {
- return isFixedSize;
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return isSynchronized;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/TraceSwitch.cs b/mcs/class/System/System.Diagnostics/TraceSwitch.cs
deleted file mode 100755
index 4b64d80e6ce..00000000000
--- a/mcs/class/System/System.Diagnostics/TraceSwitch.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// System.Diagnostics.TraceSwtich.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-
-namespace System.Diagnostics
-{
- /// <summary>
- /// Multi-level switch to provide tracing and debug output without
- /// recompiling.
- /// </summary>
- public class TraceSwitch : Switch
- {
- private TraceLevel level;
- private bool traceError = false;
- private bool traceInfo = false;
- private bool traceVerbose = false;
- private bool traceWarning = false;
-
- /// <summary>
- /// Initializes a new instance
- /// </summary>
- /// <param name="displayName">Name for the switch</param>
- /// <param name="description">Description of the switch</param>
- public TraceSwitch(string displayName, string description)
- : base(displayName, description)
- {
- }
-
- /// <summary>
- /// Gets or sets the trace level that specifies the messages to
- /// output for tracing and debugging.
- /// </summary>
- public TraceLevel Level
- {
- get
- {
- return level;
- }
- set
- {
- level = value;
- }
-
- }
-
- /// <summary>
- /// Gets a value indicating whether the Level is set to Error,
- /// Warning, Info, or Verbose.
- /// </summary>
- public bool TraceError
- {
- get
- {
- return traceError;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether the Level is set to Info or Verbose.
- /// </summary>
- public bool TraceInfo
- {
- get
- {
- return traceInfo;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether the Level is set to Verbose.
- /// </summary>
- public bool TraceVerbose
- {
- get
- {
- return traceVerbose;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether the Level is set to
- /// Warning, Info, or Verbose.
- /// </summary>
- public bool TraceWarning
- {
- get
- {
- return traceWarning;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Globalization/Locale.cs b/mcs/class/System/System.Globalization/Locale.cs
deleted file mode 100755
index 539184dbde4..00000000000
--- a/mcs/class/System/System.Globalization/Locale.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Globalization.Locale.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Globalization {
-
- internal class Locale {
-
- /// <summary>
- /// Returns the translated message for the current locale
- /// </summary>
- public static string GetText (string msg)
- {
- return msg;
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/AddressFamily.cs b/mcs/class/System/System.Net.Sockets/AddressFamily.cs
deleted file mode 100644
index c53fd8835b1..00000000000
--- a/mcs/class/System/System.Net.Sockets/AddressFamily.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// AddressFamily.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:31:59 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- [Serializable]
- public enum AddressFamily {
- Unknown = -1,
- Unspecified = 0,
- Unix = 1,
- InterNetwork = 2,
- ImpLink = 3,
- Pup = 4,
- Chaos = 5,
- NS = 6,
- Ipx = 6,
- Iso = 7,
- Osi = 7,
- Ecma = 8,
- DataKit = 9,
- Ccitt = 10,
- Sna = 11,
- DecNet = 12,
- DataLink = 13,
- Lat = 14,
- HyperChannel = 15,
- AppleTalk = 16,
- NetBios = 17,
- VoiceView = 18,
- FireFox = 19,
- Banyan = 21,
- Atm = 22,
- InterNetworkV6 = 23,
- Cluster = 24,
- Ieee12844 = 25,
- Irda = 26,
- NetworkDesigners = 28,
- Max = 29,
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/ChangeLog b/mcs/class/System/System.Net.Sockets/ChangeLog
deleted file mode 100644
index a1e31119dff..00000000000
--- a/mcs/class/System/System.Net.Sockets/ChangeLog
+++ /dev/null
@@ -1,33 +0,0 @@
-2002-02-13 Dick Porter <dick@ximian.com>
-
- * Socket.cs: Implemenent Select, Blocking, Connected,
- GetSocketOption, Poll, SetSocketOption and Shutdown
-
- * MulticastOption.cs:
- * LingerOption.cs: Delete override methods that don't need to be
- implemented
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * NetworkStream.cs: Implement class.
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * SocketException.cs: Implemented
-
- * Socket.cs: Implemented most methods
-
- * LingerOption.cs: Made compile
-
- * AddressFamily.cs: Removed empty auto-generated comments
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * SocketException.cs: Reimplemented.
-
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * ChangeLog : Add to this directory.
-
- * SocketException.cs, TcpClient.cs, TcpListener.cs : MonoTODO
- attribute decoration. \ No newline at end of file
diff --git a/mcs/class/System/System.Net.Sockets/LingerOption.cs b/mcs/class/System/System.Net.Sockets/LingerOption.cs
deleted file mode 100644
index 53dc8fa9292..00000000000
--- a/mcs/class/System/System.Net.Sockets/LingerOption.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Net.Sockets.LingerOption.cs
-//
-// Author:
-// Andrew Sutton
-//
-// (C) Andrew Sutton
-//
-
-using System;
-
-namespace System.Net.Sockets
-{
- // <remarks>
- // Encapsulates a linger option.
- // </remarks>
- public class LingerOption
- {
- // Don't change the names of these fields without also
- // changing socket-io.c in the runtime
- protected bool enabled;
- protected int seconds;
-
- public LingerOption (bool enable, int secs)
- {
- enabled = enable;
- seconds = secs;
- }
-
- public bool Enabled
- {
- get { return enabled; }
- set { enabled = value; }
- }
-
- public int LingerTime
- {
- get { return seconds; }
- set { seconds = value; }
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/MulticastOption.cs b/mcs/class/System/System.Net.Sockets/MulticastOption.cs
deleted file mode 100644
index 0018f0de8a8..00000000000
--- a/mcs/class/System/System.Net.Sockets/MulticastOption.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Net.Sockets.MulticastOption.cs
-//
-// Author:
-// Andrew Sutton
-//
-// (C) Andrew Sutton
-//
-
-using System;
-using System.Net;
-
-namespace System.Net.Sockets
-{
- // <remarks>
- // Encapsulates a multicast option
- // </remarks>
- public class MulticastOption
- {
- // Don't change the names of these fields without also
- // changing socket-io.c in the runtime
- protected IPAddress group;
- protected IPAddress local;
-
- public MulticastOption (IPAddress grp)
- {
- group = grp;
- }
-
- public MulticastOption (IPAddress grp, IPAddress addr)
- {
- group = grp;
- local = addr;
- }
-
- public IPAddress Group
- {
- get { return group; }
- set { group = value; }
- }
-
- public IPAddress LocalAddress
- {
- get { return local; }
- set { local = value; }
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/NetworkStream.cs b/mcs/class/System/System.Net.Sockets/NetworkStream.cs
deleted file mode 100644
index 38990bd8ec5..00000000000
--- a/mcs/class/System/System.Net.Sockets/NetworkStream.cs
+++ /dev/null
@@ -1,272 +0,0 @@
-//
-// System.Net.Sockets.NetworkStream.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.IO;
-
-namespace System.Net.Sockets
-{
- public class NetworkStream : Stream, IDisposable {
- FileAccess access;
- Socket socket;
- bool owns_socket;
- bool readable, writeable;
-
- public NetworkStream (Socket socket)
- : this (socket, FileAccess.ReadWrite, false)
- {
- }
-
- public NetworkStream (Socket socket, bool owns_socket)
- : this (socket, FileAccess.ReadWrite, owns_socket)
- {
- }
-
- public NetworkStream (Socket socket, FileAccess access)
- : this (socket, access, false)
- {
- }
-
- public NetworkStream (Socket socket, FileAccess access, bool owns_socket)
- {
- if (socket == null)
- throw new ArgumentNullException ();
- if (!socket.Connected)
- throw new ArgumentException ("Not connected", "socket");
- if (socket.SocketType != SocketType.Stream)
- throw new ArgumentException ("Socket is not of type Stream", "socket");
- if (!socket.Blocking)
- throw new IOException ();
-
- this.socket = socket;
- this.owns_socket = owns_socket;
- this.access = access;
-
- readable = CanRead;
- writeable = CanWrite;
- }
-
- public override bool CanRead {
- get {
- return access == FileAccess.ReadWrite || access == FileAccess.Read;
- }
- }
-
- public override bool CanSeek {
- get {
- // network sockets cant seek.
- return false;
- }
- }
-
- public override bool CanWrite {
- get {
- return access == FileAccess.ReadWrite || access == FileAccess.Write;
- }
- }
-
- public virtual bool DataAvailable {
- get {
- return socket.Available > 0;
- }
- }
-
- public override long Length {
- get {
- // Network sockets always throw an exception
- throw new NotSupportedException ();
- }
- }
-
- public override long Position {
- get {
- // Network sockets always throw an exception
- throw new NotSupportedException ();
- }
-
- set {
- // Network sockets always throw an exception
- throw new NotSupportedException ();
- }
- }
-
- protected bool Readable {
- get {
- return readable;
- }
-
- set {
- readable = value;
- }
- }
-
- protected Socket Socket {
- get {
- return socket;
- }
- }
-
- protected bool Writeable {
- get {
- return writeable;
- }
-
- set {
- writeable = value;
- }
- }
-
- public override IAsyncResult BeginRead (byte [] buffer, int offset, int size,
- AsyncCallback callback, object state)
- {
- IAsyncResult retval;
-
- if (buffer == null)
- throw new ArgumentNullException ();
- if (socket == null)
- throw new ObjectDisposedException ("socket");
- int len = buffer.Length;
- if (offset >= len || size != len)
- throw new ArgumentOutOfRangeException ();
-
- try {
- retval = socket.BeginReceive (buffer, offset, size, 0, callback, state);
- } catch {
- throw new IOException ("BeginReceive failure");
- }
-
- return retval;
- }
-
- public override IAsyncResult BeginWrite (byte [] buffer, int offset, int size,
- AsyncCallback callback, object state)
- {
- IAsyncResult retval;
-
- if (buffer == null)
- throw new ArgumentNullException ();
- if (socket == null)
- throw new ObjectDisposedException ("socket");
- int len = buffer.Length;
- if (len < size)
- throw new ArgumentException ();
-
- try {
- retval = socket.BeginSend (buffer, offset, size, 0, callback, state);
- } catch {
- throw new IOException ("BeginWrite failure");
- }
-
- return retval;
- }
-
- ~NetworkStream ()
- {
- Dispose (false);
- }
-
- public override void Close ()
- {
- Dispose (true);
- }
-
- public virtual void Dispose (bool disposing)
- {
- if (owns_socket)
- if (socket != null)
- socket.Close ();
- socket = null;
- }
-
- public override int EndRead (IAsyncResult ar)
- {
- int res;
-
- if (ar == null)
- throw new ArgumentNullException ();
- if (socket == null)
- throw new ObjectDisposedException ("socket");
-
- try {
- res = socket.EndReceive (ar);
- } catch {
- throw new IOException ("EndRead failure");
- }
- return res;
- }
-
- public override void EndWrite (IAsyncResult ar)
- {
- if (ar == null)
- throw new ArgumentNullException ();
- if (socket == null)
- throw new ObjectDisposedException ("socket");
-
- try {
- socket.EndSend (ar);
- } catch {
- throw new IOException ("EndWrite failure");
- }
- }
-
- public override void Flush ()
- {
- // network streams are non-buffered, this is a no-op
- }
-
- void IDisposable.Dispose ()
- {
- Dispose (true);
- }
-
- public override int Read (byte [] buffer, int offset, int size)
- {
- int res;
-
- if (buffer == null)
- throw new ArgumentNullException ();
- if (buffer.Length < size)
- throw new ArgumentException ();
-
- try {
- res = socket.Receive (buffer, offset, size, 0);
- } catch {
- throw new IOException ("Read failure");
- }
- return res;
- }
-
- public override long Seek (long offset, SeekOrigin origin)
- {
- // NetworkStream objects do not support seeking.
-
- throw new NotSupportedException ();
- }
-
- public override void SetLength (long value)
- {
- // NetworkStream objects do not support SetLength
-
- throw new NotSupportedException ();
- }
-
- public override void Write (byte [] buffer, int offset, int size)
- {
- if (buffer == null)
- throw new ArgumentNullException ();
- if (buffer.Length < size)
- throw new ArgumentException ();
- try {
- socket.Send (buffer, offset, size, 0);
- } catch {
- throw new IOException ("Write failure");
- }
- }
-
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/ProtocolFamily.cs b/mcs/class/System/System.Net.Sockets/ProtocolFamily.cs
deleted file mode 100644
index 3b0777e6e54..00000000000
--- a/mcs/class/System/System.Net.Sockets/ProtocolFamily.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Net.Sockets.ProtocolFamily.cs
-//
-// Author:
-// Andrew Sutton
-//
-// (C) Andrew Sutton
-//
-
-namespace System.Net.Sockets
-{
- public enum ProtocolFamily
- {
- AppleTalk,
- Atm,
- Banyan,
- Ccitt,
- Chaos,
- Cluster,
- DataKit,
- DataLink,
- DecNet,
- Ecma,
- FireFox,
- HyperChannel,
- Ieee12844,
- ImpLink,
- InterNetwork,
- InterNetworkV6,
- Ipx,
- Irda,
- Iso,
- Lat,
- Max,
- NetBios,
- NetworkDesigners,
- NS,
- Osi,
- Pup,
- Sna,
- Unix,
- Unknown,
- Unspecified,
- VoiceView
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/ProtocolType.cs b/mcs/class/System/System.Net.Sockets/ProtocolType.cs
deleted file mode 100644
index 0b106e5f946..00000000000
--- a/mcs/class/System/System.Net.Sockets/ProtocolType.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-// ProtocolType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:32:24 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum ProtocolType {
-
- /// <summary>
- /// </summary>
- IP = 0,
-
- /// <summary>
- /// </summary>
- Icmp = 1,
-
- /// <summary>
- /// </summary>
- Igmp = 2,
-
- /// <summary>
- /// </summary>
- Ggp = 3,
-
- /// <summary>
- /// </summary>
- Tcp = 6,
-
- /// <summary>
- /// </summary>
- Pup = 12,
-
- /// <summary>
- /// </summary>
- Udp = 17,
-
- /// <summary>
- /// </summary>
- Idp = 22,
-
- /// <summary>
- /// </summary>
- ND = 77,
-
- /// <summary>
- /// </summary>
- Raw = 255,
-
- /// <summary>
- /// </summary>
- Unspecified = 0,
-
- /// <summary>
- /// </summary>
- Ipx = 1000,
-
- /// <summary>
- /// </summary>
- Spx = 1256,
-
- /// <summary>
- /// </summary>
- SpxII = 1257,
-
- /// <summary>
- /// </summary>
- Unknown = -1,
- } // ProtocolType
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SelectMode.cs b/mcs/class/System/System.Net.Sockets/SelectMode.cs
deleted file mode 100644
index 587f2a1d1b6..00000000000
--- a/mcs/class/System/System.Net.Sockets/SelectMode.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// SelectMode.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:32:30 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SelectMode {
-
- /// <summary>
- /// </summary>
- SelectRead = 0,
-
- /// <summary>
- /// </summary>
- SelectWrite = 1,
-
- /// <summary>
- /// </summary>
- SelectError = 2,
- } // SelectMode
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs
deleted file mode 100644
index e238e410db7..00000000000
--- a/mcs/class/System/System.Net.Sockets/Socket.cs
+++ /dev/null
@@ -1,937 +0,0 @@
-// System.Net.Sockets.Socket.cs
-//
-// Authors:
-// Phillip Pearson (pp@myelin.co.nz)
-// Dick Porter <dick@ximian.com>
-//
-// Copyright (C) 2001, 2002 Phillip Pearson and Ximian, Inc.
-// http://www.myelin.co.nz
-//
-
-using System;
-using System.Net;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Threading;
-
-namespace System.Net.Sockets
-{
- public class Socket : IDisposable
- {
- private sealed class SocketAsyncResult: IAsyncResult
- {
- private object state;
- private WaitHandle waithandle;
- private bool completed_sync, completed;
- private Worker worker;
-
- public SocketAsyncResult(object state) {
- this.state=state;
- waithandle=new ManualResetEvent(false);
- completed_sync=completed=false;
- }
-
- public object AsyncState {
- get {
- return(state);
- }
- }
-
- public WaitHandle AsyncWaitHandle {
- get {
- return(waithandle);
- }
- set {
- waithandle=value;
- }
- }
-
- public bool CompletedSynchronously {
- get {
- return(completed_sync);
- }
- }
-
- public bool IsCompleted {
- get {
- return(completed);
- }
- set {
- completed=value;
- }
- }
-
- public Worker Worker {
- get {
- return(worker);
- }
- set {
- worker=value;
- }
- }
- }
-
- private sealed class Worker
- {
- private AsyncCallback callback;
- private SocketAsyncResult result;
- private Socket socket;
-
- // Parameters
- private EndPoint endpoint; // Connect,ReceiveFrom,SendTo
- private byte[] buffer; // Receive,ReceiveFrom,Send,SendTo
- private int offset; // Receive,ReceiveFrom,Send,SendTo
- private int size; // Receive,ReceiveFrom,Send,SendTo
- private SocketFlags sockflags; // Receive,ReceiveFrom,Send,SendTo
-
- // Return values
- private Socket acc_socket;
- private int total;
-
-
- // For Accept
- public Worker(Socket req_sock,
- AsyncCallback req_callback,
- SocketAsyncResult req_result)
- : this(req_sock, null, 0, 0, SocketFlags.None,
- null, req_callback, req_result) {}
-
- // For Connect
- public Worker(Socket req_sock, EndPoint req_endpoint,
- AsyncCallback req_callback,
- SocketAsyncResult req_result)
- : this(req_sock, null, 0, 0, SocketFlags.None,
- req_endpoint, req_callback,
- req_result) {}
-
- // For Receive and Send
- public Worker(Socket req_sock, byte[] req_buffer,
- int req_offset, int req_size,
- SocketFlags req_sockflags,
- AsyncCallback req_callback,
- SocketAsyncResult req_result)
- : this(req_sock, req_buffer, req_offset,
- req_size, req_sockflags, null,
- req_callback, req_result) {}
-
- // For ReceiveFrom and SendTo
- public Worker(Socket req_sock, byte[] req_buffer,
- int req_offset, int req_size,
- SocketFlags req_sockflags,
- EndPoint req_endpoint,
- AsyncCallback req_callback,
- SocketAsyncResult req_result) {
- socket=req_sock;
- buffer=req_buffer;
- offset=req_offset;
- size=req_size;
- sockflags=req_sockflags;
- endpoint=req_endpoint;
- callback=req_callback;
- result=req_result;
- }
-
- private void End() {
- callback(result);
- ((ManualResetEvent)result.AsyncWaitHandle).Set();
- result.IsCompleted=true;
- }
-
- public void Accept() {
- lock(result) {
- acc_socket=socket.Accept();
- End();
- }
- }
-
- public void Connect() {
- lock(result) {
- socket.Connect(endpoint);
- End();
- }
- }
-
- public void Receive() {
- lock(result) {
- total=socket.Receive(buffer, offset,
- size, sockflags);
- End();
- }
- }
-
- public void ReceiveFrom() {
- lock(result) {
- total=socket.ReceiveFrom(buffer,
- offset, size,
- sockflags,
- ref endpoint);
- End();
- }
- }
-
- public void Send() {
- lock(result) {
- total=socket.Send(buffer, offset, size,
- sockflags);
- End();
- }
- }
-
- public void SendTo() {
- lock(result) {
- total=socket.SendTo(buffer, offset,
- size, sockflags,
- endpoint);
- End();
- }
- }
-
- public EndPoint EndPoint {
- get {
- return(endpoint);
- }
- }
-
- public Socket Socket {
- get {
- return(acc_socket);
- }
- }
-
- public int Total {
- get {
- return(total);
- }
- }
- }
-
- /* the field "socket" is looked up by name by the runtime */
- private IntPtr socket;
- private AddressFamily address_family;
- private SocketType socket_type;
- private ProtocolType protocol_type;
- private bool blocking=true;
-
- /* When true, the socket was connected at the time of
- * the last IO operation
- */
- private bool connected=false;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Select_internal(ref Socket[] read,
- ref Socket[] write,
- ref Socket[] err,
- int timeout);
-
- public static void Select(IList read_list, IList write_list,
- IList err_list, int time_us) {
- if(read_list==null &&
- write_list==null &&
- err_list==null) {
- throw new ArgumentNullException();
- }
-
- int read_count, write_count, err_count;
-
- if(read_list!=null) {
- read_count=read_list.Count;
- } else {
- read_count=0;
- }
-
- if(write_list!=null) {
- write_count=write_list.Count;
- } else {
- write_count=0;
- }
-
- if(err_list!=null) {
- err_count=err_list.Count;
- } else {
- err_count=0;
- }
-
- Socket[] read_arr=new Socket[read_count];
- Socket[] write_arr=new Socket[write_count];
- Socket[] err_arr=new Socket[err_count];
-
- int i;
-
- if(read_list!=null) {
- i=0;
-
- foreach (Socket s in read_list) {
- read_arr[i]=s;
- i++;
- }
- }
-
- if(write_list!=null) {
- i=0;
- foreach (Socket s in write_list) {
- write_arr[i]=s;
- i++;
- }
- }
-
- if(err_list!=null) {
- i=0;
- foreach (Socket s in err_list) {
- err_arr[i]=s;
- i++;
- }
- }
-
- Select_internal(ref read_arr, ref write_arr,
- ref err_arr, time_us);
-
- if(read_list!=null) {
- read_list.Clear();
- for(i=0; i<read_arr.Length; i++) {
- read_list.Add(read_arr[i]);
- }
- }
-
- if(write_list!=null) {
- write_list.Clear();
- for(i=0; i<write_arr.Length; i++) {
- write_list.Add(write_arr[i]);
- }
- }
-
- if(err_list!=null) {
- err_list.Clear();
- for(i=0; i<err_arr.Length; i++) {
- err_list.Add(err_arr[i]);
- }
- }
- }
-
- // private constructor used by Accept, which already
- // has a socket handle to use
- private Socket(AddressFamily family, SocketType type,
- ProtocolType proto, IntPtr sock) {
- address_family=family;
- socket_type=type;
- protocol_type=proto;
-
- socket=sock;
- connected=true;
- }
-
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern IntPtr Socket_internal(AddressFamily family,
- SocketType type,
- ProtocolType proto);
-
- public Socket(AddressFamily family, SocketType type,
- ProtocolType proto) {
- address_family=family;
- socket_type=type;
- protocol_type=proto;
-
- socket=Socket_internal(family, type, proto);
- }
-
- public AddressFamily AddressFamily {
- get {
- return(address_family);
- }
- }
-
- // Returns the amount of data waiting to be read on socket
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Available_internal(IntPtr socket);
-
- public int Available {
- get {
- return(Available_internal(socket));
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Blocking_internal(IntPtr socket,
- bool block);
-
- public bool Blocking {
- get {
- return(blocking);
- }
- set {
- Blocking_internal(socket, value);
- blocking=value;
- }
- }
-
- public bool Connected {
- get {
- return(connected);
- }
- }
-
- public IntPtr Handle {
- get {
- return(socket);
- }
- }
-
- // Returns the local endpoint details in addr and port
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static SocketAddress LocalEndPoint_internal(IntPtr socket);
-
- [MonoTODO("Support non-IP endpoints")]
- public EndPoint LocalEndPoint {
- get {
- SocketAddress sa;
-
- sa=LocalEndPoint_internal(socket);
-
- if(sa.Family==AddressFamily.InterNetwork) {
- // Stupidly, EndPoint.Create() is an
- // instance method
- return new IPEndPoint(0, 0).Create(sa);
- } else {
- throw new NotImplementedException();
- }
- }
- }
-
- public ProtocolType ProtocolType {
- get {
- return(protocol_type);
- }
- }
-
- // Returns the remote endpoint details in addr and port
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static SocketAddress RemoteEndPoint_internal(IntPtr socket);
-
- [MonoTODO("Support non-IP endpoints")]
- public EndPoint RemoteEndPoint {
- get {
- SocketAddress sa;
-
- sa=RemoteEndPoint_internal(socket);
-
- if(sa.Family==AddressFamily.InterNetwork) {
- // Stupidly, EndPoint.Create() is an
- // instance method
- return new IPEndPoint(0, 0).Create(sa);
- } else {
- throw new NotImplementedException();
- }
- }
- }
-
- public SocketType SocketType {
- get {
- return(socket_type);
- }
- }
-
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static IntPtr Accept_internal(IntPtr sock);
-
- public Socket Accept() {
- IntPtr sock=Accept_internal(socket);
-
- return(new Socket(this.AddressFamily, this.SocketType,
- this.ProtocolType, sock));
- }
-
- public IAsyncResult BeginAccept(AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, callback, req);
- Thread child=new Thread(new ThreadStart(worker.Accept));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginConnect(EndPoint end_point,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, end_point, callback,
- req);
- Thread child=new Thread(new ThreadStart(worker.Connect));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginReceive(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, buffer, offset, size,
- socket_flags, callback, req);
- Thread child=new Thread(new ThreadStart(worker.Receive));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginReceiveFrom(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- ref EndPoint remote_end,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, buffer, offset, size,
- socket_flags, remote_end,
- callback, req);
- Thread child=new Thread(new ThreadStart(worker.ReceiveFrom));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginSend(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, buffer, offset, size,
- socket_flags, callback, req);
- Thread child=new Thread(new ThreadStart(worker.Send));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginSendTo(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- EndPoint remote_end,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, buffer, offset, size,
- socket_flags, remote_end,
- callback, req);
- Thread child=new Thread(new ThreadStart(worker.SendTo));
- child.Start();
- return(req);
- }
-
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Bind_internal(IntPtr sock,
- SocketAddress sa);
-
- public void Bind(EndPoint local_end) {
- if(local_end==null) {
- throw new ArgumentNullException();
- }
-
- Bind_internal(socket, local_end.Serialize());
- }
-
- // Closes the socket
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Close_internal(IntPtr socket);
-
- public void Close() {
- connected=false;
- Close_internal(socket);
- }
-
- // Connects to the remote address
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Connect_internal(IntPtr sock,
- SocketAddress sa);
-
- public void Connect(EndPoint remote_end) {
- if(remote_end==null) {
- throw new ArgumentNullException();
- }
-
- Connect_internal(socket, remote_end.Serialize());
- connected=true;
- }
-
- public Socket EndAccept(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- return(req.Worker.Socket);
- }
-
- public void EndConnect(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- }
-
- public int EndReceive(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- return(req.Worker.Total);
- }
-
- public int EndReceiveFrom(IAsyncResult result,
- ref EndPoint end_point) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- end_point=req.Worker.EndPoint;
- return(req.Worker.Total);
- }
-
- public int EndSend(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- return(req.Worker.Total);
- }
-
- public int EndSendTo(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- return(req.Worker.Total);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void GetSocketOption_obj_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, out object obj_val);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void GetSocketOption_arr_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val);
-
- public object GetSocketOption(SocketOptionLevel level,
- SocketOptionName name) {
- object obj_val;
-
- GetSocketOption_obj_internal(socket, level, name,
- out obj_val);
-
- if(name==SocketOptionName.Linger) {
- return((LingerOption)obj_val);
- } else if (name==SocketOptionName.AddMembership ||
- name==SocketOptionName.DropMembership) {
- return((MulticastOption)obj_val);
- } else {
- return((int)obj_val);
- }
- }
-
- public void GetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- byte[] opt_value) {
- int opt_value_len=opt_value.Length;
-
- GetSocketOption_arr_internal(socket, level, name,
- ref opt_value);
- }
-
- public byte[] GetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- int length) {
- byte[] byte_val=new byte[length];
-
- GetSocketOption_arr_internal(socket, level, name,
- ref byte_val);
-
- return(byte_val);
- }
-
- [MonoTODO("Totally undocumented")]
- public int IOControl(int ioctl_code, byte[] in_value,
- byte[] out_value) {
- throw new NotImplementedException();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Listen_internal(IntPtr sock,
- int backlog);
-
- public void Listen(int backlog) {
- Listen_internal(socket, backlog);
- }
-
- /* The docs for Poll() are a bit lightweight too, but
- * it seems to be just a simple wrapper around Select.
- */
- public bool Poll(int time_us, SelectMode mode) {
- ArrayList socketlist=new ArrayList(1);
-
- socketlist.Add(socket);
-
- switch(mode) {
- case SelectMode.SelectError:
- Select(null, null, socketlist, time_us);
- break;
- case SelectMode.SelectRead:
- Select(socketlist, null, null, time_us);
- break;
- case SelectMode.SelectWrite:
- Select(null, socketlist, null, time_us);
- break;
- default:
- throw new NotSupportedException();
- }
-
- if(socketlist.Contains(socket)) {
- return(true);
- } else {
- return(false);
- }
- }
-
- public int Receive(byte[] buf) {
- return(Receive(buf, 0, buf.Length, SocketFlags.None));
- }
-
- public int Receive(byte[] buf, SocketFlags flags) {
- return(Receive(buf, 0, buf.Length, flags));
- }
-
- public int Receive(byte[] buf, int size, SocketFlags flags) {
- return(Receive(buf, 0, size, flags));
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Receive_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags);
-
- public int Receive(byte[] buf, int offset, int size,
- SocketFlags flags) {
- if(buf==null) {
- throw new ArgumentNullException();
- }
- if(offset+size>buf.Length) {
- throw new ArgumentException();
- }
-
- int ret;
-
- try {
- ret=Receive_internal(socket, buf, offset,
- size, flags);
- } catch(SocketException) {
- connected=false;
- throw;
- }
- connected=true;
-
- return(ret);
- }
-
- public int ReceiveFrom(byte[] buf, ref EndPoint remote_end) {
- return(ReceiveFrom(buf, 0, buf.Length,
- SocketFlags.None, ref remote_end));
- }
-
- public int ReceiveFrom(byte[] buf, SocketFlags flags,
- ref EndPoint remote_end) {
- return(ReceiveFrom(buf, 0, buf.Length, flags,
- ref remote_end));
- }
-
- public int ReceiveFrom(byte[] buf, int size, SocketFlags flags,
- ref EndPoint remote_end) {
- return(ReceiveFrom(buf, 0, size, flags,
- ref remote_end));
- }
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int RecvFrom_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- ref SocketAddress sockaddr);
-
- public int ReceiveFrom(byte[] buf, int offset, int size,
- SocketFlags flags,
- ref EndPoint remote_end) {
- if(buf==null || remote_end==null) {
- throw new ArgumentNullException();
- }
- if(offset+size>buf.Length) {
- throw new ArgumentException();
- }
-
- SocketAddress sockaddr=remote_end.Serialize();
- int count;
-
- try {
- count=RecvFrom_internal(socket, buf, offset,
- size, flags,
- ref sockaddr);
- } catch(SocketException) {
- connected=false;
- throw;
- }
- connected=true;
-
- // Stupidly, EndPoint.Create() is an
- // instance method
- remote_end=remote_end.Create(sockaddr);
-
- return(count);
- }
-
- public int Send(byte[] buf) {
- return(Send(buf, 0, buf.Length, SocketFlags.None));
- }
-
- public int Send(byte[] buf, SocketFlags flags) {
- return(Send(buf, 0, buf.Length, flags));
- }
-
- public int Send(byte[] buf, int size, SocketFlags flags) {
- return(Send(buf, 0, size, flags));
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Send_internal(IntPtr sock,
- byte[] buf, int offset,
- int count,
- SocketFlags flags);
-
- public int Send(byte[] buf, int offset, int size,
- SocketFlags flags) {
- if(buf==null) {
- throw new ArgumentNullException();
- }
- if(offset+size>buf.Length) {
- throw new ArgumentException();
- }
-
- int ret;
-
- try {
- ret=Send_internal(socket, buf, offset, size,
- flags);
- } catch(SocketException) {
- connected=false;
- throw;
- }
- connected=true;
-
- return(ret);
- }
-
- public int SendTo(byte[] buffer, EndPoint remote_end) {
- return(SendTo(buffer, 0, buffer.Length,
- SocketFlags.None, remote_end));
- }
-
- public int SendTo(byte[] buffer, SocketFlags flags,
- EndPoint remote_end) {
- return(SendTo(buffer, 0, buffer.Length, flags,
- remote_end));
- }
-
- public int SendTo(byte[] buffer, int size, SocketFlags flags,
- EndPoint remote_end) {
- return(SendTo(buffer, size, buffer.Length, flags,
- remote_end));
- }
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int SendTo_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- SocketAddress sa);
-
- public int SendTo(byte[] buffer, int offset, int size,
- SocketFlags flags, EndPoint remote_end) {
- if(buffer==null || remote_end==null) {
- throw new ArgumentNullException();
- }
- if(offset+size>buffer.Length) {
- throw new ArgumentException();
- }
-
- SocketAddress sockaddr=remote_end.Serialize();
-
- int ret;
-
- try {
- ret=SendTo_internal(socket, buffer, offset,
- size, flags, sockaddr);
- }
- catch(SocketException) {
- connected=false;
- throw;
- }
- connected=true;
-
- return(ret);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void SetSocketOption_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, object obj_val, byte[] byte_val, int int_val);
-
- public void SetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- byte[] opt_value) {
- SetSocketOption_internal(socket, level, name, null,
- opt_value, 0);
- }
-
- public void SetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- int opt_value) {
- SetSocketOption_internal(socket, level, name, null,
- null, opt_value);
- }
-
- public void SetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- object opt_value) {
- if(opt_value==null) {
- throw new ArgumentNullException();
- }
-
- SetSocketOption_internal(socket, level, name,
- opt_value, null, 0);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Shutdown_internal(IntPtr socket, SocketShutdown how);
-
- public void Shutdown(SocketShutdown how) {
- Shutdown_internal(socket, how);
- }
-
- private bool disposed = false;
-
- protected virtual void Dispose(bool explicitDisposing) {
- // Check to see if Dispose has already been called
- if(!this.disposed) {
- // If this is a call to Dispose,
- // dispose all managed resources.
- if(explicitDisposing) {
- // Free up stuff here
- }
-
- // Release unmanaged resources
- this.disposed=true;
- this.Close();
- }
- }
-
- public void Dispose() {
- Dispose(true);
- // Take yourself off the Finalization queue
- GC.SuppressFinalize(this);
- }
-
- ~Socket () {
- Dispose(false);
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/SocketException.cs b/mcs/class/System/System.Net.Sockets/SocketException.cs
deleted file mode 100644
index 161a7cf27ae..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketException.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Net.Sockets.NetworkStream.cs
-//
-// Author:
-// Dick Porter <dick@ximian.com>
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.Serialization;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-
-namespace System.Net.Sockets
-{
- [Serializable]
- public class SocketException : Win32Exception
- {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int WSAGetLastError_internal();
-
- public SocketException ()
- : base (WSAGetLastError_internal()) {
- }
-
- public SocketException (int error)
- : base (error) {
- }
-
- protected SocketException (SerializationInfo info,
- StreamingContext context)
- : base (info, context) {
- }
-
- public override int ErrorCode {
- get {
- return NativeErrorCode;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/SocketFlags.cs b/mcs/class/System/System.Net.Sockets/SocketFlags.cs
deleted file mode 100644
index 8e958d47c05..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketFlags.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// SocketFlags.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:32:49 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum SocketFlags {
-
- /// <summary>
- /// </summary>
- None = 0x00000000,
-
- /// <summary>
- /// </summary>
- OutOfBand = 0x00000001,
-
- /// <summary>
- /// </summary>
- Peek = 0x00000002,
-
- /// <summary>
- /// </summary>
- DontRoute = 0x00000004,
-
- /// <summary>
- /// </summary>
- Partial = 0x00008000,
- } // SocketFlags
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs b/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs
deleted file mode 100644
index 657a4532154..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// SocketOptionLevel.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:32:55 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SocketOptionLevel {
-
- /// <summary>
- /// </summary>
- Socket = 65535,
-
- /// <summary>
- /// </summary>
- IP = 0,
-
- /// <summary>
- /// </summary>
- Tcp = 6,
-
- /// <summary>
- /// </summary>
- Udp = 17,
- } // SocketOptionLevel
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SocketOptionName.cs b/mcs/class/System/System.Net.Sockets/SocketOptionName.cs
deleted file mode 100644
index 117c7fc0225..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketOptionName.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-// SocketOptionName.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:33:02 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SocketOptionName {
-
- /// <summary>
- /// </summary>
- Debug = 1,
-
- /// <summary>
- /// </summary>
- AcceptConnection = 2,
-
- /// <summary>
- /// </summary>
- ReuseAddress = 4,
-
- /// <summary>
- /// </summary>
- KeepAlive = 8,
-
- /// <summary>
- /// </summary>
- DontRoute = 16,
-
- /// <summary>
- /// </summary>
- Broadcast = 32,
-
- /// <summary>
- /// </summary>
- UseLoopback = 64,
-
- /// <summary>
- /// </summary>
- Linger = 128,
-
- /// <summary>
- /// </summary>
- OutOfBandInline = 256,
-
- /// <summary>
- /// </summary>
- DontLinger = -129,
-
- /// <summary>
- /// </summary>
- ExclusiveAddressUse = -5,
-
- /// <summary>
- /// </summary>
- SendBuffer = 4097,
-
- /// <summary>
- /// </summary>
- ReceiveBuffer = 4098,
-
- /// <summary>
- /// </summary>
- SendLowWater = 4099,
-
- /// <summary>
- /// </summary>
- ReceiveLowWater = 4100,
-
- /// <summary>
- /// </summary>
- SendTimeout = 4101,
-
- /// <summary>
- /// </summary>
- ReceiveTimeout = 4102,
-
- /// <summary>
- /// </summary>
- Error = 4103,
-
- /// <summary>
- /// </summary>
- Type = 4104,
-
- /// <summary>
- /// </summary>
- MaxConnections = 2147483647,
-
- /// <summary>
- /// </summary>
- IPOptions = 1,
-
- /// <summary>
- /// </summary>
- HeaderIncluded = 2,
-
- /// <summary>
- /// </summary>
- TypeOfService = 3,
-
- /// <summary>
- /// </summary>
- IpTimeToLive = 4,
-
- /// <summary>
- /// </summary>
- MulticastInterface = 9,
-
- /// <summary>
- /// </summary>
- MulticastTimeToLive = 10,
-
- /// <summary>
- /// </summary>
- MulticastLoopback = 11,
-
- /// <summary>
- /// </summary>
- AddMembership = 12,
-
- /// <summary>
- /// </summary>
- DropMembership = 13,
-
- /// <summary>
- /// </summary>
- DontFragment = 14,
-
- /// <summary>
- /// </summary>
- AddSourceMembership = 15,
-
- /// <summary>
- /// </summary>
- DropSourceMembership = 16,
-
- /// <summary>
- /// </summary>
- BlockSource = 17,
-
- /// <summary>
- /// </summary>
- UnblockSource = 18,
-
- /// <summary>
- /// </summary>
- PacketInformation = 19,
-
- /// <summary>
- /// </summary>
- NoDelay = 1,
-
- /// <summary>
- /// </summary>
- BsdUrgent = 2,
-
- /// <summary>
- /// </summary>
- Expedited = 2,
-
- /// <summary>
- /// </summary>
- NoChecksum = 1,
-
- /// <summary>
- /// </summary>
- ChecksumCoverage = 20,
- } // SocketOptionName
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SocketShutdown.cs b/mcs/class/System/System.Net.Sockets/SocketShutdown.cs
deleted file mode 100644
index 0f9e5f269dc..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketShutdown.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// SocketShutdown.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:32:43 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SocketShutdown {
-
- /// <summary>
- /// </summary>
- Receive = 0,
-
- /// <summary>
- /// </summary>
- Send = 1,
-
- /// <summary>
- /// </summary>
- Both = 2,
- } // SocketShutdown
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SocketType.cs b/mcs/class/System/System.Net.Sockets/SocketType.cs
deleted file mode 100644
index bdb6c54d3c2..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketType.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// SocketType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:32:37 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SocketType {
-
- /// <summary>
- /// </summary>
- Stream = 1,
-
- /// <summary>
- /// </summary>
- Dgram = 2,
-
- /// <summary>
- /// </summary>
- Raw = 3,
-
- /// <summary>
- /// </summary>
- Rdm = 4,
-
- /// <summary>
- /// </summary>
- Seqpacket = 5,
-
- /// <summary>
- /// </summary>
- Unknown = -1,
- } // SocketType
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/TcpClient.cs b/mcs/class/System/System.Net.Sockets/TcpClient.cs
deleted file mode 100755
index 452869c7137..00000000000
--- a/mcs/class/System/System.Net.Sockets/TcpClient.cs
+++ /dev/null
@@ -1,321 +0,0 @@
-// System.Net.Sockets.TcpClient.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-// NB: This is untested (probably buggy) code - take care if using it
-
-using System;
-using System.Net;
-
-namespace System.Net.Sockets
-{
- /// <remarks>
- /// A slightly more abstracted way to create an
- /// outgoing network connections than a Socket.
- /// </remarks>
- public class TcpClient : IDisposable
- {
- // private data
-
- private NetworkStream stream;
- private bool active;
- private Socket client;
- private bool disposed = false;
-
- // constructor
-
- /// <summary>
- /// Some code that is shared between the constructors.
- /// </summary>
- private void Init ()
- {
- active = false;
- client = new Socket(AddressFamily.InterNetwork,
- SocketType.Stream, ProtocolType.Tcp);
- }
-
- /// <summary>
- /// Constructs a new TcpClient with no connection set up
- /// </summary>
- public TcpClient ()
- {
- Init();
- client.Bind(new IPEndPoint(IPAddress.Any, 0));
- }
-
- /// <summary>
- /// Constructs a new TcpClient with a specified local endpoint.
- /// Use this if you want to have your connections originating
- /// from a certain port, or a certain IP (on a multi homed
- /// system).
- /// </summary>
- /// <param name="local_end_point">The aforementioned local endpoint</param>
- public TcpClient (IPEndPoint local_end_point)
- {
- Init();
- client.Bind(local_end_point);
- }
-
- /// <summary>
- /// Constructs a new TcpClient and connects to a specified
- /// host on a specified port. A quick way to set up a network
- /// connection.
- /// </summary>
- /// <param name="hostname">The host to connect to, e.g.
- /// 192.168.0.201 or www.myelin.co.nz</param>
- /// <param name="port">The port to connect to, e.g. 80 for HTTP</param>
- public TcpClient (string hostname, int port)
- {
- Init();
- client.Bind(new IPEndPoint(IPAddress.Any, 0));
- Connect(hostname, port);
- }
-
- /// <summary>
- /// A flag that is 'true' if the TcpClient has an active connection
- /// </summary>
- protected bool Active
- {
- get { return active; }
- set { active = value; }
- }
-
- /// <summary>
- /// The socket that all network comms passes through
- /// </summary>
- [MonoTODO]
- protected Socket Client
- {
- get { return client; }
- set { client = value; } //TODO: should we be able to set the socket like this?
- }
-
- /// <summary>
- /// Internal function to allow TcpListener.AcceptTcpClient
- /// to work (it needs to be able to set protected property
- /// 'Client')
- /// </summary>
- /// <param name="s"></param>
- internal void SetTcpClient (Socket s)
- {
- Client = s; // client or Client? They are the same at the moment
- }
-
- /// <summary>
- /// If set, the socket will remain open after it has been
- /// instructed to close, in order to send data that remains
- /// in the buffer.
- /// </summary>
- public LingerOption LingerState
- {
- get {
- return (LingerOption)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.Linger);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.Linger, value);
- }
- }
-
- /// <summary>
- /// <p>If set, outbound data will be sent at once rather than collected
- /// until enough is available to fill a packet.</p>
- ///
- /// <p>This is the TCP_NODELAY sockopt from BSD sockets and WinSock.
- /// For more information, look up the Nagle algorithm.</p>
- /// </summary>
- public bool NoDelay
- {
- get {
- return (bool)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.NoDelay);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.NoDelay, value);
- }
- }
-
- /// <summary>
- /// How big the receive buffer is (from the connection socket)
- /// </summary>
- public int ReceiveBufferSize
- {
- get {
- return (int)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveBuffer);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveBuffer, value);
- }
- }
-
- /// <summary>
- /// How long before the socket will time out on a
- /// Receive() call
- /// </summary>
- public int ReceiveTimeout
- {
- get {
- return (int)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveTimeout);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveTimeout, value);
- }
- }
-
- /// <summary>
- /// How big the send buffer is (from the connection socket)
- /// </summary>
- public int SendBufferSize
- {
- get {
- return (int)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendBuffer);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendBuffer, value);
- }
- }
-
- /// <summary>
- /// How long before the socket will time out on a
- /// Send() call
- /// </summary>
- public int SendTimeout
- {
- get {
- return (int)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendTimeout);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendTimeout, value);
- }
- }
-
-
- // methods
-
- /// <summary>
- /// Closes the socket and disposes of all managed resources.
- ///
- /// Throws SocketException if something goes wrong while
- /// closing the socket.
- /// </summary>
- public void Close ()
- {
- Dispose(true);
- }
-
- /// <summary>
- /// Connects to a specified remote endpoint
- ///
- /// Throws SocketException if something goes wrong while
- /// connecting.
- /// </summary>
- /// <param name="remote_end_point">The aforementioned endpoint</param>
- public void Connect (IPEndPoint remote_end_point)
- {
- client.Connect(remote_end_point);
- stream = new NetworkStream(client, true);
- active = true;
- }
-
- /// <summary>
- /// Connects to an IP address on a port
- ///
- /// Throws SocketException if something goes wrong while
- /// connecting.
- /// </summary>
- /// <param name="address">The IP address (get it from Dns.GetHostByName)</param>
- /// <param name="port">The port to connect to, e.g. 80 for HTTP</param>
- public void Connect (IPAddress address, int port)
- {
- Connect(new IPEndPoint(address, port));
- }
-
- /// <summary>
- /// Resolves a fully qualified domain name to an IP address
- /// and connects to it on a specified port
- ///
- /// Throws SocketException if something goes wrong while
- /// connecting.
- /// </summary>
- /// <param name="hostname">The hostname, e.g. www.myelin.co.nz</param>
- /// <param name="port">The port, e.g. 80 for HTTP</param>
- [MonoTODO]
- public void Connect (string hostname, int port)
- {
- IPHostEntry host = Dns.GetHostByName(hostname);
- /* TODO: This will connect to the first IP address returned
- from GetHostByName. Is that right? */
- Connect(new IPEndPoint(host.AddressList[0], port));
- }
-
- /// <summary>
- /// Gets rid of all managed resources
- /// </summary>
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- /// <summary>
- /// Gets rid of all unmanaged resources
- /// </summary>
- /// <param name="disposing">If this is true, it gets rid of all
- /// managed resources as well</param>
- protected virtual void Dispose (bool disposing)
- {
- if (disposed == false) {
- if (active) {
- // This closes the socket as well, as the NetworkStream
- // owns the socket.
- stream.Close();
- active = false;
- }
- disposed = true;
- }
- }
-
- /// <summary>
- /// Destructor - just calls Dispose()
- /// </summary>
- ~TcpClient ()
- {
- Dispose(false);
- }
-
- /// <returns>A NetworkStream object connected to the
- /// connection socket</returns>
- public NetworkStream GetStream()
- {
- return stream;
- }
-
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/TcpListener.cs b/mcs/class/System/System.Net.Sockets/TcpListener.cs
deleted file mode 100755
index 8359719ec8f..00000000000
--- a/mcs/class/System/System.Net.Sockets/TcpListener.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-// System.Net.Sockets.TcpListener.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-// NB: This is untested (probably buggy) code - take care using it
-
-using System;
-using System.Net;
-
-namespace System.Net.Sockets
-{
- /// <remarks>
- /// A slightly more abstracted way to listen for incoming
- /// network connections than a Socket.
- /// </remarks>
- public class TcpListener
- {
- // private data
-
- private bool active;
- private Socket server;
-
- // constructor
-
- /// <summary>
- /// Some code that is shared between the constructors.
- /// </summary>
- private void Init ()
- {
- active = false;
- server = new Socket(AddressFamily.InterNetwork,
- SocketType.Stream, ProtocolType.Tcp);
- }
-
- /// <summary>
- /// Constructs a new TcpListener to listen on a specified port
- /// </summary>
- /// <param name="port">The port to listen on, e.g. 80 if you
- /// are a web server</param>
- public TcpListener (int port)
- {
- Init();
- server.Bind(new IPEndPoint(IPAddress.Any, port));
- }
-
- /// <summary>
- /// Constructs a new TcpListener with a specified local endpoint
- /// </summary>
- /// <param name="local_end_point">The endpoint</param>
- public TcpListener (IPEndPoint local_end_point)
- {
- Init();
- server.Bind(local_end_point);
- }
-
- /// <summary>
- /// Constructs a new TcpListener, listening on a specified port
- /// and IP (for use on a multi-homed machine)
- /// </summary>
- /// <param name="listen_ip">The IP to listen on</param>
- /// <param name="port">The port to listen on</param>
- public TcpListener (IPAddress listen_ip, int port)
- {
- Init();
- server.Bind(new IPEndPoint(listen_ip, port));
- }
-
-
- // properties
-
- /// <summary>
- /// A flag that is 'true' if the TcpListener is listening,
- /// or 'false' if it is not listening
- /// </summary>
- protected bool Active
- {
- get { return active; }
- }
-
- /// <summary>
- /// The local end point
- /// </summary>
- public EndPoint LocalEndPoint
- {
- get { return server.LocalEndPoint; }
- }
-
- /// <summary>
- /// The listening socket
- /// </summary>
- protected Socket Server
- {
- get { return server; }
- }
-
-
- // methods
-
- /// <summary>
- /// Accepts a pending connection
- /// <returns>A Socket object for the new connection</returns>
- public Socket AcceptSocket ()
- {
- return server.Accept();
- }
-
- /// <summary>
- /// Accepts a pending connection
- /// </summary>
- /// <returns>A TcpClient
- /// object made from the new socket.</returns>
- public TcpClient AcceptTcpClient ()
- {
- TcpClient client = new TcpClient();
- // use internal method SetTcpClient to make a
- // client with the specified socket
- client.SetTcpClient(AcceptSocket());
- return client;
- }
-
- /// <summary>
- /// Destructor - stops the listener listening
- /// </summary>
- ~TcpListener ()
- {
- if (active == true) {
- Stop();
- }
- }
-
- /// <returns>
- /// Returns 'true' if there is a connection waiting to be accepted
- /// with AcceptSocket() or AcceptTcpClient().
- /// </returns>
- public bool Pending ()
- {
- return server.Poll(1000, SelectMode.SelectRead);
- }
-
- /// <summary>
- /// Tells the TcpListener to start listening.
- /// </summary>
- [MonoTODO]
- public void Start ()
- {
- server.Listen(-1); //TODO: How big a backlog should we specify? -1 == MAX?
- active = true;
- }
-
- /// <summary>
- /// Tells the TcpListener to stop listening and dispose
- /// of all managed resources.
- /// </summary>
- public void Stop ()
- {
- server.Close();
- }
-
- }
-}
diff --git a/mcs/class/System/System.Net/AuthenticationManager.cs b/mcs/class/System/System.Net/AuthenticationManager.cs
deleted file mode 100755
index b67ff556817..00000000000
--- a/mcs/class/System/System.Net/AuthenticationManager.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.Net.AuthenticationManager.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Net {
-
- public class AuthenticationManager {
-
- static ArrayList modules;
-
- public static IEnumerator RegisteredModules {
- get {
- if (modules == null)
- modules = new ArrayList ();
-
- return modules as IEnumerator;
- }
- }
-
- [MonoTODO]
- public static Authorization PreAuthenticate (WebRequest request,
- ICredentials credentials)
- {
- // FIXME: implement
- return null;
- }
-
- public static void Register (IAuthenticationModule authenticationModule)
- {
- if (modules == null)
- modules = new ArrayList ();
-
- modules.Add (authenticationModule);
- }
-
- [MonoTODO]
- public static void Unregister (IAuthenticationModule authenticationModule)
- {
- // FIXME: implement
- }
-
- [MonoTODO]
- public static void Unregister (string authenticationScheme)
- {
- // FIXME: implement
- }
- }
-}
diff --git a/mcs/class/System/System.Net/Authorization.cs b/mcs/class/System/System.Net/Authorization.cs
deleted file mode 100755
index 60e8c889f22..00000000000
--- a/mcs/class/System/System.Net/Authorization.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Net.Authorization.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Net {
-
- public class Authorization {
- string token;
- bool complete;
-
- public Authorization (string token)
- {
- this.complete = true;
- this.token = token;
- }
-
- public Authorization (string token, bool complete)
- {
- this.complete = complete;
- this.token = token;
- }
-
- public bool Complete {
- get {
- return complete;
- }
- }
-
-
- }
-}
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog
deleted file mode 100644
index 42132e203bd..00000000000
--- a/mcs/class/System/System.Net/ChangeLog
+++ /dev/null
@@ -1,74 +0,0 @@
-2002-02-24 Duncan Mak <duncan@ximian.com>
-
- * ICredentialLookup.cs: Added the GetCredential method to the
- interface. The interface is named "ICredentials", should this file
- be renamed?
-
- * NetworkCredential.cs: Added to CVS. Need to investigate on how
- GetCredential() works
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * SocketAddress.cs: Implemented.
-
- * IPEndPoint.cs: Turned 'Address' field into a real property.
- Implemented Create() and Serialize() methods.
-
- * IPAddress.cs: Fixed class constructor, turned 'Address' field
- into a real property. Removed undocumented "public
- IPAddress(string)" constructor.
-
- * EndPoint.cs: Implemented. All methods return
- NotSupportedException to enforce subclass overriding.
-
- * Dns.cs: Replaced fixed-layout Hostent struct and cygwin
- P/Invokes with portable internal calls.
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * Dns.cs: Updated to API changes.
-
- * IPAddress.cs: Updated API. Much left to implement.
-
- * Dns.cs: Remove IPToString method
-
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * Dns.cs, AuthenticationManager.cs, SocketAddress.cs : MonoTODO
- attribute insertion.
-
-2001-11-22 Nick Drochak <ndrochak@gol.com>
-
- * IPAddress.cs: Fix constructor bug, properly name Address property,
- and use triple-slash for comments.
-
-2001-11-20 Miguel de Icaza <miguel@ximian.com>
-
- * IPAddress.cs: Updated to contain Any, Broadcast, Loopback and
- None as suggested by Phillip.
-
-2001-09-26 Mads Pultz <mpultz@get2net.dk>
- * Dns.cs: Initial work on BeginGetHostByName and EndGetHostByName implemented.
-
-2001-09-24 Mads Pultz <mpultz@get2net.dk>
-
- * Dns.cs: Minor changes (some print statements removed)
-
-2001-09-23 Mads Pultz <mpultz@get2net.dk>
-
- * Dns.cs: Initial work submitted to repository.
- * IPHostEntry.cs: Initial work submitted to repository.
-
-2001-07-12 Sean MacIsaac <macisaac@ximian.com>
-
- * Authorization.cs: Fixed compiler error.
-
- * IAuthenticationModule.cs: Changes for Beta2.
-
- * IPAddress.cs: Internal storage changed to be uint not int.
-
- * IPEndPoint.cs: Fixed compiler error.
-
- * EndPoint.cs: Fixed compiler error.
-
- * AuthenticationManager.cs: Fixed typo.
diff --git a/mcs/class/System/System.Net/ConnectionModes.cs b/mcs/class/System/System.Net/ConnectionModes.cs
deleted file mode 100755
index 3a1cc437702..00000000000
--- a/mcs/class/System/System.Net/ConnectionModes.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// ConnectionModes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:35:39 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum ConnectionModes {
-
- /// <summary>
- /// </summary>
- Single = 0,
-
- /// <summary>
- /// </summary>
- Persistent = 1,
-
- /// <summary>
- /// </summary>
- Pipeline = 2,
-
- /// <summary>
- /// </summary>
- Mux = 3,
- } // ConnectionModes
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/Dns.cs b/mcs/class/System/System.Net/Dns.cs
deleted file mode 100644
index f08f2f85a34..00000000000
--- a/mcs/class/System/System.Net/Dns.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-// System.Net.Dns.cs
-//
-// Author: Mads Pultz (mpultz@diku.dk)
-//
-// (C) Mads Pultz, 2001
-
-using System;
-using System.Net.Sockets;
-using System.Text;
-using System.Collections;
-using System.Threading;
-using System.Runtime.CompilerServices;
-
-namespace System.Net {
- public sealed class Dns {
-
- /// <summary>
- /// Helper class
- /// </summary>
- private sealed class DnsAsyncResult: IAsyncResult {
- private object state;
- private WaitHandle waitHandle;
- private bool completedSync, completed;
- private Worker worker;
-
- public DnsAsyncResult(object state) {
- this.state = state;
- waitHandle = new ManualResetEvent(false);
- completedSync = completed = false;
- }
- public object AsyncState {
- get { return state; }
- }
- public WaitHandle AsyncWaitHandle {
- set { waitHandle = value; }
- get { return waitHandle; }
- }
- public bool CompletedSynchronously {
- get { return completedSync; }
- }
- public bool IsCompleted {
- set { completed = value; }
- get { return completed; }
- }
- public Worker Worker {
- set { worker = value; }
- get { return worker; }
- }
- }
-
- /// <summary>
- /// Helper class for asynchronous calls to DNS server
- /// </summary>
- private sealed class Worker {
- private AsyncCallback reqCallback;
- private DnsAsyncResult reqRes;
- private string req;
- private IPHostEntry result;
-
- public Worker(string req, AsyncCallback reqCallback, DnsAsyncResult reqRes) {
- this.req = req;
- this.reqCallback = reqCallback;
- this.reqRes = reqRes;
- }
- private void End() {
- reqCallback(reqRes);
- ((ManualResetEvent)reqRes.AsyncWaitHandle).Set();
- reqRes.IsCompleted = true;
- }
- public void GetHostByName() {
- lock(reqRes) {
- result = Dns.GetHostByName(req);
- End();
- }
- }
- public void Resolve() {
- lock(reqRes) {
- result = Dns.Resolve(req);
- End();
- }
- }
- public IPHostEntry Result {
- get { return result; }
- }
- }
-
- public static IAsyncResult BeginGetHostByName(string hostName,
- AsyncCallback requestCallback, object stateObject)
- {
- DnsAsyncResult requestResult = new DnsAsyncResult(stateObject);
- Worker worker = new Worker(hostName, requestCallback, requestResult);
- Thread child = new Thread(new ThreadStart(worker.GetHostByName));
- child.Start();
- return requestResult;
- }
-
- public static IAsyncResult BeginResolve(string hostName,
- AsyncCallback requestCallback, object stateObject)
- {
- DnsAsyncResult requestResult = new DnsAsyncResult(stateObject);
- Worker worker = new Worker(hostName, requestCallback, requestResult);
- Thread child = new Thread(new ThreadStart(worker.Resolve));
- child.Start();
- return requestResult;
- }
-
- public static IPHostEntry EndGetHostByName(IAsyncResult asyncResult) {
- return ((DnsAsyncResult)asyncResult).Worker.Result;
- }
-
- public static IPHostEntry EndResolve(IAsyncResult asyncResult) {
- return ((DnsAsyncResult)asyncResult).Worker.Result;
- }
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool GetHostByName_internal(string host, out string h_name, out string[] h_aliases, out string[] h_addr_list);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool GetHostByAddr_internal(string addr, out string h_name, out string[] h_aliases, out string[] h_addr_list);
-
- private static IPHostEntry hostent_to_IPHostEntry(string h_name, string[] h_aliases, string[] h_addrlist) {
- IPHostEntry he = new IPHostEntry();
- IPAddress[] addrlist = new IPAddress[h_addrlist.Length];
-
- he.HostName=h_name;
- he.Aliases=h_aliases;
- for(int i=0; i<h_addrlist.Length; i++) {
- addrlist[i]=IPAddress.Parse(h_addrlist[i]);
- }
- he.AddressList=addrlist;
-
- return(he);
- }
-
- public static IPHostEntry GetHostByAddress(IPAddress address) {
- if (address == null)
- throw new ArgumentNullException();
- return GetHostByAddress(address.ToString());
- }
-
- public static IPHostEntry GetHostByAddress(string address) {
- if (address == null) {
- throw new ArgumentNullException();
- }
-
- string h_name;
- string[] h_aliases, h_addrlist;
-
- bool ret = GetHostByAddr_internal(address, out h_name,
- out h_aliases,
- out h_addrlist);
- if (ret == false) {
- throw new SocketException();
- }
-
- return(hostent_to_IPHostEntry(h_name, h_aliases,
- h_addrlist));
- }
-
- public static IPHostEntry GetHostByName(string hostName) {
- if (hostName == null) {
- throw new ArgumentNullException();
- }
-
- string h_name;
- string[] h_aliases, h_addrlist;
-
- bool ret = GetHostByName_internal(hostName, out h_name,
- out h_aliases,
- out h_addrlist);
- if (ret == false) {
- throw new SocketException();
- }
-
- return(hostent_to_IPHostEntry(h_name, h_aliases,
- h_addrlist));
- }
-
- /// <summary>
- /// This method returns the host name associated with the local host.
- /// </summary>
- public static string GetHostName() {
- IPHostEntry h = GetHostByAddress("127.0.0.1");
- return h.HostName;
- }
-
- /// <summary>
- /// This method resovles a DNS-style host name or IP
- /// address.
- /// </summary>
- /// <param name=hostName>
- /// A string containing either a DNS-style host name (e.g.
- /// www.go-mono.com) or IP address (e.g. 129.250.184.233).
- /// </param>
- public static IPHostEntry Resolve(string hostName) {
- if (hostName == null)
- throw new ArgumentNullException();
- try {
- return GetHostByAddress(hostName);
- } catch (SocketException) {
- return GetHostByName(hostName);
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.Net/EndPoint.cs b/mcs/class/System/System.Net/EndPoint.cs
deleted file mode 100755
index 5e1d81f98dc..00000000000
--- a/mcs/class/System/System.Net/EndPoint.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Net.EndPoint.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Net.Sockets;
-
-namespace System.Net {
- [Serializable]
- public abstract class EndPoint {
-
- // NB: These methods really do nothing but throw
- // NotSupportedException
-
- public virtual AddressFamily AddressFamily {
- get {
- throw new NotSupportedException();
- }
- }
-
- public virtual EndPoint Create (SocketAddress address)
- {
- throw new NotSupportedException();
- }
-
- public virtual SocketAddress Serialize ()
- {
- throw new NotSupportedException();
- }
-
- protected EndPoint ()
- {
- }
- }
-}
-
diff --git a/mcs/class/System/System.Net/HttpStatusCode.cs b/mcs/class/System/System.Net/HttpStatusCode.cs
deleted file mode 100755
index 6688853fafc..00000000000
--- a/mcs/class/System/System.Net/HttpStatusCode.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-// HttpStatusCode.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:32:05 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum HttpStatusCode {
-
- /// <summary>
- /// </summary>
- Continue = 100,
-
- /// <summary>
- /// </summary>
- SwitchingProtocols = 101,
-
- /// <summary>
- /// </summary>
- OK = 200,
-
- /// <summary>
- /// </summary>
- Created = 201,
-
- /// <summary>
- /// </summary>
- Accepted = 202,
-
- /// <summary>
- /// </summary>
- NonAuthoritativeInformation = 203,
-
- /// <summary>
- /// </summary>
- NoContent = 204,
-
- /// <summary>
- /// </summary>
- ResetContent = 205,
-
- /// <summary>
- /// </summary>
- PartialContent = 206,
-
- /// <summary>
- /// </summary>
- MultipleChoices = 300,
-
- /// <summary>
- /// </summary>
- Ambiguous = 300,
-
- /// <summary>
- /// </summary>
- MovedPermanently = 301,
-
- /// <summary>
- /// </summary>
- Moved = 301,
-
- /// <summary>
- /// </summary>
- Found = 302,
-
- /// <summary>
- /// </summary>
- Redirect = 302,
-
- /// <summary>
- /// </summary>
- SeeOther = 303,
-
- /// <summary>
- /// </summary>
- RedirectMethod = 303,
-
- /// <summary>
- /// </summary>
- NotModified = 304,
-
- /// <summary>
- /// </summary>
- UseProxy = 305,
-
- /// <summary>
- /// </summary>
- Unused = 306,
-
- /// <summary>
- /// </summary>
- TemporaryRedirect = 307,
-
- /// <summary>
- /// </summary>
- RedirectKeepVerb = 307,
-
- /// <summary>
- /// </summary>
- BadRequest = 400,
-
- /// <summary>
- /// </summary>
- Unauthorized = 401,
-
- /// <summary>
- /// </summary>
- PaymentRequired = 402,
-
- /// <summary>
- /// </summary>
- Forbidden = 403,
-
- /// <summary>
- /// </summary>
- NotFound = 404,
-
- /// <summary>
- /// </summary>
- MethodNotAllowed = 405,
-
- /// <summary>
- /// </summary>
- NotAcceptable = 406,
-
- /// <summary>
- /// </summary>
- ProxyAuthenticationRequired = 407,
-
- /// <summary>
- /// </summary>
- RequestTimeout = 408,
-
- /// <summary>
- /// </summary>
- Conflict = 409,
-
- /// <summary>
- /// </summary>
- Gone = 410,
-
- /// <summary>
- /// </summary>
- LengthRequired = 411,
-
- /// <summary>
- /// </summary>
- PreconditionFailed = 412,
-
- /// <summary>
- /// </summary>
- RequestEntityTooLarge = 413,
-
- /// <summary>
- /// </summary>
- RequestUriTooLong = 414,
-
- /// <summary>
- /// </summary>
- UnsupportedMediaType = 415,
-
- /// <summary>
- /// </summary>
- RequestedRangeNotSatisfiable = 416,
-
- /// <summary>
- /// </summary>
- ExpectationFailed = 417,
-
- /// <summary>
- /// </summary>
- InternalServerError = 500,
-
- /// <summary>
- /// </summary>
- NotImplemented = 501,
-
- /// <summary>
- /// </summary>
- BadGateway = 502,
-
- /// <summary>
- /// </summary>
- ServiceUnavailable = 503,
-
- /// <summary>
- /// </summary>
- GatewayTimeout = 504,
-
- /// <summary>
- /// </summary>
- HttpVersionNotSupported = 505,
- } // HttpStatusCode
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/IAuthenticationModule.cs b/mcs/class/System/System.Net/IAuthenticationModule.cs
deleted file mode 100755
index 15119f74da3..00000000000
--- a/mcs/class/System/System.Net/IAuthenticationModule.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Net.IAuthenticationModule.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Net {
-
- // <remarks>
- // Authentication interface for Web client authentication modules.
- // </remarks>
- public interface IAuthenticationModule {
- string AuthenticationType {
- get;
- }
-
- bool CanPreAuthenticate {
- get;
- }
-
- bool CanRespond (string challenge);
-
- Authorization PreAuthenticate (WebRequest request, ICredentials credentials);
-
- Authorization Respond (string challenge, WebRequest request, ICredentials credentials);
- }
-}
diff --git a/mcs/class/System/System.Net/ICredentialLookup.cs b/mcs/class/System/System.Net/ICredentialLookup.cs
deleted file mode 100755
index 26b48ba9860..00000000000
--- a/mcs/class/System/System.Net/ICredentialLookup.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Net.ICredential.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-
-namespace System.Net {
-
- // <remarks>
- // Base authentication interface for Web clients.
- // </remarks>
- public interface ICredentials
- {
- NetworkCredential GetCredential (Uri uri, string authType);
- }
-}
diff --git a/mcs/class/System/System.Net/IPAddress.cs b/mcs/class/System/System.Net/IPAddress.cs
deleted file mode 100755
index bd9763d028b..00000000000
--- a/mcs/class/System/System.Net/IPAddress.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// System.Net.IPAddress.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Net.Sockets;
-
-namespace System.Net {
-
- /// <remarks>
- /// Encapsulates an IP Address.
- /// </remarks>
- [Serializable]
- public class IPAddress {
- // Don't change the name of this field without also
- // changing socket-io.c in the runtime
- private long address;
-
- public static readonly IPAddress Any=new IPAddress(0);
- public static readonly IPAddress Broadcast=new IPAddress(0xffffffff);
- public static readonly IPAddress Loopback=new IPAddress(0x7f000001);
- public static readonly IPAddress None=new IPAddress(0xffffffff);
-
- [MonoTODO("Figure out host endian")]
- public static short HostToNetworkOrder(short host) {
- return(host);
- }
-
- [MonoTODO("Figure out host endian")]
- public static int HostToNetworkOrder(int host) {
- return(host);
- }
-
- [MonoTODO("Figure out host endian")]
- public static long HostToNetworkOrder(long host) {
- return(host);
- }
-
- [MonoTODO("Figure out host endian")]
- public static short NetworkToHostOrder(short network) {
- return(network);
- }
-
- [MonoTODO("Figure out host endian")]
- public static int NetworkToHostOrder(int network) {
- return(network);
- }
-
- [MonoTODO("Figure out host endian")]
- public static long NetworkToHostOrder(long network) {
- return(network);
- }
-
- /// <summary>
- /// Constructor from a 32-bit constant.
- /// </summary>
- public IPAddress (long addr)
- {
- address = addr;
- }
-
- public static IPAddress Parse(string ip)
- {
- if(ip==null) {
- throw new ArgumentNullException("null ip string");
- }
-
- string[] ips = ip.Split (new char[] {'.'});
- int i;
- long a = 0;
-
- for (i = 0; i < ips.Length; i++)
- a = (a << 8) | (UInt16.Parse(ips [i]));
-
- return(new IPAddress(a));
- }
-
- public long Address {
- get {
- return(address);
- }
- set {
- address=value;
- }
- }
-
- public AddressFamily AddressFamily {
- get {
- return(AddressFamily.InterNetwork);
- }
- }
-
-
- /// <summary>
- /// Used to tell whether an address is a loopback.
- /// </summary>
- /// <param name="addr">Address to compare</param>
- /// <returns></returns>
- public static bool IsLoopback (IPAddress addr)
- {
- return addr.Equals(Loopback);
- }
-
- /// <summary>
- /// Overrides System.Object.ToString to return
- /// this object rendered in a quad-dotted notation
- /// </summary>
- public override string ToString ()
- {
- return ToString (address);
- }
-
- /// <summary>
- /// Returns this object rendered in a quad-dotted notation
- /// </summary>
- static string ToString (long addr)
- {
- return ((addr >> 24) & 0xff).ToString () + "." +
- ((addr >> 16) & 0xff).ToString () + "." +
- ((addr >> 8) & 0xff).ToString () + "." +
- (addr & 0xff).ToString ();
- }
-
- /// <returns>
- /// Whether both objects are equal.
- /// </returns>
- public override bool Equals (object other)
- {
- if (other is System.Net.IPAddress){
- return Address == ((System.Net.IPAddress) other).Address;
- }
- return false;
- }
-
- public override int GetHashCode ()
- {
- return (int)Address;
- }
- }
-}
diff --git a/mcs/class/System/System.Net/IPEndPoint.cs b/mcs/class/System/System.Net/IPEndPoint.cs
deleted file mode 100755
index 5e1557f3752..00000000000
--- a/mcs/class/System/System.Net/IPEndPoint.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// System.Net.IPEndPoint.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Net.Sockets;
-
-namespace System.Net {
- [Serializable]
- public class IPEndPoint : EndPoint {
-
- public const int MaxPort = 65535;
- public const int MinPort = 0;
-
- public IPEndPoint (IPAddress address, int port)
- {
- if(port<MinPort || port>MaxPort) {
- throw new ArgumentException("Invalid port");
- }
-
- Address = address;
- Port = port;
- }
-
- public IPEndPoint (long iaddr, int port)
- {
- if(port<MinPort || port>MaxPort) {
- throw new ArgumentException("Invalid port");
- }
-
- IPAddress address = new IPAddress (iaddr);
-
- Address = address;
- Port = port;
- }
-
- private IPAddress address;
- public IPAddress Address {
- get {
- return(address);
- }
- set {
- address=value;
- }
- }
-
- public override AddressFamily AddressFamily {
- get {
- return AddressFamily.InterNetwork;
- }
- }
-
- private int port;
- public int Port {
- get {
- return port;
- }
- set {
- // LAMESPEC: no mention of sanity checking
- port = value;
- }
- }
-
- // bytes 2 and 3 store the port, the rest
- // stores the address
- public override EndPoint Create(SocketAddress sockaddr) {
- int size=sockaddr.Size;
-
- // LAMESPEC: no mention of what to do if
- // sockaddr is bogus
- if(size<8) {
- // absolute minimum amount needed for
- // an address family, buffer size,
- // port and address
- return(null);
- }
- AddressFamily family=(AddressFamily)sockaddr[0];
- if(family!=AddressFamily.InterNetwork) {
- return(null);
- }
-
- int port=(((int)sockaddr[2])<<8) + (int)sockaddr[3];
- long address=(((long)sockaddr[4])<<24) +
- (((long)sockaddr[5])<<16) +
- (((long)sockaddr[6])<<8) +
- (long)sockaddr[7];
-
- IPEndPoint ipe = new IPEndPoint(address, port);
-
- return(ipe);
- }
-
- public override SocketAddress Serialize() {
- // .net produces a 16 byte buffer, even though
- // only 8 bytes are used. I guess its just a
- // holdover from struct sockaddr padding.
- SocketAddress sockaddr = new SocketAddress(AddressFamily.InterNetwork, 16);
-
- // bytes 2 and 3 store the port, the rest
- // stores the address
- sockaddr[2]=(byte)((port>>8) & 0xff);
- sockaddr[3]=(byte)(port & 0xff);
-
- sockaddr[4]=(byte)((address.Address >> 24) & 0xff);
- sockaddr[5]=(byte)((address.Address >> 16) & 0xff);
- sockaddr[6]=(byte)((address.Address >> 8) & 0xff);
- sockaddr[7]=(byte)(address.Address & 0xff);
-
- return(sockaddr);
- }
-
- public override string ToString() {
- return(address.ToString() + ":" + port);
- }
- }
-}
diff --git a/mcs/class/System/System.Net/IPHostEntry.cs b/mcs/class/System/System.Net/IPHostEntry.cs
deleted file mode 100644
index dd24e48b19b..00000000000
--- a/mcs/class/System/System.Net/IPHostEntry.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-// System.Net.IPHostEntry.cs
-//
-// Author: Mads Pultz (mpultz@diku.dk)
-//
-// (C) Mads Pultz, 2001
-
-using System;
-
-namespace System.Net {
-
- public class IPHostEntry {
- private IPAddress[] addressList;
- private String[] aliases;
- private String hostName;
-
- public IPHostEntry() {
- hostName = "localhost";
- addressList = new IPAddress[1];
- addressList[0] = IPAddress.Loopback;
- aliases = new String[0];
- }
-
- public IPAddress[] AddressList {
- get { return addressList; }
- set { addressList = value; }
- }
-
- public string[] Aliases {
- get { return aliases; }
- set { aliases = value; }
- }
-
- public string HostName {
- get { return hostName; }
- set { hostName = value; }
- }
-
-/* According to the .NET Framework SDK Documentation (beta 2) the following
- methods from Object are not overrided. I implemented them before realizing
- this but I leave the implementation here if needed in the future.
-
- public override string ToString() {
- string res = hostName;
- if (addressList != null && addressList.Length > 0)
- res += " [" + addressList[0] + "]";
- return res;
- }
-
- public override bool Equals(object obj) {
- if (obj is IPHostEntry) {
- IPHostEntry h = (IPHostEntry)obj;
- return hostName.Equals(h.HostName) && aliases.Equals(h.Aliases) &&
- addressList.Equals(h.AddressList);
- }
- else
- return false;
- }
-
- public override int GetHashCode() {
- return hostName.GetHashCode();
- }
-
- protected new object MemberwiseClone() {
- IPHostEntry res = new IPHostEntry();
- res.AddressList = new IPAddress[addressList.Length];
- Array.Copy(addressList, res.AddressList, addressList.Length);
- res.Aliases = new String[aliases.Length];
- Array.Copy(aliases, res.Aliases, aliases.Length);
- res.HostName = hostName;
- return res;
- }
-*/
- }
-}
-
diff --git a/mcs/class/System/System.Net/NetworkAccess.cs b/mcs/class/System/System.Net/NetworkAccess.cs
deleted file mode 100755
index 7d20e93aa2c..00000000000
--- a/mcs/class/System/System.Net/NetworkAccess.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// NetworkAccess.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:35:58 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum NetworkAccess {
-
- /// <summary>
- /// </summary>
- Accept = 128,
-
- /// <summary>
- /// </summary>
- Connect = 64,
- } // NetworkAccess
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/NetworkCredential.cs b/mcs/class/System/System.Net/NetworkCredential.cs
deleted file mode 100755
index 8f62cdbe292..00000000000
--- a/mcs/class/System/System.Net/NetworkCredential.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.Net.NetworkCredential.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Net
-{
- public class NetworkCredential : ICredentials
- {
- // Fields
- string userName;
- string password;
- string domain;
-
- // Constructors
- public NetworkCredential ()
- : base ()
- {
- }
-
- public NetworkCredential (string userName, string password)
- {
- this.userName = userName;
- this.password = password;
- }
-
- public NetworkCredential (string userName, string password, string domain)
- {
- this.userName = userName;
- this.password = password;
- this.domain = domain;
- }
-
- // Properties
-
- public string Domain
- {
- get { return domain; }
- set { domain = value; }
- }
-
- public string UserName
- {
- get { return userName; }
- set { userName = value; }
- }
-
- public string Password
- {
- get { return password; }
- set { password = value; }
- }
-
- [MonoTODO]
- public NetworkCredential GetCredential (Uri uri, string authType)
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/System/System.Net/ProxyUseType.cs b/mcs/class/System/System.Net/ProxyUseType.cs
deleted file mode 100755
index fc878e6c09a..00000000000
--- a/mcs/class/System/System.Net/ProxyUseType.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// ProxyUseType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:36:08 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum ProxyUseType {
-
- /// <summary>
- /// </summary>
- Standard = 0,
-
- /// <summary>
- /// </summary>
- Tunnel = 1,
-
- /// <summary>
- /// </summary>
- FtpGateway = 2,
-
- /// <summary>
- /// </summary>
- Socks = 3,
- } // ProxyUseType
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/SocketAddress.cs b/mcs/class/System/System.Net/SocketAddress.cs
deleted file mode 100755
index 4b4d8a69793..00000000000
--- a/mcs/class/System/System.Net/SocketAddress.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Net.SocketAddress.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Net.Sockets;
-
-namespace System.Net {
-
- public class SocketAddress {
- private byte[] data;
-
- public SocketAddress (AddressFamily family, int size)
- {
- if(size<2) {
- throw new ArgumentOutOfRangeException("size is too small");
- }
-
- data=new byte[size];
- data[0]=(byte)family;
- data[1]=(byte)size;
- }
-
- public SocketAddress (AddressFamily family)
- {
- data=new byte[32];
- data[0]=(byte)family;
- data[1]=(byte)32;
- }
-
- public AddressFamily Family {
- get {
- return((AddressFamily)data[0]);
- }
- }
-
- public int Size {
- get {
- return((int)data[1]);
- }
- }
-
- public byte this [ int offset ] {
- get {
- return(data[offset]);
- }
-
- set {
- data[offset]=value;
- }
- }
-
- public override string ToString() {
- string af=((AddressFamily)data[0]).ToString();
- int size=(int)data[1];
- string ret=af+":"+size+":{";
-
- for(int i=2; i<size; i++) {
- int val=(int)data[i];
- ret=ret+val;
- if(i<size-1) {
- ret=ret+",";
- }
- }
-
- ret=ret+"}";
-
- return(ret);
- }
-
- }
-}
diff --git a/mcs/class/System/System.Net/TransportType.cs b/mcs/class/System/System.Net/TransportType.cs
deleted file mode 100755
index b9e5822fcff..00000000000
--- a/mcs/class/System/System.Net/TransportType.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// TransportType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:32:18 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum TransportType {
-
- /// <summary>
- /// </summary>
- Udp = 1,
-
- /// <summary>
- /// </summary>
- Connectionless = 1,
-
- /// <summary>
- /// </summary>
- Tcp = 2,
-
- /// <summary>
- /// </summary>
- ConnectionOriented = 2,
-
- /// <summary>
- /// </summary>
- All = 3,
- } // TransportType
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/WebExceptionStatus.cs b/mcs/class/System/System.Net/WebExceptionStatus.cs
deleted file mode 100755
index 05dd876bac0..00000000000
--- a/mcs/class/System/System.Net/WebExceptionStatus.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// WebExceptionStatus.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:33:08 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum WebExceptionStatus {
-
- /// <summary>
- /// </summary>
- Success = 0,
-
- /// <summary>
- /// </summary>
- NameResolutionFailure = 1,
-
- /// <summary>
- /// </summary>
- ConnectFailure = 2,
-
- /// <summary>
- /// </summary>
- ReceiveFailure = 3,
-
- /// <summary>
- /// </summary>
- SendFailure = 4,
-
- /// <summary>
- /// </summary>
- PipelineFailure = 5,
-
- /// <summary>
- /// </summary>
- RequestCanceled = 6,
-
- /// <summary>
- /// </summary>
- ProtocolError = 7,
-
- /// <summary>
- /// </summary>
- ConnectionClosed = 8,
-
- /// <summary>
- /// </summary>
- TrustFailure = 9,
-
- /// <summary>
- /// </summary>
- SecureChannelFailure = 10,
-
- /// <summary>
- /// </summary>
- ServerProtocolViolation = 11,
-
- /// <summary>
- /// </summary>
- KeepAliveFailure = 12,
-
- /// <summary>
- /// </summary>
- Pending = 13,
-
- /// <summary>
- /// </summary>
- Timeout = 14,
-
- /// <summary>
- /// </summary>
- ProxyNameResolutionFailure = 15,
- } // WebExceptionStatus
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/WebStatus.cs b/mcs/class/System/System.Net/WebStatus.cs
deleted file mode 100755
index 5ad5450a738..00000000000
--- a/mcs/class/System/System.Net/WebStatus.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// WebStatus.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:37:37 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum WebStatus {
-
- /// <summary>
- /// </summary>
- Success = 0,
-
- /// <summary>
- /// </summary>
- NameResolutionFailure = 1,
-
- /// <summary>
- /// </summary>
- ConnectFailure = 2,
-
- /// <summary>
- /// </summary>
- ReceiveFailure = 3,
-
- /// <summary>
- /// </summary>
- SendFailure = 4,
-
- /// <summary>
- /// </summary>
- PipelineFailure = 5,
-
- /// <summary>
- /// </summary>
- RequestCanceled = 6,
-
- /// <summary>
- /// </summary>
- ProtocolError = 7,
-
- /// <summary>
- /// </summary>
- ConnectionClosed = 8,
-
- /// <summary>
- /// </summary>
- TrustFailure = 9,
-
- /// <summary>
- /// </summary>
- SecureChannelFailure = 10,
-
- /// <summary>
- /// </summary>
- ServerProtocolViolation = 11,
-
- /// <summary>
- /// </summary>
- KeepAliveFailure = 12,
-
- /// <summary>
- /// </summary>
- Pending = 13,
- } // WebStatus
-
-} // System.Net
diff --git a/mcs/class/System/System.Text.RegularExpressions/arch.cs b/mcs/class/System/System.Text.RegularExpressions/arch.cs
deleted file mode 100644
index 274d9add1a9..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/arch.cs
+++ /dev/null
@@ -1,333 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: arch.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-
-namespace System.Text.RegularExpressions {
-
- enum OpCode : ushort {
- False = 0, // always fails
- True, // always succeeds
-
- // matching
-
- Position, // zero-width position assertion
- String, // match string literal
- Reference, // back reference
-
- // character matching
-
- Character, // match character exactly
- Category, // match character from category
- Range, // match character from range
- Set, // match character from set
- In, // match character from group of tests
-
- // capturing
-
- Open, // open group
- Close, // close group
- Balance, // balance groups
-
- // control flow
-
- IfDefined, // conditional on capture
- Sub, // non-backtracking subexpression
- Test, // non-backtracking lookahead/behind
- Branch, // alternative expression
- Jump, // unconditional goto
- Repeat, // new repeat context
- Until, // repeat subexpression within context
- FastRepeat, // repeat simple subexpression
- Anchor, // anchoring expression
-
- // miscellaneous
-
- Info // pattern information
- }
-
- [Flags]
- enum OpFlags : ushort {
- None = 0x000,
- Negate = 0x100, // succeed on mismatch
- IgnoreCase = 0x200, // case insensitive matching
- RightToLeft = 0x400, // right-to-left matching
- Lazy = 0x800 // minimizing repeat
- }
-
- enum Position : ushort {
- Any, // anywhere
- Start, // start of string \A
- StartOfString, // start of string \A
- StartOfLine, // start of line ^
- StartOfScan, // start of scan \G
- End, // end or before newline at end \Z
- EndOfString, // end of string \z
- EndOfLine, // end of line $
- Boundary, // word boundary \b
- NonBoundary // not word boundary \B
- };
-
- // see category.cs for Category enum
-
- interface IMachine {
- Match Scan (Regex regex, string text, int start, int end);
- }
-
- interface IMachineFactory {
- IMachine NewInstance ();
- }
-
- // Anchor SKIP OFFSET
- //
- // Flags: [RightToLeft] ??
- // SKIP: relative address of tail expression
- // OFFSET: offset of anchor from start of pattern
- //
- // Usage:
- //
- // Anchor :1 OFFSET
- // <expr>
- // True
- // 1: <tail>
- //
- // Notes:
- //
- // In practice, the anchoring expression is only going to be
- // Position (StartOfString, StartOfLine, StartOfScan) or String.
- // This is because the optimizer looks for position anchors at the
- // start of the expression, and if that fails it looks for the
- // longest substring. If an expression has neither a position
- // anchor or a longest substring anchor, then the anchoring expression
- // is left empty. Since an empty expression will anchor at any
- // position in any string, the entire input string will be scanned.
-
- // String LEN STR...
- //
- // Flags: [RightToLeft, IgnoreCase]
- // LEN: length of string
- // STR: string characters
-
- // Branch SKIP
- //
- // SKIP: relative address of next branch
- //
- // Branch :1
- // <alt expr 1>
- // Jump :4
- // 1: Branch :2
- // <alt expr 2>
- // Jump :4
- // 2: Branch :3
- // <alt expr 3>
- // Jump :4
- // 3: False
- // 4: <tail>
-
- // Repeat SKIP MIN MAX
- //
- // Flags: [Lazy]
- // SKIP: relative address of Until instruction
- // MIN: minimum iterations
- // MAX: maximum iterations (0xffff is infinity)
- //
- // Repeat :1 MIN MAX
- // <expr>
- // Until
- // 1: <tail>
-
- // FastRepeat SKIP MIN MAX
- //
- // Flags: [Lazy]
- // SKIP: relative address of tail expression
- // MIN: minimum iterations
- // MAX: maximum iterations (0xffff is infinity)
- //
- // FastRepeat :1 MIN MAX
- // <expr>
- // True
- // 1: <tail>
- //
- // Notes:
- //
- // The subexpression of a FastRepeat construct must not contain any
- // complex operators. These include: Open, Close, Balance, Repeat,
- // FastRepeat, Sub, Test. In addition, the subexpression must have
- // been determined to have a fixed width.
-
- // Sub SKIP
- //
- // SKIP: relative address of tail expression
- //
- // Sub :1
- // <expr>
- // 1: <tail>
- //
- // Notes:
- //
- // The Sub operator invokes an independent subexpression. This means
- // that the subexpression will match only once and so will not
- // participate in any backtracking.
-
- // Test TSKIP FSKIP
- //
- // TSKIP: relative address of true expression
- // FSKIP: relative address of false expression
- //
- // Usage: (?(?=test)true|false)
- //
- // Test :1 :2
- // <test expr>
- // 1: <true expr>
- // Jump
- // 2: <false epxr>
- // <tail>
- //
- // Usage: (?(?=test)true)
- //
- // Test :1 :2
- // <test expr>
- // 1: <true expr>
- // 2: <tail>
- //
- // Usage: (?=test)
- //
- // Test :1 :2
- // <test expr>
- // 1: <true expr>
- // Jump 3:
- // 2: False
- // 3: <tail>
- //
- // Notes:
- //
- // For negative lookaheads, just swap the values of TSKIP and
- // FSKIP. For lookbehinds, the test expression must be compiled
- // in reverse. The test expression is always executed as an
- // independent subexpression, so its behaviour is non-backtracking
- // (like a Sub clause.)
-
- // IfDefined SKIP GID
- //
- // SKIP: relative address of else expression
- // GID: number of group to check
- //
- // Usage: (?(gid)true)
- //
- // IfDefined :1
- // <true expr>
- // 1: <tail>
- //
- // Usage: (?(gid)true|false)
- //
- // IfDefined :1
- // <true expr>
- // Jump :2
- // 1: <false expr>
- // 2: <tail>
-
- // Jump SKIP
- //
- // SKIP: relative address of target expression
- //
- // Jump :1
- // ...
- // :1 <target expr>
-
- // Character CHAR
- //
- // Flags: [Negate, IgnoreCase, RightToLeft]
- // CHAR: exact character to match
-
- // Category CAT
- //
- // Flags: [Negate, RightToLeft]
- // CAT: category to match (see Category enum)
-
- // Range LO HI
- //
- // Flags: [Negate, IgnoreCase, RightToLeft]
- // LO: lowest character in range
- // HI: higest character in range
-
- // Set LO LEN SET...
- //
- // Flags: [Negate, IgnoreCase, RightToLeft]
- // LO: lowest character in set
- // LEN: number of words in set
- // SET: bit array representing characters in set
- //
- // Notes:
- //
- // Each word in the set represents 16 characters, so the first word
- // defines membership for characters LO to LO + 15, the second for
- // LO + 16 to LO + 31, and so on up to LO + (LEN * 16 - 1). It is
- // up to the compiler to provide a compact representation for sparse
- // unicode sets. The simple way is to use Set 0 4096. Other methods
- // involve paritioning the set and placing the components into an
- // In block.
-
- // In SKIP
- //
- // SKIP: relative address of tail expression
- //
- // Usage: [expr]
- //
- // In :1
- // <expr>
- // True
- // :1 <tail>
- //
- // Usage: [^expr]
- //
- // In :1
- // <expr>
- // False
- // :1 <tail>
- //
- // Notes:
- //
- // The In instruction consumes a single character, using the flags
- // of the first instruction in the subexpression to determine its
- // IgnoreCase and RightToLeft properties. The subexpression is then
- // applied to the single character as a disjunction. If any instruction
- // in the subexpression succeeds, the entire In construct succeeds
- // and matching continues with the tail.
-
- // Position POS
- //
- // POS: position to match (see Position enum)
-
- // Open GID
- //
- // GID: number of group to open
-
- // Close GID
- //
- // GID: number of group to close
-
- // Balance GID BAL
- //
- // GID: number of capturing group (0 if none)
- // BAL: number of group to undefine
-
- // Info GROUPS MIN MAX
- //
- // GROUPS: number of capturing groups
- // MIN: minimum width of pattern
- // MAX: maximum width of pattern (0xffff means undefined)
-
- // False
-
- // True
-
- // Reference GID
- //
- // Flags: [IgnoreCase, RightToLeft]
- // GID: number of group to reference
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/cache.cs b/mcs/class/System/System.Text.RegularExpressions/cache.cs
deleted file mode 100644
index 8936eca3f2c..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/cache.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: cache.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
-
- class FactoryCache {
- public FactoryCache (int capacity) {
- this.capacity = capacity;
- this.factories = new Hashtable (capacity);
- this.mru_list = new MRUList ();
- }
-
- public void Add (string pattern, RegexOptions options, IMachineFactory factory) {
- lock (this) {
- Key k = new Key (pattern, options);
-
- while (factories.Count >= capacity) {
- object victim = mru_list.Evict ();
- if (victim != null)
- factories.Remove ((Key)victim);
- }
-
- factories[k] = factory;
- mru_list.Use (k);
- }
- }
-
- public IMachineFactory Lookup (string pattern, RegexOptions options) {
- lock (this) {
- Key k = new Key (pattern, options);
- if (factories.Contains (k)) {
- mru_list.Use (k);
- return (IMachineFactory)factories[k];
- }
- }
-
- return null;
- }
-
- private int capacity;
- private Hashtable factories;
- private MRUList mru_list;
-
- struct Key {
- public string pattern;
- public RegexOptions options;
-
- public Key (string pattern, RegexOptions options) {
- this.pattern = pattern;
- this.options = options;
- }
-
- public new int GetHashCode () {
- return pattern.GetHashCode () ^ (int)options;
- }
-
- public new bool Equals (object o) {
- if (o == null || o.GetType () != this.GetType ())
- return false;
-
- Key k = (Key)o;
- return options == k.options && pattern.Equals (k.pattern);
- }
-
- public new string ToString () {
- return "('" + pattern + "', [" + options + "])";
- }
- }
- }
-
- class MRUList {
- public MRUList () {
- head = tail = null;
- }
-
- public void Use (object o) {
- Node node;
-
- if (head == null) {
- node = new Node (o);
- head = tail = node;
- return;
- }
-
- node = head;
- while (node != null && !o.Equals (node.value))
- node = node.previous;
-
- if (node == null)
- node = new Node (o);
- else {
- if (node == head)
- return;
-
- if (node == tail)
- tail = node.next;
- else
- node.previous.next = node.next;
-
- node.next.previous = node.previous;
- }
-
- head.next = node;
- node.previous = head;
- node.next = null;
- head = node;
- }
-
- public object Evict () {
- if (tail == null)
- return null;
-
- object o = tail.value;
- tail = tail.next;
- tail.previous = null;
- return o;
- }
-
- private Node head, tail;
-
- private class Node {
- public object value;
- public Node previous, next;
-
- public Node (object value) {
- this.value = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/category.cs b/mcs/class/System/System.Text.RegularExpressions/category.cs
deleted file mode 100644
index 763712cb581..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/category.cs
+++ /dev/null
@@ -1,637 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: category.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Globalization;
-
-namespace System.Text.RegularExpressions {
-
- enum Category : ushort {
- None,
-
- // canonical classes
-
- Any, // any character except newline .
- AnySingleline, // any character . (s option)
- Word, // any word character \w
- Digit, // any digit character \d
- WhiteSpace, // any whitespace character \s
-
- // ECMAScript classes
-
-
- EcmaAny,
- EcmaAnySingleline,
- EcmaWord, // [a-zA-Z_0-9]
- EcmaDigit, // [0-9]
- EcmaWhiteSpace, // [ \f\n\r\t\v]
-
- // unicode categories
-
- UnicodeL, // Letter
- UnicodeM, // Mark
- UnicodeN, // Number
- UnicodeZ, // Separator
- UnicodeP, // Punctuation
- UnicodeS, // Symbol
- UnicodeC, // Other
-
- UnicodeLu, // UppercaseLetter
- UnicodeLl, // LowercaseLetter
- UnicodeLt, // TitlecaseLetter
- UnicodeLm, // ModifierLetter
- UnicodeLo, // OtherLetter
- UnicodeMn, // NonspacingMark
- UnicodeMe, // EnclosingMark
- UnicodeMc, // SpacingMark
- UnicodeNd, // DecimalNumber
- UnicodeNl, // LetterNumber
- UnicodeNo, // OtherNumber
- UnicodeZs, // SpaceSeparator
- UnicodeZl, // LineSeparator
- UnicodeZp, // ParagraphSeparator
- UnicodePd, // DashPunctuation
- UnicodePs, // OpenPunctuation
- UnicodePi, // InitialPunctuation
- UnicodePe, // ClosePunctuation
- UnicodePf, // FinalPunctuation
- UnicodePc, // ConnectorPunctuation
- UnicodePo, // OtherPunctuation
- UnicodeSm, // MathSymbol
- UnicodeSc, // CurrencySymbol
- UnicodeSk, // ModifierSymbol
- UnicodeSo, // OtherSymbol
- UnicodeCc, // Control
- UnicodeCf, // Format
- UnicodeCo, // PrivateUse
- UnicodeCs, // Surrogate
- UnicodeCn, // Unassigned
-
- // unicode block ranges
-
- // notes: the categories marked with a star are valid unicode block ranges,
- // but don't seem to be accepted by the MS parser using the /p{...} format.
- // any ideas?
-
- UnicodeBasicLatin,
- UnicodeLatin1Supplement, // *
- UnicodeLatinExtendedA, // *
- UnicodeLatinExtendedB, // *
- UnicodeIPAExtensions,
- UnicodeSpacingModifierLetters,
- UnicodeCombiningDiacriticalMarks,
- UnicodeGreek,
- UnicodeCyrillic,
- UnicodeArmenian,
- UnicodeHebrew,
- UnicodeArabic,
- UnicodeSyriac,
- UnicodeThaana,
- UnicodeDevanagari,
- UnicodeBengali,
- UnicodeGurmukhi,
- UnicodeGujarati,
- UnicodeOriya,
- UnicodeTamil,
- UnicodeTelugu,
- UnicodeKannada,
- UnicodeMalayalam,
- UnicodeSinhala,
- UnicodeThai,
- UnicodeLao,
- UnicodeTibetan,
- UnicodeMyanmar,
- UnicodeGeorgian,
- UnicodeHangulJamo,
- UnicodeEthiopic,
- UnicodeCherokee,
- UnicodeUnifiedCanadianAboriginalSyllabics,
- UnicodeOgham,
- UnicodeRunic,
- UnicodeKhmer,
- UnicodeMongolian,
- UnicodeLatinExtendedAdditional,
- UnicodeGreekExtended,
- UnicodeGeneralPunctuation,
- UnicodeSuperscriptsandSubscripts,
- UnicodeCurrencySymbols,
- UnicodeCombiningMarksforSymbols,
- UnicodeLetterlikeSymbols,
- UnicodeNumberForms,
- UnicodeArrows,
- UnicodeMathematicalOperators,
- UnicodeMiscellaneousTechnical,
- UnicodeControlPictures,
- UnicodeOpticalCharacterRecognition,
- UnicodeEnclosedAlphanumerics,
- UnicodeBoxDrawing,
- UnicodeBlockElements,
- UnicodeGeometricShapes,
- UnicodeMiscellaneousSymbols,
- UnicodeDingbats,
- UnicodeBraillePatterns,
- UnicodeCJKRadicalsSupplement,
- UnicodeKangxiRadicals,
- UnicodeIdeographicDescriptionCharacters,
- UnicodeCJKSymbolsandPunctuation,
- UnicodeHiragana,
- UnicodeKatakana,
- UnicodeBopomofo,
- UnicodeHangulCompatibilityJamo,
- UnicodeKanbun,
- UnicodeBopomofoExtended,
- UnicodeEnclosedCJKLettersandMonths,
- UnicodeCJKCompatibility,
- UnicodeCJKUnifiedIdeographsExtensionA,
- UnicodeCJKUnifiedIdeographs,
- UnicodeYiSyllables,
- UnicodeYiRadicals,
- UnicodeHangulSyllables,
- UnicodeHighSurrogates,
- UnicodeHighPrivateUseSurrogates,
- UnicodeLowSurrogates,
- UnicodePrivateUse,
- UnicodeCJKCompatibilityIdeographs,
- UnicodeAlphabeticPresentationForms,
- UnicodeArabicPresentationFormsA, // *
- UnicodeCombiningHalfMarks,
- UnicodeCJKCompatibilityForms,
- UnicodeSmallFormVariants,
- UnicodeArabicPresentationFormsB, // *
- UnicodeSpecials,
- UnicodeHalfwidthandFullwidthForms,
-
- UnicodeOldItalic,
- UnicodeGothic,
- UnicodeDeseret,
- UnicodeByzantineMusicalSymbols,
- UnicodeMusicalSymbols,
- UnicodeMathematicalAlphanumericSymbols,
- UnicodeCJKUnifiedIdeographsExtensionB,
- UnicodeCJKCompatibilityIdeographsSupplement,
- UnicodeTags
- }
-
- class CategoryUtils {
- public static Category CategoryFromName (string name) {
- try {
- if (name.Substring (0, 2).Equals ("Is")) // remove prefix from block range
- name = name.Substring (2);
-
- return (Category)Enum.Parse (typeof (Category), "Unicode" + name);
- }
- catch (ArgumentException) {
- return Category.None;
- }
- }
-
- public static bool IsCategory (Category cat, char c) {
- switch (cat) {
- case Category.None:
- return false;
-
- case Category.Any:
- return c != '\n';
-
- case Category.AnySingleline:
- return true;
-
- case Category.Word:
- return
- Char.IsLetterOrDigit (c) ||
- IsCategory (UnicodeCategory.ConnectorPunctuation, c);
-
- case Category.Digit:
- return Char.IsDigit (c);
-
- case Category.WhiteSpace:
- return Char.IsWhiteSpace (c);
-
- // ECMA categories
-
- case Category.EcmaAny:
- return c != '\n';
-
- case Category.EcmaAnySingleline:
- return true;
-
- case Category.EcmaWord:
- return
- 'a' <= c && c <= 'z' ||
- 'A' <= c && c <= 'Z' ||
- '0' <= c && c <= '9' ||
- '_' == c;
-
- case Category.EcmaDigit:
- return
- '0' <= c && c <= 9;
-
- case Category.EcmaWhiteSpace:
- return
- c == ' ' ||
- c == '\f' ||
- c == '\n' ||
- c == '\r' ||
- c == '\t' ||
- c == '\v';
-
- // Unicode categories...
-
- // letter
-
- case Category.UnicodeLu: return IsCategory (UnicodeCategory.UppercaseLetter, c);
- case Category.UnicodeLl: return IsCategory (UnicodeCategory.LowercaseLetter, c);
- case Category.UnicodeLt: return IsCategory (UnicodeCategory.TitlecaseLetter, c);
- case Category.UnicodeLm: return IsCategory (UnicodeCategory.ModifierLetter, c);
- case Category.UnicodeLo: return IsCategory (UnicodeCategory.OtherLetter, c);
-
- // mark
-
- case Category.UnicodeMn: return IsCategory (UnicodeCategory.NonSpacingMark, c);
- case Category.UnicodeMe: return IsCategory (UnicodeCategory.EnclosingMark, c);
- case Category.UnicodeMc: return IsCategory (UnicodeCategory.SpacingCombiningMark, c);
- case Category.UnicodeNd: return IsCategory (UnicodeCategory.DecimalDigitNumber, c);
-
- // number
-
- case Category.UnicodeNl: return IsCategory (UnicodeCategory.LetterNumber, c);
- case Category.UnicodeNo: return IsCategory (UnicodeCategory.OtherNumber, c);
-
- // separator
-
- case Category.UnicodeZs: return IsCategory (UnicodeCategory.SpaceSeparator, c);
- case Category.UnicodeZl: return IsCategory (UnicodeCategory.LineSeparator, c);
- case Category.UnicodeZp: return IsCategory (UnicodeCategory.ParagraphSeparator, c);
-
- // punctuation
-
- case Category.UnicodePd: return IsCategory (UnicodeCategory.DashPunctuation, c);
- case Category.UnicodePs: return IsCategory (UnicodeCategory.OpenPunctuation, c);
- case Category.UnicodePi: return IsCategory (UnicodeCategory.InitialQuotePunctuation, c);
- case Category.UnicodePe: return IsCategory (UnicodeCategory.ClosePunctuation, c);
- case Category.UnicodePf: return IsCategory (UnicodeCategory.FinalQuotePunctuation, c);
- case Category.UnicodePc: return IsCategory (UnicodeCategory.ConnectorPunctuation, c);
- case Category.UnicodePo: return IsCategory (UnicodeCategory.OtherPunctuation, c);
-
- // symbol
-
- case Category.UnicodeSm: return IsCategory (UnicodeCategory.MathSymbol, c);
- case Category.UnicodeSc: return IsCategory (UnicodeCategory.CurrencySymbol, c);
- case Category.UnicodeSk: return IsCategory (UnicodeCategory.ModifierSymbol, c);
- case Category.UnicodeSo: return IsCategory (UnicodeCategory.OtherSymbol, c);
-
- // other
-
- case Category.UnicodeCc: return IsCategory (UnicodeCategory.Control, c);
- case Category.UnicodeCf: return IsCategory (UnicodeCategory.Format, c);
- case Category.UnicodeCo: return IsCategory (UnicodeCategory.PrivateUse, c);
- case Category.UnicodeCs: return IsCategory (UnicodeCategory.Surrogate, c);
- case Category.UnicodeCn: return IsCategory (UnicodeCategory.OtherNotAssigned, c);
-
- case Category.UnicodeL: // letter
- return
- IsCategory (UnicodeCategory.UppercaseLetter, c) ||
- IsCategory (UnicodeCategory.LowercaseLetter, c) ||
- IsCategory (UnicodeCategory.TitlecaseLetter, c) ||
- IsCategory (UnicodeCategory.ModifierLetter, c) ||
- IsCategory (UnicodeCategory.OtherLetter, c);
-
- case Category.UnicodeM: // mark
- return
- IsCategory (UnicodeCategory.NonSpacingMark, c) ||
- IsCategory (UnicodeCategory.EnclosingMark, c) ||
- IsCategory (UnicodeCategory.SpacingCombiningMark, c);
-
- case Category.UnicodeN: // number
- return
- IsCategory (UnicodeCategory.DecimalDigitNumber, c) ||
- IsCategory (UnicodeCategory.LetterNumber, c) ||
- IsCategory (UnicodeCategory.OtherNumber, c);
-
- case Category.UnicodeZ: // separator
- return
- IsCategory (UnicodeCategory.SpaceSeparator, c) ||
- IsCategory (UnicodeCategory.LineSeparator, c) ||
- IsCategory (UnicodeCategory.ParagraphSeparator, c);
-
- case Category.UnicodeP: // punctuation
- return
- IsCategory (UnicodeCategory.DashPunctuation, c) ||
- IsCategory (UnicodeCategory.OpenPunctuation, c) ||
- IsCategory (UnicodeCategory.InitialQuotePunctuation, c) ||
- IsCategory (UnicodeCategory.ClosePunctuation, c) ||
- IsCategory (UnicodeCategory.FinalQuotePunctuation, c) ||
- IsCategory (UnicodeCategory.ConnectorPunctuation, c) ||
- IsCategory (UnicodeCategory.OtherPunctuation, c);
-
- case Category.UnicodeS: // symbol
- return
- IsCategory (UnicodeCategory.MathSymbol, c) ||
- IsCategory (UnicodeCategory.CurrencySymbol, c) ||
- IsCategory (UnicodeCategory.ModifierSymbol, c) ||
- IsCategory (UnicodeCategory.OtherSymbol, c);
-
- case Category.UnicodeC: // other
- return
- IsCategory (UnicodeCategory.Control, c) ||
- IsCategory (UnicodeCategory.Format, c) ||
- IsCategory (UnicodeCategory.PrivateUse, c) ||
- IsCategory (UnicodeCategory.Surrogate, c) ||
- IsCategory (UnicodeCategory.OtherNotAssigned, c);
-
- // Unicode block ranges...
-
- case Category.UnicodeBasicLatin:
- return '\u0000' <= c && c <= '\u007F';
-
- case Category.UnicodeLatin1Supplement:
- return '\u0080' <= c && c <= '\u00FF';
-
- case Category.UnicodeLatinExtendedA:
- return '\u0100' <= c && c <= '\u017F';
-
- case Category.UnicodeLatinExtendedB:
- return '\u0180' <= c && c <= '\u024F';
-
- case Category.UnicodeIPAExtensions:
- return '\u0250' <= c && c <= '\u02AF';
-
- case Category.UnicodeSpacingModifierLetters:
- return '\u02B0' <= c && c <= '\u02FF';
-
- case Category.UnicodeCombiningDiacriticalMarks:
- return '\u0300' <= c && c <= '\u036F';
-
- case Category.UnicodeGreek:
- return '\u0370' <= c && c <= '\u03FF';
-
- case Category.UnicodeCyrillic:
- return '\u0400' <= c && c <= '\u04FF';
-
- case Category.UnicodeArmenian:
- return '\u0530' <= c && c <= '\u058F';
-
- case Category.UnicodeHebrew:
- return '\u0590' <= c && c <= '\u05FF';
-
- case Category.UnicodeArabic:
- return '\u0600' <= c && c <= '\u06FF';
-
- case Category.UnicodeSyriac:
- return '\u0700' <= c && c <= '\u074F';
-
- case Category.UnicodeThaana:
- return '\u0780' <= c && c <= '\u07BF';
-
- case Category.UnicodeDevanagari:
- return '\u0900' <= c && c <= '\u097F';
-
- case Category.UnicodeBengali:
- return '\u0980' <= c && c <= '\u09FF';
-
- case Category.UnicodeGurmukhi:
- return '\u0A00' <= c && c <= '\u0A7F';
-
- case Category.UnicodeGujarati:
- return '\u0A80' <= c && c <= '\u0AFF';
-
- case Category.UnicodeOriya:
- return '\u0B00' <= c && c <= '\u0B7F';
-
- case Category.UnicodeTamil:
- return '\u0B80' <= c && c <= '\u0BFF';
-
- case Category.UnicodeTelugu:
- return '\u0C00' <= c && c <= '\u0C7F';
-
- case Category.UnicodeKannada:
- return '\u0C80' <= c && c <= '\u0CFF';
-
- case Category.UnicodeMalayalam:
- return '\u0D00' <= c && c <= '\u0D7F';
-
- case Category.UnicodeSinhala:
- return '\u0D80' <= c && c <= '\u0DFF';
-
- case Category.UnicodeThai:
- return '\u0E00' <= c && c <= '\u0E7F';
-
- case Category.UnicodeLao:
- return '\u0E80' <= c && c <= '\u0EFF';
-
- case Category.UnicodeTibetan:
- return '\u0F00' <= c && c <= '\u0FFF';
-
- case Category.UnicodeMyanmar:
- return '\u1000' <= c && c <= '\u109F';
-
- case Category.UnicodeGeorgian:
- return '\u10A0' <= c && c <= '\u10FF';
-
- case Category.UnicodeHangulJamo:
- return '\u1100' <= c && c <= '\u11FF';
-
- case Category.UnicodeEthiopic:
- return '\u1200' <= c && c <= '\u137F';
-
- case Category.UnicodeCherokee:
- return '\u13A0' <= c && c <= '\u13FF';
-
- case Category.UnicodeUnifiedCanadianAboriginalSyllabics:
- return '\u1400' <= c && c <= '\u167F';
-
- case Category.UnicodeOgham:
- return '\u1680' <= c && c <= '\u169F';
-
- case Category.UnicodeRunic:
- return '\u16A0' <= c && c <= '\u16FF';
-
- case Category.UnicodeKhmer:
- return '\u1780' <= c && c <= '\u17FF';
-
- case Category.UnicodeMongolian:
- return '\u1800' <= c && c <= '\u18AF';
-
- case Category.UnicodeLatinExtendedAdditional:
- return '\u1E00' <= c && c <= '\u1EFF';
-
- case Category.UnicodeGreekExtended:
- return '\u1F00' <= c && c <= '\u1FFF';
-
- case Category.UnicodeGeneralPunctuation:
- return '\u2000' <= c && c <= '\u206F';
-
- case Category.UnicodeSuperscriptsandSubscripts:
- return '\u2070' <= c && c <= '\u209F';
-
- case Category.UnicodeCurrencySymbols:
- return '\u20A0' <= c && c <= '\u20CF';
-
- case Category.UnicodeCombiningMarksforSymbols:
- return '\u20D0' <= c && c <= '\u20FF';
-
- case Category.UnicodeLetterlikeSymbols:
- return '\u2100' <= c && c <= '\u214F';
-
- case Category.UnicodeNumberForms:
- return '\u2150' <= c && c <= '\u218F';
-
- case Category.UnicodeArrows:
- return '\u2190' <= c && c <= '\u21FF';
-
- case Category.UnicodeMathematicalOperators:
- return '\u2200' <= c && c <= '\u22FF';
-
- case Category.UnicodeMiscellaneousTechnical:
- return '\u2300' <= c && c <= '\u23FF';
-
- case Category.UnicodeControlPictures:
- return '\u2400' <= c && c <= '\u243F';
-
- case Category.UnicodeOpticalCharacterRecognition:
- return '\u2440' <= c && c <= '\u245F';
-
- case Category.UnicodeEnclosedAlphanumerics:
- return '\u2460' <= c && c <= '\u24FF';
-
- case Category.UnicodeBoxDrawing:
- return '\u2500' <= c && c <= '\u257F';
-
- case Category.UnicodeBlockElements:
- return '\u2580' <= c && c <= '\u259F';
-
- case Category.UnicodeGeometricShapes:
- return '\u25A0' <= c && c <= '\u25FF';
-
- case Category.UnicodeMiscellaneousSymbols:
- return '\u2600' <= c && c <= '\u26FF';
-
- case Category.UnicodeDingbats:
- return '\u2700' <= c && c <= '\u27BF';
-
- case Category.UnicodeBraillePatterns:
- return '\u2800' <= c && c <= '\u28FF';
-
- case Category.UnicodeCJKRadicalsSupplement:
- return '\u2E80' <= c && c <= '\u2EFF';
-
- case Category.UnicodeKangxiRadicals:
- return '\u2F00' <= c && c <= '\u2FDF';
-
- case Category.UnicodeIdeographicDescriptionCharacters:
- return '\u2FF0' <= c && c <= '\u2FFF';
-
- case Category.UnicodeCJKSymbolsandPunctuation:
- return '\u3000' <= c && c <= '\u303F';
-
- case Category.UnicodeHiragana:
- return '\u3040' <= c && c <= '\u309F';
-
- case Category.UnicodeKatakana:
- return '\u30A0' <= c && c <= '\u30FF';
-
- case Category.UnicodeBopomofo:
- return '\u3100' <= c && c <= '\u312F';
-
- case Category.UnicodeHangulCompatibilityJamo:
- return '\u3130' <= c && c <= '\u318F';
-
- case Category.UnicodeKanbun:
- return '\u3190' <= c && c <= '\u319F';
-
- case Category.UnicodeBopomofoExtended:
- return '\u31A0' <= c && c <= '\u31BF';
-
- case Category.UnicodeEnclosedCJKLettersandMonths:
- return '\u3200' <= c && c <= '\u32FF';
-
- case Category.UnicodeCJKCompatibility:
- return '\u3300' <= c && c <= '\u33FF';
-
- case Category.UnicodeCJKUnifiedIdeographsExtensionA:
- return '\u3400' <= c && c <= '\u4DB5';
-
- case Category.UnicodeCJKUnifiedIdeographs:
- return '\u4E00' <= c && c <= '\u9FFF';
-
- case Category.UnicodeYiSyllables:
- return '\uA000' <= c && c <= '\uA48F';
-
- case Category.UnicodeYiRadicals:
- return '\uA490' <= c && c <= '\uA4CF';
-
- case Category.UnicodeHangulSyllables:
- return '\uAC00' <= c && c <= '\uD7A3';
-
- case Category.UnicodeHighSurrogates:
- return '\uD800' <= c && c <= '\uDB7F';
-
- case Category.UnicodeHighPrivateUseSurrogates:
- return '\uDB80' <= c && c <= '\uDBFF';
-
- case Category.UnicodeLowSurrogates:
- return '\uDC00' <= c && c <= '\uDFFF';
-
- case Category.UnicodePrivateUse:
- return '\uE000' <= c && c <= '\uF8FF';
-
- case Category.UnicodeCJKCompatibilityIdeographs:
- return '\uF900' <= c && c <= '\uFAFF';
-
- case Category.UnicodeAlphabeticPresentationForms:
- return '\uFB00' <= c && c <= '\uFB4F';
-
- case Category.UnicodeArabicPresentationFormsA:
- return '\uFB50' <= c && c <= '\uFDFF';
-
- case Category.UnicodeCombiningHalfMarks:
- return '\uFE20' <= c && c <= '\uFE2F';
-
- case Category.UnicodeCJKCompatibilityForms:
- return '\uFE30' <= c && c <= '\uFE4F';
-
- case Category.UnicodeSmallFormVariants:
- return '\uFE50' <= c && c <= '\uFE6F';
-
- case Category.UnicodeArabicPresentationFormsB:
- return '\uFE70' <= c && c <= '\uFEFE';
-
- case Category.UnicodeHalfwidthandFullwidthForms:
- return '\uFF00' <= c && c <= '\uFFEF';
-
- case Category.UnicodeSpecials:
- return
- '\uFEFF' <= c && c <= '\uFEFF' ||
- '\uFFF0' <= c && c <= '\uFFFD';
-
- // these block ranges begin above 0x10000
-
- case Category.UnicodeOldItalic:
- case Category.UnicodeGothic:
- case Category.UnicodeDeseret:
- case Category.UnicodeByzantineMusicalSymbols:
- case Category.UnicodeMusicalSymbols:
- case Category.UnicodeMathematicalAlphanumericSymbols:
- case Category.UnicodeCJKUnifiedIdeographsExtensionB:
- case Category.UnicodeCJKCompatibilityIdeographsSupplement:
- case Category.UnicodeTags:
- return false;
-
- default:
- return false;
- }
- }
-
- private static bool IsCategory (UnicodeCategory uc, char c) {
- if (Char.GetUnicodeCategory (c) == uc)
- return true;
-
- return false;
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/collections.cs b/mcs/class/System/System.Text.RegularExpressions/collections.cs
deleted file mode 100644
index 11db0ea6105..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/collections.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: collections.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
- public abstract class RegexCollectionBase : ICollection, IEnumerable {
- public int Count {
- get { return list.Count; }
- }
-
- public bool IsReadOnly {
- get { return true; } // FIXME
- }
-
- public bool IsSynchronized {
- get { return false; } // FIXME
- }
-
- public object SyncRoot {
- get { return list; } // FIXME
- }
-
- public void CopyTo (Array array, int index) {
- foreach (Object o in list) {
- if (index > array.Length)
- break;
-
- array.SetValue (o, index ++);
- }
- }
-
- public IEnumerator GetEnumerator () {
- return new Enumerator (list);
- }
-
- // internal methods
-
- internal RegexCollectionBase () {
- list = new ArrayList ();
- }
-
- internal void Add (Object o) {
- list.Add (o);
- }
-
- // IEnumerator implementation
-
- private class Enumerator : IEnumerator {
- public Enumerator (IList list) {
- this.list = list;
- Reset ();
- }
-
- public object Current {
- get {
- if (ptr >= list.Count)
- throw new InvalidOperationException ();
-
- return list[ptr];
- }
- }
-
- public bool MoveNext () {
- if (ptr > list.Count)
- throw new InvalidOperationException ();
-
- return ++ ptr < list.Count;
- }
-
- public void Reset () {
- ptr = -1;
- }
-
- private IList list;
- private int ptr;
- }
-
- // protected fields
-
- protected ArrayList list;
- }
-
- public class CaptureCollection : RegexCollectionBase, ICollection, IEnumerable {
- public Capture this[int i] {
- get { return (Capture)list[i]; }
- }
-
- internal CaptureCollection (Capture cap) {
- while (cap != null) {
- if (cap.IsDefined)
- Add (cap);
-
- cap = cap.Previous;
- }
-
- list.Reverse ();
- }
- }
-
- public class GroupCollection : RegexCollectionBase, ICollection, IEnumerable {
- public Group this[int i] {
- get { return (Group)list[i]; }
- }
-
- internal GroupCollection () {
- }
- }
-
- public class MatchCollection : RegexCollectionBase, ICollection, IEnumerable {
- public Match this[int i] {
- get { return (Match)list[i]; }
- }
-
- internal MatchCollection () {
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/compiler.cs b/mcs/class/System/System.Text.RegularExpressions/compiler.cs
deleted file mode 100644
index 82fb8cfbb73..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/compiler.cs
+++ /dev/null
@@ -1,368 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: compiler.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
- abstract class LinkRef {
- // empty
- }
-
- interface ICompiler {
- void Reset ();
- IMachineFactory GetMachineFactory ();
-
- // instruction emission
-
- void EmitFalse ();
- void EmitTrue ();
-
- // character matching
-
- void EmitCharacter (char c, bool negate, bool ignore, bool reverse);
- void EmitCategory (Category cat, bool negate, bool reverse);
- void EmitRange (char lo, char hi, bool negate, bool ignore, bool reverse);
- void EmitSet (char lo, BitArray set, bool negate, bool ignore, bool reverse);
-
- // other operators
-
- void EmitString (string str, bool ignore, bool reverse);
- void EmitPosition (Position pos);
- void EmitOpen (int gid);
- void EmitClose (int gid);
- void EmitBalance (int gid, int balance);
- void EmitReference (int gid, bool ignore, bool reverse);
-
- // constructs
-
- void EmitIfDefined (int gid, LinkRef tail);
- void EmitSub (LinkRef tail);
- void EmitTest (LinkRef yes, LinkRef tail);
- void EmitBranch (LinkRef next);
- void EmitJump (LinkRef target);
- void EmitRepeat (int min, int max, bool lazy, LinkRef until);
- void EmitUntil (LinkRef repeat);
- void EmitIn (LinkRef tail);
- void EmitInfo (int count, int min, int max);
- void EmitFastRepeat (int min, int max, bool lazy, LinkRef tail);
- void EmitAnchor (int offset, LinkRef tail);
-
- LinkRef NewLink ();
- void ResolveLink (LinkRef link);
- }
-
- class InterpreterFactory : IMachineFactory {
- public InterpreterFactory (ushort[] pattern) {
- this.pattern = pattern;
- }
-
- public IMachine NewInstance () {
- return new Interpreter (pattern);
- }
-
- private ushort[] pattern;
- }
-
- class PatternCompiler : ICompiler {
- public static ushort EncodeOp (OpCode op, OpFlags flags) {
- return (ushort)((int)op | ((int)flags & 0xff00));
- }
-
- public static void DecodeOp (ushort word, out OpCode op, out OpFlags flags) {
- op = (OpCode)(word & 0x00ff);
- flags = (OpFlags)(word & 0xff00);
- }
-
- public PatternCompiler () {
- pgm = new ArrayList ();
- }
-
- // ICompiler implementation
-
- public void Reset () {
- pgm.Clear ();
- }
-
- public IMachineFactory GetMachineFactory () {
- ushort[] image = new ushort[pgm.Count];
- pgm.CopyTo (image);
-
- return new InterpreterFactory (image);
- }
-
- public void EmitFalse () {
- Emit (OpCode.False);
- }
-
- public void EmitTrue () {
- Emit (OpCode.True);
- }
-
- public void EmitCharacter (char c, bool negate, bool ignore, bool reverse) {
- Emit (OpCode.Character, MakeFlags (negate, ignore, reverse, false));
-
- if (ignore)
- c = Char.ToLower (c);
-
- Emit ((ushort)c);
- }
-
- public void EmitCategory (Category cat, bool negate, bool reverse) {
- Emit (OpCode.Category, MakeFlags (negate, false, reverse, false));
- Emit ((ushort)cat);
- }
-
- public void EmitRange (char lo, char hi, bool negate, bool ignore, bool reverse) {
- Emit (OpCode.Range, MakeFlags (negate, ignore, reverse, false));
- Emit ((ushort)lo);
- Emit ((ushort)hi);
- }
-
- public void EmitSet (char lo, BitArray set, bool negate, bool ignore, bool reverse) {
- Emit (OpCode.Set, MakeFlags (negate, ignore, reverse, false));
- Emit ((ushort)lo);
-
- int len = (set.Length + 0xf) >> 4;
- Emit ((ushort)len);
-
- int b = 0;
- while (len -- != 0) {
- ushort word = 0;
- for (int i = 0; i < 16; ++ i) {
- if (b >= set.Length)
- break;
-
- if (set[b ++])
- word |= (ushort)(1 << i);
- }
-
- Emit (word);
- }
- }
-
- public void EmitString (string str, bool ignore, bool reverse) {
- Emit (OpCode.String, MakeFlags (false, ignore, reverse, false));
- int len = str.Length;
- Emit ((ushort)len);
-
- if (ignore)
- str = str.ToLower ();
-
- for (int i = 0; i < len; ++ i)
- Emit ((ushort)str[i]);
- }
-
- public void EmitPosition (Position pos) {
- Emit (OpCode.Position, 0);
- Emit ((ushort)pos);
- }
-
- public void EmitOpen (int gid) {
- Emit (OpCode.Open);
- Emit ((ushort)gid);
- }
-
- public void EmitClose (int gid) {
- Emit (OpCode.Close);
- Emit ((ushort)gid);
- }
-
- public void EmitBalance (int gid, int balance) {
- Emit (OpCode.Balance);
- Emit ((ushort)gid);
- Emit ((ushort)balance);
- }
-
- public void EmitReference (int gid, bool ignore, bool reverse) {
- Emit (OpCode.Reference, MakeFlags (false, ignore, reverse, false));
- Emit ((ushort)gid);
- }
-
- public void EmitIfDefined (int gid, LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.IfDefined);
- EmitLink (tail);
- Emit ((ushort)gid);
- }
-
- public void EmitSub (LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.Sub);
- EmitLink (tail);
- }
-
- public void EmitTest (LinkRef yes, LinkRef tail) {
- BeginLink (yes);
- BeginLink (tail);
- Emit (OpCode.Test);
- EmitLink (yes);
- EmitLink (tail);
- }
-
- public void EmitBranch (LinkRef next) {
- BeginLink (next);
- Emit (OpCode.Branch, 0);
- EmitLink (next);
- }
-
- public void EmitJump (LinkRef target) {
- BeginLink (target);
- Emit (OpCode.Jump, 0);
- EmitLink (target);
- }
-
- public void EmitRepeat (int min, int max, bool lazy, LinkRef until) {
- BeginLink (until);
- Emit (OpCode.Repeat, MakeFlags (false, false, false, lazy));
- EmitLink (until);
- Emit ((ushort)min);
- Emit ((ushort)max);
- }
-
- public void EmitUntil (LinkRef repeat) {
- ResolveLink (repeat);
- Emit (OpCode.Until);
- }
-
- public void EmitFastRepeat (int min, int max, bool lazy, LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.FastRepeat, MakeFlags (false, false, false, lazy));
- EmitLink (tail);
- Emit ((ushort)min);
- Emit ((ushort)max);
- }
-
- public void EmitIn (LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.In);
- EmitLink (tail);
- }
-
- public void EmitAnchor (int offset, LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.Anchor);
- EmitLink (tail);
- Emit ((ushort)offset);
- }
-
- public void EmitInfo (int count, int min, int max) {
- Emit (OpCode.Info);
- Emit ((ushort)count);
- Emit ((ushort)min);
- Emit ((ushort)max);
- }
-
- public LinkRef NewLink () {
- return new PatternLinkStack ();
- }
-
- public void ResolveLink (LinkRef lref) {
- PatternLinkStack stack = (PatternLinkStack)lref;
-
- while (stack.Pop ())
- pgm[stack.OffsetAddress] = (ushort)stack.GetOffset (CurrentAddress);
- }
-
- // private members
-
- private static OpFlags MakeFlags (bool negate, bool ignore, bool reverse, bool lazy) {
- OpFlags flags = 0;
- if (negate) flags |= OpFlags.Negate;
- if (ignore) flags |= OpFlags.IgnoreCase;
- if (reverse) flags |= OpFlags.RightToLeft;
- if (lazy) flags |= OpFlags.Lazy;
-
- return flags;
- }
-
- private void Emit (OpCode op) {
- Emit (op, (OpFlags)0);
- }
-
- private void Emit (OpCode op, OpFlags flags) {
- Emit (EncodeOp (op, flags));
- }
-
- private void Emit (ushort word) {
- pgm.Add (word);
- }
-
- private int CurrentAddress {
- get { return pgm.Count; }
- }
-
- private void BeginLink (LinkRef lref) {
- PatternLinkStack stack = (PatternLinkStack)lref;
- stack.BaseAddress = CurrentAddress;
- }
-
- private void EmitLink (LinkRef lref) {
- PatternLinkStack stack = (PatternLinkStack)lref;
- stack.OffsetAddress = CurrentAddress;
- Emit ((ushort)0); // placeholder
- stack.Push ();
- }
-
- private class PatternLinkStack : LinkStack {
- public PatternLinkStack () {
- }
-
- public int BaseAddress {
- set { link.base_addr = value; }
- }
-
- public int OffsetAddress {
- get { return link.offset_addr; }
- set { link.offset_addr = value; }
- }
-
- public int GetOffset (int target_addr) {
- return target_addr - link.base_addr;
- }
-
- // LinkStack implementation
-
- protected override object GetCurrent () { return link; }
- protected override void SetCurrent (object l) { link = (Link)l; }
-
- private struct Link {
- public int base_addr;
- public int offset_addr;
- }
-
- Link link;
- }
-
- private ArrayList pgm;
- }
-
- abstract class LinkStack : LinkRef {
- public LinkStack () {
- stack = new Stack ();
- }
-
- public void Push () {
- stack.Push (GetCurrent ());
- }
-
- public bool Pop () {
- if (stack.Count > 0) {
- SetCurrent (stack.Pop ());
- return true;
- }
-
- return false;
- }
-
- protected abstract object GetCurrent ();
- protected abstract void SetCurrent (object l);
-
- private Stack stack;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/debug.cs b/mcs/class/System/System.Text.RegularExpressions/debug.cs
deleted file mode 100644
index fdc3ab87bc3..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/debug.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: debug.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
-
- class Disassembler {
- public static void DisassemblePattern (ushort[] image) {
- DisassembleBlock (image, 0, 0);
- }
-
- public static void DisassembleBlock (ushort[] image, int pc, int depth) {
- OpCode op;
- OpFlags flags;
-
- for (;;) {
- if (pc >= image.Length)
- return;
-
- PatternCompiler.DecodeOp (image[pc], out op, out flags);
- Console.Write (FormatAddress (pc) + ": "); // address
- Console.Write (new string (' ', depth * 2)); // indent
- Console.Write (DisassembleOp (image, pc)); // instruction
- Console.WriteLine ();
-
- int skip;
- switch (op) {
- case OpCode.False: case OpCode.True: case OpCode.Until:
- skip = 1;
- break;
-
- case OpCode.Character: case OpCode.Category: case OpCode.Position:
- case OpCode.Open: case OpCode.Close: case OpCode.Reference:
- case OpCode.Sub: case OpCode.Branch: case OpCode.Jump: case OpCode.In:
- skip = 2;
- break;
-
- case OpCode.Balance: case OpCode.IfDefined: case OpCode.Range:
- case OpCode.Test: case OpCode.Anchor:
- skip = 3;
- break;
-
- case OpCode.Repeat: case OpCode.FastRepeat: case OpCode.Info:
- skip = 4;
- break;
-
- case OpCode.String: skip = image[pc + 1] + 2; break;
- case OpCode.Set: skip = image[pc + 2] + 3; break;
-
- default:
- skip = 1;
- break;
- }
-
- pc += skip;
- }
- }
-
- public static string DisassembleOp (ushort[] image, int pc) {
- OpCode op;
- OpFlags flags;
-
- PatternCompiler.DecodeOp (image[pc], out op, out flags);
- string str = op.ToString ();
- if (flags != 0)
- str += "[" + flags.ToString ("f") + "]";
-
- switch (op) {
- case OpCode.False: case OpCode.True: case OpCode.Until:
- default:
- break;
-
- case OpCode.Info:
- str += " " + image[pc + 1];
- str += " (" + image[pc + 2] + ", " + image[pc + 3] + ")";
- break;
-
- case OpCode.Character:
- str += " '" + FormatChar ((char)image[pc + 1]) + "'";
- break;
-
- case OpCode.Category:
- str += " /" + (Category)image[pc + 1];
- break;
-
- case OpCode.Range:
- str += " '" + FormatChar ((char)image[pc + 1]) + "', ";
- str += " '" + FormatChar ((char)image[pc + 2]) + "'";
- break;
-
- case OpCode.Set:
- str += " " + FormatSet (image, pc + 1);
- break;
-
- case OpCode.String:
- str += " '" + ReadString (image, pc + 1) + "'";
- break;
-
- case OpCode.Position:
- str += " /" + (Position)image[pc + 1];
- break;
-
- case OpCode.Open: case OpCode.Close: case OpCode.Reference:
- str += " " + image[pc + 1];
- break;
-
- case OpCode.Balance:
- str += " " + image[pc + 1] + " " + image[pc + 2];
- break;
-
- case OpCode.IfDefined: case OpCode.Anchor:
- str += " :" + FormatAddress (pc + image[pc + 1]);
- str += " " + image[pc + 2];
- break;
-
- case OpCode.Sub: case OpCode.Branch: case OpCode.Jump:
- case OpCode.In:
- str += " :" + FormatAddress (pc + image[pc + 1]);
- break;
-
- case OpCode.Test:
- str += " :" + FormatAddress (pc + image[pc + 1]);
- str += ", :" + FormatAddress (pc + image[pc + 2]);
- break;
-
- case OpCode.Repeat: case OpCode.FastRepeat:
- str += " :" + FormatAddress (pc + image[pc + 1]);
- str += " (" + image[pc + 2] + ", ";
- if (image[pc + 3] == 0xffff)
- str += "Inf";
- else
- str += image[pc + 3];
- str += ")";
- break;
-
- }
-
- return str;
- }
-
- // private static members
-
- private static string ReadString (ushort[] image, int pc) {
- int len = image[pc];
- char[] chars = new char[len];
-
- for (int i = 0; i < len; ++ i)
- chars[i] = (char)image[pc + i + 1];
-
- return new string (chars);
- }
-
- private static string FormatAddress (int pc) {
- return pc.ToString ("x4");
- }
-
- private static string FormatSet (ushort[] image, int pc) {
- int lo = image[pc ++];
- int hi = (image[pc ++] << 4) - 1;
-
- string str = "[";
-
- bool hot = false;
- char a = (char)0, b;
- for (int i = 0; i <= hi; ++ i) {
- bool m = (image[pc + (i >> 4)] & (1 << (i & 0xf))) != 0;
-
- if (m & !hot) { // start of range
- a = (char)(lo + i);
- hot = true;
- }
- else if (hot & (!m || i == hi)) { // end of range
- b = (char)(lo + i - 1);
-
- str += FormatChar (a);
- if (b != a)
- str += "-" + FormatChar (b);
-
- hot = false;
- }
- }
-
- str += "]";
- return str;
- }
-
- private static string FormatChar (char c) {
- if (c == '-' || c == ']')
- return "\\" + c;
-
- if (Char.IsLetterOrDigit (c) || Char.IsSymbol (c))
- return c.ToString ();
-
- if (Char.IsControl (c)) {
- return "^" + (char)('@' + c);
- }
-
- return "\\u" + ((int)c).ToString ("x4");
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/interpreter.cs b/mcs/class/System/System.Text.RegularExpressions/interpreter.cs
deleted file mode 100644
index a45f0748179..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/interpreter.cs
+++ /dev/null
@@ -1,889 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: interpreter.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-using System.Globalization;
-
-namespace System.Text.RegularExpressions {
-
- class Interpreter : IMachine {
- public Interpreter (ushort[] program) {
- this.program = program;
- this.checkpoints = new Stack ();
- this.qs = null;
-
- // process info block
-
- if ((OpCode)program[0] != OpCode.Info)
- throw NewInterpretException ("Can't find info block.");
-
- this.group_count = program[1] + 1;
- this.match_min = program[2];
- this.match_max = program[3];
-
- // setup
-
- this.captures = new Capture[group_count];
- this.program_start = 4;
- }
-
- // IMachine implementation
-
- public Match Scan (Regex regex, string text, int start, int end) {
- this.text = text;
- this.text_end = end;
- this.scan_ptr = start;
-
- if (Eval (Mode.Match, ref scan_ptr, program_start))
- return new Match (regex, this, end, captures);
-
- return Match.Empty;
- }
-
- // private methods
-
- private void Reset () {
- for (int i = 0; i < group_count; ++ i)
- captures[i] = new Capture (text);
-
- checkpoints.Clear ();
- checkpoint = 0;
- fast = repeat = null;
- }
-
- private bool Eval (Mode mode, ref int ref_ptr, int pc) {
- int ptr = ref_ptr;
- Begin:
- for (;;) {
- ushort word = program[pc];
- OpCode op = (OpCode)(word & 0x00ff);
- OpFlags flags = (OpFlags)(word & 0xff00);
-
- switch (op) {
- case OpCode.Anchor: {
- int skip = program[pc + 1];
-
- int anch_offset = program[pc + 2];
- int anch_ptr = ptr + anch_offset;
- int anch_end = text_end - match_min + anch_offset; // maximum anchor position
-
- // the general case for an anchoring expression is at the bottom, however we
- // do some checks for the common cases before to save processing time. the current
- // optimizer only outputs three types of anchoring expressions: fixed position,
- // fixed substring, and no anchor.
-
- OpCode anch_op = (OpCode)(program[pc + 3] & 0x00ff);
- if (anch_op == OpCode.Position && skip == 6) { // position anchor
- // Anchor
- // Position
- // True
-
- switch ((Position)program[pc + 4]) {
- case Position.StartOfString:
- if (anch_ptr == 0) {
- ptr = 0;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
- }
- break;
-
- case Position.StartOfLine:
- if (anch_ptr == 0) {
- ptr = 0;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
-
- ++ anch_ptr;
- }
-
- while (anch_ptr <= anch_end) {
- if (text[anch_ptr - 1] == '\n') {
- ptr = anch_ptr - anch_offset;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
- }
-
- ++ anch_ptr;
- }
- break;
-
- case Position.StartOfScan:
- if (anch_ptr == scan_ptr) {
- ptr = scan_ptr - anch_offset;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
- }
- break;
-
- default:
- // FIXME
- break;
- }
- }
- else if (qs != null ||
- (anch_op == OpCode.String && skip == 6 + program[pc + 4])) { // substring anchor
- // Anchor
- // String
- // True
-
- if (qs == null) {
- bool ignore = ((OpFlags)program[pc + 3] & OpFlags.IgnoreCase) != 0;
- string substring = GetString (pc + 3);
-
- qs = new QuickSearch (substring, ignore);
- }
-
- while (anch_ptr <= anch_end) {
- anch_ptr = qs.Search (text, anch_ptr, anch_end);
- if (anch_ptr < 0)
- break;
-
- ptr = anch_ptr - anch_offset;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
-
- ++ anch_ptr;
- }
- }
- else if (anch_op == OpCode.True) { // no anchor
- // Anchor
- // True
-
- while (anch_ptr <= anch_end) {
- ptr = anch_ptr;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
-
- ++ anch_ptr;
- }
- }
- else { // general case
- // Anchor
- // <expr>
- // True
-
- while (anch_ptr <= anch_end) {
- ptr = anch_ptr;
- if (Eval (Mode.Match, ref ptr, pc + 3)) {
- // anchor expression passed: try real expression at the correct offset
-
- ptr = anch_ptr - anch_offset;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
- }
-
- ++ anch_ptr;
- }
- }
-
- goto Fail;
- }
-
- case OpCode.False: {
- goto Fail;
- }
-
- case OpCode.True: {
- goto Pass;
- }
-
- case OpCode.Position: {
- if (!IsPosition ((Position)program[pc + 1], ptr))
- goto Fail;
- pc += 2;
- break;
- }
-
- case OpCode.String: {
- bool reverse = (flags & OpFlags.RightToLeft) != 0;
- bool ignore = (flags & OpFlags.IgnoreCase) != 0;
- int len = program[pc + 1];
-
- if (reverse) {
- ptr -= len;
- if (ptr < 0)
- goto Fail;
- }
- else if (ptr + len > text_end)
- goto Fail;
-
- pc += 2;
- for (int i = 0; i < len; ++ i) {
- char c = text[ptr + i];
- if (ignore)
- c = Char.ToLower (c);
-
- if (c != (char)program[pc ++])
- goto Fail;
- }
-
- if (!reverse)
- ptr += len;
- break;
- }
-
- case OpCode.Reference: {
- bool reverse = (flags & OpFlags.RightToLeft) != 0;
- bool ignore = (flags & OpFlags.IgnoreCase) != 0;
- Capture cap = captures[program[pc + 1]].GetLastDefined ();
- if (cap == null)
- goto Fail;
-
- int str = cap.Index;
- int len = cap.Length;
-
- if (reverse) {
- ptr -= len;
- if (ptr < 0)
- goto Fail;
- }
- else if (ptr + len > text_end)
- goto Fail;
-
- pc += 2;
- for (int i = 0; i < len; ++ i) {
- if (ignore) {
- if (Char.ToLower (text[ptr + i]) != Char.ToLower (text[str + i]))
- goto Fail;
- }
- else {
- if (text[ptr + i] != text[str + i])
- goto Fail;
- }
- }
-
- if (!reverse)
- ptr += len;
- break;
- }
-
- case OpCode.Character: case OpCode.Category:
- case OpCode.Range: case OpCode.Set: {
- if (!EvalChar (mode, ref ptr, ref pc, false))
- goto Fail;
- break;
- }
-
- case OpCode.In: {
- int target = pc + program[pc + 1];
- pc += 2;
- if (!EvalChar (mode, ref ptr, ref pc, true))
- goto Fail;
-
- pc = target;
- break;
- }
-
- case OpCode.Open: {
- Open (program[pc + 1], ptr);
- pc += 2;
- break;
- }
-
- case OpCode.Close: {
- Close (program[pc + 1], ptr);
- pc += 2;
- break;
- }
-
- case OpCode.Balance: {
- Balance (program[pc + 1], program[pc + 2], ptr);
- break;
- }
-
- case OpCode.IfDefined: {
- Capture cap = captures[program[pc + 2]];
- if (cap.GetLastDefined () == null)
- pc += program[pc + 1];
- else
- pc += 3;
- break;
- }
-
- case OpCode.Sub: {
- if (!Eval (Mode.Match, ref ptr, pc + 2))
- goto Fail;
-
- pc += program[pc + 1];
- break;
- }
-
- case OpCode.Test: {
- int cp = Checkpoint ();
- int test_ptr = ptr;
- if (Eval (Mode.Match, ref test_ptr, pc + 3))
- pc += program[pc + 1];
- else {
- Backtrack (cp);
- pc += program[pc + 2];
- }
- break;
- }
-
- case OpCode.Branch: {
- OpCode branch_op;
- do {
- int cp = Checkpoint ();
- if (Eval (Mode.Match, ref ptr, pc + 2))
- goto Pass;
-
- Backtrack (cp);
-
- pc += program[pc + 1];
- branch_op = (OpCode)(program[pc] & 0xff);
- } while (branch_op != OpCode.False);
-
- goto Fail;
- }
-
- case OpCode.Jump: {
- pc += program[pc + 1];
- break;
- }
-
- case OpCode.Repeat: {
- this.repeat = new RepeatContext (
- this.repeat, // previous context
- program[pc + 2], // minimum
- program[pc + 3], // maximum
- (flags & OpFlags.Lazy) != 0, // lazy
- pc + 4 // subexpression
- );
-
- if (Eval (Mode.Match, ref ptr, pc + program[pc + 1]))
- goto Pass;
- else {
- this.repeat = this.repeat.Previous;
- goto Fail;
- }
- }
-
- case OpCode.Until: {
- RepeatContext current = this.repeat;
- int start = current.Start;
-
- if (!current.IsMinimum) {
- ++ current.Count;
- current.Start = ptr;
- if (Eval (Mode.Match, ref ptr, repeat.Expression))
- goto Pass;
-
- current.Start = start;
- -- current.Count;
- goto Fail;
- }
-
- if (ptr == current.Start) {
- // degenerate match ... match tail or fail
-
- this.repeat = current.Previous;
- if (Eval (Mode.Match, ref ptr, pc + 1))
- goto Pass;
-
- goto Fail;
- }
-
- if (current.IsLazy) {
- // match tail first ...
-
- this.repeat = current.Previous;
- int cp = Checkpoint ();
- if (Eval (Mode.Match, ref ptr, pc + 1))
- goto Pass;
-
- Backtrack (cp);
-
- // ... then match more
-
- this.repeat = current;
- if (!current.IsMaximum) {
- ++ current.Count;
- current.Start = ptr;
- if (Eval (Mode.Match, ref ptr, current.Expression))
- goto Pass;
-
- current.Start = start;
- -- current.Count;
- goto Fail;
- }
-
- return false;
- }
- else {
- // match more first ...
-
- if (!current.IsMaximum) {
- int cp = Checkpoint ();
- ++ current.Count;
- current.Start = ptr;
- if (Eval (Mode.Match, ref ptr, current.Expression))
- goto Pass;
-
- current.Start = start;
- -- current.Count;
- Backtrack (cp);
- }
-
- // ... then match tail
-
- this.repeat = current.Previous;
- if (Eval (Mode.Match, ref ptr, pc + 1))
- goto Pass;
-
- this.repeat = current;
- goto Fail;
- }
- }
-
- case OpCode.FastRepeat: {
- this.fast = new RepeatContext (
- fast,
- program[pc + 2], // minimum
- program[pc + 3], // maximum
- (flags & OpFlags.Lazy) != 0, // lazy
- pc + 4 // subexpression
- );
- fast.Start = ptr;
-
- int cp = Checkpoint ();
-
- pc += program[pc + 1]; // tail expression
- ushort tail_word = program[pc];
-
- int c1, c2; // first character of tail operator
- int coff; // 0 or -1 depending on direction
-
- OpCode tail_op = (OpCode)(tail_word & 0xff);
- if (tail_op == OpCode.Character || tail_op == OpCode.String) {
- OpFlags tail_flags = (OpFlags)(tail_word & 0xff00);
-
- if (tail_op == OpCode.String)
- c1 = program[pc + 2]; // first char of string
- else
- c1 = program[pc + 1]; // character
-
- if ((tail_flags & OpFlags.IgnoreCase) != 0)
- c2 = Char.ToUpper ((char)c1); // ignore case
- else
- c2 = c1;
-
- if ((tail_flags & OpFlags.RightToLeft) != 0)
- coff = -1; // reverse
- else
- coff = 0;
- }
- else {
- c1 = c2 = -1;
- coff = 0;
- }
-
- if (fast.IsLazy) {
- if (!fast.IsMinimum && !Eval (Mode.Count, ref ptr, fast.Expression)) {
- //Console.WriteLine ("lazy fast: failed mininum.");
- fast = fast.Previous;
- goto Fail;
- }
-
- while (true) {
- int p = ptr + coff;
- if ((c1 < 0 || (p >= 0 && p < text_end && (c1 == text[p] || c2 == text[p]))) &&
- Eval (Mode.Match, ref ptr, pc))
- break;
-
- if (fast.IsMaximum) {
- //Console.WriteLine ("lazy fast: failed with maximum.");
- fast = fast.Previous;
- goto Fail;
- }
-
- Backtrack (cp);
- if (!Eval (Mode.Count, ref ptr, fast.Expression)) {
- //Console.WriteLine ("lazy fast: no more.");
- fast = fast.Previous;
- goto Fail;
- }
- }
- fast = fast.Previous;
- goto Pass;
- }
- else {
- if (!Eval (Mode.Count, ref ptr, fast.Expression)) {
- fast = fast.Previous;
- goto Fail;
- }
-
- int width;
- if (fast.Count > 0)
- width = (ptr - fast.Start) / fast.Count;
- else
- width = 0;
-
- while (true) {
- int p = ptr + coff;
- if ((c1 < 0 || (p >= 0 && p < text_end && (c1 == text[p] || c2 == text[p]))) &&
- Eval (Mode.Match, ref ptr, pc))
- break;
-
- -- fast.Count;
- if (!fast.IsMinimum) {
- fast = fast.Previous;
- goto Fail;
- }
-
- ptr -= width;
- Backtrack (cp);
- }
- fast = fast.Previous;
- goto Pass;
- }
- }
-
- case OpCode.Info: {
- throw NewInterpretException ("Info block found in pattern.");
- }
- }
- }
- Pass:
- ref_ptr = ptr;
-
- switch (mode) {
- case Mode.Match:
- return true;
-
- case Mode.Count: {
- ++ fast.Count;
- if (fast.IsMaximum || (fast.IsLazy && fast.IsMinimum))
- return true;
-
- pc = fast.Expression;
- goto Begin;
- }
- }
-
- Fail:
- switch (mode) {
- case Mode.Match:
- return false;
-
- case Mode.Count: {
- if (!fast.IsLazy && fast.IsMinimum)
- return true;
-
- ref_ptr = fast.Start;
- return false;
- }
- }
-
- return false;
- }
-
- private bool EvalChar (Mode mode, ref int ptr, ref int pc, bool multi) {
- bool consumed = false;
- char c = '\0';
- bool negate;
- bool ignore;
- do {
- ushort word = program[pc];
- OpCode op = (OpCode)(word & 0x00ff);
- OpFlags flags = (OpFlags)(word & 0xff00);
-
- ++ pc;
-
- ignore = (flags & OpFlags.IgnoreCase) != 0;
-
- // consume character: the direction of an In construct is
- // determined by the direction of its first op
-
- if (!consumed) {
- if ((flags & OpFlags.RightToLeft) != 0) {
- if (ptr <= 0)
- return false;
-
- c = text[-- ptr];
- }
- else {
- if (ptr >= text_end)
- return false;
-
- c = text[ptr ++];
- }
-
- if (ignore)
- c = Char.ToLower (c);
-
- consumed = true;
- }
-
- // negate flag
-
- negate = (flags & OpFlags.Negate) != 0;
-
- // execute op
-
- switch (op) {
- case OpCode.True:
- return true;
-
- case OpCode.False:
- return false;
-
- case OpCode.Character: {
- if (c == (char)program[pc ++])
- return !negate;
- break;
- }
-
- case OpCode.Category: {
- if (CategoryUtils.IsCategory ((Category)program[pc ++], c))
- return !negate;
-
- break;
- }
-
- case OpCode.Range: {
- int lo = (char)program[pc ++];
- int hi = (char)program[pc ++];
- if (lo <= c && c <= hi)
- return !negate;
- break;
- }
-
- case OpCode.Set: {
- int lo = (char)program[pc ++];
- int len = (char)program[pc ++];
- int bits = pc;
- pc += len;
-
- int i = (int)c - lo;
- if (i < 0 || i >= len << 4)
- break;
-
- if ((program[bits + (i >> 4)] & (1 << (i & 0xf))) != 0)
- return !negate;
- break;
- }
- }
- } while (multi);
-
- return negate;
- }
-
- private bool TryMatch (ref int ref_ptr, int pc) {
- Reset ();
-
- int ptr = ref_ptr;
- captures[0].Open (ptr);
- if (Eval (Mode.Match, ref ptr, pc)) {
- captures[0].Close (ptr);
- ref_ptr = ptr;
- return true;
- }
-
- return false;
- }
-
- private bool IsPosition (Position pos, int ptr) {
- switch (pos) {
- case Position.Start: case Position.StartOfString:
- return ptr == 0;
-
- case Position.StartOfLine:
- return ptr == 0 || text[ptr - 1] == '\n';
-
- case Position.StartOfScan:
- return ptr == scan_ptr;
-
- case Position.End:
- return ptr == text_end ||
- (ptr == text_end - 1 && text[ptr] == '\n');
-
- case Position.EndOfLine:
- return ptr == text_end || text[ptr] == '\n';
-
- case Position.EndOfString:
- return ptr == text_end;
-
- case Position.Boundary:
- if (text_end == 0)
- return false;
-
- if (ptr == 0)
- return IsWordChar (text[ptr]);
- else if (ptr == text_end)
- return IsWordChar (text[ptr - 1]);
- else
- return IsWordChar (text[ptr]) != IsWordChar (text[ptr - 1]);
-
- case Position.NonBoundary:
- if (text_end == 0)
- return false;
-
- if (ptr == 0)
- return !IsWordChar (text[ptr]);
- else if (ptr == text_end)
- return !IsWordChar (text[ptr - 1]);
- else
- return IsWordChar (text[ptr]) == IsWordChar (text[ptr - 1]);
-
- default:
- return false;
- }
- }
-
- private bool IsWordChar (char c) {
- return CategoryUtils.IsCategory (Category.Word, c);
- }
-
- private string GetString (int pc) {
- int len = program[pc + 1];
- int str = pc + 2;
-
- char[] cs = new char[len];
- for (int i = 0; i < len; ++ i)
- cs[i] = (char)program[str ++];
-
- return new string (cs);
- }
-
- // capture management
-
- private void Open (int gid, int ptr) {
- Capture cap = captures[gid];
- if (cap.IsDefined || cap.Checkpoint < checkpoint) {
- cap = new Capture (cap, checkpoint);
- captures[gid] = cap;
- }
-
- cap.Open (ptr);
- }
-
- private void Close (int gid, int ptr) {
- captures[gid].Close (ptr);
- }
-
- private void Balance (int gid, int balance_gid, int ptr) {
- Capture balance = captures[balance_gid];
- if (!balance.IsDefined)
- throw NewInterpretException ("Invalid state - balancing group not closed.");
-
- if (gid > 0) {
- Open (gid, balance.Index + balance.Length);
- Close (gid, ptr);
- }
-
- captures[balance_gid] = balance.Previous;
- }
-
- private int Checkpoint () {
- checkpoints.Push (captures);
- captures = (Capture[])captures.Clone ();
- checkpoint = checkpoints.Count;
-
- return checkpoint;
- }
-
- private void Backtrack (int cp) {
- if (cp > checkpoints.Count)
- throw NewInterpretException ("Can't backtrack forwards");
-
- while (checkpoints.Count > cp)
- checkpoints.Pop ();
-
- captures = (Capture[])checkpoints.Peek ();
- checkpoint = cp;
-
- // TODO optimize this
- }
-
- private Exception NewInterpretException (string msg) {
- return new ApplicationException (msg);
- }
-
- // interpreter attributes
-
- private ushort[] program; // regex program
- private int program_start; // first instruction after info block
- private string text; // input text
- private int text_end; // end of input text (last character + 1)
- private int group_count; // number of capturing groups
- private int match_min, match_max; // match width information
- private QuickSearch qs; // fast substring matcher
-
- // match state
-
- private int scan_ptr; // start of scan
-
- private Capture[] captures; // current captures
-
- private int checkpoint; // last checkpoint
- private Stack checkpoints; // checkpointed captures
-
- private RepeatContext repeat; // current repeat context
- private RepeatContext fast; // fast repeat context
-
- // private classes
-
- private class RepeatContext {
- public RepeatContext (RepeatContext previous, int min, int max, bool lazy, int expr_pc) {
- this.previous = previous;
- this.min = min;
- this.max = max;
- this.lazy = lazy;
- this.expr_pc = expr_pc;
-
- this.start = -1;
- this.count = 0;
- }
-
- public int Count {
- get { return count; }
- set { count = value; }
- }
-
- public int Start {
- get { return start; }
- set { start = value; }
- }
-
- public bool IsMinimum {
- get { return min <= count; }
- }
-
- public bool IsMaximum {
- get { return max <= count; }
- }
-
- public bool IsLazy {
- get { return lazy; }
- }
-
- public int Expression {
- get { return expr_pc; }
- }
-
- public RepeatContext Previous {
- get { return previous; }
- }
-
- private int start;
- private int min, max;
- private bool lazy;
- private int expr_pc;
- private RepeatContext previous;
-
- private int count;
- }
-
- private enum Mode {
- Search,
- Match,
- Count
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/interval.cs b/mcs/class/System/System.Text.RegularExpressions/interval.cs
deleted file mode 100644
index 4c8d19f5b15..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/interval.cs
+++ /dev/null
@@ -1,305 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: interval.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
-
- struct Interval : IComparable {
- public int low;
- public int high;
- public bool contiguous;
-
- public static Interval Empty {
- get {
- Interval i;
- i.low = 0;
- i.high = i.low - 1;
- i.contiguous = true;
-
- return i;
- }
- }
-
- public static Interval Entire {
- get { return new Interval (Int32.MinValue, Int32.MaxValue); }
- }
-
- public Interval (int low, int high) {
- if (low > high) {
- int t = low;
- low = high;
- high = t;
- }
-
- this.low = low;
- this.high = high;
- this.contiguous = true;
- }
-
- public bool IsDiscontiguous {
- get { return !contiguous; }
- }
-
- public bool IsSingleton {
- get { return contiguous && low == high; }
- }
-
- public bool IsRange {
- get { return !IsSingleton && !IsEmpty; }
- }
-
- public bool IsEmpty {
- get { return low > high; }
- }
-
- public int Size {
- get {
- if (IsEmpty)
- return 0;
-
- return high - low + 1;
- }
- }
-
- public bool IsDisjoint (Interval i) {
- if (IsEmpty || i.IsEmpty)
- return true;
-
- return !(low <= i.high && i.low <= high);
- }
-
- public bool IsAdjacent (Interval i) {
- if (IsEmpty || i.IsEmpty)
- return false;
-
- return low == i.high + 1 || high == i.low - 1;
- }
-
- public bool Contains (Interval i) {
- if (!IsEmpty && i.IsEmpty)
- return true;
- if (IsEmpty)
- return false;
-
- return low <= i.low && i.high <= high;
- }
-
- public bool Contains (int i) {
- return low <= i && i <= high;
- }
-
- public void Merge (Interval i) {
- if (i.IsEmpty)
- return;
- if (IsEmpty) {
- this.low = i.low;
- this.high = i.high;
- }
-
- if (i.low < low)
- low = i.low;
- if (i.high > high)
- high = i.high;
- }
-
- public void Intersect (Interval i) {
- if (IsDisjoint (i)) {
- low = 0;
- high = low - 1;
- return;
- }
-
- if (i.low > low)
- low = i.low;
- if (i.high > high)
- high = i.high;
- }
-
- public int CompareTo (object o) {
- return low - ((Interval)o).low;
- }
-
- public new string ToString () {
- if (IsEmpty)
- return "(EMPTY)";
- else if (!contiguous)
- return "{" + low + ", " + high + "}";
- else if (IsSingleton)
- return "(" + low + ")";
- else
- return "(" + low + ", " + high + ")";
- }
- }
-
- class IntervalCollection : ICollection, IEnumerable {
- public IntervalCollection () {
- intervals = new ArrayList ();
- }
-
- public Interval this[int i] {
- get { return (Interval)intervals[i]; }
- set { intervals[i] = value; }
- }
-
- public void Add (Interval i) {
- intervals.Add (i);
- }
-
- public void Clear () {
- intervals.Clear ();
- }
-
- public void Sort () {
- intervals.Sort ();
- }
-
- public void Normalize () {
- intervals.Sort ();
-
- int j = 0;
- while (j < intervals.Count - 1) {
- Interval a = (Interval)intervals[j];
- Interval b = (Interval)intervals[j + 1];
-
- if (!a.IsDisjoint (b) || a.IsAdjacent (b)) {
- a.Merge (b);
- intervals[j] = a;
- intervals.RemoveAt (j + 1);
- }
- else
- ++ j;
- }
-
- }
-
- public delegate double CostDelegate (Interval i);
-
- public IntervalCollection GetMetaCollection (CostDelegate cost_del) {
- IntervalCollection meta = new IntervalCollection ();
-
- Normalize ();
- Optimize (0, Count - 1, meta, cost_del);
- meta.intervals.Sort ();
-
- return meta;
- }
-
- private void Optimize (int begin, int end, IntervalCollection meta, CostDelegate cost_del) {
- Interval set;
- set.contiguous = false;
-
- int best_set_begin = -1;
- int best_set_end = -1;
- double best_set_cost = 0;
-
- for (int i = begin; i <= end; ++ i) {
- set.low = this[i].low;
-
- double cost = 0.0;
- for (int j = i; j <= end; ++ j) {
- set.high = this[j].high;
- cost += cost_del (this[j]);
-
- double set_cost = cost_del (set);
- if (set_cost < cost && cost > best_set_cost) {
- best_set_begin = i;
- best_set_end = j;
- best_set_cost = cost;
- }
- }
- }
-
- if (best_set_begin < 0) {
- // didn't find an optimal set: add original members
-
- for (int i = begin; i <= end; ++ i)
- meta.Add (this[i]);
- }
- else {
- // found set: add it ...
-
- set.low = this[best_set_begin].low;
- set.high = this[best_set_end].high;
-
- meta.Add (set);
-
- // ... and optimize to the left and right
-
- if (best_set_begin > begin)
- Optimize (begin, best_set_begin - 1, meta, cost_del);
- if (best_set_end < end)
- Optimize (best_set_end + 1, end, meta, cost_del);
- }
- }
-
- // ICollection implementation
-
- public int Count {
- get { return intervals.Count; }
- }
-
- public bool IsSynchronized {
- get { return false; }
- }
-
- public object SyncRoot {
- get { return intervals; }
- }
-
- public void CopyTo (Array array, int index) {
- foreach (Interval i in intervals) {
- if (index > array.Length)
- break;
-
- array.SetValue (i, index ++);
- }
- }
-
- // IEnumerator implementation
-
- public IEnumerator GetEnumerator () {
- return new Enumerator (intervals);
- }
-
- private class Enumerator : IEnumerator {
- public Enumerator (IList list) {
- this.list = list;
- Reset ();
- }
-
- public object Current {
- get {
- if (ptr >= list.Count)
- throw new InvalidOperationException ();
-
- return list[ptr];
- }
- }
-
- public bool MoveNext () {
- if (ptr > list.Count)
- throw new InvalidOperationException ();
-
- return ++ ptr < list.Count;
- }
-
- public void Reset () {
- ptr = -1;
- }
-
- private IList list;
- private int ptr;
- }
-
- // private fields
-
- private ArrayList intervals;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/match.cs b/mcs/class/System/System.Text.RegularExpressions/match.cs
deleted file mode 100644
index 7bc3d70cf38..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/match.cs
+++ /dev/null
@@ -1,215 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: match.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-
-namespace System.Text.RegularExpressions {
-
- public class Capture {
- public int Index {
- get {
- if (!IsDefined)
- return 0; // capture not completed
- else if (start <= end)
- return start; // normal capture
- else
- return end; // reverse capture
- }
- }
-
- public int Length {
- get {
- if (!IsDefined)
- return 0;
- else if (start <= end)
- return end - start;
- else
- return start - end;
- }
- }
-
- public string Value {
- get { return IsDefined ? text.Substring (Index, Length) : ""; }
- }
-
- public override string ToString () {
- return Value;
- }
-
- // internal members
-
- internal Capture () { // empty capture
- this.previous = null;
- this.text = null;
- this.checkpoint = 0;
-
- this.start = -1;
- this.end = -1;
- }
-
- internal Capture (Capture cap) { // copy constructor
- this.previous = cap.previous;
- this.text = cap.text;
- this.checkpoint = cap.checkpoint;
-
- this.start = cap.start;
- this.end = cap.end;
- }
-
- internal Capture (string text) { // first capture
- this.previous = null;
- this.text = text;
- this.checkpoint = 0;
-
- this.start = -1;
- this.end = -1;
- }
-
- internal Capture (Capture previous, int checkpoint) {
- this.previous = previous;
- this.text = previous.text;
- this.checkpoint = checkpoint;
-
- this.start = -1;
- this.end = -1;
- }
-
- internal Capture Previous {
- get { return previous; }
- }
-
- internal string Text {
- get { return text; }
- }
-
- internal int Checkpoint {
- get { return checkpoint; }
- }
-
- internal bool IsDefined {
- get { return start >= 0 && end >= 0; }
- }
-
- internal Capture GetLastDefined () {
- Capture cap = this;
- while (cap != null && !cap.IsDefined)
- cap = cap.Previous;
-
- return cap;
- }
-
- internal void Open (int ptr) {
- this.start = ptr;
- }
-
- internal void Close (int ptr) {
- this.end = ptr;
- }
-
- // private
-
- private int start, end;
- private string text;
- private int checkpoint;
- private Capture previous;
- }
-
- public class Group : Capture {
- public static Group Synchronized (Group inner) {
- return inner; // is this enough?
- }
-
- public CaptureCollection Captures {
- get { return captures; }
- }
-
- public bool Success {
- get { return GetLastDefined () != null; }
- }
-
- // internal
-
- internal Group () : base () {
- }
-
- internal Group (Capture last) : base (last) {
- captures = new CaptureCollection (last);
-
- // TODO make construction of captures lazy
- }
-
- private CaptureCollection captures;
- }
-
- public class Match : Group {
- public static Match Empty {
- get { return empty; }
- }
-
- public static Match Synchronized (Match inner) {
- return inner; // FIXME need to sync on machine access
- }
-
- public GroupCollection Groups {
- get { return groups; }
- }
-
- public Match NextMatch () {
- if (this == Empty)
- return Empty;
-
- int scan_ptr = regex.RightToLeft ? Index : Index + Length;
-
- // next match after an empty match: make sure scan ptr makes progress
-
- if (Length == 0)
- scan_ptr += regex.RightToLeft ? -1 : +1;
-
- return machine.Scan (regex, Text, scan_ptr, text_length);
- }
-
- public virtual string Result (string replacement) {
- return ReplacementEvaluator.Evaluate (replacement, this);
- }
-
- // internal
-
- internal Match () : base () {
- this.regex = null;
- this.machine = null;
- this.text_length = 0;
- this.groups = new GroupCollection ();
-
- groups.Add (this);
- }
-
- internal Match (Regex regex, IMachine machine, int text_length, Capture[] captures) : base (captures[0]) {
- this.regex = regex;
- this.machine = machine;
- this.text_length = text_length;
- this.groups = new GroupCollection ();
-
- groups.Add (this);
- for (int i = 1; i < captures.Length; ++ i)
- groups.Add (new Group (captures[i]));
- }
-
- internal Regex Regex {
- get { return regex; }
- }
-
- // private
-
- private Regex regex;
- private IMachine machine;
- private int text_length;
- private GroupCollection groups;
-
- private static Match empty = new Match ();
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/notes.txt b/mcs/class/System/System.Text.RegularExpressions/notes.txt
deleted file mode 100644
index 56b047ec76e..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/notes.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-TODO:
-
-* Need to go through everything and square it with RightToLeft matching.
- The support for this was built into an early version, and lots of things built
- afterwards are not savvy about bi-directional matching. Things that spring to
- mind: Regex match methods should start at 0 or text.Length depending on
- direction. Do split and replace need changes? Match should be aware of its
- direction (already applied some of this to NextMatch logic). The interpreter
- needs to check left and right bounds. Anchoring and substring discovery need
- to be reworked. RTL matches are going to have anchors on the right - ie $, \Z
- and \z. This should be added to the anchor logic. QuickSearch needs to work in
- reverse. There may be other stuff.... work through the code.
-
-* Add ECMAScript support to the parser. For example, [.\w\s\d] map to ECMA
- categories instead of canonical ones [DONE]. There's different behaviour on
- backreference/octal disambiguation. Find out what the runtime behavioural
- difference is for cyclic backreferences eg (?(1)abc\1) - this is only briefly
- mentioned in the spec. I couldn't find much on this in the ECMAScript
- specification either.
-
-* Octal/backreference parsing needs a big fix. The rules are ridiculously complex.
-
-* Add a check in QuickSearch for single character substrings. This is likely to
- be a common case. There's no need to go through a shift table. Also, have a
- look at just computing a relevant subset of the shift table and using an
- (offset, size) pair to help test inclusion. Characters not in the table get
- the default len + 1 shift.
-
-* Improve the perl test suite. Run under MS runtime to generate checksums for
- each trial. Checksums should incorporate: all captures (index, length) for all
- groups; names of explicit capturing groups, and the numbers they map to. Any
- other state? RegexTrial.Execute() will then compare result and checksum.
-
-* The pattern (?(1?)a|b). It should fail: Perl fails, the MS implementation
- fails, but I pass. The documentation says that the construct (?(X)...) can be
- processed in two ways. If X is a valid group number, or a valid group name,
- then the expression becomes a capture conditional - the (...) part is
- executed only if X has been captured. If X is not a group number or name, then
- it is treated as a positive lookahead., and (...) is only executed if the
- lookahead succeeds. My code does the latter, but on further investigation it
- appears that both Perl and MS fail to recognize an expression assertion if the
- first character of the assertion is a number - which instead suggests a
- capture conditional. The exception raised is something like "invalid group
- number". I get the feeling the my behaviour seems more correct, but it's not
- consistent with the other implementations, so it should probably be changed.
diff --git a/mcs/class/System/System.Text.RegularExpressions/parser.cs b/mcs/class/System/System.Text.RegularExpressions/parser.cs
deleted file mode 100644
index 3327cf3024a..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/parser.cs
+++ /dev/null
@@ -1,1109 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: parser.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-using System.Globalization;
-
-namespace System.Text.RegularExpressions.Syntax {
-
- class Parser {
- public static int ParseDecimal (string str, ref int ptr) {
- return ParseNumber (str, ref ptr, 10, 1, Int32.MaxValue);
- }
-
- public static int ParseOctal (string str, ref int ptr) {
- return ParseNumber (str, ref ptr, 8, 1, 3);
- }
-
- public static int ParseHex (string str, ref int ptr, int digits) {
- return ParseNumber (str, ref ptr, 16, digits, digits);
- }
-
- public static int ParseNumber (string str, ref int ptr, int b, int min, int max) {
- int p = ptr, n = 0, digits = 0, d;
- if (max < min)
- max = Int32.MaxValue;
-
- while (digits < max && p < str.Length) {
- d = ParseDigit (str[p ++], b, digits);
- if (d < 0) {
- -- p;
- break;
- }
-
- n = n * b + d;
- ++ digits;
- }
-
- if (digits < min)
- return -1;
-
- ptr = p;
- return n;
- }
-
- public static string ParseName (string str, ref int ptr) {
- if (Char.IsDigit (str[ptr])) {
- int gid = ParseNumber (str, ref ptr, 10, 1, 0);
- if (gid > 0)
- return gid.ToString ();
-
- return null;
- }
-
- int start = ptr;
- for (;;) {
- if (!IsNameChar (str[ptr]))
- break;
- ++ ptr;
- }
-
- if (ptr - start > 0)
- return str.Substring (start, ptr - start);
-
- return null;
- }
-
- public static string Escape (string str) {
- string result = "";
- for (int i = 0; i < str.Length; ++ i) {
- char c = str[i];
- switch (c) {
- case '\\': case '*': case '+': case '?': case '|':
- case '{': case '[': case '(': case ')': case '^':
- case '$': case '.': case '#': case ' ':
- result += "\\" + c;
- break;
-
- case '\t': result += "\\t"; break;
- case '\n': result += "\\n"; break;
- case '\r': result += "\\r"; break;
- case '\f': result += "\\f"; break;
-
- default: result += c; break;
- }
- }
-
- return result;
- }
-
- public static string Unescape (string str) {
- return new Parser ().ParseString (str);
- }
-
- // public instance
-
- public Parser () {
- this.caps = new ArrayList ();
- this.refs = new Hashtable ();
- }
-
- public RegularExpression ParseRegularExpression (string pattern, RegexOptions options) {
- this.pattern = pattern;
- this.ptr = 0;
-
- caps.Clear ();
- refs.Clear ();
- this.num_groups = 0;
-
- try {
- RegularExpression re = new RegularExpression ();
- ParseGroup (re, options, null);
- ResolveReferences ();
-
- re.GroupCount = num_groups;
-
- return re;
- }
- catch (IndexOutOfRangeException) {
- throw NewParseException ("Unexpected end of pattern.");
- }
- }
-
- public IDictionary GetMapping () {
- Hashtable mapping = new Hashtable ();
- foreach (CapturingGroup group in caps) {
- if (group.Name != null)
- mapping.Add (group.Name, group.Number);
- }
-
- return mapping;
- }
-
- // private methods
-
- private void ParseGroup (Group group, RegexOptions options, Assertion assertion) {
- bool is_top_level = group is RegularExpression;
-
- Alternation alternation = null;
- string literal = null;
-
- Group current = new Group ();
- Expression expr = null;
- bool closed = false;
-
- while (true) {
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- if (ptr >= pattern.Length)
- break;
-
- // (1) Parse for Expressions
-
- char ch = pattern[ptr ++];
-
- switch (ch) {
- case '^': {
- Position pos =
- IsMultiline (options) ? Position.StartOfLine : Position.Start;
- expr = new PositionAssertion (pos);
- break;
- }
-
- case '$': {
- Position pos =
- IsMultiline (options) ? Position.EndOfLine : Position.End;
- expr = new PositionAssertion (pos);
- break;
- }
-
- case '.': {
- Category cat =
- IsSingleline (options) ? Category.AnySingleline : Category.Any;
- expr = new CharacterClass (cat, false);
- break;
- }
-
- case '\\': {
- int c = ParseEscape ();
- if (c >= 0)
- ch = (char)c;
- else {
- expr = ParseSpecial (options);
-
- if (expr == null)
- ch = pattern[ptr ++]; // default escape
- }
- break;
- }
-
- case '[': {
- expr = ParseCharacterClass (options);
- break;
- }
-
- case '(': {
- bool ignore = IsIgnoreCase (options);
- expr = ParseGroupingConstruct (ref options);
- if (expr == null) {
- if (literal != null && IsIgnoreCase (options) != ignore) {
- current.AppendExpression (new Literal (literal, IsIgnoreCase (options)));
- literal = null;
- }
-
- continue;
- }
- break;
- }
-
- case ')': {
- closed = true;
- goto EndOfGroup;
- }
-
- case '|': {
- if (literal != null) {
- current.AppendExpression (new Literal (literal, IsIgnoreCase (options)));
- literal = null;
- }
-
- if (assertion != null) {
- if (assertion.TrueExpression == null)
- assertion.TrueExpression = current;
- else if (assertion.FalseExpression == null)
- assertion.FalseExpression = current;
- else
- throw NewParseException ("Too many | in (?()|).");
- }
- else {
- if (alternation == null)
- alternation = new Alternation ();
-
- alternation.AddAlternative (current);
- }
-
- current = new Group ();
- continue;
- }
-
- case '*': case '+': case '?': case '{': {
- throw NewParseException ("Bad quantifier.");
- }
-
- default:
- break; // literal character
- }
-
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
-
- // (2) Check for Repetitions
-
- if (ptr < pattern.Length) {
- char k = pattern[ptr];
-
- if (k == '?' || k == '*' || k == '+' || k == '{') {
- ++ ptr;
-
- int min = 0, max = 0;
- bool lazy = false;
-
- switch (k) {
- case '?': min = 0; max = 1; break;
- case '*': min = 0; max = 0xffff; break;
- case '+': min = 1; max = 0xffff; break;
- case '{': ParseRepetitionBounds (out min, out max, options); break;
- }
-
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- if (ptr < pattern.Length && pattern[ptr] == '?') {
- ++ ptr;
- lazy = true;
- }
-
- Repetition repetition = new Repetition (min, max, lazy);
-
- if (expr == null)
- repetition.Expression = new Literal (ch.ToString (), IsIgnoreCase (options));
- else
- repetition.Expression = expr;
-
- expr = repetition;
- }
- }
-
- // (3) Append Expression and/or Literal
-
- if (expr == null) {
- if (literal == null)
- literal = "";
- literal += ch;
- }
- else {
- if (literal != null) {
- current.AppendExpression (new Literal (literal, IsIgnoreCase (options)));
- literal = null;
- }
-
- current.AppendExpression (expr);
- expr = null;
- }
-
- if (is_top_level && ptr >= pattern.Length)
- goto EndOfGroup;
- }
-
- EndOfGroup:
- if (is_top_level && closed)
- throw NewParseException ("Too many )'s.");
- if (!is_top_level && !closed)
- throw NewParseException ("Not enough )'s.");
-
-
- // clean up literals and alternations
-
- if (literal != null)
- current.AppendExpression (new Literal (literal, IsIgnoreCase (options)));
-
- if (assertion != null) {
- if (assertion.TrueExpression == null)
- assertion.TrueExpression = current;
- else
- assertion.FalseExpression = current;
-
- group.AppendExpression (assertion);
- }
- else if (alternation != null) {
- alternation.AddAlternative (current);
- group.AppendExpression (alternation);
- }
- else
- group.AppendExpression (current);
- }
-
- private Expression ParseGroupingConstruct (ref RegexOptions options) {
- if (pattern[ptr] != '?') {
- Group group;
-
- if (IsExplicitCapture (options))
- group = new Group ();
- else {
- group = new CapturingGroup ();
- caps.Add (group);
- }
-
- ParseGroup (group, options, null);
- return group;
- }
- else
- ++ ptr;
-
- switch (pattern[ptr]) {
- case ':': { // non-capturing group
- ++ ptr;
- Group group = new Group ();
- ParseGroup (group, options, null);
-
- return group;
- }
-
- case '>': { // non-backtracking group
- ++ ptr;
- Group group = new NonBacktrackingGroup ();
- ParseGroup (group, options, null);
-
- return group;
- }
-
- case 'i': case 'm': case 'n':
- case 's': case 'x': case '-': { // options
- RegexOptions o = options;
- ParseOptions (ref o, false);
- if (pattern[ptr] == '-') {
- ++ ptr;
- ParseOptions (ref o, true);
- }
-
- if (pattern[ptr] == ':') { // pass options to child group
- ++ ptr;
- Group group = new Group ();
- ParseGroup (group, o, null);
- return group;
- }
- else if (pattern[ptr] == ')') { // change options of enclosing group
- ++ ptr;
- options = o;
- return null;
- }
- else
- throw NewParseException ("Bad options");
- }
-
- case '<': case '=': case '!': { // lookahead/lookbehind
- ExpressionAssertion asn = new ExpressionAssertion ();
- if (!ParseAssertionType (asn))
- goto case '\''; // it's a (?<name> ) construct
-
- Group test = new Group ();
- ParseGroup (test, options, null);
-
- asn.TestExpression = test;
- return asn;
- }
-
- case '\'': { // named/balancing group
- char delim;
- if (pattern[ptr] == '<')
- delim = '>';
- else
- delim = '\'';
-
- ++ ptr;
- string name = ParseName ();
-
- if (pattern[ptr] == delim) {
- // capturing group
-
- if (name == null)
- throw NewParseException ("Bad group name.");
-
- ++ ptr;
- CapturingGroup cap = new CapturingGroup ();
- cap.Name = name;
- caps.Add (cap);
- ParseGroup (cap, options, null);
-
- return cap;
- }
- else if (pattern[ptr] == '-') {
- // balancing group
-
- ++ ptr;
- string balance_name = ParseName ();
- if (balance_name == null || pattern[ptr] != delim)
- throw NewParseException ("Bad balancing group name.");
-
- ++ ptr;
- BalancingGroup bal = new BalancingGroup ();
- bal.Name = name;
- caps.Add (bal);
- refs.Add (bal, balance_name);
-
- return bal;
- }
- else
- throw NewParseException ("Bad group name.");
- }
-
- case '(': { // expression/capture test
- Assertion asn;
-
- ++ ptr;
- int p = ptr;
- string name = ParseName ();
- if (name == null || pattern[ptr] != ')') { // expression test
- // FIXME MS implementation doesn't seem to
- // implement this version of (?(x) ...)
-
- ptr = p;
- ExpressionAssertion expr_asn = new ExpressionAssertion ();
-
- if (pattern[ptr] == '?') {
- ++ ptr;
- if (!ParseAssertionType (expr_asn))
- throw NewParseException ("Bad conditional.");
- }
- else {
- expr_asn.Negate = false;
- expr_asn.Reverse = false;
- }
-
- Group test = new Group ();
- ParseGroup (test, options, null);
- expr_asn.TestExpression = test;
- asn = expr_asn;
- }
- else { // capture test
- ++ ptr;
- asn = new CaptureAssertion ();
- refs.Add (asn, name);
- }
-
- Group group = new Group ();
- ParseGroup (group, options, asn);
- return group;
- }
-
- case '#': { // comment
- ++ ptr;
- while (pattern[ptr ++] != ')') {
- if (ptr >= pattern.Length)
- throw NewParseException ("Unterminated (?#...) comment.");
- }
- return null;
- }
-
- default: // error
- throw NewParseException ("Bad grouping construct.");
- }
- }
-
- private bool ParseAssertionType (ExpressionAssertion assertion) {
- if (pattern[ptr] == '<') {
- switch (pattern[ptr + 1]) {
- case '=':
- assertion.Negate = false;
- break;
- case '!':
- assertion.Negate = true;
- break;
- default:
- return false;
- }
-
- assertion.Reverse = true;
- ptr += 2;
- }
- else {
- switch (pattern[ptr]) {
- case '=':
- assertion.Negate = false;
- break;
- case '!':
- assertion.Negate = true;
- break;
- default:
- return false;
- }
-
- assertion.Reverse = false;
- ptr += 1;
- }
-
- return true;
- }
-
- private void ParseOptions (ref RegexOptions options, bool negate) {
- for (;;) {
- switch (pattern[ptr]) {
- case 'i':
- if (negate)
- options &= ~RegexOptions.IgnoreCase;
- else
- options |= RegexOptions.IgnoreCase;
- break;
-
- case 'm':
- if (negate)
- options &= ~RegexOptions.Multiline;
- else
- options |= RegexOptions.Multiline;
- break;
-
- case 'n':
- if (negate)
- options &= ~RegexOptions.ExplicitCapture;
- else
- options |= RegexOptions.ExplicitCapture;
- break;
-
- case 's':
- if (negate)
- options &= ~RegexOptions.Singleline;
- else
- options |= RegexOptions.Singleline;
- break;
-
- case 'x':
- if (negate)
- options &= ~RegexOptions.IgnorePatternWhitespace;
- else
- options |= RegexOptions.IgnorePatternWhitespace;
- break;
-
- default:
- return;
- }
-
- ++ ptr;
- }
- }
-
- private Expression ParseCharacterClass (RegexOptions options) {
- bool negate, ecma;
- if (pattern[ptr] == '^') {
- negate = true;
- ++ ptr;
- }
- else
- negate = false;
-
- ecma = IsECMAScript (options);
- CharacterClass cls = new CharacterClass (negate, IsIgnoreCase (options));
-
- if (pattern[ptr] == ']') {
- cls.AddCharacter (']');
- ++ ptr;
- }
-
- int c = -1;
- int last = -1;
- bool range = false;
- bool closed = false;
- while (ptr < pattern.Length) {
- c = pattern[ptr ++];
-
- if (c == ']') {
- closed = true;
- break;
- }
-
- if (c == '-') {
- range = true;
- continue;
- }
-
- if (c == '\\') {
- c = ParseEscape ();
- if (c < 0) {
- // didn't recognize escape
-
- c = pattern[ptr ++];
- switch (c) {
- case 'b': c = '\b'; break;
-
- case 'd':
- cls.AddCategory (ecma ? Category.EcmaDigit : Category.Digit, false);
- last = -1;
- continue;
-
- case 'w':
- cls.AddCategory (ecma ? Category.EcmaWord : Category.Word, false);
- last = -1;
- continue;
-
- case 's':
- cls.AddCategory (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, false);
- last = -1;
- continue;
-
- case 'p':
- cls.AddCategory (ParseUnicodeCategory (), false); // ignore ecma
- last = -1;
- continue;
-
- case 'D':
- cls.AddCategory (ecma ? Category.EcmaDigit : Category.Digit, true);
- last = -1;
- continue;
-
- case 'W':
- cls.AddCategory (ecma ? Category.EcmaWord : Category.Word, true);
- last = -1;
- continue;
-
- case 'S':
- cls.AddCategory (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, true);
- last = -1;
- continue;
-
- case 'P':
- cls.AddCategory (ParseUnicodeCategory (), true);
- last = -1;
- continue;
-
- default: break; // add escaped character
- }
- }
- }
-
- if (range) {
- if (c < last)
- throw NewParseException ("[x-y] range in reverse order.");
-
- if (last >=0 )
- cls.AddRange ((char)last, (char)c);
- else {
- cls.AddCharacter ((char)c);
- cls.AddCharacter ('-');
- }
-
- range = false;
- last = -1;
- }
- else {
- cls.AddCharacter ((char)c);
- last = c;
- }
- }
-
- if (!closed)
- throw NewParseException ("Unterminated [] set.");
-
- if (range)
- cls.AddCharacter ('-');
-
- return cls;
- }
-
- private void ParseRepetitionBounds (out int min, out int max, RegexOptions options) {
- int n, m;
-
- /* check syntax */
-
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- n = ParseNumber (10, 1, 0);
- if (n < 0)
- throw NewParseException ("Illegal {x,y} - bad value of x.");
-
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- switch (pattern[ptr ++]) {
- case '}':
- m = n;
- break;
- case ',':
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- m = ParseNumber (10, 1, 0);
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- if (pattern[ptr ++] != '}')
- throw NewParseException ("Illegal {x,y} - bad value of y.");
- break;
- default:
- throw NewParseException ("Illegal {x,y}");
- }
-
- /* check bounds and ordering */
-
- if (n >= 0xffff || m >= 0xffff)
- throw NewParseException ("Illegal {x, y} - maximum of 65535.");
- if (m >= 0 && m < n)
- throw NewParseException ("Illegal {x, y} with x > y.");
-
- /* assign min and max */
-
- min = n;
- if (m > 0)
- max = m;
- else
- max = 0xffff;
- }
-
- private Category ParseUnicodeCategory () {
- if (pattern[ptr ++] != '{')
- throw NewParseException ("Incomplete \\p{X} character escape.");
-
- string name = ParseName (pattern, ref ptr);
- if (name == null)
- throw NewParseException ("Incomplete \\p{X} character escape.");
-
- Category cat = CategoryUtils.CategoryFromName (name);
- if (cat == Category.None)
- throw NewParseException ("Unknown property '" + name + "'.");
-
- if (pattern[ptr ++] != '}')
- throw NewParseException ("Incomplete \\p{X} character escape.");
-
- return cat;
- }
-
- private Expression ParseSpecial (RegexOptions options) {
- int p = ptr;
- bool ecma = IsECMAScript (options);
- Expression expr = null;
-
- switch (pattern[ptr ++]) {
-
- // categories
-
- case 'd':
- expr = new CharacterClass (ecma ? Category.EcmaDigit : Category.Digit, false);
- break;
-
- case 'w':
- expr = new CharacterClass (ecma ? Category.EcmaWord : Category.Word, false);
- break;
-
- case 's':
- expr = new CharacterClass (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, false);
- break;
-
- case 'p':
- // this is odd - ECMAScript isn't supposed to support Unicode,
- // yet \p{..} compiles and runs under the MS implementation
- // identically to canonical mode. That's why I'm ignoring the
- // value of ecma here.
-
- expr = new CharacterClass (ParseUnicodeCategory (), false);
- break;
-
- case 'D':
- expr = new CharacterClass (ecma ? Category.EcmaDigit : Category.Digit, true);
- break;
-
- case 'W':
- expr = new CharacterClass (ecma ? Category.EcmaWord : Category.Word, true);
- break;
-
- case 'S':
- expr = new CharacterClass (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, true);
- break;
-
- case 'P':
- expr = new CharacterClass (ParseUnicodeCategory (), true);
- break;
-
- // positions
-
- case 'A': expr = new PositionAssertion (Position.StartOfString); break;
- case 'Z': expr = new PositionAssertion (Position.End); break;
- case 'z': expr = new PositionAssertion (Position.EndOfString); break;
- case 'G': expr = new PositionAssertion (Position.StartOfScan); break;
- case 'b': expr = new PositionAssertion (Position.Boundary); break;
- case 'B': expr = new PositionAssertion (Position.NonBoundary); break;
-
- // references
-
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9': {
- ptr --;
- int n = ParseNumber (10, 1, 0);
- if (n < 0) {
- ptr = p;
- return null;
- }
-
- // FIXME test if number is within number of assigned groups
- // this may present a problem for right-to-left matching
-
- Reference reference = new Reference (IsIgnoreCase (options));
- refs.Add (reference, n.ToString ());
- expr = reference;
- break;
- }
-
- case 'k': {
- char delim = pattern[ptr ++];
- if (delim == '<')
- delim = '>';
- else if (delim != '\'')
- throw NewParseException ("Malformed \\k<...> named backreference.");
-
- string name = ParseName ();
- if (name == null || pattern[ptr] != delim)
- throw NewParseException ("Malformed \\k<...> named backreference.");
-
- ++ ptr;
- Reference reference = new Reference (IsIgnoreCase (options));
- refs.Add (reference, name);
- expr = reference;
- break;
- }
-
- default:
- expr = null;
- break;
- }
-
- if (expr == null)
- ptr = p;
-
- return expr;
- }
-
- private int ParseEscape () {
- int p = ptr;
- int c;
-
- switch (pattern[ptr ++]) {
-
- // standard escapes (except \b)
-
- case 'a': return '\u0007';
- case 't': return '\u0009';
- case 'r': return '\u000d';
- case 'v': return '\u000b';
- case 'f': return '\u000c';
- case 'n': return '\u000a';
- case 'e': return '\u001b';
- case '\\': return '\\';
-
- // character codes
-
- case '0': return ParseOctal (pattern, ref ptr);
-
- case 'x':
- c = ParseHex (pattern, ref ptr, 2);
- if (c < 0)
- throw NewParseException ("Insufficient hex digits");
-
- return c;
-
- case 'u':
- c = ParseHex (pattern, ref ptr, 4);
- if (c < 0)
- throw NewParseException ("Insufficient hex digits");
-
- return c;
-
- // control characters
-
- case 'c':
- c = pattern[p ++];
- if (c >= 'A' && c <= 'Z')
- return c - 'A';
- else if (c >= '@' && c <= '_')
- return c - '@';
- else
- throw NewParseException ("Unrecognized control character.");
-
- // unknown escape
-
- default:
- ptr = p;
- return -1;
- }
- }
-
- private string ParseName () {
- return Parser.ParseName (pattern, ref ptr);
- }
-
- private static bool IsNameChar (char c) {
- UnicodeCategory cat = Char.GetUnicodeCategory (c);
- if (cat == UnicodeCategory.ModifierLetter)
- return false;
- if (cat == UnicodeCategory.ConnectorPunctuation)
- return true;
- return Char.IsLetterOrDigit (c);
- }
-
- private int ParseNumber (int b, int min, int max) {
- return Parser.ParseNumber (pattern, ref ptr, b, min, max);
- }
-
- private int ParseDecimal () {
- return Parser.ParseDecimal (pattern, ref ptr);
- }
-
- private static int ParseDigit (char c, int b, int n) {
- switch (b) {
- case 8:
- if (c >= '0' && c <= '7')
- return c - '0';
- else
- return -1;
- case 10:
- if (c >= '0' && c <= '9')
- return c - '0';
- else
- return -1;
- case 16:
- if (c >= '0' && c <= '9')
- return c - '0';
- else if (c >= 'a' && c <= 'f')
- return 10 + c - 'a';
- else if (c >= 'A' && c <= 'F')
- return 10 + c - 'A';
- else
- return -1;
- default:
- return -1;
- }
- }
-
- private void ConsumeWhitespace (bool ignore) {
- while (true) {
- if (ptr >= pattern.Length)
- break;
-
- if (pattern[ptr] == '(') {
- if (ptr + 3 >= pattern.Length)
- return;
-
- if (pattern[ptr + 1] != '?' || pattern[ptr + 2] != '#')
- return;
-
- ptr += 3;
- while (pattern[ptr ++] != ')')
- /* ignore */ ;
- }
- else if (ignore && pattern[ptr] == '#') {
- while (ptr < pattern.Length && pattern[ptr ++] != '\n')
- /* ignore */ ;
- }
- else if (ignore && Char.IsWhiteSpace (pattern[ptr])) {
- while (ptr < pattern.Length && Char.IsWhiteSpace (pattern[ptr]))
- ++ ptr;
- }
- else
- return;
- }
- }
-
- private string ParseString (string pattern) {
- this.pattern = pattern;
- this.ptr = 0;
-
- string result = "";
- while (ptr < pattern.Length) {
- int c = pattern[ptr ++];
- if (c == '\\')
- c = ParseEscape ();
-
- result += (char)c;
- }
-
- return result;
- }
-
- private void ResolveReferences () {
- int gid = 1;
- Hashtable dict = new Hashtable ();
-
- // number unnamed groups
-
- foreach (CapturingGroup group in caps) {
- if (group.Name == null) {
- dict.Add (gid.ToString (), group);
- group.Number = gid ++;
-
- ++ num_groups;
- }
- }
-
- // number named groups
-
- foreach (CapturingGroup group in caps) {
- if (group.Name != null) {
- if (!dict.Contains (group.Name)) {
- dict.Add (group.Name, group);
- group.Number = gid ++;
-
- ++ num_groups;
- }
- else {
- CapturingGroup prev = (CapturingGroup)dict[group.Name];
- group.Number = prev.Number;
- }
- }
- }
-
- // resolve references
-
- foreach (Expression expr in refs.Keys) {
- string name = (string)refs[expr];
- if (!dict.Contains (name)) {
- throw NewParseException ("Reference to undefined group " +
- (Char.IsDigit (name[0]) ? "number " : "name ") +
- name);
- }
-
- CapturingGroup group = (CapturingGroup)dict[name];
- if (expr is Reference)
- ((Reference)expr).CapturingGroup = group;
- else if (expr is CaptureAssertion)
- ((CaptureAssertion)expr).CapturingGroup = group;
- else if (expr is BalancingGroup)
- ((BalancingGroup)expr).Balance = group;
- }
- }
-
- // flag helper functions
-
- private static bool IsIgnoreCase (RegexOptions options) {
- return (options & RegexOptions.IgnoreCase) != 0;
- }
-
- private static bool IsMultiline (RegexOptions options) {
- return (options & RegexOptions.Multiline) != 0;
- }
-
- private static bool IsExplicitCapture (RegexOptions options) {
- return (options & RegexOptions.ExplicitCapture) != 0;
- }
-
- private static bool IsSingleline (RegexOptions options) {
- return (options & RegexOptions.Singleline) != 0;
- }
-
- private static bool IsIgnorePatternWhitespace (RegexOptions options) {
- return (options & RegexOptions.IgnorePatternWhitespace) != 0;
- }
-
- private static bool IsRightToLeft (RegexOptions options) {
- return (options & RegexOptions.RightToLeft) != 0;
- }
-
- private static bool IsECMAScript (RegexOptions options) {
- return (options & RegexOptions.ECMAScript) != 0;
- }
-
- // exception creation
-
- private ArgumentException NewParseException (string msg) {
- msg = "parsing \"" + pattern + "\" - " + msg;
- return new ArgumentException (msg, pattern);
- }
-
- private string pattern;
- private int ptr;
-
- private ArrayList caps;
- private Hashtable refs;
- private int num_groups;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs b/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs
deleted file mode 100644
index 65665a2518b..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: quicksearch.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-
-namespace System.Text.RegularExpressions {
-
- // TODO use simple test for single character strings
-
- class QuickSearch {
- // simplified boyer-moore for fast substring matching
-
- public QuickSearch (string str, bool ignore) {
- this.str = str;
- this.len = str.Length;
- this.ignore = ignore;
-
- Setup ();
- }
-
- public string String {
- get { return str; }
- }
-
- public int Length {
- get { return len; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- }
-
- public int Search (string text, int start, int end) {
- if (end > text.Length - len)
- end = text.Length - len;
-
- int ptr = start;
- if (!ignore) {
- while (ptr <= end) {
- int i = len - 1;
- while (str[i] == text[ptr + i]) {
- if (-- i < 0)
- return ptr;
- }
-
- if (ptr < end)
- ptr += shift[text[ptr + len]];
- else
- break;
- }
- }
- else {
- // ignore case: same as above, but we convert text
- // to lower case before doing the string compare
-
- while (ptr <= end) {
- int i = len - 1;
- while (str[i] == Char.ToLower (text[ptr + i])) {
- if (-- i < 0)
- return ptr;
- }
-
- if (ptr < end)
- ptr += shift[text[ptr + len]];
- else
- break;
- }
- }
-
- return -1;
- }
-
- // private
-
- private void Setup () {
- if (ignore)
- str = str.ToLower ();
-
- // this is a 64k entry shift table. that's 128kb per pattern!
- // is it worth compressing this by only storing shifts within
- // a (lo, hi) character range? for most substrings this would
- // be around 50 bytes...
-
- shift = new int[0x1000];
- for (int i = 0; i < 0x1000; ++ i)
- shift[i] = len + 1;
-
- for (int i = 0; i < len; ++ i) {
- char c = str[i];
-
- shift[c] = len - i;
- if (ignore)
- shift[Char.ToUpper (c)] = len - i;
- }
- }
-
- private string str;
- private int len;
- private bool ignore;
-
- private int[] shift;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/regex.cs b/mcs/class/System/System.Text.RegularExpressions/regex.cs
deleted file mode 100644
index df083656613..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/regex.cs
+++ /dev/null
@@ -1,386 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: regex.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.Serialization;
-
-using RegularExpression = System.Text.RegularExpressions.Syntax.RegularExpression;
-using Parser = System.Text.RegularExpressions.Syntax.Parser;
-
-namespace System.Text.RegularExpressions {
-
- public delegate string MatchEvaluator (Match match);
-
- [Flags]
- public enum RegexOptions {
- None = 0x000,
- IgnoreCase = 0x001,
- Multiline = 0x002,
- ExplicitCapture = 0x004,
- Compiled = 0x008,
- Singleline = 0x010,
- IgnorePatternWhitespace = 0x020,
- RightToLeft = 0x040,
- ECMAScript = 0x100
- }
-
- public class Regex : ISerializable {
- public static void CompileToAssembly
- (RegexCompilationInfo[] regexes, AssemblyName aname)
- {
- throw new Exception ("Not implemented.");
- }
-
- public static void CompileToAssembly
- (RegexCompilationInfo[] regexes, AssemblyName aname,
- CustomAttributeBuilder[] attribs)
- {
- throw new Exception ("Not implemented.");
- }
-
- public static void CompileToAssembly
- (RegexCompilationInfo[] regexes, AssemblyName aname,
- CustomAttributeBuilder[] attribs, string resourceFile)
- {
- throw new Exception ("Not implemented.");
- }
-
- public static string Escape (string str) {
- return Parser.Escape (str);
- }
-
- public static string Unescape (string str) {
- return Parser.Unescape (str);
- }
-
- public static bool IsMatch (string input, string pattern) {
- Regex re = new Regex (pattern, RegexOptions.None);
- return re.IsMatch (input);
- }
-
- public static Match Match (string input, string pattern) {
- return Regex.Match (input, pattern, RegexOptions.None);
- }
-
- public static Match Match (string input, string pattern, RegexOptions options) {
- Regex re = new Regex (pattern, options);
- return re.Match (input);
- }
-
- public static string Replace
- (string input, string pattern, MatchEvaluator evaluator)
- {
- return Regex.Replace (input, pattern, evaluator, RegexOptions.None);
- }
-
- public static string Replace
- (string input, string pattern, MatchEvaluator evaluator,
- RegexOptions options)
- {
- Regex re = new Regex (pattern, options);
- return re.Replace (input, evaluator);
- }
-
- public static string Replace
- (string input, string pattern, string replacement)
- {
- return Regex.Replace (input, pattern, replacement, RegexOptions.None);
- }
-
- public static string Replace
- (string input, string pattern, string replacement,
- RegexOptions options)
- {
- Regex re = new Regex (pattern, options);
- return re.Replace (input, pattern);
- }
-
- public static string[] Split (string input, string pattern) {
- return Regex.Split (input, pattern, RegexOptions.None);
- }
-
- public static string[] Split (string input, string pattern, RegexOptions options) {
- Regex re = new Regex (input, options);
- return re.Split (input);
- }
-
- // private
-
- private static FactoryCache cache = new FactoryCache (200); // TODO put some meaningful number here
-
- // constructors
-
- protected Regex () {
- // XXX what's this constructor for?
- }
-
- public Regex (string pattern) : this (pattern, RegexOptions.None) {
- }
-
- public Regex (string pattern, RegexOptions options) {
- this.pattern = pattern;
- this.options = options;
-
- this.factory = cache.Lookup (pattern, options);
-
- if (this.factory == null) {
- // parse and install group mapping
-
- Parser psr = new Parser ();
- RegularExpression re = psr.ParseRegularExpression (pattern, options);
- this.group_count = re.GroupCount;
- this.mapping = psr.GetMapping ();
-
- // compile
-
- ICompiler cmp;
- if ((options & RegexOptions.Compiled) != 0)
- throw new Exception ("Not implemented.");
- //cmp = new CILCompiler ();
- else
- cmp = new PatternCompiler ();
-
- re.Compile (cmp, RightToLeft);
-
- // install machine factory and add to pattern cache
-
- this.factory = cmp.GetMachineFactory ();
- cache.Add (pattern, options, this.factory);
- }
- }
-
- // public instance properties
-
- public RegexOptions Options {
- get { return options; }
- }
-
- public bool RightToLeft {
- get { return (options & RegexOptions.RightToLeft) != 0; }
- }
-
- // public instance methods
-
- public string[] GetGroupNames () {
- string[] names = new string[mapping.Count];
- mapping.Keys.CopyTo (names, 0);
-
- return names;
- }
-
- public int[] GetGroupNumbers () {
- int[] numbers = new int[mapping.Count];
- mapping.Values.CopyTo (numbers, 0);
-
- return numbers;
- }
-
- public string GroupNameFromNumber (int i) {
- if (i >= group_count)
- return "";
-
- foreach (string name in mapping.Keys) {
- if ((int)mapping[name] == i)
- return name;
- }
-
- return "";
- }
-
- public int GroupNumberFromName (string name) {
- if (mapping.Contains (name))
- return (int)mapping[name];
-
- return -1;
- }
-
- // match methods
-
- public bool IsMatch (string input) {
- return IsMatch (input, 0);
- }
-
- public bool IsMatch (string input, int startat) {
- return Match (input, startat).Success;
- }
-
- public Match Match (string input) {
- return Match (input, 0);
- }
-
- public Match Match (string input, int startat) {
- return CreateMachine ().Scan (this, input, startat, input.Length);
- }
-
- public Match Match (string input, int startat, int length) {
- return CreateMachine ().Scan (this, input, startat, startat + length);
- }
-
- public MatchCollection Matches (string input) {
- return Matches (input, 0);
- }
-
- public MatchCollection Matches (string input, int startat) {
- MatchCollection ms = new MatchCollection ();
- Match m = Match (input, startat);
- while (m.Success) {
- ms.Add (m);
- m = m.NextMatch ();
- }
-
- return ms;
- }
-
- // replace methods
-
- public string Replace (string input, MatchEvaluator evaluator) {
- return Replace (input, evaluator, Int32.MaxValue, 0);
- }
-
- public string Replace (string input, MatchEvaluator evaluator, int count) {
- return Replace (input, evaluator, count, 0);
- }
-
- public string Replace (string input, MatchEvaluator evaluator, int count, int startat)
- {
- StringBuilder result = new StringBuilder ();
- int ptr = startat;
-
- Match m = Match (input, startat);
- while (m.Success && count -- > 0) {
- result.Append (input.Substring (ptr, m.Index - ptr));
- result.Append (evaluator (m));
-
- ptr = m.Index + m.Length;
- m = m.NextMatch ();
- }
- result.Append (input.Substring (ptr));
-
- return result.ToString ();
- }
-
- public string Replace (string input, string replacement) {
- return Replace (input, replacement, Int32.MaxValue, 0);
- }
-
- public string Replace (string input, string replacement, int count) {
- return Replace (input, replacement, count, 0);
- }
-
- public string Replace (string input, string replacement, int count, int startat) {
- ReplacementEvaluator ev = new ReplacementEvaluator (this, replacement);
- return Replace (input, new MatchEvaluator (ev.Evaluate), count, startat);
- }
-
- // split methods
-
- public string[] Split (string input) {
- return Split (input, Int32.MaxValue, 0);
- }
-
- public string[] Split (string input, int count) {
- return Split (input, count, 0);
- }
-
- public string[] Split (string input, int count, int startat) {
- ArrayList splits = new ArrayList ();
- if (count == 0)
- count = Int32.MaxValue;
-
- int ptr = startat;
- Match m = Match (input, startat);
- while (count -- > 0 && m.Success) {
- splits.Add (input.Substring (ptr, m.Index - ptr));
- ptr = m.Index + m.Length;
- }
-
- if (count > 0)
- splits.Add (input.Substring (ptr));
-
- string[] result = new string[splits.Count];
- splits.CopyTo (result);
- return result;
- }
-
- // object methods
-
- public override string ToString () {
- return pattern;
- }
-
- // ISerializable interface
-
- public void GetObjectData (SerializationInfo info, StreamingContext context) {
- throw new Exception ("Not implemented.");
- }
-
- // internal
-
- internal int GroupCount {
- get { return group_count; }
- }
-
- // private
-
- private IMachine CreateMachine () {
- return factory.NewInstance ();
- }
-
- private string pattern;
- private RegexOptions options;
-
- private IMachineFactory factory;
- private IDictionary mapping;
- private int group_count;
- }
-
- public class RegexCompilationInfo {
- public RegexCompilationInfo (string pattern, RegexOptions options, string name, string full_namespace, bool is_public) {
- this.pattern = pattern;
- this.options = options;
- this.name = name;
- this.full_namespace = full_namespace;
- this.is_public = is_public;
- }
-
- public bool IsPublic {
- get { return is_public; }
- set { is_public = value; }
- }
-
- public string Name {
- get { return name; }
- set { name = value; }
- }
-
- public string Namespace {
- get { return full_namespace; }
- set { full_namespace = value; }
- }
-
- public RegexOptions Options {
- get { return options; }
- set { options = value; }
- }
-
- public string Pattern {
- get { return pattern; }
- set { pattern = value; }
- }
-
- // private
-
- private string pattern, name, full_namespace;
- private RegexOptions options;
- private bool is_public;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/replace.cs b/mcs/class/System/System.Text.RegularExpressions/replace.cs
deleted file mode 100644
index 88b99f394bc..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/replace.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: replace.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Text;
-using System.Collections;
-
-using Parser = System.Text.RegularExpressions.Syntax.Parser;
-
-namespace System.Text.RegularExpressions {
-
- class ReplacementEvaluator {
- public static string Evaluate (string replacement, Match match) {
- ReplacementEvaluator ev = new ReplacementEvaluator (match.Regex, replacement);
- return ev.Evaluate (match);
- }
-
- public ReplacementEvaluator (Regex regex, string replacement) {
- this.regex = regex;
- terms = new ArrayList ();
- Compile (replacement);
- }
-
- public string Evaluate (Match match) {
- StringBuilder result = new StringBuilder ();
- foreach (Term term in terms)
- result.Append (term.GetResult (match));
-
- return result.ToString ();
- }
-
- // private
-
- private void Compile (string replacement) {
- replacement = Parser.Unescape (replacement);
- string literal = "";
-
- int ptr = 0;
- char c;
- Term term = null;
- while (ptr < replacement.Length) {
- c = replacement[ptr ++];
-
- if (c == '$') {
- if (replacement[ptr] == '$') {
- ++ ptr;
- break;
- }
-
- term = CompileTerm (replacement, ref ptr);
- }
-
- if (term != null) {
- term.Literal = literal;
- terms.Add (term);
-
- term = null;
- literal = "";
- }
- else
- literal += c;
- }
-
- if (term == null && literal.Length > 0) {
- terms.Add (new Term (literal));
- }
- }
-
- private Term CompileTerm (string str, ref int ptr) {
- char c = str[ptr];
-
- if (Char.IsDigit (c)) { // numbered group
- int n = Parser.ParseDecimal (str, ref ptr);
- if (n < 0 || n > regex.GroupCount)
- throw new ArgumentException ("Bad group number.");
-
- return new Term (TermOp.Match, n);
- }
-
- ++ ptr;
-
- switch (c) {
- case '{': { // named group
- string name = Parser.ParseName (str, ref ptr);
- if (str[ptr ++] != '}' || name == null)
- throw new ArgumentException ("Bad group name.");
-
- int n = regex.GroupNumberFromName (name);
-
- if (n < 0)
- throw new ArgumentException ("Bad group name.");
-
- return new Term (TermOp.Match, n);
- }
-
- case '&': // entire match
- return new Term (TermOp.Match, 0);
-
- case '`': // text before match
- return new Term (TermOp.PreMatch, 0);
-
- case '\'': // text after match
- return new Term (TermOp.PostMatch, 0);
-
- case '+': // last group
- return new Term (TermOp.Match, regex.GroupCount - 1);
-
- case '_': // entire text
- return new Term (TermOp.All, 0);
-
- default:
- throw new ArgumentException ("Bad replacement pattern.");
- }
- }
-
- private Regex regex;
- private ArrayList terms;
-
- private enum TermOp {
- None, // no action
- Match, // input within group
- PreMatch, // input before group
- PostMatch, // input after group
- All // entire input
- }
-
- private class Term {
- public Term (TermOp op, int arg) {
- this.op = op;
- this.arg = arg;
- this.literal = "";
- }
-
- public Term (string literal) {
- this.op = TermOp.None;
- this.arg = 0;
- this.literal = literal;
- }
-
- public string Literal {
- set { literal = value; }
- }
-
- public string GetResult (Match match) {
- Group group = match.Groups[arg];
-
- switch (op) {
- case TermOp.None:
- return literal;
-
- case TermOp.Match:
- return literal + group.Value;
-
- case TermOp.PreMatch:
- return literal + group.Text.Substring (0, group.Index);
-
- case TermOp.PostMatch:
- return literal + group.Text.Substring (group.Index + group.Length);
-
- case TermOp.All:
- return literal + group.Text;
- }
-
- return "";
- }
-
- public TermOp op; // term type
- public int arg; // group argument
- public string literal; // literal to prepend
-
- public override string ToString () {
- return op.ToString () + "(" + arg + ") " + literal;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/syntax.cs b/mcs/class/System/System.Text.RegularExpressions/syntax.cs
deleted file mode 100644
index f0d0bc4ef78..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/syntax.cs
+++ /dev/null
@@ -1,976 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: syntax.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions.Syntax {
- // collection classes
-
- class ExpressionCollection : CollectionBase {
- public void Add (Expression e) {
- List.Add (e);
- }
-
- public Expression this[int i] {
- get { return (Expression)List[i]; }
- set { List[i] = value; }
- }
-
- protected override void OnValidate (object o) {
- // allow null elements
- }
- }
-
- // abstract classes
-
- abstract class Expression {
- public abstract void Compile (ICompiler cmp, bool reverse);
- public abstract void GetWidth (out int min, out int max);
-
- public int GetFixedWidth () {
- int min, max;
- GetWidth (out min, out max);
-
- if (min == max)
- return min;
-
- return -1;
- }
-
- public virtual AnchorInfo GetAnchorInfo () {
- return new AnchorInfo (this, GetFixedWidth ());
- }
-
- public virtual bool IsComplex () {
- return true;
- }
- }
-
- // composite expressions
-
- abstract class CompositeExpression : Expression {
- public CompositeExpression () {
- expressions = new ExpressionCollection ();
- }
-
- protected ExpressionCollection Expressions {
- get { return expressions; }
- }
-
- protected void GetWidth (out int min, out int max, int count) {
- min = Int32.MaxValue;
- max = 0;
- bool empty = true;
-
- for (int i = 0; i < count; ++ i) {
- Expression e = Expressions[i];
- if (e == null)
- continue;
-
- empty = false;
- int a, b;
- e.GetWidth (out a, out b);
- if (a < min) min = a;
- if (b > max) max = b;
- }
-
- if (empty)
- min = max = 0;
- }
-
- private ExpressionCollection expressions;
- }
-
- // groups
-
- class Group : CompositeExpression {
- public Group () {
- }
-
- public Expression Expression {
- get { return Expressions[0]; }
- set { Expressions[0] = value; }
- }
-
- public void AppendExpression (Expression e) {
- Expressions.Add (e);
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- int count = Expressions.Count;
- for (int i = 0; i < count; ++ i) {
- Expression e;
- if (reverse)
- e = Expressions[count - i - 1];
- else
- e = Expressions[i];
-
- e.Compile (cmp, reverse);
- }
- }
-
- public override void GetWidth (out int min, out int max) {
- min = 0;
- max = 0;
-
- foreach (Expression e in Expressions) {
- int a, b;
- e.GetWidth (out a, out b);
- min += a;
- if (max == Int32.MaxValue || b == Int32.MaxValue)
- max = Int32.MaxValue;
- else
- max += b;
- }
- }
-
- public override AnchorInfo GetAnchorInfo () {
- int ptr;
- int width = GetFixedWidth ();
-
- ArrayList infos = new ArrayList ();
- IntervalCollection segments = new IntervalCollection ();
-
- // accumulate segments
-
- ptr = 0;
- foreach (Expression e in Expressions) {
- AnchorInfo info = e.GetAnchorInfo ();
- infos.Add (info);
-
- if (info.IsPosition)
- return new AnchorInfo (this, ptr + info.Offset, width, info.Position);
-
- if (info.IsSubstring)
- segments.Add (info.GetInterval (ptr));
-
- if (info.IsUnknownWidth)
- break;
-
- ptr += info.Width;
- }
-
- // normalize and find the longest segment
-
- segments.Normalize ();
-
- Interval longest = Interval.Empty;
- foreach (Interval segment in segments) {
- if (segment.Size > longest.Size)
- longest = segment;
- }
-
- // now chain the substrings that made this segment together
-
- if (!longest.IsEmpty) {
- string str = "";
- bool ignore = false;
-
- ptr = 0;
- foreach (AnchorInfo info in infos) {
- if (info.IsSubstring && longest.Contains (info.GetInterval (ptr))) {
- str += info.Substring; // TODO mark subexpressions
- ignore |= info.IgnoreCase;
- }
-
- if (info.IsUnknownWidth)
- break;
-
- ptr += info.Width;
- }
-
- return new AnchorInfo (this, longest.low, width, str, ignore);
- }
-
- return new AnchorInfo (this, width);
- }
-
- public override bool IsComplex () {
- bool comp = false;
- foreach (Expression e in Expressions) {
- comp |= e.IsComplex ();
- }
-
- return comp | GetFixedWidth () <= 0;
- }
- }
-
- class RegularExpression : Group {
- public RegularExpression () {
- group_count = 0;
- }
-
- public int GroupCount {
- get { return group_count; }
- set { group_count = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- // info block
-
- int min, max;
- GetWidth (out min, out max);
- cmp.EmitInfo (group_count, min, max);
-
- // anchoring expression
-
- AnchorInfo info = GetAnchorInfo ();
- if (reverse)
- info = new AnchorInfo (this, GetFixedWidth ()); // FIXME
-
- LinkRef pattern = cmp.NewLink ();
- cmp.EmitAnchor (info.Offset, pattern);
-
- if (info.IsPosition)
- cmp.EmitPosition (info.Position);
- else if (info.IsSubstring)
- cmp.EmitString (info.Substring, info.IgnoreCase, reverse);
-
- cmp.EmitTrue ();
-
- // pattern
-
- cmp.ResolveLink (pattern);
- base.Compile (cmp, reverse);
- cmp.EmitTrue ();
- }
-
- private int group_count;
- }
-
- class CapturingGroup : Group {
- public CapturingGroup () {
- this.gid = 0;
- this.name = null;
- }
-
- public int Number {
- get { return gid; }
- set { gid = value; }
- }
-
- public string Name {
- get { return name; }
- set { name = value; }
- }
-
- public bool IsNamed {
- get { return name != null; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- cmp.EmitOpen (gid);
- base.Compile (cmp, reverse);
- cmp.EmitClose (gid);
- }
-
- public override bool IsComplex () {
- return true;
- }
-
- private int gid;
- private string name;
- }
-
- class BalancingGroup : CapturingGroup {
- public BalancingGroup () {
- this.balance = null;
- }
-
- public CapturingGroup Balance {
- get { return balance; }
- set { balance = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- // can't invoke Group.Compile from here :(
- // so I'll just repeat the code
-
- int count = Expressions.Count;
- for (int i = 0; i < count; ++ i) {
- Expression e;
- if (reverse)
- e = Expressions[count - i - 1];
- else
- e = Expressions[i];
-
- e.Compile (cmp, reverse);
- }
-
- cmp.EmitBalance (this.Number, balance.Number);
- }
-
- private CapturingGroup balance;
- }
-
- class NonBacktrackingGroup : Group {
- public NonBacktrackingGroup () {
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- LinkRef tail = cmp.NewLink ();
-
- cmp.EmitSub (tail);
- base.Compile (cmp, reverse);
- cmp.EmitTrue ();
- cmp.ResolveLink (tail);
- }
-
- public override bool IsComplex () {
- return true;
- }
- }
-
- // repetition
-
- class Repetition : CompositeExpression {
- public Repetition (int min, int max, bool lazy) {
- Expressions.Add (null);
-
- this.min = min;
- this.max = max;
- this.lazy = lazy;
- }
-
- public Expression Expression {
- get { return Expressions[0]; }
- set { Expressions[0] = value; }
- }
-
- public int Minimum {
- get { return min; }
- set { min = value; }
- }
-
- public int Maximum {
- get { return max; }
- set { max = value; }
- }
-
- public bool Lazy {
- get { return lazy; }
- set { lazy = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- if (Expression.IsComplex ()) {
- LinkRef until = cmp.NewLink ();
-
- cmp.EmitRepeat (min, max, lazy, until);
- Expression.Compile (cmp, reverse);
- cmp.EmitUntil (until);
- }
- else {
- LinkRef tail = cmp.NewLink ();
-
- cmp.EmitFastRepeat (min, max, lazy, tail);
- Expression.Compile (cmp, reverse);
- cmp.EmitTrue ();
- cmp.ResolveLink (tail);
- }
- }
-
- public override void GetWidth (out int min, out int max) {
- Expression.GetWidth (out min, out max);
- min = min * this.min;
- if (max == Int32.MaxValue || this.max == 0xffff)
- max = Int32.MaxValue;
- else
- max = max * this.max;
- }
-
- public override AnchorInfo GetAnchorInfo () {
- int width = GetFixedWidth ();
- if (Minimum == 0)
- return new AnchorInfo (this, width);
-
- AnchorInfo info = Expression.GetAnchorInfo ();
- if (info.IsPosition)
- return new AnchorInfo (this, info.Offset, width, info.Position);
-
- if (info.IsSubstring) {
- if (info.IsComplete) {
- string str = "";
- for (int i = 0; i < Minimum; ++ i)
- str += info.Substring;
-
- return new AnchorInfo (this, 0, width, str, info.IgnoreCase);
- }
-
- return new AnchorInfo (this, info.Offset, width, info.Substring, info.IgnoreCase);
- }
-
- return new AnchorInfo (this, width);
- }
-
- private int min, max;
- private bool lazy;
- }
-
- // assertions
-
- abstract class Assertion : CompositeExpression {
- public Assertion () {
- Expressions.Add (null); // true expression
- Expressions.Add (null); // false expression
- }
-
- public Expression TrueExpression {
- get { return Expressions[0]; }
- set { Expressions[0] = value; }
- }
-
- public Expression FalseExpression {
- get { return Expressions[1]; }
- set { Expressions[1] = value; }
- }
-
- public override void GetWidth (out int min, out int max) {
- GetWidth (out min, out max, 2);
-
- if (TrueExpression == null || FalseExpression == null)
- min = 0;
- }
- }
-
- class CaptureAssertion : Assertion {
- public CaptureAssertion () {
- }
-
- public CapturingGroup CapturingGroup {
- get { return group; }
- set { group = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- int gid = group.Number;
- LinkRef tail = cmp.NewLink ();
-
- if (FalseExpression == null) {
- // IfDefined :1
- // <yes_exp>
- // 1: <tail>
-
- cmp.EmitIfDefined (gid, tail);
- TrueExpression.Compile (cmp, reverse);
- }
- else {
- // IfDefined :1
- // <yes_expr>
- // Jump :2
- // 1: <no_expr>
- // 2: <tail>
-
- LinkRef false_expr = cmp.NewLink ();
- cmp.EmitIfDefined (gid, false_expr);
- TrueExpression.Compile (cmp, reverse);
- cmp.EmitJump (tail);
- cmp.ResolveLink (false_expr);
- FalseExpression.Compile (cmp, reverse);
- }
-
- cmp.ResolveLink (tail);
- }
-
- public override bool IsComplex () {
- bool comp = false;
- if (TrueExpression != null)
- comp |= TrueExpression.IsComplex ();
- if (FalseExpression != null)
- comp |= FalseExpression.IsComplex ();
-
- return comp | GetFixedWidth () <= 0;
- }
-
- private CapturingGroup group;
- }
-
- class ExpressionAssertion : Assertion {
- public ExpressionAssertion () {
- Expressions.Add (null); // test expression
- }
-
- public bool Reverse {
- get { return reverse; }
- set { reverse = value; }
- }
-
- public bool Negate {
- get { return negate; }
- set { negate = value; }
- }
-
- public Expression TestExpression {
- get { return Expressions[2]; }
- set { Expressions[2] = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- LinkRef true_expr = cmp.NewLink ();
- LinkRef false_expr = cmp.NewLink ();
-
- // test op: positive / negative
-
- if (!negate)
- cmp.EmitTest (true_expr, false_expr);
- else
- cmp.EmitTest (false_expr, true_expr);
-
- // test expression: lookahead / lookbehind
-
- TestExpression.Compile (cmp, reverse ^ this.reverse);
- cmp.EmitTrue ();
-
- // target expressions
-
- if (TrueExpression == null) { // (?= ...)
- // Test :1, :2
- // <test_expr>
- // :2 False
- // :1 <tail>
-
- cmp.ResolveLink (false_expr);
- cmp.EmitFalse ();
- cmp.ResolveLink (true_expr);
- }
- else {
- cmp.ResolveLink (true_expr);
- TrueExpression.Compile (cmp, reverse);
-
- if (FalseExpression == null) { // (?(...) ...)
- // Test :1, :2
- // <test_expr>
- // :1 <yes_expr>
- // :2 <tail>
-
- cmp.ResolveLink (false_expr);
- }
- else { // (?(...) ... | ...)
- // Test :1, :2
- // <test_expr>
- // :1 <yes_expr>
- // Jump :3
- // :2 <no_expr>
- // :3 <tail>
-
- LinkRef tail = cmp.NewLink ();
-
- cmp.EmitJump (tail);
- cmp.ResolveLink (false_expr);
- FalseExpression.Compile (cmp, reverse);
- cmp.ResolveLink (tail);
- }
- }
- }
-
- private bool reverse, negate;
- }
-
- // alternation
-
- class Alternation : CompositeExpression {
- public Alternation () {
- }
-
- public ExpressionCollection Alternatives {
- get { return Expressions; }
- }
-
- public void AddAlternative (Expression e) {
- Alternatives.Add (e);
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- LinkRef next = cmp.NewLink ();
- LinkRef tail = cmp.NewLink ();
-
- foreach (Expression e in Alternatives) {
- cmp.EmitBranch (next);
- e.Compile (cmp, reverse);
- cmp.EmitJump (tail);
- cmp.ResolveLink (next);
- }
-
- cmp.EmitFalse ();
- cmp.ResolveLink (tail);
- }
-
- public override void GetWidth (out int min, out int max) {
- GetWidth (out min, out max, Alternatives.Count);
- }
-
- public override bool IsComplex () {
- bool comp = false;
- foreach (Expression e in Alternatives) {
- comp |= e.IsComplex ();
- }
-
- return comp | GetFixedWidth () <= 0;
- }
- }
-
- // terminal expressions
-
- class Literal : Expression {
- public Literal (string str, bool ignore) {
- this.str = str;
- this.ignore = ignore;
- }
-
- public string String {
- get { return str; }
- set { str = value; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- set { ignore = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- if (str.Length == 0)
- return;
-
- if (str.Length == 1)
- cmp.EmitCharacter (str[0], false, ignore, reverse);
- else
- cmp.EmitString (str, ignore, reverse);
- }
-
- public override void GetWidth (out int min, out int max) {
- min = max = str.Length;
- }
-
- public override AnchorInfo GetAnchorInfo () {
- return new AnchorInfo (this, 0, str.Length, str, ignore);
- }
-
- public override bool IsComplex () {
- return false;
- }
-
- private string str;
- private bool ignore;
- }
-
- class PositionAssertion : Expression {
- public PositionAssertion (Position pos) {
- this.pos = pos;
- }
-
- public Position Position {
- get { return pos; }
- set { pos = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- cmp.EmitPosition (pos);
- }
-
- public override void GetWidth (out int min, out int max) {
- min = max = 0;
- }
-
- public override bool IsComplex () {
- return false;
- }
-
- public override AnchorInfo GetAnchorInfo () {
- switch (pos) {
- case Position.StartOfString: case Position.StartOfLine: case Position.StartOfScan:
- return new AnchorInfo (this, 0, 0, pos);
-
- default:
- return new AnchorInfo (this, 0);
- }
- }
-
- private Position pos;
- }
-
- class Reference : Expression {
- public Reference (bool ignore) {
- this.ignore = ignore;
- }
-
- public CapturingGroup CapturingGroup {
- get { return group; }
- set { group = value; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- set { ignore = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- cmp.EmitReference (group.Number, ignore, reverse);
- }
-
- public override void GetWidth (out int min, out int max) {
- //group.GetWidth (out min, out max);
- // TODO set width to referenced group for non-cyclical references
- min = 0;
- max = Int32.MaxValue;
- }
-
- public override bool IsComplex () {
- return true; // FIXME incorporate cyclic check
- }
-
- private CapturingGroup group;
- private bool ignore;
- }
-
- class CharacterClass : Expression {
- public CharacterClass (bool negate, bool ignore) {
- this.negate = negate;
- this.ignore = ignore;
-
- intervals = new IntervalCollection ();
-
- // initialize pos/neg category arrays
-
- Array cat_values = Enum.GetValues (typeof (Category));
- int cat_size = (int)(Category)cat_values.GetValue (cat_values.Length - 1) + 1;
- pos_cats = new bool[cat_size];
- neg_cats = new bool[cat_size];
- for (int i = 0; i < cat_size; ++ i) {
- pos_cats[i] = false;
- neg_cats[i] = false;
- }
- }
-
- public CharacterClass (Category cat, bool negate) : this (false, false) {
- this.AddCategory (cat, negate);
- }
-
- public bool Negate {
- get { return negate; }
- set { negate = value; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- set { ignore = value; }
- }
-
- public void AddCategory (Category cat, bool negate) {
- int n = (int)cat;
-
- if (negate) {
- if (pos_cats[n])
- pos_cats[n] = false;
-
- neg_cats[n] = true;
- }
- else {
- if (neg_cats[n])
- neg_cats[n] = false;
-
- pos_cats[n] = true;
- }
- }
-
- public void AddCharacter (char c) {
- intervals.Add (new Interval (c, c));
- }
-
- public void AddRange (char lo, char hi) {
- intervals.Add (new Interval (lo, hi));
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- // create the meta-collection
-
- IntervalCollection meta =
- intervals.GetMetaCollection (new IntervalCollection.CostDelegate (GetIntervalCost));
-
- // count ops
-
- int count = meta.Count;
- for (int i = 0; i < pos_cats.Length; ++ i) {
- if (pos_cats[i]) ++ count;
- if (neg_cats[i]) ++ count;
- }
-
- if (count == 0)
- return;
-
- // emit in op for |meta| > 1
-
- LinkRef tail = cmp.NewLink ();
- if (count > 1)
- cmp.EmitIn (tail);
-
- // emit categories
-
- for (int i = 0; i < pos_cats.Length; ++ i) {
- if (pos_cats[i])
- cmp.EmitCategory ((Category)i, negate, reverse);
- else if (neg_cats[i])
- cmp.EmitCategory ((Category)i, !negate, reverse);
- }
-
- // emit character/range/sets from meta-collection
-
- foreach (Interval a in meta) {
- if (a.IsDiscontiguous) { // Set
- BitArray bits = new BitArray (a.Size);
- foreach (Interval b in intervals) {
- if (a.Contains (b)) {
- for (int i = b.low; i <= b.high; ++ i)
- bits[i - a.low] = true;
- }
- }
-
- cmp.EmitSet ((char)a.low, bits, negate, ignore, reverse);
- }
- else if (a.IsSingleton) // Character
- cmp.EmitCharacter ((char)a.low, negate, ignore, reverse);
- else // Range
- cmp.EmitRange ((char)a.low, (char)a.high, negate, ignore, reverse);
- }
-
- // finish up
-
- if (count > 1) {
- if (negate)
- cmp.EmitTrue ();
- else
- cmp.EmitFalse ();
-
- cmp.ResolveLink (tail);
- }
- }
-
- public override void GetWidth (out int min, out int max) {
- min = max = 1;
- }
-
- public override bool IsComplex () {
- return false;
- }
-
- // private
-
- private static double GetIntervalCost (Interval i) {
- // use op length as cost metric (=> optimize for space)
-
- if (i.IsDiscontiguous)
- return 3 + ((i.Size + 0xf) >> 4); // Set
- else if (i.IsSingleton)
- return 2; // Character
- else
- return 3; // Range
- }
-
- private bool negate, ignore;
- private bool[] pos_cats, neg_cats;
- private IntervalCollection intervals;
- }
-
- class AnchorInfo {
- private Expression expr;
-
- private Position pos;
- private int offset;
-
- private string str;
- private int width;
- private bool ignore;
-
- public AnchorInfo (Expression expr, int width) {
- this.expr = expr;
- this.offset = 0;
- this.width = width;
-
- this.str = null;
- this.ignore = false;
- this.pos = Position.Any;
- }
-
- public AnchorInfo (Expression expr, int offset, int width, string str, bool ignore) {
- this.expr = expr;
- this.offset = offset;
- this.width = width;
-
- this.str = ignore ? str.ToLower () : str;
-
- this.ignore = ignore;
- this.pos = Position.Any;
- }
-
- public AnchorInfo (Expression expr, int offset, int width, Position pos) {
- this.expr = expr;
- this.offset = offset;
- this.width = width;
-
- this.pos = pos;
-
- this.str = null;
- this.ignore = false;
- }
-
- public Expression Expression {
- get { return expr; }
- }
-
- public int Offset {
- get { return offset; }
- }
-
- public int Width {
- get { return width; }
- }
-
- public int Length {
- get { return (str != null) ? str.Length : 0; }
- }
-
- public bool IsUnknownWidth {
- get { return width < 0; }
- }
-
- public bool IsComplete {
- get { return Length == Width; }
- }
-
- public string Substring {
- get { return str; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- }
-
- public Position Position {
- get { return pos; }
- }
-
- public bool IsSubstring {
- get { return str != null; }
- }
-
- public bool IsPosition {
- get { return pos != Position.Any; }
- }
-
- public Interval GetInterval () {
- return GetInterval (0);
- }
-
- public Interval GetInterval (int start) {
- if (!IsSubstring)
- return Interval.Empty;
-
- return new Interval (start + Offset, start + Offset + Length - 1);
- }
- }
-}
diff --git a/mcs/class/System/System.Threading/ChangeLog b/mcs/class/System/System.Threading/ChangeLog
deleted file mode 100755
index 2f7f43e9fc6..00000000000
--- a/mcs/class/System/System.Threading/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-2001-09-21 Dick Porter <dick@ximian.com>
-
- * ThreadExceptionEventArgs.cs: Implemented
-
-2001-09-13 Dick Porter <dick@ximian.com>
-
- * ThreadExceptionEventArgs.cs, ThreadExceptionEventHandler.cs:
- More System.Threading stubs, in the System assembly.
-
diff --git a/mcs/class/System/System.Threading/ThreadExceptionEventArgs.cs b/mcs/class/System/System.Threading/ThreadExceptionEventArgs.cs
deleted file mode 100755
index 002324fe2db..00000000000
--- a/mcs/class/System/System.Threading/ThreadExceptionEventArgs.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Threading.ThreadExceptionEventArgs.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public class ThreadExceptionEventArgs : EventArgs
- {
- private Exception exception;
-
- public ThreadExceptionEventArgs(Exception t) {
- exception=t;
- }
-
- public Exception Exception {
- get {
- return(exception);
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Threading/ThreadExceptionEventHandler.cs b/mcs/class/System/System.Threading/ThreadExceptionEventHandler.cs
deleted file mode 100755
index 6f47d2bdd96..00000000000
--- a/mcs/class/System/System.Threading/ThreadExceptionEventHandler.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.ThreadExceptionEventHandler.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void ThreadExceptionEventHandler(object sender, ThreadExceptionEventArgs e);
-}
diff --git a/mcs/class/System/System.build b/mcs/class/System/System.build
deleted file mode 100644
index 1c718b9f00b..00000000000
--- a/mcs/class/System/System.build
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.dll -->
-
-<project name="System" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/System.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/unsafe"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- <excludes name="System.CodeDom/Code-X-Collection.cs"/>
- <excludes name="System.Net/IAuthenticationModule.cs"/>
- <excludes name="System.Net/AuthenticationManager.cs"/>
- </sources>
- </csc>
- <copy file="../lib/System.dll" tofile="Test/System.dll"/>
- <nant basedir="Test" target="build"/>
- </target>
-
- <target name="test" depends="build">
- <nant basedir="Test" target="test"/>
- </target>
-
- <target name="clean">
- <nant basedir="Test" target="clean"/>
- <delete file="../lib/System.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System/System/ChangeLog b/mcs/class/System/System/ChangeLog
deleted file mode 100644
index 6a77f00c92a..00000000000
--- a/mcs/class/System/System/ChangeLog
+++ /dev/null
@@ -1,14 +0,0 @@
-2002-02-08 Duncan Mak <duncan@ximian.com>
-
- * UriFormatException.cs: Removed TODO attribute, the docs are
- probably wrong here. In any case, this code compiles and should work.
-
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * UriFormatException.cs: Added bits for serialization.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ChangeLog : Add to this directory.
-
- * Uri.cs, UriFormatException.cs : Decorate bits with MonoTODO attribute. \ No newline at end of file
diff --git a/mcs/class/System/System/TODOAttribute.cs b/mcs/class/System/System/TODOAttribute.cs
deleted file mode 100644
index e14b61a2649..00000000000
--- a/mcs/class/System/System/TODOAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
- }
-}
diff --git a/mcs/class/System/System/Uri.cs b/mcs/class/System/System/Uri.cs
deleted file mode 100755
index 6410ed63357..00000000000
--- a/mcs/class/System/System/Uri.cs
+++ /dev/null
@@ -1,328 +0,0 @@
-//
-// System.Uri
-//
-// Author:
-// Garrett Rooney (rooneg@electricjellyfish.net)
-//
-// (C) 2001 Garrett Rooney
-//
-
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class Uri : MarshalByRefObject, ISerializable {
-
- private string path = "";
- private string host = "";
- private string fragment = "";
- private string scheme = "";
- private string port = "";
- private string query = "";
-
- // FIXME: is this correct?
- private bool userEscaped = false;
-
- public static readonly string SchemeDelimiter = "://";
- public static readonly string UriSchemeFile = "file";
- public static readonly string UriSchemeFtp = "ftp";
- public static readonly string UriSchemeGopher = "gopher";
- public static readonly string UriSchemeHttp = "http";
- public static readonly string UriSchemeHttps = "https";
- public static readonly string UriSchemeMailto = "mailto";
- public static readonly string UriSchemeNntp = "nntp";
-
- // the details table holds random info about the types of uri's
- private struct detail {
- public string scheme;
- public string port;
- public string delimiter;
-
- public detail(string s, string p, string d) {
- scheme = s;
- port = p;
- delimiter = d;
- }
- };
-
- static detail[] details = new detail[] {
- new detail(UriSchemeFile, "-1", SchemeDelimiter),
- new detail(UriSchemeFtp, "23", SchemeDelimiter),
- new detail(UriSchemeGopher, "70", SchemeDelimiter),
- new detail(UriSchemeHttp, "80", SchemeDelimiter),
- new detail(UriSchemeHttps, "223", SchemeDelimiter),
- new detail(UriSchemeMailto, "25", ":"),
- new detail(UriSchemeNntp, "119", SchemeDelimiter)
- };
-
- public static UriHostNameType CheckHostName(string name) {
- throw new NotImplementedException();
- }
-
- public static bool CheckSchemeName(string schemeName) {
- throw new NotImplementedException();
- }
-
- public static int FromHex(char digit) {
- throw new NotImplementedException();
- }
-
- public static string HexEscape(char character) {
- throw new NotImplementedException();
- }
-
- public static char HexUnescape(string pattern, ref int index) {
- throw new NotImplementedException();
- }
-
- public static bool IsHexDigit(char character) {
- throw new NotImplementedException();
- }
-
- public static bool IsHexEncoding(string pattern, int index) {
- throw new NotImplementedException();
- }
-
- private void Parse(string uri) {
- int i;
-
- // figure out the scheme
- int colon = uri.IndexOf(':');
- if (colon == -1 || colon == uri.Length) {
- throw new UriFormatException();
- } else {
- string s = uri.Substring(0, colon).ToLower();
- uri = uri.Remove(0, colon);
- for (i = 0; i < details.Length; i++) {
- if (details[i].scheme == s) {
- scheme = details[i].scheme;
-
- // assume default port. if
- // they specify one it'll get
- // set later on.
- port = details[i].port;
- break;
- }
- }
- if (i == details.Length) {
- throw new UriFormatException();
- }
- }
-
- // get rid of the delimiter
- uri = uri.Remove(0, details[i].delimiter.Length);
-
- parseHost(uri);
- }
-
- [MonoTODO]
- private void parseHost(string uri) {
-
- // FIXME: this doesn't handle IPv6 addresses correctly
- for (int i = 0; i < uri.Length; i++) {
- switch (uri[i]) {
- case ':':
- host = uri.Substring(0, i);
- parsePort(uri.Remove(0, i + 1));
- return;
- case '/':
- host = uri.Substring(0, i);
- parsePath(uri.Remove(0, i + 1));
- return;
- case '?':
- case '#':
- throw new UriFormatException();
- default:
- break;
- }
- }
-
- host = uri;
- }
-
- [MonoTODO]
- private void parsePort(string uri) {
-
- for (int i = 0; i < uri.Length; i++) {
- switch (uri[i]) {
- case '/':
- port = uri.Substring(0, i);
- parsePath(uri.Remove(0, i + 1));
- return;
- case '?':
- case '#':
- throw new UriFormatException();
- default:
- // FIXME: should this check if
- // uri[i] is a number?
- break;
- }
- }
-
- port = uri;
- }
-
- private void parsePath(string uri) {
-
- for (int i = 0; i < uri.Length; i++) {
- switch (uri[i]) {
- case '#':
- path = uri.Substring(0, i);
- fragment = uri.Remove(0, i + 1);
- return;
- case '?':
- path = uri.Substring(0, i);
- query = uri.Remove(0, i + 1);
- return;
- default:
- break;
- }
- }
-
- path = uri;
- }
-
- public Uri(string uri) {
- Parse(uri);
- }
-
- protected Uri(SerializationInfo serializationInfo,
- StreamingContext streamingContext) {
- throw new NotImplementedException();
- }
-
- public Uri(string uri, bool dontEscape) {
- userEscaped = dontEscape;
- Parse(uri);
- }
-
- public Uri(Uri baseUri, string relativeUri) {
- throw new NotImplementedException();
- }
-
- public Uri(Uri baseUri, string relativeUri, bool dontEscape) {
- userEscaped = dontEscape;
-
- throw new NotImplementedException();
- }
-
- public string AbsolutePath { get { return path; } }
-
- public string AbsoluteUri {
- get { throw new NotImplementedException(); }
- }
-
- public string Authority { get { return host + ":" + port; } }
-
- public string Fragment { get { return fragment; } }
-
- public string Host { get { return host; } }
-
- public UriHostNameType HostNameType {
- get { throw new NotImplementedException(); }
- }
-
- public bool IsDefaultPort {
- get {
- for (int i = 0; i < details.Length; i++) {
- if (details[i].scheme == scheme) {
- if (details[i].port == port) {
- return true;
- }
- }
- }
-
- return false;
- }
- }
-
- public bool IsFile {
- get {
- if (scheme == UriSchemeFile)
- return true;
- else
- return false;
- }
- }
-
- [MonoTODO ("Should check IPv6")]
- public bool IsLoopback {
- get {
- if (host == "localhost" || host == "127.0.0.1")
- return true;
- else
- return false;
- }
- }
-
- [MonoTODO]
- public bool IsUnc {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public string LocalPath {
- get { throw new NotImplementedException(); }
- }
-
- public string PathAndQuery {
- get { return path + "?" + query; }
- }
-
- public string Port { get { return port; } }
-
- public string Query { get { return query; } }
-
- public string Scheme { get { return scheme; } }
-
- // FIXME: what the hell are segments?
- [MonoTODO]
- public string[] Segments {
- get { throw new NotImplementedException(); }
- }
-
- public bool UserEscaped { get { return userEscaped; } }
-
- [MonoTODO]
- public string UserInfo {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public override bool Equals(object compared) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public override int GetHashCode() {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public string GetLeftPart(UriPartial part) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public string MakeRelative(Uri toUri) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public override string ToString() {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void GetObjectData(SerializationInfo info,
- StreamingContext context)
- {
- // FIXME: Implement me. yes, it is public because it implements ISerializable
- }
-
- [MonoTODO]
- protected static string EscapeString(string str) {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System/System/UriFormatException.cs b/mcs/class/System/System/UriFormatException.cs
deleted file mode 100755
index 8bd1813602f..00000000000
--- a/mcs/class/System/System/UriFormatException.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.UriFormatException.cs
-//
-// Author:
-// Scott Sanders (scott@stonecobra.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Scott Sanders
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
- [Serializable]
- public class UriFormatException : FormatException, ISerializable
- {
-
- // Constructors
- public UriFormatException ()
- : base (Locale.GetText ("Invalid URI format"))
- {
- }
-
- public UriFormatException (string message)
- : base (message)
- {
- }
-
- protected UriFormatException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- // Methods
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- }
- }
-}
-
diff --git a/mcs/class/System/System/UriHostNameType.cs b/mcs/class/System/System/UriHostNameType.cs
deleted file mode 100755
index 5e9eafb312a..00000000000
--- a/mcs/class/System/System/UriHostNameType.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// UriHostNameType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:33:14 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- public enum UriHostNameType {
-
- /// <summary>
- /// </summary>
- Unknown = 0,
-
- /// <summary>
- /// </summary>
- Dns = 2,
-
- /// <summary>
- /// </summary>
- IPv4 = 3,
-
- /// <summary>
- /// </summary>
- IPv6 = 4,
- } // UriHostNameType
-
-} // System
diff --git a/mcs/class/System/System/UriPartial.cs b/mcs/class/System/System/UriPartial.cs
deleted file mode 100755
index 21cb52f8dbe..00000000000
--- a/mcs/class/System/System/UriPartial.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// UriPartial.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:33:21 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- public enum UriPartial {
-
- /// <summary>
- /// </summary>
- Scheme = 0,
-
- /// <summary>
- /// </summary>
- Authority = 1,
-
- /// <summary>
- /// </summary>
- Path = 2,
- } // UriPartial
-
-} // System
diff --git a/mcs/class/System/Test/.cvsignore b/mcs/class/System/Test/.cvsignore
deleted file mode 100644
index 6a7461313bb..00000000000
--- a/mcs/class/System/Test/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.dll
diff --git a/mcs/class/System/Test/AllTests.cs b/mcs/class/System/Test/AllTests.cs
deleted file mode 100644
index 088883f455a..00000000000
--- a/mcs/class/System/Test/AllTests.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// Ximian.Mono.Tests.AllTests, System.dll
-//
-// Author:
-// Mario Martinez (mariom925@home.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-namespace Ximian.Mono.Tests
-{
- /// <summary>
- /// Combines all unit tests for the System.dll assembly
- /// into one test suite.
- /// </summary>
- public class AllTests : TestCase
- {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite();
- suite.AddTest(DnsTest.Suite);
-
- suite.AddTest(Testsuite.System.Collections.Specialized.NameValueCollectionTest.Suite);
- suite.AddTest(new TestSuite(typeof(System.Collections.Specialized.StringCollectionTest)));
- suite.AddTest(MonoTests.System.Text.RegularExpressions.AllTests.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/System/Test/ChangeLog b/mcs/class/System/Test/ChangeLog
deleted file mode 100644
index f7f82c99ab1..00000000000
--- a/mcs/class/System/Test/ChangeLog
+++ /dev/null
@@ -1,22 +0,0 @@
-2002-02-11 Duncan Mak <duncan@ximian.com>
-
- * AllTests.cs: Removed entry for IPHostEntryTest.cs because Mads
- removed it and included it in the new DnsTest.cs. This fixes the build.
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * DnsTest.cs: Updated test.
-
-2001-09-26 Mads Pultz <mpultz@get2net.dk>
- * DnsTest.cs: initial tests of BeginGetHostByName and EndGetHostByName implemented.
-
-2001-09-24 Mads Pultz <mpultz@get2net.dk>
-
- * DnsTest.cs: now tests GetHostByAddress, GetHostByName,
- IpToString and Resolve.
-
-2001-09-23 Mads Pultz <mpultz@get2net.dk>
-
- * DnsTest.cs: Initial work submitted to repository.
- * IPHostEntryTest.cs: Initial work submitted to repository.
-
diff --git a/mcs/class/System/Test/DnsTest.cs b/mcs/class/System/Test/DnsTest.cs
deleted file mode 100644
index 532cd0fa2ed..00000000000
--- a/mcs/class/System/Test/DnsTest.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-// DnsTest.cs - NUnit Test Cases for the System.Net.Dns class
-//
-// Author: Mads Pultz (mpultz@diku.dk)
-//
-// (C) Mads Pultz, 2001
-//
-// This test assumes the following:
-// 1) The following Internet sites exist:
-// www.go-mono.com with IP address 129.250.184.233
-// info.diku.dk with IP address 130.225.96.4
-// 2) The following DNS name does not exist:
-// www.hopefullydoesnotexist.dk
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-using System.Collections;
-
-public class DnsTest: TestCase {
-
- private String site1Name = "www.go-mono.com",
- site1Dot = "129.250.184.233",
- site2Name = "info.diku.dk",
- site2Dot = "130.225.96.4",
- noneExistingSite = "www.hopefullydoesnotexist.dk";
- private uint site1IP = 2180692201, site2IP = 2195808260; // Big-Endian
-
- public DnsTest(String name): base(name) {
- }
-
- public static ITest Suite {
- get { return new TestSuite(typeof(DnsTest)); }
- }
-
- private void Callback(IAsyncResult ar) {
- IPHostEntry h;
- h = System.Net.Dns.EndGetHostByName(ar);
- SubTestValidIPHostEntry(h);
- }
-
- public void TestAsyncGetHostByName(){
- IAsyncResult r;
- r = System.Net.Dns.BeginGetHostByName(site1Name, new AsyncCallback(Callback), null);
- }
-
- public void TestAsyncResolve() {
- IAsyncResult r;
- r = System.Net.Dns.BeginResolve(site1Name, new AsyncCallback(Callback), null);
- }
-
- public void TestGetHostName() {
- string hostName = System.Net.Dns.GetHostName();
- Assert(hostName != null);
- }
-
- private void SubTestGetHostByName(string siteName, string siteDot) {
- IPHostEntry h = System.Net.Dns.GetHostByName(siteName);
- SubTestValidIPHostEntry(h);
- Assert(h.HostName.Equals(siteName));
- Assert(h.AddressList[0].ToString() == siteDot);
- }
-
- public void TestGetHostByName() {
- SubTestGetHostByName(site1Name, site1Dot);
- SubTestGetHostByName(site2Name, site2Dot);
- try {
- System.Net.Dns.GetHostByName(noneExistingSite);
- Fail("Should raise a SocketException (assuming that '" + noneExistingSite + "' does not exist)");
- } catch (SocketException) {
- }
- try {
- System.Net.Dns.GetHostByName(null);
- Fail("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- }
-
- private void SubTestGetHostByAddressStringFormatException(string addr) {
- try {
- System.Net.Dns.GetHostByAddress(addr);
- Fail("Should raise a FormatException");
- } catch (FormatException) {
- }
- }
-
- private void SubTestGetHostByAddressString(string addr) {
- IPHostEntry h = System.Net.Dns.GetHostByAddress(addr);
- SubTestValidIPHostEntry(h);
- }
-
- public void TestGetHostByAddressString() {
- try {
- String addr = null;
- System.Net.Dns.GetHostByAddress(addr);
- Fail("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- SubTestGetHostByAddressStringFormatException("123.255.23");
- SubTestGetHostByAddressStringFormatException("123.256.34.10");
- SubTestGetHostByAddressStringFormatException("not an IP address");
- SubTestGetHostByAddressString(site1Dot);
- SubTestGetHostByAddressString(site2Dot);
- }
-
- private void SubTestGetHostByAddressIPAddress(IPAddress addr) {
- IPHostEntry h = System.Net.Dns.GetHostByAddress(addr);
- SubTestValidIPHostEntry(h);
- Assert(h.AddressList[0].ToString() == addr.ToString());
- }
-
- public void TestGetHostByAddressIPAddress() {
- try {
- IPAddress addr = null;
- System.Net.Dns.GetHostByAddress(addr);
- Fail("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- SubTestGetHostByAddressIPAddress(new IPAddress(IPAddress.NetworkToHostOrder((int)site1IP)));
- SubTestGetHostByAddressIPAddress(new IPAddress(IPAddress.NetworkToHostOrder((int)site2IP)));
- }
-
- private void SubTestResolve(string addr) {
- IPHostEntry h = System.Net.Dns.Resolve(addr);
- SubTestValidIPHostEntry(h);
- }
-
- public void TestResolve() {
- SubTestResolve(site1Name);
- SubTestResolve(site2Name);
- SubTestResolve(site1Dot);
- SubTestResolve(site2Dot);
- }
-
- private void SubTestValidIPHostEntry(IPHostEntry h) {
- Assert(h.HostName != null);
- Assert(h.AddressList != null);
- Assert(h.AddressList.Length > 0);
- }
-
- private static void printIPHostEntry(IPHostEntry h)
- {
- Console.WriteLine("----------------------------------------------------");
- Console.WriteLine("Host name:");
- Console.WriteLine(h.HostName);
- Console.WriteLine("IP addresses:");
- IPAddress[] list = h.AddressList;
- for(int i = 0; i < list.Length; ++i)
- Console.WriteLine(list[i]);
- Console.WriteLine("Aliases:");
- string[] aliases = h.Aliases;
- for(int i = 0; i < aliases.Length; ++i)
- Console.WriteLine(aliases[i]);
- Console.WriteLine("----------------------------------------------------");
- }
-}
-
diff --git a/mcs/class/System/Test/NameValueCollectionTest.cs b/mcs/class/System/Test/NameValueCollectionTest.cs
deleted file mode 100644
index 1e50a12b3f2..00000000000
--- a/mcs/class/System/Test/NameValueCollectionTest.cs
+++ /dev/null
@@ -1,178 +0,0 @@
-// created on 7/21/2001 at 2:36 PM
-
-
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Text;
-
-using NUnit.Framework;
-
-
-
-namespace Testsuite.System.Collections.Specialized {
-
-
- /// <summary>Microsoft NameValueCollection test.</summary>
- public class NameValueCollectionTest {
- public static ITest Suite {
- get {
- TestSuite suite= new TestSuite("All NameValueCollection Tests");
- suite.AddTest(BasicOperationsTest.Suite);
- return suite;
- }
- }
- }
-
-
-
-
- public class BasicOperationsTest : TestCase {
-
- protected NameValueCollection nvc;
- private static Random rnd;
-
- public BasicOperationsTest(String name) : base(name) {}
-
- protected override void SetUp() {
- nvc = new NameValueCollection();
- rnd=new Random();
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(BasicOperationsTest));
- }
- }
-
-
-
- private void SetDefaultData() {
- nvc.Clear();
- nvc.Add("k1","this");
- nvc.Add("k2","test");
- nvc.Add("k3","is");
- nvc.Add("k4","silly");
- }
- private static string FormatForPrinting(NameValueCollection nv)
- {
- if (nv==null)
- return null;
- int max = nv.Count;
- StringBuilder sb = new StringBuilder("-\t-Key-\t-Value-\n");
- for (int i=0; i<max; i++){
-
- sb.Append("\t"+nv.GetKey(i)+"\t"+nv[i]+"\n");
- }
- return sb.ToString();
- }
-
-
- public void TestAddRemoveClearSetGet()
- {
- nvc.Clear();
- Assert(nvc.Count==0&& !nvc.HasKeys());
-
- SetDefaultData();
- Assert(nvc.Count==4);
- Assert("Get operation returns wrong result.\n"+FormatForPrinting(nvc),(nvc.Get(0).Equals("this"))&&(nvc.Get("k1").Equals("this")));
-
-
- nvc.Add("k2","programmer");
- Assert(nvc["k2"].Equals("test,programmer"));
-
- nvc["k2"]="project";
- nvc.Add("k2","project");
- Assert(nvc.Count==4);
- Assert("Wrong effect of add(samekey,samevalue)\n"+FormatForPrinting(nvc),nvc["k2"].Equals("project"));
- // TODO: add Remove test
- nvc.Remove("k4");
- Assert("wrong nvc.Count="+nvc.Count,nvc.Count==3);
- Assert(nvc["k4"]==null);
-
- NameValueCollection nvc1 = new NameValueCollection();
- nvc1["k1"]="these";
- nvc1["k5"]="!";
- nvc.Add(nvc1);
- Assert(FormatForPrinting(nvc)+"Count is wrong after Add(nvc1) Count="+nvc.Count,nvc.Count==4);
- Assert("Values are wrong after Add(nvc1)",(nvc["k1"].Equals("this,these"))&&(nvc["k5"].Equals("!")));
-
- nvc.Set("k3","accomplished");
- Assert("Wrong result of Set operation",nvc["k3"].Equals("accomplished"));
-
- }
-
- public void TestGetKeyGetValues()
- {
- SetDefaultData();
- Assert(nvc.GetKey(0).Equals("k1"));
- string[] values = nvc.GetValues(0);
- Assert(values[0].Equals("this"));
-
- }
-
- public void TestCopyTo() {
- SetDefaultData();
- string[] entries=new string[nvc.Count];
- nvc.CopyTo(entries,0);
- //Message(FormatForPrinting(nvc));
- //Assert("Not an entry.",entries[0] is DictionaryEntry);
- }
-
- public void TestUnderHeavyLoad() {
-
- //TODO: add memory and time measurement
-
- nvc.Clear();
- int max=10000;
- String[] cache=new String[max*2];
- int n=0;
-
- for (int i=0;i<max;i++) {
- int id=rnd.Next()&0xFFFF;
- String key=""+id+"-key-"+id;
- String val="value-"+id;
- if (nvc[key]==null) {
- nvc[key]=val;
- cache[n]=key;
- cache[n+max]=val;
- n++;
- }
- }
-
- Assert(nvc.Count==n);
-
- for (int i=0;i<n;i++) {
- String key=cache[i];
- String val=nvc[key] as String;
- String err="nvc[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
-
- int r1=(n/3);
- int r2=r1+(n/5);
-
- for (int i=r1;i<r2;i++) {
- nvc.Remove(cache[i]);
- }
-
-
- for (int i=0;i<n;i++) {
- if (i>=r1 && i<r2) {
- Assert(nvc[cache[i]]==null);
- } else {
- String key=cache[i];
- String val=nvc[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
- }
-
- }
-
- }
-}
-
diff --git a/mcs/class/System/Test/StringCollectionTest.cs b/mcs/class/System/Test/StringCollectionTest.cs
deleted file mode 100644
index 5df63605e24..00000000000
--- a/mcs/class/System/Test/StringCollectionTest.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-/* System.Collections.Specialized.StringCollection.cs
- * Authors:
- * John Barnette (jbarn@httcb.net)
- *
- * Copyright (C) 2001 John Barnette
-*/
-
-using NUnit.Framework;
-
-namespace System.Collections.Specialized {
- public class StringCollectionTest : TestCase {
- private StringCollection sc;
- string[] strings = {
- "foo",
- "bar",
- "baz",
- "john",
- "paul",
- "george",
- "ringo"
- };
-
- public StringCollectionTest(string name) : base(name) {}
-
- protected override void SetUp() {
- sc = new StringCollection();
- sc.AddRange(strings);
- }
-
- // Simple Tests
-
- public void TestSimpleCount() {
- Assert(sc.Count == 7);
- }
-
- public void TestSimpleIsReadOnly() {
- Assert(!sc.IsReadOnly);
- }
-
- public void TestSimpleIsSynchronized() {
- Assert(!sc.IsSynchronized);
- }
-
- public void TestSimpleItemGet() {
- for(int i = 0; i < strings.Length; i++) {
- Assert(strings[i].Equals(sc[i]));
- }
- }
-
- public void TestSimpleItemSet() {
- sc[0] = "bob";
- Assert(sc[0].Equals("bob"));
- }
-
- public void TestSimpleSyncRoot() {
- Assert(sc.Equals(sc.SyncRoot));
- }
-
- public void TestSimpleAdd() {
- int index = sc.Add("chuck");
- Assert(index == strings.Length);
- Assert(sc[strings.Length].Equals("chuck"));
-
- }
-
- public void TestSimpleAddRange() {
- string[] newStrings = {
- "peter",
- "paul",
- "mary"
- };
-
- int index = sc.Count;
- sc.AddRange(newStrings);
-
- Assert(sc.Count == index + newStrings.Length);
-
- for (int i = 0; i+index <= sc.Count-1; i++) {
- Assert(newStrings[i].Equals(sc[i+index]));
- }
- }
-
- public void TestSimpleClear() {
- sc.Clear();
- Assert(sc.Count == 0);
- }
-
- public void TestSimpleContains() {
- Assert(sc.Contains(strings[0]));
- Assert(!sc.Contains("NOT CONTAINED"));
- }
-
- public void TestSimpleCopyTo() {
- string[] copyArray = new string[sc.Count];
- sc.CopyTo(copyArray, 0);
- for (int i = 0; i < copyArray.Length; i++) {
- Assert(copyArray[i] == sc[i]);
- }
- }
-
- public void TestSimpleGetEnumerator() {
- int index = 0;
- foreach(string s in sc) {
- Assert(s.Equals(strings[index]));
- index++;
- }
- }
-
- public void TestSimpleIndexOf() {
- Assert(sc.IndexOf(strings[0]) == 0);
- }
-
- public void TestSimpleInsert() {
- int index = 3;
- int oldCount = sc.Count;
- string before = sc[index - 1];
- string current = sc[index];
- string after = sc[index + 1];
- string newStr = "paco";
-
- sc.Insert(index, newStr);
-
- Assert(sc.Count == oldCount + 1);
- Assert(sc[index].Equals(newStr));
- Assert(sc[index-1].Equals(before));
- Assert(sc[index+1].Equals(current));
- Assert(sc[index+2].Equals(after));
- }
-
- public void TestSimpleRemove() {
- int oldCount = sc.Count;
- sc.Remove(strings[0]);
- Assert(oldCount == sc.Count + 1);
- Assert(!sc.Contains(strings[0]));
- }
-
- public void TestSimpleRemoveAt() {
- int index = 3;
- int oldCount = sc.Count;
- string after = sc[index+1];
-
- sc.RemoveAt(index);
- Assert(oldCount == sc.Count + 1);
- Assert(sc[index].Equals(after));
- }
-
- }
-}
diff --git a/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs b/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs
deleted file mode 100755
index 12b9680f36c..00000000000
--- a/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// System.Net.Sockets.TcpClientTest.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-using System;
-using System.Net;
-using System.Net.Sockets;
-using NUnit.Framework;
-
-namespace MonoTests.System.Net.Sockets {
-
- /// <summary>
- /// Tests System.Net.Sockets.TcpClient
- /// </summary>
- public class TcpClientTest : TestCase {
-
- public TcpClientTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof (TcpClientTest));
- }
- }
-
- /// <summary>
- /// Tests the TcpClient object
- /// (from System.Net.Sockets)
- /// </summary>
- public void test_TcpClient()
- {
- // set up a listening Socket
- Socket lSock = new Socket(AddressFamily.InterNetwork,
- SocketType.Stream, ProtocolType.Tcp);
-
- lSock.Bind(new IPEndPoint(IPAddress.Any, 1234));
- lSock.Listen(-1);
-
-
- // connect to it with a TcpClient
- TcpClient outClient = new TcpClient("localhost", 1234);
- Socket inSock = lSock.Accept();
-
-
- // now try exchanging data
- NetworkStream stream = outClient.GetStream();
-
- const int len = 1024;
- byte[] outBuf = new Byte[len];
- for (int i=0; i<len; i++)
- {
- outBuf[i] = (byte)(i % 256);
- }
-
- // send it
- stream.Write(outBuf,0,len);
-
- // and see if it comes back
- byte[] inBuf = new Byte[len];
- int ret = inSock.Receive(inBuf, 0, len, 0);
- Assert(ret != 0);
-
- for (int i=0; i<len; i++)
- {
- Assert(inBuf[i] == outBuf[i]);
- }
-
-
- // tidy up
- inSock.Close();
- outClient.Close();
- lSock.Close();
-
- }
-
- }
-
-}
diff --git a/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs b/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs
deleted file mode 100755
index a07d6bfcb9e..00000000000
--- a/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// System.Net.Sockets.TcpListenerTest.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-using System;
-using System.Net;
-using System.Net.Sockets;
-using NUnit.Framework;
-
-namespace MonoTests.System.Net.Sockets {
-
- /// <summary>
- /// Tests System.Net.Sockets.TcpListener
- /// </summary>
- public class TcpListenerTest : TestCase {
-
- public TcpListenerTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof (TcpListenerTest));
- }
- }
-
- /// <summary>
- /// Tests the TcpListener object
- /// (from System.Net.Sockets)
- /// </summary>
- public void test_TcpListener()
- {
- // listen with a new listener
- TcpListener inListener = new TcpListener(1234);
- inListener.Start();
-
-
- // connect to it from a new socket
- Socket outSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
- ProtocolType.IP);
- IPHostEntry hostent = Dns.GetHostByAddress("127.0.0.1");
- IPEndPoint remote = new IPEndPoint(hostent.AddressList[0], 1234);
- outSock.Connect(remote);
-
-
- // make sure the connection arrives
- Assert(inListener.Pending());
- Socket inSock = inListener.AcceptSocket();
-
-
- // now send some data and see if it comes out the other end
- const int len = 1024;
- byte[] outBuf = new Byte[len];
- for (int i=0; i<len; i++)
- {
- outBuf[i] = (byte)(i % 256);
- }
-
- outSock.Send(outBuf, 0, len, 0);
-
- byte[] inBuf = new Byte[len];
- int ret = inSock.Receive(inBuf, 0, len, 0);
-
-
- // let's see if it arrived OK
- Assert(ret != 0);
- for (int i=0; i<len; i++)
- {
- Assert(inBuf[i] == outBuf[i]);
- }
-
-
- // tidy up after ourselves
- inSock.Close();
-
- inListener.Stop();
- }
-
-
- }
-
-}
diff --git a/mcs/class/System/Test/System.Net/DnsTest.cs b/mcs/class/System/Test/System.Net/DnsTest.cs
deleted file mode 100644
index 532cd0fa2ed..00000000000
--- a/mcs/class/System/Test/System.Net/DnsTest.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-// DnsTest.cs - NUnit Test Cases for the System.Net.Dns class
-//
-// Author: Mads Pultz (mpultz@diku.dk)
-//
-// (C) Mads Pultz, 2001
-//
-// This test assumes the following:
-// 1) The following Internet sites exist:
-// www.go-mono.com with IP address 129.250.184.233
-// info.diku.dk with IP address 130.225.96.4
-// 2) The following DNS name does not exist:
-// www.hopefullydoesnotexist.dk
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-using System.Collections;
-
-public class DnsTest: TestCase {
-
- private String site1Name = "www.go-mono.com",
- site1Dot = "129.250.184.233",
- site2Name = "info.diku.dk",
- site2Dot = "130.225.96.4",
- noneExistingSite = "www.hopefullydoesnotexist.dk";
- private uint site1IP = 2180692201, site2IP = 2195808260; // Big-Endian
-
- public DnsTest(String name): base(name) {
- }
-
- public static ITest Suite {
- get { return new TestSuite(typeof(DnsTest)); }
- }
-
- private void Callback(IAsyncResult ar) {
- IPHostEntry h;
- h = System.Net.Dns.EndGetHostByName(ar);
- SubTestValidIPHostEntry(h);
- }
-
- public void TestAsyncGetHostByName(){
- IAsyncResult r;
- r = System.Net.Dns.BeginGetHostByName(site1Name, new AsyncCallback(Callback), null);
- }
-
- public void TestAsyncResolve() {
- IAsyncResult r;
- r = System.Net.Dns.BeginResolve(site1Name, new AsyncCallback(Callback), null);
- }
-
- public void TestGetHostName() {
- string hostName = System.Net.Dns.GetHostName();
- Assert(hostName != null);
- }
-
- private void SubTestGetHostByName(string siteName, string siteDot) {
- IPHostEntry h = System.Net.Dns.GetHostByName(siteName);
- SubTestValidIPHostEntry(h);
- Assert(h.HostName.Equals(siteName));
- Assert(h.AddressList[0].ToString() == siteDot);
- }
-
- public void TestGetHostByName() {
- SubTestGetHostByName(site1Name, site1Dot);
- SubTestGetHostByName(site2Name, site2Dot);
- try {
- System.Net.Dns.GetHostByName(noneExistingSite);
- Fail("Should raise a SocketException (assuming that '" + noneExistingSite + "' does not exist)");
- } catch (SocketException) {
- }
- try {
- System.Net.Dns.GetHostByName(null);
- Fail("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- }
-
- private void SubTestGetHostByAddressStringFormatException(string addr) {
- try {
- System.Net.Dns.GetHostByAddress(addr);
- Fail("Should raise a FormatException");
- } catch (FormatException) {
- }
- }
-
- private void SubTestGetHostByAddressString(string addr) {
- IPHostEntry h = System.Net.Dns.GetHostByAddress(addr);
- SubTestValidIPHostEntry(h);
- }
-
- public void TestGetHostByAddressString() {
- try {
- String addr = null;
- System.Net.Dns.GetHostByAddress(addr);
- Fail("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- SubTestGetHostByAddressStringFormatException("123.255.23");
- SubTestGetHostByAddressStringFormatException("123.256.34.10");
- SubTestGetHostByAddressStringFormatException("not an IP address");
- SubTestGetHostByAddressString(site1Dot);
- SubTestGetHostByAddressString(site2Dot);
- }
-
- private void SubTestGetHostByAddressIPAddress(IPAddress addr) {
- IPHostEntry h = System.Net.Dns.GetHostByAddress(addr);
- SubTestValidIPHostEntry(h);
- Assert(h.AddressList[0].ToString() == addr.ToString());
- }
-
- public void TestGetHostByAddressIPAddress() {
- try {
- IPAddress addr = null;
- System.Net.Dns.GetHostByAddress(addr);
- Fail("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- SubTestGetHostByAddressIPAddress(new IPAddress(IPAddress.NetworkToHostOrder((int)site1IP)));
- SubTestGetHostByAddressIPAddress(new IPAddress(IPAddress.NetworkToHostOrder((int)site2IP)));
- }
-
- private void SubTestResolve(string addr) {
- IPHostEntry h = System.Net.Dns.Resolve(addr);
- SubTestValidIPHostEntry(h);
- }
-
- public void TestResolve() {
- SubTestResolve(site1Name);
- SubTestResolve(site2Name);
- SubTestResolve(site1Dot);
- SubTestResolve(site2Dot);
- }
-
- private void SubTestValidIPHostEntry(IPHostEntry h) {
- Assert(h.HostName != null);
- Assert(h.AddressList != null);
- Assert(h.AddressList.Length > 0);
- }
-
- private static void printIPHostEntry(IPHostEntry h)
- {
- Console.WriteLine("----------------------------------------------------");
- Console.WriteLine("Host name:");
- Console.WriteLine(h.HostName);
- Console.WriteLine("IP addresses:");
- IPAddress[] list = h.AddressList;
- for(int i = 0; i < list.Length; ++i)
- Console.WriteLine(list[i]);
- Console.WriteLine("Aliases:");
- string[] aliases = h.Aliases;
- for(int i = 0; i < aliases.Length; ++i)
- Console.WriteLine(aliases[i]);
- Console.WriteLine("----------------------------------------------------");
- }
-}
-
diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/AllTests.cs b/mcs/class/System/Test/System.Text.RegularExpressions/AllTests.cs
deleted file mode 100644
index 6016eeef70a..00000000000
--- a/mcs/class/System/Test/System.Text.RegularExpressions/AllTests.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// assembly: System_test
-// namespace: MonoTests.System.Text.RegularExpressions
-// file: AllTests.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Text.RegularExpressions {
-
- public class AllTests : TestCase {
- public AllTests (string name) : base (name) { }
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (PerlTest.Suite);
-
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/PerlTest.cs b/mcs/class/System/Test/System.Text.RegularExpressions/PerlTest.cs
deleted file mode 100644
index f09681a91cc..00000000000
--- a/mcs/class/System/Test/System.Text.RegularExpressions/PerlTest.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// assembly: System_test
-// namespace: MonoTests.System.Text.RegularExpressions
-// file: PerlTest.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Text.RegularExpressions;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Text.RegularExpressions {
-
- public class PerlTest : TestCase {
- public static ITest Suite {
- get { return new TestSuite (typeof (PerlTest)); }
- }
-
- public PerlTest () : this ("System.Text.RegularExpressions Perl testsuite") { }
- public PerlTest (string name) : base (name) { }
-
- public void TestTrials () {
- foreach (RegexTrial trial in PerlTrials.trials) {
- string actual = trial.Execute ();
- if (actual != trial.Expected) {
- Assertion.Fail (
- trial.ToString () +
- "Expected " + trial.Expected +
- " but got " + actual
- );
- }
- }
- }
-
- protected override void SetUp () { }
- protected override void TearDown () { }
- }
-}
diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs b/mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs
deleted file mode 100644
index eecb7a454c5..00000000000
--- a/mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs
+++ /dev/null
@@ -1,746 +0,0 @@
-//
-// assembly: System_test
-// namespace: MonoTests.System.Text.RegularExpressions
-// file: PerlTrials.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System.Text.RegularExpressions;
-
-namespace MonoTests.System.Text.RegularExpressions {
-
- class PerlTrials {
- // ported from perl-5.6.1/t/op/re_tests
-
- public static RegexTrial[] trials = new RegexTrial[] {
- new RegexTrial (@"abc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc", RegexOptions.None, "xbc", "Fail."),
- new RegexTrial (@"abc", RegexOptions.None, "axc", "Fail."),
- new RegexTrial (@"abc", RegexOptions.None, "abx", "Fail."),
- new RegexTrial (@"abc", RegexOptions.None, "xabcy", "Pass. Group[0]=(1,3)"),
- new RegexTrial (@"abc", RegexOptions.None, "ababc", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"ab*c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab*bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab*bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab*bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@".{1}", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@".{3,4}", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab{0,}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab+bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab+bc", RegexOptions.None, "abc", "Fail."),
- new RegexTrial (@"ab+bc", RegexOptions.None, "abq", "Fail."),
- new RegexTrial (@"ab{1,}bc", RegexOptions.None, "abq", "Fail."),
- new RegexTrial (@"ab+bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{1,}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{1,3}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{3,4}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{4,5}bc", RegexOptions.None, "abbbbc", "Fail."),
- new RegexTrial (@"ab?bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab?bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab{0,1}bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab?bc", RegexOptions.None, "abbbbc", "Fail."),
- new RegexTrial (@"ab?c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab{0,1}c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.None, "abcc", "Fail."),
- new RegexTrial (@"^abc", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.None, "aabc", "Fail."),
- new RegexTrial (@"abc$", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),
- new RegexTrial (@"abc$", RegexOptions.None, "aabcd", "Fail."),
- new RegexTrial (@"^", RegexOptions.None, "abc", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"$", RegexOptions.None, "abc", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"a.c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.c", RegexOptions.None, "axc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.*c", RegexOptions.None, "axyzc", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"a.*c", RegexOptions.None, "axyzd", "Fail."),
- new RegexTrial (@"a[bc]d", RegexOptions.None, "abc", "Fail."),
- new RegexTrial (@"a[bc]d", RegexOptions.None, "abd", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[b-d]e", RegexOptions.None, "abd", "Fail."),
- new RegexTrial (@"a[b-d]e", RegexOptions.None, "ace", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[b-d]", RegexOptions.None, "aac", "Pass. Group[0]=(1,2)"),
- new RegexTrial (@"a[-b]", RegexOptions.None, "a-", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[b-]", RegexOptions.None, "a-", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[b-a]", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a[]b", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a[", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a]", RegexOptions.None, "a]", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[]]b", RegexOptions.None, "a]b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^bc]d", RegexOptions.None, "aed", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^bc]d", RegexOptions.None, "abd", "Fail."),
- new RegexTrial (@"a[^-b]c", RegexOptions.None, "adc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^-b]c", RegexOptions.None, "a-c", "Fail."),
- new RegexTrial (@"a[^]b]c", RegexOptions.None, "a]c", "Fail."),
- new RegexTrial (@"a[^]b]c", RegexOptions.None, "adc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"\ba\b", RegexOptions.None, "a-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"\ba\b", RegexOptions.None, "-a", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"\ba\b", RegexOptions.None, "-a-", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"\by\b", RegexOptions.None, "xy", "Fail."),
- new RegexTrial (@"\by\b", RegexOptions.None, "yz", "Fail."),
- new RegexTrial (@"\by\b", RegexOptions.None, "xyz", "Fail."),
- new RegexTrial (@"\Ba\B", RegexOptions.None, "a-", "Fail."),
- new RegexTrial (@"\Ba\B", RegexOptions.None, "-a", "Fail."),
- new RegexTrial (@"\Ba\B", RegexOptions.None, "-a-", "Fail."),
- new RegexTrial (@"\By\b", RegexOptions.None, "xy", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"\by\B", RegexOptions.None, "yz", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"\By\B", RegexOptions.None, "xyz", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"\w", RegexOptions.None, "a", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"\w", RegexOptions.None, "-", "Fail."),
- new RegexTrial (@"\W", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"\W", RegexOptions.None, "-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"a\sb", RegexOptions.None, "a b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a\sb", RegexOptions.None, "a-b", "Fail."),
- new RegexTrial (@"a\Sb", RegexOptions.None, "a b", "Fail."),
- new RegexTrial (@"a\Sb", RegexOptions.None, "a-b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"\d", RegexOptions.None, "1", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"\d", RegexOptions.None, "-", "Fail."),
- new RegexTrial (@"\D", RegexOptions.None, "1", "Fail."),
- new RegexTrial (@"\D", RegexOptions.None, "-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"[\w]", RegexOptions.None, "a", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"[\w]", RegexOptions.None, "-", "Fail."),
- new RegexTrial (@"[\W]", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"[\W]", RegexOptions.None, "-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"a[\s]b", RegexOptions.None, "a b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[\s]b", RegexOptions.None, "a-b", "Fail."),
- new RegexTrial (@"a[\S]b", RegexOptions.None, "a b", "Fail."),
- new RegexTrial (@"a[\S]b", RegexOptions.None, "a-b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"[\d]", RegexOptions.None, "1", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"[\d]", RegexOptions.None, "-", "Fail."),
- new RegexTrial (@"[\D]", RegexOptions.None, "1", "Fail."),
- new RegexTrial (@"[\D]", RegexOptions.None, "-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"ab|cd", RegexOptions.None, "abc", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"ab|cd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"()ef", RegexOptions.None, "def", "Pass. Group[0]=(1,2) Group[1]=(1,0)"),
- new RegexTrial (@"*a", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(*)b", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"$b", RegexOptions.None, "b", "Fail."),
- new RegexTrial (@"a\", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a\(b", RegexOptions.None, "a(b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a\(*b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a\(*b", RegexOptions.None, "a((b", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"a\\b", RegexOptions.None, "a\\b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc)", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(abc", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"((a))", RegexOptions.None, "abc", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)"),
- new RegexTrial (@"(a)b(c)", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)"),
- new RegexTrial (@"a+b+c", RegexOptions.None, "aabbabc", "Pass. Group[0]=(4,3)"),
- new RegexTrial (@"a{1,}b{1,}c", RegexOptions.None, "aabbabc", "Pass. Group[0]=(4,3)"),
- new RegexTrial (@"a**", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a.+?c", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"(a+|b)*", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b){0,}", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b)+", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b){1,}", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b)?", RegexOptions.None, "ab", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(a+|b){0,1}", RegexOptions.None, "ab", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@")(", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"[^ab]*", RegexOptions.None, "cde", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc", RegexOptions.None, "", "Fail."),
- new RegexTrial (@"a*", RegexOptions.None, "", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"([abc])*d", RegexOptions.None, "abbbcd", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,1)(2,1)(3,1)(4,1)"),
- new RegexTrial (@"([abc])*bcd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,1)"),
- new RegexTrial (@"a|b|c|d|e", RegexOptions.None, "e", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(a|b|c|d|e)f", RegexOptions.None, "ef", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"abcd*efg", RegexOptions.None, "abcdefg", "Pass. Group[0]=(0,7)"),
- new RegexTrial (@"ab*", RegexOptions.None, "xabyabbbz", "Pass. Group[0]=(1,2)"),
- new RegexTrial (@"ab*", RegexOptions.None, "xayabbbz", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"(ab|cd)e", RegexOptions.None, "abcde", "Pass. Group[0]=(2,3) Group[1]=(2,2)"),
- new RegexTrial (@"[abhgefdc]ij", RegexOptions.None, "hij", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^(ab|cd)e", RegexOptions.None, "abcde", "Fail."),
- new RegexTrial (@"(abc|)ef", RegexOptions.None, "abcdef", "Pass. Group[0]=(4,2) Group[1]=(4,0)"),
- new RegexTrial (@"(a|b)c*d", RegexOptions.None, "abcd", "Pass. Group[0]=(1,3) Group[1]=(1,1)"),
- new RegexTrial (@"(ab|ab*)bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1)"),
- new RegexTrial (@"a([bc]*)c*", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,2)"),
- new RegexTrial (@"a([bc]*)(c*d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)"),
- new RegexTrial (@"a([bc]+)(c*d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)"),
- new RegexTrial (@"a([bc]*)(c+d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)"),
- new RegexTrial (@"a[bcd]*dcdcde", RegexOptions.None, "adcdcde", "Pass. Group[0]=(0,7)"),
- new RegexTrial (@"a[bcd]+dcdcde", RegexOptions.None, "adcdcde", "Fail."),
- new RegexTrial (@"(ab|a)b*c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,2)"),
- new RegexTrial (@"((a)(b)c)(d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)"),
- new RegexTrial (@"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.None, "alpha", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"^a(bc+|b[eh])g|.h$", RegexOptions.None, "abh", "Pass. Group[0]=(1,2) Group[1]="),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "effgz", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]="),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "ij", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)"),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "effg", "Fail."),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "bcdd", "Fail."),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "reffgz", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]="),
- new RegexTrial (@"((((((((((a))))))))))", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"((((((((((a))))))))))\10", RegexOptions.None, "aa", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"((((((((((a))))))))))!", RegexOptions.None, "aa", "Fail."),
- new RegexTrial (@"((((((((((a))))))))))!", RegexOptions.None, "a!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"(((((((((a)))))))))", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)"),
- new RegexTrial (@"multiple words of text", RegexOptions.None, "uh-uh", "Fail."),
- new RegexTrial (@"multiple words", RegexOptions.None, "multiple words, yeah", "Pass. Group[0]=(0,14)"),
- new RegexTrial (@"(.*)c(.*)", RegexOptions.None, "abcde", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)"),
- new RegexTrial (@"\((.*), (.*)\)", RegexOptions.None, "(a, b)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)"),
- new RegexTrial (@"[k]", RegexOptions.None, "ab", "Fail."),
- new RegexTrial (@"abcd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"a(bc)d", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2)"),
- new RegexTrial (@"a[-]?c", RegexOptions.None, "ac", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"(abc)\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(0,3)"),
- new RegexTrial (@"([a-c]*)\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(0,3)"),
- new RegexTrial (@"\1", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"\2", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(a)|\1", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(a)|\1", RegexOptions.None, "x", "Fail."),
- new RegexTrial (@"(a)|\2", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(([a-c])b*?\2)*", RegexOptions.None, "ababbbcbc", "Pass. Group[0]=(0,5) Group[1]=(0,3)(3,2) Group[2]=(0,1)(3,1)"),
- new RegexTrial (@"(([a-c])b*?\2){3}", RegexOptions.None, "ababbbcbc", "Pass. Group[0]=(0,9) Group[1]=(0,3)(3,3)(6,3) Group[2]=(0,1)(3,1)(6,1)"),
- new RegexTrial (@"((\3|b)\2(a)x)+", RegexOptions.None, "aaxabxbaxbbx", "Fail."),
- new RegexTrial (@"((\3|b)\2(a)x)+", RegexOptions.None, "aaaxabaxbaaxbbax", "Pass. Group[0]=(12,4) Group[1]=(12,4) Group[2]=(12,1) Group[3]=(14,1)"),
- new RegexTrial (@"((\3|b)\2(a)){2,}", RegexOptions.None, "bbaababbabaaaaabbaaaabba", "Pass. Group[0]=(15,9) Group[1]=(15,3)(18,3)(21,3) Group[2]=(15,1)(18,1)(21,1) Group[3]=(17,1)(20,1)(23,1)"),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "XBC", "Fail."),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "AXC", "Fail."),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "ABX", "Fail."),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "XABCY", "Pass. Group[0]=(1,3)"),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "ABABC", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"ab*c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab*bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab*bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab*?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{0,}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab+?bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab+bc", RegexOptions.IgnoreCase, "ABC", "Fail."),
- new RegexTrial (@"ab+bc", RegexOptions.IgnoreCase, "ABQ", "Fail."),
- new RegexTrial (@"ab{1,}bc", RegexOptions.IgnoreCase, "ABQ", "Fail."),
- new RegexTrial (@"ab+bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{1,}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{1,3}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{3,4}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{4,5}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Fail."),
- new RegexTrial (@"ab??bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab??bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab{0,1}?bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab??bc", RegexOptions.IgnoreCase, "ABBBBC", "Fail."),
- new RegexTrial (@"ab??c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab{0,1}?c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.IgnoreCase, "ABCC", "Fail."),
- new RegexTrial (@"^abc", RegexOptions.IgnoreCase, "ABCC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.IgnoreCase, "AABC", "Fail."),
- new RegexTrial (@"abc$", RegexOptions.IgnoreCase, "AABC", "Pass. Group[0]=(1,3)"),
- new RegexTrial (@"^", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"$", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"a.c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.c", RegexOptions.IgnoreCase, "AXC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.*?c", RegexOptions.IgnoreCase, "AXYZC", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"a.*c", RegexOptions.IgnoreCase, "AXYZD", "Fail."),
- new RegexTrial (@"a[bc]d", RegexOptions.IgnoreCase, "ABC", "Fail."),
- new RegexTrial (@"a[bc]d", RegexOptions.IgnoreCase, "ABD", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[b-d]e", RegexOptions.IgnoreCase, "ABD", "Fail."),
- new RegexTrial (@"a[b-d]e", RegexOptions.IgnoreCase, "ACE", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[b-d]", RegexOptions.IgnoreCase, "AAC", "Pass. Group[0]=(1,2)"),
- new RegexTrial (@"a[-b]", RegexOptions.IgnoreCase, "A-", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[b-]", RegexOptions.IgnoreCase, "A-", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[b-a]", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a[]b", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a[", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a]", RegexOptions.IgnoreCase, "A]", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[]]b", RegexOptions.IgnoreCase, "A]B", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^bc]d", RegexOptions.IgnoreCase, "AED", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^bc]d", RegexOptions.IgnoreCase, "ABD", "Fail."),
- new RegexTrial (@"a[^-b]c", RegexOptions.IgnoreCase, "ADC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^-b]c", RegexOptions.IgnoreCase, "A-C", "Fail."),
- new RegexTrial (@"a[^]b]c", RegexOptions.IgnoreCase, "A]C", "Fail."),
- new RegexTrial (@"a[^]b]c", RegexOptions.IgnoreCase, "ADC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab|cd", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"ab|cd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"()ef", RegexOptions.IgnoreCase, "DEF", "Pass. Group[0]=(1,2) Group[1]=(1,0)"),
- new RegexTrial (@"*a", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"(*)b", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"$b", RegexOptions.IgnoreCase, "B", "Fail."),
- new RegexTrial (@"a\", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a\(b", RegexOptions.IgnoreCase, "A(B", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a\(*b", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a\(*b", RegexOptions.IgnoreCase, "A((B", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"a\\b", RegexOptions.IgnoreCase, "A\\B", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc)", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"(abc", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"((a))", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)"),
- new RegexTrial (@"(a)b(c)", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)"),
- new RegexTrial (@"a+b+c", RegexOptions.IgnoreCase, "AABBABC", "Pass. Group[0]=(4,3)"),
- new RegexTrial (@"a{1,}b{1,}c", RegexOptions.IgnoreCase, "AABBABC", "Pass. Group[0]=(4,3)"),
- new RegexTrial (@"a**", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a.+?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.*?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.{0,5}?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"(a+|b)*", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b){0,}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b)+", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b){1,}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b)?", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(a+|b){0,1}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(a+|b){0,1}?", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,0) Group[1]="),
- new RegexTrial (@")(", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"[^ab]*", RegexOptions.IgnoreCase, "CDE", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "", "Fail."),
- new RegexTrial (@"a*", RegexOptions.IgnoreCase, "", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"([abc])*d", RegexOptions.IgnoreCase, "ABBBCD", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,1)(2,1)(3,1)(4,1)"),
- new RegexTrial (@"([abc])*bcd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(0,1)"),
- new RegexTrial (@"a|b|c|d|e", RegexOptions.IgnoreCase, "E", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(a|b|c|d|e)f", RegexOptions.IgnoreCase, "EF", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"abcd*efg", RegexOptions.IgnoreCase, "ABCDEFG", "Pass. Group[0]=(0,7)"),
- new RegexTrial (@"ab*", RegexOptions.IgnoreCase, "XABYABBBZ", "Pass. Group[0]=(1,2)"),
- new RegexTrial (@"ab*", RegexOptions.IgnoreCase, "XAYABBBZ", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"(ab|cd)e", RegexOptions.IgnoreCase, "ABCDE", "Pass. Group[0]=(2,3) Group[1]=(2,2)"),
- new RegexTrial (@"[abhgefdc]ij", RegexOptions.IgnoreCase, "HIJ", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^(ab|cd)e", RegexOptions.IgnoreCase, "ABCDE", "Fail."),
- new RegexTrial (@"(abc|)ef", RegexOptions.IgnoreCase, "ABCDEF", "Pass. Group[0]=(4,2) Group[1]=(4,0)"),
- new RegexTrial (@"(a|b)c*d", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(1,3) Group[1]=(1,1)"),
- new RegexTrial (@"(ab|ab*)bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,1)"),
- new RegexTrial (@"a([bc]*)c*", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(1,2)"),
- new RegexTrial (@"a([bc]*)(c*d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)"),
- new RegexTrial (@"a([bc]+)(c*d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)"),
- new RegexTrial (@"a([bc]*)(c+d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)"),
- new RegexTrial (@"a[bcd]*dcdcde", RegexOptions.IgnoreCase, "ADCDCDE", "Pass. Group[0]=(0,7)"),
- new RegexTrial (@"a[bcd]+dcdcde", RegexOptions.IgnoreCase, "ADCDCDE", "Fail."),
- new RegexTrial (@"(ab|a)b*c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,2)"),
- new RegexTrial (@"((a)(b)c)(d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)"),
- new RegexTrial (@"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.IgnoreCase, "ALPHA", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"^a(bc+|b[eh])g|.h$", RegexOptions.IgnoreCase, "ABH", "Pass. Group[0]=(1,2) Group[1]="),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "EFFGZ", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]="),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "IJ", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)"),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "EFFG", "Fail."),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "BCDD", "Fail."),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "REFFGZ", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]="),
- new RegexTrial (@"((((((((((a))))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"((((((((((a))))))))))\10", RegexOptions.IgnoreCase, "AA", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"((((((((((a))))))))))!", RegexOptions.IgnoreCase, "AA", "Fail."),
- new RegexTrial (@"((((((((((a))))))))))!", RegexOptions.IgnoreCase, "A!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"(((((((((a)))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)"),
- new RegexTrial (@"(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))", RegexOptions.IgnoreCase, "C", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"multiple words of text", RegexOptions.IgnoreCase, "UH-UH", "Fail."),
- new RegexTrial (@"multiple words", RegexOptions.IgnoreCase, "MULTIPLE WORDS, YEAH", "Pass. Group[0]=(0,14)"),
- new RegexTrial (@"(.*)c(.*)", RegexOptions.IgnoreCase, "ABCDE", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)"),
- new RegexTrial (@"\((.*), (.*)\)", RegexOptions.IgnoreCase, "(A, B)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)"),
- new RegexTrial (@"[k]", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"abcd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"a(bc)d", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2)"),
- new RegexTrial (@"a[-]?c", RegexOptions.IgnoreCase, "AC", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"(abc)\1", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,6) Group[1]=(0,3)"),
- new RegexTrial (@"([a-c]*)\1", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,6) Group[1]=(0,3)"),
- new RegexTrial (@"a(?!b).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"a(?=d).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"a(?=c|d).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"a(?:b|c|d)(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)"),
- new RegexTrial (@"a(?:b|c|d)*(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)"),
- new RegexTrial (@"a(?:b|c|d)+?(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)"),
- new RegexTrial (@"a(?:b|c|d)+?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,3) Group[1]=(2,1)"),
- new RegexTrial (@"a(?:b|c|d)+(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){2}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,4) Group[1]=(3,1)"),
- new RegexTrial (@"a(?:b|c|d){4,5}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)"),
- new RegexTrial (@"a(?:b|c|d){4,5}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,6) Group[1]=(5,1)"),
- new RegexTrial (@"((foo)|(bar))*", RegexOptions.None, "foobar", "Pass. Group[0]=(0,6) Group[1]=(0,3)(3,3) Group[2]=(0,3) Group[3]=(3,3)"),
- new RegexTrial (@":(?:", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a(?:b|c|d){6,7}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){6,7}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){5,6}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){5,6}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)"),
- new RegexTrial (@"a(?:b|c|d){5,7}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){5,7}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)"),
- new RegexTrial (@"a(?:b|(c|e){1,2}?|d)+?(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(1,1) Group[2]=(2,1)"),
- new RegexTrial (@"^(.+)?B", RegexOptions.None, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"^([^a-z])|(\^)$", RegexOptions.None, ".", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]="),
- new RegexTrial (@"^[<>]&", RegexOptions.None, "<&OUT", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,10) Group[1]=(0,1)(1,2)(3,3)(6,4)"),
- new RegexTrial (@"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaa", "Fail."),
- new RegexTrial (@"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaaaa", "Fail."),
- new RegexTrial (@"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,10) Group[1]=(0,1)(1,2)(3,3)(6,4)"),
- new RegexTrial (@"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaa", "Fail."),
- new RegexTrial (@"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaaaa", "Fail."),
- new RegexTrial (@"((a{4})+)", RegexOptions.None, "aaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4)"),
- new RegexTrial (@"(((aa){2})+)", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4) Group[3]=(0,2)(2,2)(4,2)(6,2)"),
- new RegexTrial (@"(((a{2}){2})+)", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4) Group[3]=(0,2)(2,2)(4,2)(6,2)"),
- new RegexTrial (@"(?:(f)(o)(o)|(b)(a)(r))*", RegexOptions.None, "foobar", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(3,1) Group[5]=(4,1) Group[6]=(5,1)"),
- new RegexTrial (@"(?<=a)b", RegexOptions.None, "ab", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"(?<=a)b", RegexOptions.None, "cb", "Fail."),
- new RegexTrial (@"(?<=a)b", RegexOptions.None, "b", "Fail."),
- new RegexTrial (@"(?<!c)b", RegexOptions.None, "ab", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"(?<!c)b", RegexOptions.None, "cb", "Fail."),
- new RegexTrial (@"(?<!c)b", RegexOptions.None, "b", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(?<!c)b", RegexOptions.None, "b", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(?<%)b", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(?:..)*a", RegexOptions.None, "aba", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"(?:..)*?a", RegexOptions.None, "aba", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"^(?:b|a(?=(.)))*\1", RegexOptions.None, "abc", "Pass. Group[0]=(0,2) Group[1]=(1,1)"),
- new RegexTrial (@"^(){3,5}", RegexOptions.None, "abc", "Pass. Group[0]=(0,0) Group[1]=(0,0)(0,0)(0,0)"),
- new RegexTrial (@"^(a+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1)"),
- new RegexTrial (@"^((a|b)+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(0,1)"),
- new RegexTrial (@"^((a|bc)+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(0,1)"),
- new RegexTrial (@"(a|x)*ab", RegexOptions.None, "cab", "Pass. Group[0]=(1,2) Group[1]="),
- new RegexTrial (@"(a)*ab", RegexOptions.None, "cab", "Pass. Group[0]=(1,2) Group[1]="),
- new RegexTrial (@"(?:(?i)a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?i)a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?i)a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?i)a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?i)a)b", RegexOptions.None, "aB", "Fail."),
- new RegexTrial (@"((?i)a)b", RegexOptions.None, "aB", "Fail."),
- new RegexTrial (@"(?i:a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?i:a))b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?i:a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?i:a))b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?i:a)b", RegexOptions.None, "aB", "Fail."),
- new RegexTrial (@"((?i:a))b", RegexOptions.None, "aB", "Fail."),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "Ab", "Fail."),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "Ab", "Fail."),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "Ab", "Fail."),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "Ab", "Fail."),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"((?-i:a.))b", RegexOptions.IgnoreCase, "a\nB", "Fail."),
- new RegexTrial (@"((?s-i:a.))b", RegexOptions.IgnoreCase, "a\nB", "Pass. Group[0]=(0,3) Group[1]=(0,2)"),
- new RegexTrial (@"((?s-i:a.))b", RegexOptions.IgnoreCase, "B\nB", "Fail."),
- new RegexTrial (@"(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))", RegexOptions.None, "cabbbb", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))", RegexOptions.None, "caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "Pass. Group[0]=(0,41)"),
- new RegexTrial (@"(ab)\d\1", RegexOptions.IgnoreCase, "Ab4ab", "Pass. Group[0]=(0,5) Group[1]=(0,2)"),
- new RegexTrial (@"(ab)\d\1", RegexOptions.IgnoreCase, "ab4Ab", "Pass. Group[0]=(0,5) Group[1]=(0,2)"),
- new RegexTrial (@"foo\w*\d{4}baz", RegexOptions.None, "foobar1234baz", "Pass. Group[0]=(0,13)"),
- new RegexTrial (@"x(~~)*(?:(?:F)?)?", RegexOptions.None, "x~~", "Pass. Group[0]=(0,3) Group[1]=(1,2)"),
- new RegexTrial (@"^a(?#xxx){3}c", RegexOptions.None, "aaac", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"(?<![cd])b", RegexOptions.None, "dbcb", "Fail."),
- new RegexTrial (@"(?<![cd])[ab]", RegexOptions.None, "dbaacb", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"(?<!(c|d))b", RegexOptions.None, "dbcb", "Fail."),
- new RegexTrial (@"(?<!(c|d))[ab]", RegexOptions.None, "dbaacb", "Pass. Group[0]=(2,1) Group[1]="),
- new RegexTrial (@"(?<!cd)[ab]", RegexOptions.None, "cdaccb", "Pass. Group[0]=(5,1)"),
- new RegexTrial (@"^(?:a?b?)*$", RegexOptions.None, "a--", "Fail."),
- new RegexTrial (@"((?s)^a(.))((?m)^b$)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(0,3) Group[1]=(0,2) Group[2]=(1,1) Group[3]=(2,1)"),
- new RegexTrial (@"((?m)^b$)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)"),
- new RegexTrial (@"(?m)^b", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"(?m)^(b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)"),
- new RegexTrial (@"((?m)^b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)"),
- new RegexTrial (@"\n((?m)^b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(1,2) Group[1]=(2,1)"),
- new RegexTrial (@"((?s).)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(3,2) Group[1]=(3,1)"),
- new RegexTrial (@"((?s).)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(3,2) Group[1]=(3,1)"),
- new RegexTrial (@"((?s)b.)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,3) Group[1]=(2,2)"),
- new RegexTrial (@"((?s)b.)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,3) Group[1]=(2,2)"),
- new RegexTrial (@"^b", RegexOptions.None, "a\nb\nc\n", "Fail."),
- new RegexTrial (@"()^b", RegexOptions.None, "a\nb\nc\n", "Fail."),
- new RegexTrial (@"((?m)^b)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)"),
- new RegexTrial (@"(x)?(?(1)a|b)", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"(x)?(?(1)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]="),
- new RegexTrial (@"()?(?(1)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]="),
- new RegexTrial (@"()(?(1)b|a)", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"()?(?(1)a|b)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,0)"),
- new RegexTrial (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "(blah)", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(5,1)"),
- new RegexTrial (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "blah", "Pass. Group[0]=(0,4) Group[1]= Group[2]="),
- new RegexTrial (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "blah)", "Fail."),
- new RegexTrial (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "(blah", "Fail."),
- new RegexTrial (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "(blah)", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(5,1)"),
- new RegexTrial (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "blah", "Pass. Group[0]=(0,4) Group[1]= Group[2]="),
- new RegexTrial (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "blah)", "Fail."),
- new RegexTrial (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "(blah", "Fail."),
- new RegexTrial (@"(?(1)a|b|c)", RegexOptions.None, "a", "Error."),
- new RegexTrial (@"(?(?!a)a|b)", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"(?(?!a)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(?(?=a)b|a)", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"(?(?=a)a|b)", RegexOptions.None, "a", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(?=(a+?))(\1ab)", RegexOptions.None, "aaab", "Pass. Group[0]=(1,3) Group[1]=(1,1) Group[2]=(1,3)"),
- new RegexTrial (@"^(?=(a+?))\1ab", RegexOptions.None, "aaab", "Fail."),
- new RegexTrial (@"(\w+:)+", RegexOptions.None, "one:", "Pass. Group[0]=(0,4) Group[1]=(0,4)"),
- new RegexTrial (@"$(?<=^(a))", RegexOptions.None, "a", "Pass. Group[0]=(1,0) Group[1]=(0,1)"),
- new RegexTrial (@"(?=(a+?))(\1ab)", RegexOptions.None, "aaab", "Pass. Group[0]=(1,3) Group[1]=(1,1) Group[2]=(1,3)"),
- new RegexTrial (@"^(?=(a+?))\1ab", RegexOptions.None, "aaab", "Fail."),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd:", "Fail."),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]= Group[2]=(0,4)"),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "xy:z:::abcd", "Pass. Group[0]=(0,11) Group[1]=(0,7) Group[2]=(7,4)"),
- new RegexTrial (@"^[^bcd]*(c+)", RegexOptions.None, "aexycd", "Pass. Group[0]=(0,5) Group[1]=(4,1)"),
- new RegexTrial (@"(a*)b+", RegexOptions.None, "caab", "Pass. Group[0]=(1,3) Group[1]=(1,2)"),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd:", "Fail."),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]= Group[2]=(0,4)"),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "xy:z:::abcd", "Pass. Group[0]=(0,11) Group[1]=(0,7) Group[2]=(7,4)"),
- new RegexTrial (@"^[^bcd]*(c+)", RegexOptions.None, "aexycd", "Pass. Group[0]=(0,5) Group[1]=(4,1)"),
- new RegexTrial (@"(>a+)ab", RegexOptions.None, "aaab", "Fail."),
- new RegexTrial (@"(?>a+)b", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"([[:]+)", RegexOptions.None, "a:[b]:", "Pass. Group[0]=(1,2) Group[1]=(1,2)"),
- new RegexTrial (@"([[=]+)", RegexOptions.None, "a=[b]=", "Pass. Group[0]=(1,2) Group[1]=(1,2)"),
- new RegexTrial (@"([[.]+)", RegexOptions.None, "a.[b].", "Pass. Group[0]=(1,2) Group[1]=(1,2)"),
- new RegexTrial (@"[a[:]b[:c]", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"[a[:]b[:c]", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"((?>a+)b)", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4) Group[1]=(0,4)"),
- new RegexTrial (@"(?>(a+))b", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4) Group[1]=(0,3)"),
- new RegexTrial (@"((?>[^()]+)|\([^()]*\))+", RegexOptions.None, "((abc(ade)ufh()()x", "Pass. Group[0]=(2,16) Group[1]=(2,3)(5,5)(10,3)(13,2)(15,2)(17,1)"),
- new RegexTrial (@"(?<=x+)", RegexOptions.None, "xxxxy", "Pass. Group[0]=(1,0)"),
- new RegexTrial (@"a{37,17}", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"\Z", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(4,0)"),
- new RegexTrial (@"$", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\Z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(4,0)"),
- new RegexTrial (@"$", RegexOptions.None, "b\na\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\Z", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"$", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\Z", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(4,0)"),
- new RegexTrial (@"$", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(1,0)"),
- new RegexTrial (@"\Z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(4,0)"),
- new RegexTrial (@"$", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(1,0)"),
- new RegexTrial (@"\Z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"$", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(1,0)"),
- new RegexTrial (@"a\Z", RegexOptions.None, "a\nb\n", "Fail."),
- new RegexTrial (@"a\z", RegexOptions.None, "a\nb\n", "Fail."),
- new RegexTrial (@"a$", RegexOptions.None, "a\nb\n", "Fail."),
- new RegexTrial (@"a\Z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.None, "b\na\n", "Fail."),
- new RegexTrial (@"a$", RegexOptions.None, "b\na\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\Z", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a$", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.Multiline, "a\nb\n", "Fail."),
- new RegexTrial (@"a$", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"a\Z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.Multiline, "b\na\n", "Fail."),
- new RegexTrial (@"a$", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\Z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a$", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"aa\Z", RegexOptions.None, "aa\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "aa\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "aa\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\naa\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\naa\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\naa\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa$", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "aa\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "aa\nb\n", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\naa\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\naa\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\naa\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\Z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "ab\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "ab\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "ab\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nab\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nab\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nab\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "ab\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "ab\nb\n", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nab\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nab\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nab\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\Z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "abb\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "abb\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "abb\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nabb\n", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nabb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nabb\n", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "abb\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "abb\nb\n", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nabb\n", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nabb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nabb\n", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\Z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"(^|x)(c)", RegexOptions.None, "ca", "Pass. Group[0]=(0,1) Group[1]=(0,0) Group[2]=(0,1)"),
- new RegexTrial (@"a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz", RegexOptions.None, "x", "Fail."),
- new RegexTrial (@"round\(((?>[^()]+))\)", RegexOptions.None, "_I(round(xs * sz),1)", "Pass. Group[0]=(3,14) Group[1]=(9,7)"),
- new RegexTrial (@"foo.bart", RegexOptions.None, "foo.bart", "Pass. Group[0]=(0,8)"),
- new RegexTrial (@"^d[x][x][x]", RegexOptions.Multiline, "abcd\ndxxx", "Pass. Group[0]=(5,4)"),
- new RegexTrial (@".X(.+)+X", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)"),
- new RegexTrial (@".X(.+)+XX", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)"),
- new RegexTrial (@".XX(.+)+X", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)"),
- new RegexTrial (@".X(.+)+X", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".X(.+)+XX", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".XX(.+)+X", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".X(.+)+[X]", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)"),
- new RegexTrial (@".X(.+)+[X][X]", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)"),
- new RegexTrial (@".XX(.+)+[X]", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)"),
- new RegexTrial (@".X(.+)+[X]", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".X(.+)+[X][X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".XX(.+)+[X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".[X](.+)+[X]", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)"),
- new RegexTrial (@".[X](.+)+[X][X]", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)"),
- new RegexTrial (@".[X][X](.+)+[X]", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)"),
- new RegexTrial (@".[X](.+)+[X]", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".[X](.+)+[X][X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".[X][X](.+)+[X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@"tt+$", RegexOptions.None, "xxxtt", "Pass. Group[0]=(3,2)"),
- new RegexTrial (@"([\d-z]+)", RegexOptions.None, "a0-za", "Pass. Group[0]=(1,3) Group[1]=(1,3)"),
- new RegexTrial (@"([\d-\s]+)", RegexOptions.None, "a0- z", "Pass. Group[0]=(1,3) Group[1]=(1,3)"),
- new RegexTrial (@"\GX.*X", RegexOptions.None, "aaaXbX", "Fail."),
- new RegexTrial (@"(\d+\.\d+)", RegexOptions.None, "3.1415926", "Pass. Group[0]=(0,9) Group[1]=(0,9)"),
- new RegexTrial (@"(\ba.{0,10}br)", RegexOptions.None, "have a web browser", "Pass. Group[0]=(5,8) Group[1]=(5,8)"),
- new RegexTrial (@"\.c(pp|xx|c)?$", RegexOptions.IgnoreCase, "Changes", "Fail."),
- new RegexTrial (@"\.c(pp|xx|c)?$", RegexOptions.IgnoreCase, "IO.c", "Pass. Group[0]=(2,2) Group[1]="),
- new RegexTrial (@"(\.c(pp|xx|c)?$)", RegexOptions.IgnoreCase, "IO.c", "Pass. Group[0]=(2,2) Group[1]=(2,2) Group[2]="),
- new RegexTrial (@"^([a-z]:)", RegexOptions.None, "C:/", "Fail."),
- new RegexTrial (@"^\S\s+aa$", RegexOptions.Multiline, "\nx aa", "Pass. Group[0]=(1,4)"),
- new RegexTrial (@"(^|a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"^([ab]*?)(b)?(c)$", RegexOptions.None, "abac", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]= Group[3]=(3,1)"),
- new RegexTrial (@"(\w)?(abc)\1b", RegexOptions.None, "abcab", "Fail."),
- new RegexTrial (@"^(?:.,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"^(.,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5) Group[1]=(0,2)(2,2)"),
- new RegexTrial (@"^(?:[^,]*,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"^([^,]*,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5) Group[1]=(0,2)(2,2)"),
- new RegexTrial (@"^([^,]*,){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]*,){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]*,){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,3},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,3},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,3},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{0,3},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{0,3},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{0,3},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"(?i)", RegexOptions.None, "", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"(?!\A)x", RegexOptions.Multiline, "a\nxb\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"^(a(b)?)+$", RegexOptions.None, "aba", "Pass. Group[0]=(0,3) Group[1]=(0,2)(2,1) Group[2]=(1,1)"),
- new RegexTrial (@"^(aa(bb)?)+$", RegexOptions.None, "aabbaa", "Pass. Group[0]=(0,6) Group[1]=(0,4)(4,2) Group[2]=(2,2)"),
- new RegexTrial (@"^.{9}abc.*\n", RegexOptions.Multiline, "123\nabcabcabcabc\n", "Pass. Group[0]=(4,13)"),
- new RegexTrial (@"^(a)?a$", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]="),
- new RegexTrial (@"^(a)?(?(1)a|b)+$", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"^(a\1?)(a\1?)(a\2?)(a\3?)$", RegexOptions.None, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(1,2) Group[3]=(3,1) Group[4]=(4,2)"),
- new RegexTrial (@"^(a\1?){4}$", RegexOptions.None, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,2)(3,1)(4,2)"),
- new RegexTrial (@"^(0+)?(?:x(1))?", RegexOptions.None, "x1", "Pass. Group[0]=(0,2) Group[1]= Group[2]=(1,1)"),
- new RegexTrial (@"^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?", RegexOptions.None, "012cxx0190", "Pass. Group[0]=(0,10) Group[1]=(0,4) Group[2]= Group[3]=(6,4)"),
- new RegexTrial (@"^(b+?|a){1,2}c", RegexOptions.None, "bbbac", "Pass. Group[0]=(0,5) Group[1]=(0,3)(3,1)"),
- new RegexTrial (@"^(b+?|a){1,2}c", RegexOptions.None, "bbbbac", "Pass. Group[0]=(0,6) Group[1]=(0,4)(4,1)"),
- new RegexTrial (@"\((\w\. \w+)\)", RegexOptions.None, "cd. (A. Tw)", "Pass. Group[0]=(4,7) Group[1]=(5,5)"),
- new RegexTrial (@"((?:aaaa|bbbb)cccc)?", RegexOptions.None, "aaaacccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)"),
- new RegexTrial (@"((?:aaaa|bbbb)cccc)?", RegexOptions.None, "bbbbcccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)")
- };
- }
-}
diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/RegexTrial.cs b/mcs/class/System/Test/System.Text.RegularExpressions/RegexTrial.cs
deleted file mode 100644
index 73fc6876f09..00000000000
--- a/mcs/class/System/Test/System.Text.RegularExpressions/RegexTrial.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using System;
-using System.Text.RegularExpressions;
-
-namespace MonoTests.System.Text.RegularExpressions {
-
- class RegexTrial {
- public string pattern;
- public RegexOptions options;
- public string input;
-
- public string expected;
-
- public RegexTrial (string pattern, RegexOptions options, string input, string expected) {
- this.pattern = pattern;
- this.options = options;
- this.input = input;
- this.expected = expected;
- }
-
- public string Expected {
- get { return expected; }
- }
-
- public string Execute () {
- string result;
- try {
- Regex re = new Regex (pattern, options);
- Match m = re.Match (input);
-
- if (m.Success) {
- result = "Pass.";
-
- for (int i = 0; i < m.Groups.Count; ++ i) {
- Group group = m.Groups[i];
-
- result += " Group[" + i + "]=";
- foreach (Capture cap in group.Captures) {
- result += "(" + cap.Index + "," + cap.Length + ")";
- }
- }
- }
- else
- result = "Fail.";
- }
- catch (Exception) {
- result = "Error.";
- }
-
- return result;
- }
-
- public override string ToString () {
- return
- "Matching input '" + input +
- "' against pattern '" + pattern +
- "' with options '" + options + "'.";
- }
- }
-
- class Checksum {
- public Checksum () {
- this.sum = 0;
- }
-
- public uint Value {
- get { return sum; }
- }
-
- public void Add (string str) {
- for (int i = 0; i < str.Length; ++ i)
- Add (str[i], 16);
- }
-
- public void Add (uint n) {
- Add (n, 32);
- }
-
- public void Add (ulong n, int bits) {
- ulong mask = 1ul << (bits - 1);
- for (int i = 0; i < bits; ++ i) {
- Add ((n & mask) != 0);
- mask >>= 1;
- }
- }
-
- public void Add (bool bit) {
- bool top = (sum & 0x80000000) != 0;
- sum <<= 1;
- sum ^= bit ? (uint)1 : (uint)0;
-
- if (top)
- sum ^= key;
- }
-
- private uint sum;
- private readonly uint key = 0x04c11db7;
- }
-}
diff --git a/mcs/class/System/Test/System_test.build b/mcs/class/System/Test/System_test.build
deleted file mode 100644
index 35a4e11c85d..00000000000
--- a/mcs/class/System/Test/System_test.build
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System_test.dll -->
-<!-- Target build (default) builds tests -->
-<!-- Target test runs tests -->
-
-<project name="System_test" default="build">
- <property name="debug" value="false"/>
- <property name="nunit_home" value="..\..\..\nunit"/>
-
- <target name="build">
- <csc target="library" output="System_test.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
-
- <arg value="/noconfig"/>
- <arg value="/r:.\System.dll"/>
- </csc>
- </target>
-
- <target name="test" depends="build">
- <exec program="..\..\..\nunit\NUnitConsole" commandline="Ximian.Mono.Tests.AllTests,System_test.dll" failonerror="false"/>
- </target>
-
- <target name="clean">
- <delete file="System_test.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System/Test/TcpClientTest.cs b/mcs/class/System/Test/TcpClientTest.cs
deleted file mode 100755
index 12b9680f36c..00000000000
--- a/mcs/class/System/Test/TcpClientTest.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// System.Net.Sockets.TcpClientTest.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-using System;
-using System.Net;
-using System.Net.Sockets;
-using NUnit.Framework;
-
-namespace MonoTests.System.Net.Sockets {
-
- /// <summary>
- /// Tests System.Net.Sockets.TcpClient
- /// </summary>
- public class TcpClientTest : TestCase {
-
- public TcpClientTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof (TcpClientTest));
- }
- }
-
- /// <summary>
- /// Tests the TcpClient object
- /// (from System.Net.Sockets)
- /// </summary>
- public void test_TcpClient()
- {
- // set up a listening Socket
- Socket lSock = new Socket(AddressFamily.InterNetwork,
- SocketType.Stream, ProtocolType.Tcp);
-
- lSock.Bind(new IPEndPoint(IPAddress.Any, 1234));
- lSock.Listen(-1);
-
-
- // connect to it with a TcpClient
- TcpClient outClient = new TcpClient("localhost", 1234);
- Socket inSock = lSock.Accept();
-
-
- // now try exchanging data
- NetworkStream stream = outClient.GetStream();
-
- const int len = 1024;
- byte[] outBuf = new Byte[len];
- for (int i=0; i<len; i++)
- {
- outBuf[i] = (byte)(i % 256);
- }
-
- // send it
- stream.Write(outBuf,0,len);
-
- // and see if it comes back
- byte[] inBuf = new Byte[len];
- int ret = inSock.Receive(inBuf, 0, len, 0);
- Assert(ret != 0);
-
- for (int i=0; i<len; i++)
- {
- Assert(inBuf[i] == outBuf[i]);
- }
-
-
- // tidy up
- inSock.Close();
- outClient.Close();
- lSock.Close();
-
- }
-
- }
-
-}
diff --git a/mcs/class/System/Test/TcpListenerTest.cs b/mcs/class/System/Test/TcpListenerTest.cs
deleted file mode 100755
index a07d6bfcb9e..00000000000
--- a/mcs/class/System/Test/TcpListenerTest.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// System.Net.Sockets.TcpListenerTest.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-using System;
-using System.Net;
-using System.Net.Sockets;
-using NUnit.Framework;
-
-namespace MonoTests.System.Net.Sockets {
-
- /// <summary>
- /// Tests System.Net.Sockets.TcpListener
- /// </summary>
- public class TcpListenerTest : TestCase {
-
- public TcpListenerTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof (TcpListenerTest));
- }
- }
-
- /// <summary>
- /// Tests the TcpListener object
- /// (from System.Net.Sockets)
- /// </summary>
- public void test_TcpListener()
- {
- // listen with a new listener
- TcpListener inListener = new TcpListener(1234);
- inListener.Start();
-
-
- // connect to it from a new socket
- Socket outSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
- ProtocolType.IP);
- IPHostEntry hostent = Dns.GetHostByAddress("127.0.0.1");
- IPEndPoint remote = new IPEndPoint(hostent.AddressList[0], 1234);
- outSock.Connect(remote);
-
-
- // make sure the connection arrives
- Assert(inListener.Pending());
- Socket inSock = inListener.AcceptSocket();
-
-
- // now send some data and see if it comes out the other end
- const int len = 1024;
- byte[] outBuf = new Byte[len];
- for (int i=0; i<len; i++)
- {
- outBuf[i] = (byte)(i % 256);
- }
-
- outSock.Send(outBuf, 0, len, 0);
-
- byte[] inBuf = new Byte[len];
- int ret = inSock.Receive(inBuf, 0, len, 0);
-
-
- // let's see if it arrived OK
- Assert(ret != 0);
- for (int i=0; i<len; i++)
- {
- Assert(inBuf[i] == outBuf[i]);
- }
-
-
- // tidy up after ourselves
- inSock.Close();
-
- inListener.Stop();
- }
-
-
- }
-
-}
diff --git a/mcs/class/corlib/.cvsignore b/mcs/class/corlib/.cvsignore
deleted file mode 100644
index d091f16f294..00000000000
--- a/mcs/class/corlib/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-corlib.dll
-corlib.pdb
diff --git a/mcs/class/corlib/ChangeLog b/mcs/class/corlib/ChangeLog
deleted file mode 100644
index f2b57408c5e..00000000000
--- a/mcs/class/corlib/ChangeLog
+++ /dev/null
@@ -1,59 +0,0 @@
-2002-01-25 Mark Crichton <crichton@gimp.org>
-
- * System.Security.Cryptography/RijndaelManaged.cs: added
-
- * System.Security.Cryptography/Rijndael.cs: changed constructor
- to set default values. Hopefully I did it correctly.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * Unix/Errno.cs: Added
-
- * Unix/Wrapper.cs: Updated to new Wrapper
-
-2002-01-19 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: exclude Delegate from corlib_cmp.
-
-2002-01-09 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Exclude Security Attribute classes that need mcs
- magic to get them to compile.
-
-2002-01-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * corlib.build: Removed <excludes> for System.Resources
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Have the clean target remove any .pdb files that
- might be around if we compiled with debug on.
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Make new build of corlib_cmp.dll. This is the same
- as corlib.dll without Object and ValueType. It is used by
- /mcs/tools/corcompare.exe to compare with mscorlib.
-
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Put the linux target at the top. I keep changing the
- build for windows 'cause it's at the top. Then when I do make, nothing
- changes. It seems like it always takes me half a day to remember
- that the linux target comes second. Old age I guess.
-
- * .cvsignore: ignore corlib.pdb for times when it's built with debug on.
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Removed "exclude CodeAccessPermission.cs"
-
-2001-12-11 Duncan Mak <duncan@ximian.com>
-
- * ChangeLog: Added "System.Resources" to the exclude list.
-
-2001-12-05 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Add the change log to this directory
-
- * corlib.build: Add dependancy on linux target to test target. Need to have the dll before we can test it, right? Plus is encourages other to try 'make test'.
-
diff --git a/mcs/class/corlib/Linux/ChangeLog b/mcs/class/corlib/Linux/ChangeLog
deleted file mode 100644
index dbc60987da8..00000000000
--- a/mcs/class/corlib/Linux/ChangeLog
+++ /dev/null
@@ -1,23 +0,0 @@
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * Linux.cs: GetFileTime and SetFileTime need to be static
-
-Tue Jan 22 22:50:29 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Linux.cs: comment out call to Debug.Assert(): stuff from the System
- assembly cannot be used in corlib.
-
-2001-12-11 Dick Porter <dick@ximian.com>
-
- * Linux.cs: IO implemented with file handles with internal calls,
- rather than casting file descriptors for C library p/invokes.
- Implemented Get/Set Creation/LastAccess/LastWrite TimeFile
- functions.
-
-Wed Nov 14 16:30:27 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Linux.cs: a '/' is a valid char in a file path.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * Linux.cs (GetCurrentDirectory): implemented
diff --git a/mcs/class/corlib/Linux/Linux.cs b/mcs/class/corlib/Linux/Linux.cs
deleted file mode 100644
index 44d697c55c9..00000000000
--- a/mcs/class/corlib/Linux/Linux.cs
+++ /dev/null
@@ -1,575 +0,0 @@
-/*---------------------------------------------------------------------
-
- XX X XXX
- XX XX
- XXX XX XXX XXXXX XX
- XX XXX XX XX XX
- XX XX XX XX XXXXX XX
- XX XX XX XX XX XX X XX
- XXXX XX XX XXX XXXXXXX XXXX
- XX
- XXXXX
-
-Copyright (c) 2001 Intel Corporation. All Rights Reserved.
-
-CREATED: August 22, 2001
-OWNER: Scott D Smith, Joel Marcey
-VERSION: 1.0
----------------------------------------------------------------------*/
-
-using System;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.IO;
-using System.Collections;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace System.PAL
-{
- /// <summary>
- /// Class that implements IOperatingSystem, providing the requested functionality through calls into APIs available in Linux
- /// </summary>
- internal class OpSys
- {
- private Hashtable _environment = null;
-
- //----------------------------------
- // Class Constants
- //----------------------------------
- private const int EOF = -1; // TODO: Linux: Is this true?
-
-
- // For StdInputStream and StdOutputStream
- private IntPtr Stdin;
- private IntPtr Stdout;
- private IntPtr Stderr;
-
- //----------------------------------
- // Class Fields
- //----------------------------------
-
- //----------------------------------
- // Class Constructor
- //----------------------------------
- public OpSys()
- {
- Stdin=GetStdHandle(0);
- Stdout=GetStdHandle(1);
- Stderr=GetStdHandle(2);
- }
-
-
- //-------------------------------------------------
- // Environment Services
- //-------------------------------------------------
-
- public string NewLineSequence
- {
- get
- {
- return "\n";
- }
- }
-
- public char DirectorySeparator
- {
- get
- {
- return '/';
- }
- }
-
- public char AltDirectorySeparator
- {
- get
- {
- return '\\';
- }
- }
-
- public char VolumeSeparator
- {
- get
- {
- return '/';
- }
- }
-
- public char PathSeparator
- {
- get
- {
- return ':';
- }
- }
-
- public char[] InvalidPathChars
- {
- get
- {
- return new char[] { '\0' };
- }
- }
-
- public char[] DirVolSeparatorChars
- {
- get
- {
- return new char[] { this.DirectorySeparator, this.AltDirectorySeparator, this.VolumeSeparator};
- }
- }
- public char ExtensionCharacter
- {
- get
- {
- return '.';
- }
- }
-
- public string GetEnvironmentVariable(string eVar)
- {
- return EnvironmentVariables[eVar].ToString();
- }
-
- public IDictionary EnvironmentVariables
- {
- get
- {
- if (_environment == null) {
- IntPtr pp = _getEnviron(); // pointer to an array of char*
- _environment = new Hashtable();
-
- if (pp != IntPtr.Zero) {
- IntPtr p;
- bool done = false;
- char[] delimiter = { '=' };
-
- while (!done)
- {
- p = Marshal.ReadIntPtr(pp);
- if (p != IntPtr.Zero)
- {
- string str = Marshal.PtrToStringAuto(p);
- string[] ar = str.Split(delimiter, 2);
- switch(ar.Length)
- {
- case 1:
- _environment.Add(ar[0], "");
- break;
- case 2:
- _environment.Add(ar[0], ar[1]);
- break;
- default:
- //System.Diagnostics/.Debug.Assert(false); // this shouldn't happen
- break;
- }
- }
- else
- {
- done = true;
- }
- }
- }
- }
- return _environment;
- }
- }
-
- public string CommandLine
- {
- get
- {
- string path = Path.Combine(Path.Combine("/proc", _getPid().ToString()), "cmdline");
- StreamReader stream = File.OpenText(path);
- string res = stream.ReadToEnd();
- stream.Close();
- return res;
- }
- }
-
- public string MachineName
- {
- get
- {
- return GetEnvironmentVariable("HOSTNAME");
- }
- }
-
- public OperatingSystem OSVersion
- {
- get
- {
- return null;
- }
- }
-
- // System.Path services
-
- public string ChangeExtension(string path, string extension)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:ChangeExtension(System.String, System.String): Stub Method");
- return null;
- }
-
- public string GetExtension(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetExtension(System.String): Stub Method");
- return null;
- }
-
- public string GetFileName(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFileName(System.String): Stub Method");
- return null;
- }
-
- public string GetFileNameWithoutExtension(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFileNameWithoutExtension(System.String): Stub Method");
- return null;
- }
-
- public string GetFullPath(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFullPath(System.String): Stub Method");
- return null;
- }
-
- public string GetPathRoot(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetPathRoot(System.String): Stub Method");
- return null;
-
- }
-
- public string GetTempFileName()
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetTempFileName(): Stub Method");
- return null;
- }
-
- public string GetTempPath()
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetTempPath(): Stub Method");
- return null;
- }
-
- public bool HasExtension(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:HasExtension(System.String): Stub Method");
- return false;
- }
-
- public bool IsPathRooted(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:IsPathRooted(System.String): Stub Method");
- return false;
- }
-
-
-
- // System.Directory services
-
- public void DeleteDirectory(string path, bool recursive)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:DeleteDirectory(System.String, System.Boolean): Stub Method");
- }
-
- public bool ExistsDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:ExistsDirectory(System.String): Stub Method");
- return false;
- }
-
- public DateTime GetCreationTimeDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetCreationTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern string GetCurrentDirectory();
-
- public string[] GetDirectories(string path, string searchPattern)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetDirectories(System.String,System.String): Stub Method");
- return null;
- }
-
- public string[] GetFiles(string path, string searchPattern)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFiles(System.String, System.String): Stub Method");
- return null;
- }
-
- public string[] GetFileSystemEntries(string path, string searchPattern)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFileSystemEntries(System.String, System.String): Stub Method");
- return null;
- }
-
- public DateTime GetLastAccessTimeDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetLastAccessTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public DateTime GetLastWriteTimeDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetLastWriteTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public void MoveDirectory(string sourceDirName, string destDirName)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:MoveDirectory(System.String, System.String): Stub Method");
- }
-
- public void SetCreationTimeDirectory(string path, DateTime creationTime)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:SetCreationTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- public void SetCurrentDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:SetCurrentDirectory(System.String): Stub Method");
- }
-
- public void SetLastAccessTimeDirectory(string path, DateTime lastAccessTime)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:SetLastAccessTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- public void SetLastWriteTimeDirectory(string path, DateTime lastWriteTime)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:SetLastWriteTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- //-----------------------------------
- // I/O Services
- //-----------------------------------
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- private extern IntPtr GetStdHandle(int fd);
-
- public IntPtr StdinHandle {
- get {
- return(Stdin);
- }
- }
-
- public IntPtr StdoutHandle {
- get {
- return(Stdout);
- }
- }
-
- public IntPtr StderrHandle {
- get {
- return(Stderr);
- }
- }
-
-
- // For StdInputStream
- public int ReadStdInput(byte[] buffer, int offset, int count)
- {
- return ReadFile(StdinHandle, buffer, offset, count);
- }
-
- // For StdOutputStream
- public void FlushStdOutput(byte[] byteBuf)
- {
- FlushFile(StdoutHandle, byteBuf);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern int ReadFile(IntPtr handle, byte[] buffer, int offset, int count);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern int WriteFile(IntPtr handle, byte[] buffer, int offset, int count);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern int SetLengthFile(IntPtr handle, long length);
-
- public void FlushFile(IntPtr handle, byte[] byteBuf)
- {
- WriteFile(handle, byteBuf, 0, byteBuf.Length);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern IntPtr OpenFile(String path, FileMode mode, FileAccess access, FileShare share);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern void CloseFile(IntPtr handle);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern long SeekFile(IntPtr handle, long offset, SeekOrigin origin);
-
- public IntPtr CreateFile(string path, FileMode mode, FileAccess access, FileShare share)
- {
- return OpenFile(path, FileMode.CreateNew, access, share);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern void DeleteFile(string path);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern bool ExistsFile(string path);
-
- /* The long time parameters in GetFileTime and
- * SetFileTime correspond to Windows file times (ticks
- * from DateTime(1/1/1601 00:00 GMT))
- */
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- private extern static bool GetFileTime(IntPtr handle, out long creat, out long lastaccess, out long lastwrite);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- private extern static bool SetFileTime(IntPtr handle, long creat, long lastaccess, long lastwrite);
-
- public DateTime GetCreationTimeFile(string path)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.Read);
-
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
- s.Close();
-
- return DateTime.FromFileTime(creat);
- }
-
- public DateTime GetLastAccessTimeFile(string path)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.Read);
-
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
- s.Close();
-
- return DateTime.FromFileTime(lastaccess);
- }
-
- public DateTime GetLastWriteTimeFile(string path)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.Read);
-
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
- s.Close();
-
- return DateTime.FromFileTime(lastwrite);
- }
-
- public void SetCreationTimeFile(string path, DateTime creationTime)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
-
- // Get the existing times first
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
-
- creat=creationTime.ToFileTime();
-
- ret=SetFileTime(s.Handle, creat, lastaccess, lastwrite);
- s.Close();
- }
-
- public void SetLastAccessTimeFile(string path, DateTime lastAccessTime)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
-
- // Get the existing times first
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
-
- lastaccess=lastAccessTime.ToFileTime();
-
- ret=SetFileTime(s.Handle, creat, lastaccess, lastwrite);
- s.Close();
- }
-
- public void SetLastWriteTimeFile(string path, DateTime lastWriteTime)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
-
- // Get the existing times first
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
-
- lastwrite=lastWriteTime.ToFileTime();
-
- ret=SetFileTime(s.Handle, creat, lastaccess, lastwrite);
- s.Close();
- }
-
-
- public long FileLength(string path)
- {
- return 0;
- }
-
- public long FileLength(IntPtr handle)
- {
- return 0;
- }
-
- // Private implementation details
- [DllImport("monowrapper", EntryPoint="mono_wrapper_environ", CharSet=CharSet.Ansi)]
- private unsafe static extern IntPtr _getEnviron();
-
- [DllImport("libc", EntryPoint="getpid")]
- private unsafe static extern int _getPid();
-
- [ DllImport("libm", EntryPoint="acos") ]
- public extern static double Acos(double d);
-
- [ DllImport("libm", EntryPoint="asin") ]
- public extern static double Asin(double d);
-
- [ DllImport("libm", EntryPoint="atan") ]
- public extern static double Atan(double d);
-
- [ DllImport("libm", EntryPoint="atan2") ]
- public extern static double Atan2(double y, double x);
-
- [ DllImport("libm", EntryPoint="cos") ]
- public extern static double Cos(double d);
-
- [ DllImport("libm", EntryPoint="cosh") ]
- public extern static double Cosh(double d);
-
- [ DllImport("libm", EntryPoint="exp") ]
- public extern static double Exp(double d);
-
- [ DllImport("libm", EntryPoint="log") ]
- public extern static double Log(double d);
-
- [ DllImport("libm", EntryPoint="log10") ]
- public extern static double Log10(double d);
-
- [ DllImport("libm", EntryPoint="pow") ]
- public extern static double Pow(double x, double y);
-
- [ DllImport("libm", EntryPoint="sin") ]
- public extern static double Sin(double d);
-
- [ DllImport("libm", EntryPoint="sinh") ]
- public extern static double Sinh(double d);
-
- [ DllImport("libm", EntryPoint="sqrt") ]
- public extern static double Sqrt(double d);
-
- [ DllImport("libm", EntryPoint="tan") ]
- public extern static double Tan(double d);
-
- [ DllImport("libm", EntryPoint="tanh") ]
- public extern static double Tanh(double d);
- }
-}
diff --git a/mcs/class/corlib/System.Collections/ArrayList.cs b/mcs/class/corlib/System.Collections/ArrayList.cs
deleted file mode 100644
index 43a31f43cf6..00000000000
--- a/mcs/class/corlib/System.Collections/ArrayList.cs
+++ /dev/null
@@ -1,572 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.ArrayList
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public class ArrayList : IList, ICollection, IEnumerable, ICloneable {
- // constructors
-
- public ArrayList () {
- dataArray = new object[capacity];
- }
-
- public ArrayList (ICollection c) {
- if (null == c) {
- throw new ArgumentNullException();
- }
- dataArray = new object[c.Count];
- this.capacity = c.Count;
- foreach(object o in c) {
- Add(o);
- }
- }
-
- public ArrayList (int capacity) {
- if (capacity < 0) {
- throw new ArgumentOutOfRangeException("capacity", capacity, "Value must be greater than or equal to zero.");
- }
- dataArray = new object[capacity];
- this.capacity = capacity;
- }
-
- private ArrayList (object[] dataArray, int count, int capacity,
- bool fixedSize, bool readOnly, bool synchronized)
- {
- this.dataArray = (object[])dataArray.Clone();
- this.count = count;
- this.capacity = capacity;
- this.fixedSize = fixedSize;
- this.readOnly = readOnly;
- this.synchronized = synchronized;
- }
-
- [MonoTODO]
- public static ArrayList ReadOnly (ArrayList list) {
- throw new NotImplementedException ("System.Collections.ArrayList.ReadOnly");
- }
-
- [MonoTODO]
- public static ArrayList ReadOnly (IList list) {
- throw new NotImplementedException ("System.Collections.ArrayList.ReadOnly");
- }
-
- [MonoTODO]
- public static ArrayList Synchronized (ArrayList list) {
- throw new NotImplementedException ("System.Collections.ArrayList.Synchronized");
- }
-
- [MonoTODO]
- public static ArrayList Synchronized (IList list) {
- throw new NotImplementedException ("System.Collections.ArrayList.Synchronized");
- }
-
- [MonoTODO]
- public static ArrayList FixedSize (ArrayList list) {
- throw new NotImplementedException ("System.Collections.ArrayList.FixedSize");
- }
-
- [MonoTODO]
- public static ArrayList FixedSize (IList list) {
- throw new NotImplementedException ("System.Collections.ArrayList.FixedSize");
- }
-
- public static ArrayList Repeat (object value, int count) {
- ArrayList al = new ArrayList (count);
- for (int i = 0; i < count; i++) {
- al.dataArray[i] = value;
- }
- al.count = count;
-
- return al;
- }
-
- [MonoTODO]
- public static ArrayList Adapter (IList list) {
- throw new NotImplementedException ("System.Collections.ArrayList.Adapter");
- }
-
- // properties
-
- private bool fixedSize = false;
- private bool readOnly = false;
- private bool synchronized = false;
-
- private long version = 0;
- private ArrayList source = null;
-
- private int count = 0;
- private int capacity = 16;
-
- private object[] dataArray;
-
- private void copyDataArray (object[] outArray) {
- for (int i = 0; i < count; i++) {
- outArray[i] = dataArray[i];
- }
- }
-
- private void setSize (int newSize) {
- if (newSize == capacity) {
- return;
- }
-
- // note that this assumes that we've already sanity-checked
- // the new size
- object[] newDataArray = new object[newSize];
- copyDataArray (newDataArray);
- dataArray = newDataArray;
-
- capacity = newSize;
- }
-
- // note that this DOES NOT update count
- private void shiftElements (int startIndex, int numshift) {
- if (numshift == 0) {
- return;
- }
-
- if (count + numshift > capacity) {
- setSize (capacity * 2);
- shiftElements (startIndex, numshift);
- } else {
- if (numshift > 0) {
- int numelts = count - startIndex;
- for (int i = numelts-1; i >= 0; i--) {
- dataArray[startIndex + numshift + i] = dataArray[startIndex + i];
- }
-
- for (int i = startIndex; i < startIndex + numshift; i++) {
- dataArray[i] = null;
- }
- } else {
- int numelts = count - startIndex + numshift;
- for (int i = startIndex; i <= numelts; i++) {
- dataArray[i] = dataArray[i - numshift];
- }
- for (int i = count + numshift; i < count; i++) {
- dataArray[i] = null;
- }
- }
- }
- }
-
- public virtual int Capacity {
- get {
- return capacity;
- }
-
- set {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (value < count) {
- throw new ArgumentOutOfRangeException
- ("ArrayList Capacity being set to less than Count");
- }
-
- if (fixedSize && value != capacity) {
- throw new NotSupportedException
- ("Collection is fixed size.");
- }
-
- setSize (value);
- }
- }
-
- private void CheckSourceVersion() {
- if (null != this.source && this.version != this.source.version) {
- throw new InvalidOperationException();
- }
- }
-
- public virtual int Count {
- get {
- CheckSourceVersion();
- return count;
- }
- }
-
- public virtual bool IsFixedSize {
- get {
- return fixedSize;
- }
- }
-
- public virtual bool IsReadOnly {
- get {
- return readOnly;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return synchronized;
- }
- }
-
- public virtual object this[int index] {
- get {
- CheckSourceVersion();
-
- if (index < 0) {
- throw new ArgumentOutOfRangeException ("index < 0");
- }
-
- if (index >= count) {
- throw new ArgumentOutOfRangeException ("index out of range");
- }
-
- return dataArray[index];
- }
- set {
- if (index < 0) {
- throw new ArgumentOutOfRangeException ("index < 0");
- }
-
- if (index >= count) {
- throw new ArgumentOutOfRangeException ("index out of range");
- }
-
- if (readOnly) {
- throw new NotSupportedException ("Collection is read-only.");
- }
-
- dataArray[index] = value;
- version++;
- }
- }
-
- [MonoTODO]
- public virtual object SyncRoot {
- get {
- throw new NotImplementedException ("System.Collections.ArrayList.SyncRoot.get");
- }
- }
-
-
- // methods
-
- public virtual int Add (object value) {
- if (readOnly) {
- throw new NotSupportedException ("Collection is read-only.");
- }
-
- if (count + 1 >= capacity) {
- setSize (capacity * 2);
- }
-
- dataArray[count++] = value;
- version++;
- return count-1;
- }
-
- public virtual void AddRange (ICollection c) {
- int cc = c.Count;
- if (count + cc >= capacity)
- Capacity = cc < count? count * 2: count + cc + 1;
- c.CopyTo (dataArray, count);
- count += cc;
- version++;
- }
-
- [MonoTODO]
- public virtual int BinarySearch (object value) {
- throw new NotImplementedException ("System.Collections.ArrayList.BinarySearch");
- }
-
- [MonoTODO]
- public virtual int BinarySearch (object value, IComparer comparer) {
- throw new NotImplementedException ("System.Collections.ArrayList.BinarySearch");
- }
-
- [MonoTODO]
- public virtual int BinarySearch (int index, int count,
- object value, IComparer comparer) {
- throw new NotImplementedException ("System.Collections.ArrayList.BinarySearch");
- }
-
- public virtual void Clear () {
- count = 0;
- setSize(capacity);
- version++;
- }
-
- public virtual object Clone () {
- return new ArrayList (dataArray, count, capacity,
- fixedSize, readOnly, synchronized);
- }
-
- public virtual bool Contains (object item) {
- for (int i = 0; i < count; i++) {
- if (Object.Equals (dataArray[i], item)) {
- return true;
- }
- }
-
- return false;
- }
-
- public virtual void CopyTo (Array array) {
- CopyTo (array, 0);
- }
-
- public virtual void CopyTo (Array array, int arrayIndex) {
- System.Array.Copy (dataArray, 0, array, arrayIndex, count);
- }
-
- [MonoTODO]
- public virtual void CopyTo (int index, Array array,
- int arrayIndex, int count) {
- // FIXME: check count...
- System.Array.Copy (dataArray, index, array, arrayIndex, count);
- }
-
- private class ArrayListEnumerator : IEnumerator {
- private object[] data;
- private int idx;
- private int start;
- private int num;
-
- public ArrayListEnumerator(int index, int count, object[] items) {
- data = items;
- start = index;
- num = count;
- idx = start - 1;
- }
-
- public object Current {
- get {
- return data [idx];
- }
- }
- public bool MoveNext() {
- if (++idx < start + num)
- return true;
- return false;
- }
- public void Reset() {
- idx = start - 1;
- }
- }
-
- public virtual IEnumerator GetEnumerator () {
- return new ArrayListEnumerator(0, this.Count, dataArray);
- }
-
- private void ValidateRange(int index, int count) {
- if (index < 0) {
- throw new ArgumentOutOfRangeException("index", index, "Must be equal to or greater than zero");
- }
- if (count < 0) {
- throw new ArgumentOutOfRangeException("count", count, "Must be equal to or greater than zero");
- }
- if (index > this.count - 1) {
- throw new ArgumentException();
- }
- if (index + count > this.count - 1) {
- throw new ArgumentException();
- }
- }
-
- public virtual IEnumerator GetEnumerator (int index, int count) {
- ValidateRange(index, count);
- return new ArrayListEnumerator(index, count, dataArray);
- }
-
- public virtual ArrayList GetRange (int index, int count) {
- ValidateRange(index, count);
- ArrayList retVal = new ArrayList(count);
-
- for (int i = index; i < count + index; i++) {
- retVal.Add(this[i]);
- }
- retVal.version = this.version;
- retVal.source = this;
- return retVal;
- }
-
- public virtual int IndexOf (object value) {
- return IndexOf (value, 0, count);
- }
-
- public virtual int IndexOf (object value, int startIndex) {
- return IndexOf (value, startIndex, count - startIndex);
- }
-
- public virtual int IndexOf (object value, int startIndex, int count) {
- if (startIndex < 0 || startIndex + count > this.count || count < 0) {
- throw new ArgumentOutOfRangeException ("IndexOf arguments out of range");
- }
- for (int i = startIndex; i < (startIndex + count); i++) {
- if (Object.Equals (dataArray[i], value)) {
- return i;
- }
- }
-
- return -1;
- }
-
- public virtual void Insert (int index, object value) {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (fixedSize) {
- throw new NotSupportedException
- ("Collection is fixed size.");
- }
-
- if (index < 0 || index >= capacity) {
- throw new ArgumentOutOfRangeException ("index < 0 or index >= capacity");
- }
-
- shiftElements (index, 1);
- dataArray[index] = value;
- count++;
- version++;
- }
-
- [MonoTODO]
- public virtual void InsertRange (int index, ICollection c) {
- version++;
- }
-
- public virtual int LastIndexOf (object value) {
- return LastIndexOf (value, count - 1, count);
- }
-
- public virtual int LastIndexOf (object value, int startIndex) {
- if (startIndex < 0 || startIndex > count - 1) {
- throw new ArgumentOutOfRangeException("startIndex", startIndex, "");
- }
- return LastIndexOf (value, startIndex, startIndex + 1);
- }
-
- public virtual int LastIndexOf (object value, int StartIndex,
- int count)
- {
- int EndIndex = StartIndex - count + 1;
- for (int i = StartIndex; i >= EndIndex; i--) {
- if (Object.Equals (dataArray[i], value)) {
- return i;
- }
- }
-
- return -1;
- }
-
- public virtual void Remove (object obj) {
- int objIndex = IndexOf (obj);
-
- if (objIndex == -1) {
- // shouldn't an exception be thrown here??
- // the MS docs don't indicate one, and testing
- // with the MS .net framework doesn't indicate one
- return;
- }
-
- RemoveRange (objIndex, 1);
- }
-
- public virtual void RemoveAt (int index) {
- RemoveRange (index, 1);
- }
-
- public virtual void RemoveRange (int index, int count) {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (fixedSize) {
- throw new NotSupportedException
- ("Collection is fixed size.");
- }
-
- if (index < 0 || index >= this.count || index + count > this.count) {
- throw new ArgumentOutOfRangeException
- ("index/count out of range");
- }
-
- shiftElements (index, - count);
- this.count -= count;
- version++;
- }
-
- public virtual void Reverse () {
- Reverse (0, count);
- }
-
- public virtual void Reverse (int index, int count) {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (index < 0 || index + count > this.count) {
- throw new ArgumentOutOfRangeException
- ("index/count out of range");
- }
-
- Array.Reverse (dataArray, index, count);
- version++;
- }
-
- [MonoTODO]
- public virtual void SetRange (int index, ICollection c) {
- }
-
- public virtual void Sort () {
- Sort (0, count, null);
- }
-
- public virtual void Sort (IComparer comparer) {
- Sort (0, count, comparer);
- }
-
- public virtual void Sort (int index, int count, IComparer comparer) {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (index < 0 || index + count > this.count) {
- throw new ArgumentOutOfRangeException
- ("index/count out of range");
- }
-
- Array.Sort (dataArray, index, count, comparer);
- version++;
- }
-
- public virtual object[] ToArray() {
- object[] outArray = new object[count];
- Array.Copy (dataArray, outArray, count);
- return outArray;
- }
-
- public virtual Array ToArray (Type type) {
- Array outArray = Array.CreateInstance (type, count);
- Array.Copy (dataArray, outArray, count);
- return outArray;
- }
-
- [MonoTODO]
- public virtual void TrimToSize () {
- // FIXME: implement this
- version++;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/BitArray.cs b/mcs/class/corlib/System.Collections/BitArray.cs
deleted file mode 100644
index 049b9b6ac56..00000000000
--- a/mcs/class/corlib/System.Collections/BitArray.cs
+++ /dev/null
@@ -1,502 +0,0 @@
-using System;
-
-namespace System.Collections
-{
- // do we really need to specify IEnumerable since ICollection extends it?
- public class BitArray : ICollection, IEnumerable, ICloneable
- {
- private Int32[] m_array;
- private int m_length;
- private int m_modCount = 0;
-
- private static void clearJunk(Int32[] arr, int numbits)
- {
- int numjunkbits = 32 - (numbits%32);
- UInt32 mask = (~0U >> numjunkbits);
- arr[arr.Length - 1] &= (int)mask;
- }
-
- private static int bitsToInts(int bits)
- {
- int retval = bits/32;
- if (bits % 32 != 0)
- retval++;
-
- return retval;
- }
-
- private static int bitsToBytes(int bits)
- {
- int retval = bits/8;
- if (bits % 8 != 0)
- retval++;
-
- return retval;
- }
-
-
- private void setBit(int bitIndex, bool value)
- {
- int index = bitIndex/32;
- int shift = bitIndex%32;
-
- Int32 theBit = 1 << shift;
-
- if(value)
- m_array[index] |= theBit;
- else
- m_array[index] &= ~theBit;
-
- m_modCount++;
- }
-
- private bool getBit(int bitIndex)
- {
- int index = bitIndex/32;
- int shift = bitIndex%32;
-
- Int32 theBit = m_array[index] & (1 << shift);
-
- return (theBit == 0) ? false : true;
- }
-
- private byte getByte(int byteIndex)
- {
- int index = byteIndex/4;
- int shift = (byteIndex%4)*8;
-
- Int32 theByte = m_array[index] & (0xff << shift);
-
- return (byte)((theByte >> shift)&0xff);
- }
-
- private void setByte(int byteIndex, byte value)
- {
- int index = byteIndex/4;
- int shift = (byteIndex%4)*8;
-
- Int32 orig = m_array[index];
-
- // clear the byte
- orig &= ~(0xff << shift);
- // or in the new byte
- orig |= value << shift;
-
- m_array[index] = orig;
-
- m_modCount++;
- }
-
- /* --- Constructors --- */
- public BitArray(BitArray orig)
- {
- m_length = orig.m_length;
-
- int numInts = bitsToInts(m_length);
- m_array = new Int32[numInts];
- Array.Copy(orig.m_array, m_array, numInts);
- }
-
- public BitArray(bool[] bits)
- {
- m_length = bits.Length;
-
- int numInts = bitsToInts(m_length);
- m_array = new Int32[numInts];
- for (int i=0; i < bits.Length; i++)
- setBit(i, bits[i]);
- }
-
- public BitArray(byte[] bytes)
- {
- m_length = bytes.Length * 8;
-
- m_array = new Int32[bitsToInts(m_length)];
- for (int i=0; i < bytes.Length; i++)
- setByte(i, bytes[i]);
- }
-
- public BitArray(int capacity)
- {
- m_length = capacity;
- m_array = new Int32[bitsToInts(m_length)];
- }
-
- public BitArray(int[] words)
- {
- int arrlen = words.Length;
- m_length = arrlen*32;
- m_array = new Int32[arrlen];
- Array.Copy(words, m_array, arrlen);
- }
-
- public BitArray(int capacity, bool value) : this(capacity)
- {
- if (value)
- {
- // FIXME: Maybe you can create an array pre filled?
- for (int i = 0; i < m_array.Length; i++)
- m_array[i] = ~0;
- }
- }
-
- private BitArray(Int32 [] array, int length)
- {
- m_array = array;
- m_length = length;
- }
-
-
- /* --- Public properties --- */
- public virtual int Count
- {
- get
- {
- return m_length;
- }
- }
-
- public virtual bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public virtual bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public virtual bool this[int index]
- {
- get
- {
- return Get(index);
- }
- set
- {
- Set(index, value);
- }
-
- }
-
- public virtual int Length
- {
- get
- {
- return m_length;
- }
- set
- {
- if (value < 0)
- throw new ArgumentOutOfRangeException();
-
- int newLen = value;
- if (m_length != newLen)
- {
- int numints = bitsToInts(newLen);
- Int32 [] newArr = new Int32[numints];
- int copylen = (numints > m_array.Length ? m_array.Length : numints);
- Array.Copy(m_array, newArr, copylen);
-
- // clear out the junk bits at the end:
- clearJunk(newArr, newLen);
-
- // set the internal state
- m_array = newArr;
- m_length = newLen;
- m_modCount++;
- }
- }
- }
-
- public virtual object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- /* --- Public methods --- */
- public BitArray And(BitArray operand)
- {
- if (operand == null)
- throw new ArgumentNullException();
- if (operand.m_length != m_length)
- throw new ArgumentException();
-
- Int32 [] newarr = new Int32[m_array.Length];
- for (int i=0; i < m_array.Length; i++)
- newarr[i] = m_array[i] & operand.m_array[i];
-
- return new BitArray(newarr, m_length);
- }
-
- public object Clone()
- {
- // FIXME: according to the doc, this should be a shallow copy.
- // But the MS implementation seems to do a deep copy.
- return new BitArray((Int32 [])m_array.Clone(), m_length);
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- if (array == null)
- throw new ArgumentNullException();
- if (index < 0)
- throw new ArgumentOutOfRangeException();
-
- // FIXME: Throw ArgumentException if array is multidimensional
- if (index >= array.Length)
- throw new ArgumentException();
-
- // in each case, check to make sure enough space in array
-
- if (array is bool[])
- {
- if (index + m_length >= array.Length)
- throw new ArgumentException();
-
- bool [] barray = (bool []) array;
-
- // Copy the bits into the array
- for (int i = 0; i < m_length; i++)
- barray[index + i] = getBit(i);
- }
- else if (array is byte[])
- {
- int numbytes = bitsToBytes(m_length);
- if (index + numbytes >= array.Length)
- throw new ArgumentException();
-
- byte [] barray = (byte []) array;
- // Copy the bytes into the array
- for (int i = 0; i < numbytes; i++)
- barray[index + i] = getByte(i);
- }
- else if (array is int[])
- {
- int numints = bitsToInts(m_length);
- if (index + numints >= array.Length)
- throw new ArgumentException();
- Array.Copy(m_array, 0, array, index, numints);
- }
- else
- {
- throw new InvalidCastException();
- }
- }
-
-
- /*
- * All this code for nothing... Apparently, The MS BitArray doesn't
- * override Equals!
- *public override bool Equals(object obj)
- {
- // If it's not a BitArray, then it can't be equal to us.
- if (!(obj is BitArray))
- return false;
-
- // If the references are equal, then clearly the instances are equal
- if (this == obj)
- return true;
-
- // If its length is different, than it can't be equal.
- BitArray b = (BitArray) obj;
- if (m_length != b.m_length)
- return false;
-
-
- // Now compare the bits.
- // This is a little tricky, because if length doesn't divide 32,
- // then we shouldn't compare the unused bits in the last element
- // of m_array.
-
- // Compare all full ints. If any differ, then we are not equal.
- int numints = m_length/32;
- for (int i = 0; i < numints; i++)
- {
- if (b.m_array[i] != m_array[i])
- return false;
- }
-
- // Compare the left over bits (if any)
- int extrabits = m_length%32;
- if (extrabits != 0)
- {
- // our mask is the "extrabits" least significant bits set to 1.
- UInt32 comparemask = ~0U >> (32 - extrabits);
-
- // numints is rounded down, so it's safe to use as an index here,
- // as long as extrabits > 0.
- if ((b.m_array[numints] & comparemask)
- != (m_array[numints] & comparemask))
- return false;
- }
-
- // We passed through all the above, so we are equal.
- return true;
-
- }
- * End comment out of Equals()
- */
-
- public bool Get(int index)
- {
- if (index < 0 || index >= m_length)
- throw new ArgumentOutOfRangeException();
- return getBit(index);
- }
-
- public IEnumerator GetEnumerator()
- {
- return new BitArrayEnumerator(this);
- }
-
- /*
- * Since MS doesn't appear to override Equals/GetHashCode, we don't.
- *public override int GetHashCode()
- {
- // We could make this a constant time function
- // by just picking a constant number of bits, spread out
- // evenly across the entire array. For now, this will suffice.
-
- int retval = m_length;
-
- // Add in each array element, except for the leftover bits.
- int numints = m_length/32;
- for (int i = 0; i < numints; i++)
- retval += (int)m_array[i];
-
- // That's enough. Adding in the leftover bits is tiring.
-
- return retval;
- }
- * End comment out of GetHashCode()
- */
-
- public BitArray Not()
- {
- Int32 [] newarr = new Int32[m_array.Length];
- for (int i=0; i < m_array.Length; i++)
- newarr[i] = ~m_array[i];
-
- return new BitArray(newarr, m_length);
- }
-
- public BitArray Or(BitArray operand)
- {
- if (operand == null)
- throw new ArgumentNullException();
- if (operand.m_length != m_length)
- throw new ArgumentException();
-
- Int32 [] newarr = new Int32[m_array.Length];
- for (int i=0; i < m_array.Length; i++)
- newarr[i] = m_array[i] | operand.m_array[i];
-
- return new BitArray(newarr, m_length);
- }
-
- public void Set(int index, bool value)
- {
- if (index < 0 || index >= m_length)
- throw new ArgumentOutOfRangeException();
- setBit(index, value);
- }
-
- public void SetAll(bool value)
- {
- if (value)
- {
- for (int i = 0; i < m_array.Length; i++)
- m_array[i] = ~0;
-
- // clear out the junk bits that we might have set
- clearJunk(m_array, m_length);
- }
- else
- Array.Clear(m_array, 0, m_array.Length);
-
-
- m_modCount++;
- }
-
- public BitArray Xor(BitArray operand)
- {
- if (operand == null)
- throw new ArgumentNullException();
- if (operand.m_length != m_length)
- throw new ArgumentException();
-
- Int32 [] newarr = new Int32[m_array.Length];
- for (int i=0; i < m_array.Length; i++)
- newarr[i] = m_array[i] ^ operand.m_array[i];
-
- return new BitArray(newarr, m_length);
- }
-
- ~BitArray()
- {
- }
-
- class BitArrayEnumerator : IEnumerator
- {
- BitArray m_bitArray;
- private bool m_current;
- private int m_index;
- private int m_max;
- private int m_modCount;
-
- public BitArrayEnumerator(BitArray ba)
- {
- m_index = -1;
- m_bitArray = ba;
- m_max = ba.m_length;
- m_modCount = ba.m_modCount;
- }
-
- public object Current
- {
- get
- {
- if (m_index < 0 || m_index >= m_max)
- throw new InvalidOperationException();
- return m_current;
- }
- }
-
- public bool MoveNext()
- {
- if (m_modCount != m_bitArray.m_modCount)
- throw new InvalidOperationException();
-
- if (m_index + 1 >= m_max)
- return false;
-
- m_index++;
- m_current = m_bitArray[m_index];
- return true;
- }
-
- public void Reset()
- {
- if (m_modCount != m_bitArray.m_modCount)
- throw new InvalidOperationException();
- m_index = -1;
- }
- }
- }
-}
-
-
-
-
-
diff --git a/mcs/class/corlib/System.Collections/CaseInsensitiveComparer.cs b/mcs/class/corlib/System.Collections/CaseInsensitiveComparer.cs
deleted file mode 100644
index 4a572780a02..00000000000
--- a/mcs/class/corlib/System.Collections/CaseInsensitiveComparer.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// System.Collections.CaseInsensitiveComparer
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-
-using System;
-using System.Collections;
-
-
-
-namespace System.Collections {
-
- public class CaseInsensitiveComparer : IComparer {
-
- private static CaseInsensitiveComparer singleton;
-
-
- // Class constructor
-
- static CaseInsensitiveComparer ()
- {
- singleton=new CaseInsensitiveComparer ();
- }
-
-
- // Public instance constructor
-
- public CaseInsensitiveComparer ()
- {
- }
-
-
-
- //
- // Public static properties
- //
-
- public static CaseInsensitiveComparer Default {
- get {
- return singleton;
- }
- }
-
-
- //
- // Instance methods
- //
-
- public override string ToString ()
- {
- return "mono::System.Collections.CaseInsensitiveComparer";
- }
-
-
- //
- // IComparer
- //
-
- public int Compare (object a, object b)
- {
- string str1 = a as string;
- string str2 = b as string;
-
-
- int res = 0;
-
- if (str1 != null && str2 != null) {
- res = String.Compare (str1, str2, true);
- }
-
- return res;
- }
-
-
-
- } // CaseInsensitiveComparer
-}
-
diff --git a/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs b/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs
deleted file mode 100644
index 38dd1c97da3..00000000000
--- a/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// System.Collections.CaseInsensitiveHashCodeProvider
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-
-using System;
-using System.Collections;
-
-
-
-namespace System.Collections {
-
- public class CaseInsensitiveHashCodeProvider : IHashCodeProvider {
-
- private static CaseInsensitiveHashCodeProvider singleton;
-
-
- // Class constructor
-
- static CaseInsensitiveHashCodeProvider ()
- {
- singleton=new CaseInsensitiveHashCodeProvider ();
- }
-
-
-
- // Public instance constructor
-
- public CaseInsensitiveHashCodeProvider ()
- {
- }
-
-
-
- //
- // Public static properties
- //
-
- public static CaseInsensitiveHashCodeProvider Default {
- get {
- return singleton;
- }
- }
-
-
- //
- // Instance methods
- //
-
- public override string ToString ()
- {
- return "mono::System.Collections.CaseInsensitiveHashCodeProvider";
- }
-
-
- //
- // IHashCodeProvider
- //
-
- [MonoTODO]
- public virtual int GetHashCode (object obj)
- {
- if (obj == null) {
- throw new ArgumentNullException ("obj is null");
- }
-
- string str = obj as string;
-
- if (str == null) {
- // FIXME:
- return 0;
- }
-
- int h = 0;
- char c;
-
- if (str.Length > 0) {
- for (int i = 0;i<str.Length;i++) {
- c = str [i];
-
- if (Char.IsLetter (c))
- c = Char.ToLower (c);
-
- h = h * 31 + c;
- }
- }
-
- return h;
- }
-
- } // CaseInsensitiveHashCodeProvider
-}
-
diff --git a/mcs/class/corlib/System.Collections/ChangeLog b/mcs/class/corlib/System.Collections/ChangeLog
deleted file mode 100644
index 676dbd6136b..00000000000
--- a/mcs/class/corlib/System.Collections/ChangeLog
+++ /dev/null
@@ -1,168 +0,0 @@
-2002-02-20 Nick Drochak <ndrochak@gol.com>
-
- * ArrayList.cs: Add MonoTODO's where necessary. Fix bugs discovered
- by Bucky's tests. Implement a couple of things that were left undone.
-
-Mon Feb 11 19:49:25 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: Dick's fix to contructor.
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * Hashtable.cs: Implemented parts of the ISerializable
- interface. GetObjectData () is good, but serialization constructor
- needs some more love.
-
-Sat Jan 5 15:56:54 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Hashtable.cs: the IDictionaryEnumerator returns DictionaryEntries.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * Correct name to MonoTODO everywhere.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * ArrayList.cs : Setting an index does not implicitly
- extend the arraylist : remove FIXME.
-
- Decorate incomplete elements with the TODO attribute.
-
- * BitArray.cs : Insert TODO attributes where appropriate.
-
- * CaseInsensitiveHashcodeProvider.cs: Ditto.
-
- * Hashtable.cs, SortedList.cs : Ditto.
-
-Thu Dec 13 20:17:08 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: implemented AddRange(), CopyTo().
-
-2001-11-19 Miguel de Icaza <miguel@ximian.com>
-
- * DictionaryBase.cs: Implemented.
-
-Wed Nov 14 16:45:49 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: implement ArrayListEnumerator.
- * Hashtable.cs: hardcode the prime number table.
-
-2001-11-06 Nick Drochak <ndrochak@gol.com>
- * Queue.cs: Fixes from Ricardardo. QueueTest also updated.
-
-2001-11-04 Nick Drochak <ndrochak@gol.com>
- * Queue.cs: Fixed small syntax errors that were preventing the compile.
- I changed the build file to include Queue.cs as well.
-
-2001-11-04 Nick Drochak <ndrochak@gol.com>
- * ArrayList.cs: Fixed "off by one" error when shifting left the array when
- items are removed.
-
- * CollectionBase.cs: Added OnValidate(), OnRemove() and OnRemoveComplete()
- hook methods to the RemoveAt() method.
-
-2001-11-04 Nick Drochak <ndrochak@gol.com>
- * ArrayList.cs: Added private enumerator class and make GetEnumerator()
- methods return an instance of it.
-
-Tue Sep 25 18:52:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: fix Insert () to check capacity, not count.
-
-Tue Sep 25 16:54:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * DictionaryEntry.cs: added.
-
-2001-08-10 Dietmar Maurer <dietmar@ximian.com>
-
- * common.src: removed duplicate entries
-
-2001-08-08 Nick Drochak <ndrochak@gol.com>
-
- * ReadOnlyCollectionBase.cs: Initialized private member.
- * CollectionBase.cs: Initialized private member.
- * common.src : Added ReadOnlyCollectionBase.cs and CollectionBase.cs
- * /mcs/class/makefile: Used $(SYSTEMROOT) instead of hard coded //c/winnt
- * /mcs/makefile: Used $(SYSTEMROOT) instead of hard coded //c/winnt
-
-2001-08-08 Nick Drochak <nick@jobdragon.com>
-
- * CollectionBase.cs: Add
- * ReadOnlyCollectionBase.cs: Add
- * CollectionBaseTest.cs: Add
- * ReadOnlyCollectionBaseTest.cs: Add
-
-2001-07-31 Garrett Rooney <rooneg@electricjellyfish.net>
-
- * StackTest.cs: Add Test case for System.Collections.Stack.
- Contributed by Chris Hynes <chrish@assistedsolutions.com>
-
-2001-07-30 Garrett Rooney <rooneg@electricjellyfish.net>
-
- * Stack.cs: Clone() doesn't need to check if it's synchronized, since
- we override it in SyncStack anyway...
-
- * Stack.cs: Pop() now shrinks the array if we drop below 1/4 full, to
- avoid using massive amounts of memory that are not necessary. We only
- drop to half the current size, which I hope will avoid the 'ping-pong'
- effect.
-
- * Stack.cs: SyncStack.IsReadOnly should return stack.IsReadOnly
- instead of just returning false, since we may have a ReadOnly wrapper
- in the future (although i can't imagine why). Thanks to David
- Menestrina <dmenest@yahoo.com> for pointing this out.
-
-2001-07-23 Sergey Chaban <serge@wildwestsoftware.com>
-
- * Hashtable.cs: Fixed bug in Clear(), the Count wasn't zeroed.
- From now, Clear() increases modification count.
- Fixed HCP bug in GetHash(object) - hcp.GetHashCode() was used
- instead of hcp.GetHashCode(key). This was resulted in the
- insanely long lookup times when HashCodeProvider was used to
- construct Hashtable. Added thread-safe wrapper.
-
-2001-07-16 David Menestrina <dmenest@yahoo.com>
-
- * BitArray.cs: Add
- * BitArrayTest.cs: Add
-
-2001-07-18 Miguel de Icaza <miguel@ximian.com>
-
- * IDictionary.cs (Collections): IDictionary implements ICollection
- as well. Thanks Sergey!
-
-2001-07-18 Garrett Rooney <rooneg@electricjellyfish.net>
-
- * Stack.cs Removed unnecessary locking from many methods of
- SyncStack, removed SyncEnumerator because it was unnecessary,
- added a modCount member to Stack and Stack.Enumerator, to
- ensure that the Stack has not been modified out form under the
- Enumerator, and changed the Enumerator to use a reference to the
- stack rather than copying over the contents array.
-
-2001-07-17 David Menestrina <dmenest@yahoo.com>
-
- * Added implementation of BitArray.
-
-2001-07-17 Miguel de Icaza <miguel@ximian.com>
-
- * Hashtable.cs: Removed call to d.Count in the Hashtable
- constructor that takes an IDictionary as IDictionary does not
- provide a Count field.
-
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * IDictionary.cs: Clear was clear.
-
-2001-07-13 Miguel de Icaza <miguel@ximian.com>
-
- * All files: Renamespace things to System.
-
-2001-07-05 Vladimir Vukicevic <vladimir@ximian.com>
-
- * ArrayList.cs: initial checkin and implementation
-
- * ICollection.cs, IComprarer.cs, IDictionary.cs,
- IDictionaryEnumerator.cs, IEnumerable.cs, IHashCodeProvider.cs,
- IList.cs: initial checkin
-
diff --git a/mcs/class/corlib/System.Collections/CollectionBase.cs b/mcs/class/corlib/System.Collections/CollectionBase.cs
deleted file mode 100644
index 1994a329e0a..00000000000
--- a/mcs/class/corlib/System.Collections/CollectionBase.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// System.Collections.CollectionBase.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-
-namespace System.Collections {
-
- public abstract class CollectionBase : IList, ICollection, IEnumerable {
-
- // private instance properties
- private System.Collections.ArrayList myList;
-
- // public instance properties
- public virtual int Count { get { return InnerList.Count; } }
-
- // Public Instance Methods
- public virtual System.Collections.IEnumerator GetEnumerator() { return InnerList.GetEnumerator(); }
- public virtual void Clear() {
- OnClear();
- InnerList.Clear();
- OnClearComplete();
- }
- public virtual void RemoveAt (int index) {
- object objectToRemove;
- objectToRemove = InnerList[index];
- OnValidate(objectToRemove);
- OnRemove(index, objectToRemove);
- InnerList.RemoveAt(index);
- OnRemoveComplete(index, objectToRemove);
- }
-
- // Protected Instance Constructors
- protected CollectionBase() {
- this.myList = new System.Collections.ArrayList();
- }
-
- // Protected Instance Properties
- protected System.Collections.ArrayList InnerList {get { return this.myList; } }
- protected System.Collections.IList List {get { return this; } }
-
- // Protected Instance Methods
- protected virtual void OnClear() { }
- protected virtual void OnClearComplete() { }
-
- protected virtual void OnInsert(int index, object value) { }
- protected virtual void OnInsertComplete(int index, object value) { }
-
- protected virtual void OnRemove(int index, object value) { }
- protected virtual void OnRemoveComplete(int index, object value) { }
-
- protected virtual void OnSet(int index, object oldValue, object newValue) { }
- protected virtual void OnSetComplete(int index, object oldValue, object newValue) { }
-
- protected virtual void OnValidate(object value) {
- if (null == value) {
- throw new System.ArgumentNullException("CollectionBase.OnValidate: Invalid parameter value passed to method: null");
- }
- }
-
- // ICollection methods
- void ICollection.CopyTo(Array array, int index) {
- lock (InnerList) { InnerList.CopyTo(array, index); }
- }
- object ICollection.SyncRoot {
- get { return InnerList.SyncRoot; }
- }
- bool ICollection.IsSynchronized {
- get { return InnerList.IsSynchronized; }
- }
-
- // IList methods
- int IList.Add (object value) {
- int newPosition;
- OnValidate(value);
- newPosition = InnerList.Count;
- OnInsert(newPosition, value);
- InnerList.Add(value);
- OnInsertComplete(newPosition, value);
- return newPosition;
- }
-
- bool IList.Contains (object value) {
- return InnerList.Contains(value);
- }
-
- int IList.IndexOf (object value) {
- return InnerList.IndexOf(value);
- }
-
- void IList.Insert (int index, object value) {
- OnValidate(value);
- OnInsert(index, value);
- InnerList.Insert(index, value);
- OnInsertComplete(index, value);
- }
-
- void IList.Remove (object value) {
- int removeIndex;
- OnValidate(value);
- removeIndex = InnerList.IndexOf(value);
- OnRemove(removeIndex, value);
- InnerList.Remove(value);
- OnRemoveComplete(removeIndex, value);
- }
-
- // IList properties
- bool IList.IsFixedSize {
- get { return InnerList.IsFixedSize; }
- }
-
- bool IList.IsReadOnly {
- get { return InnerList.IsReadOnly; }
- }
-
- object IList.this[int index] {
- get { return InnerList[index]; }
- set {
- object oldValue;
- // make sure we have been given a valid value
- OnValidate(value);
- // save a reference to the object that is in the list now
- oldValue = InnerList[index];
-
- OnSet(index, oldValue, value);
- InnerList[index] = value;
- OnSetComplete(index, oldValue, value);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/Comparer.cs b/mcs/class/corlib/System.Collections/Comparer.cs
deleted file mode 100644
index ce4ce4202c6..00000000000
--- a/mcs/class/corlib/System.Collections/Comparer.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Collections.Comparer
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-using System;
-using System.Collections;
-
-
-namespace System.Collections {
-
- public sealed class Comparer : IComparer {
-
- public static readonly Comparer Default;
-
-
- // Class constructor
-
- static Comparer ()
- {
- Default = new Comparer ();
- }
-
-
-
- // Public instance constructor
-
- private Comparer ()
- {
- }
-
-
-
- // IComparer
-
- public int Compare (object a, object b)
- {
- int res=0;
-
- if (a is IComparable) {
- res = (a as IComparable).CompareTo (b);
- } else if (b is IComparable) {
- res = (b as IComparable).CompareTo (a);
- } else {
- throw new ArgumentException ("Neither a nor b IComparable");
- }
-
- return res;
- }
-
- public override string ToString ()
- {
- return "mono::System.Collections.Comparer";
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Collections/DictionaryBase.cs b/mcs/class/corlib/System.Collections/DictionaryBase.cs
deleted file mode 100755
index 5b40a990d66..00000000000
--- a/mcs/class/corlib/System.Collections/DictionaryBase.cs
+++ /dev/null
@@ -1,370 +0,0 @@
-//
-// System.Collections.DictionaryBase.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Collections {
-
- /// <summary>
- /// An abstract class that provides a simple way to monitor changes to a
- /// Hashtable. Derived classes overwrite one or more of the `On' methods
- /// to track the changes to the Hashtable.
- /// </summary>
- ///
- /// <remarks>
- /// This class is a base class that can simplify the development of
- /// strongly typed collections. The idea being that the insertion of elements
- /// into the Hashtable can be forced to be of a given type.
- ///
- /// The `On' members are protected and designed to be used only by derived
- /// classes.
- /// </remarks>
- public abstract class DictionaryBase : IDictionary, ICollection, IEnumerable {
-
- Hashtable dictionary;
-
- protected DictionaryBase ()
- {
- dictionary = new Hashtable ();
- }
-
- /// <summary>
- /// Clears the contents of the dictionary
- /// </summary>
- public void Clear ()
- {
- OnClear ();
- dictionary.Clear ();
- OnClearComplete ();
- }
-
- /// <summary>
- /// Returns the number of items in the dictionary
- /// </summary>
- public int Count {
- get {
- return dictionary.Count;
- }
- }
-
- /// <summary>
- /// The collection contained as an IDictionary
- /// </summary>
- protected IDictionary Dictionary {
- get {
- return dictionary;
- }
- }
-
- /// <summary>
- /// The internal Hashtable representation for this dictionary
- /// </summary>
- protected Hashtable InnerHashtable {
- get {
- return dictionary;
- }
- }
-
- /// <summary>
- /// Copies the contents of the Dictionary into the target array
- /// </summary>
- /// <param name="array">
- /// The array to copy the contents of the dictionary to. The
- /// array must have a zero-based indexing
- /// </param>
- /// <param name="index">
- /// Starting index within the array where to copy the objects
- /// to.
- /// </param>
- public void CopyTo (Array array, int index)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (index < 0)
- throw new ArgumentOutOfRangeException ("index must be possitive");
- if (array.Rank > 1)
- throw new ArgumentException ("array is multidimensional");
- int size = array.Length;
- if (index > size)
- throw new ArgumentException ("index is larger than array size");
- if (index + Count > size)
- throw new ArgumentException ("Copy will overlflow array");
-
- DoCopy (array, index);
- }
-
- /// <summary>
- /// Internal routine called by CopyTo to perform the actual
- /// copying of the data
- /// </summary>
- virtual protected void DoCopy (Array array, int index)
- {
- foreach (DictionaryEntry de in dictionary)
- array.SetValue (de, index++);
- }
-
- /// <summary>
- /// Returns an enumerator for the dictionary
- /// </summary>
- public IDictionaryEnumerator GetEnumerator ()
- {
- return dictionary.GetEnumerator ();
- }
-
- /// <summary>
- /// Hook invoked before the clear operation
- /// is performed on the DictionaryBase
- /// </summary>
- protected virtual void OnClear ()
- {
- }
-
- /// <summary>
- /// Hook invoked after the clear operation
- /// is performed on the DictionaryBase
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes
- /// </remarks>
- protected virtual void OnClearComplete ()
- {
- }
-
- /// <summary>
- /// Hook invoked while fetching data from the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// This method is provided as a simple way to override the values
- /// returned by the DictionaryBase.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to retrieve</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual object OnGet (object key, object current_value)
- {
- return current_value;
- }
-
- /// <summary>
- /// Hook invoked before inserting data into the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// Derived classes can override this method and perform some
- /// action before the <paramref name="current_value"/> is inserted
- /// into the dictionary.
- ///
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes
- /// </remarks>
- ///
- /// <param name="key">Key of the object to insert</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnInsert (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked after inserting the data into the DictionaryBase
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes
- /// </remarks>
- ///
- /// <param name="key">Key of the object to insert</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnInsertComplete (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked before changing a value for a key in the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// Derived classes can override this method and perform some
- /// action before the <paramref name="current_value"/> is changed
- /// in the dictionary.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to change</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnSet (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked after changing a value for a key in the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes
- /// </remarks>
- ///
- /// <param name="key">Key of the object to change</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnSetComplete (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked before removing a key/value from the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// Derived classes can override this method and perform some
- /// action before the <paramref name="current_value"/> is removed
- /// from the dictionary.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to remove</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnRemove (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked after removing a key/value from the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to remove</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnRemoveComplete (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked after the value has been validated
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to monitor the DictionaryBase.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to retrieve</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnValidate (object key, object current_value)
- {
- }
-
- bool IDictionary.IsFixedSize {
- get {
- return false;
- }
- }
-
- bool IDictionary.IsReadOnly {
- get {
- return false;
- }
- }
-
- object IDictionary.this [object key] {
- get {
- object value = dictionary [key];
-
- OnGet (key, value);
- return value;
- }
-
- set {
- if (dictionary.ContainsKey (key)){
- OnSet (key, value);
- dictionary [key] = value;
- OnSetComplete (key, value);
- } else {
- OnInsert (key, value);
- dictionary [key] = value;
- OnInsertComplete (key, value);
- }
- }
- }
-
- ICollection IDictionary.Keys {
- get {
- return dictionary.Keys;
- }
- }
-
- ICollection IDictionary.Values {
- get {
- return dictionary.Values;
- }
- }
-
- /// <summary>
- /// Adds a key/value pair to the dictionary.
- /// </summary>
- void IDictionary.Add (object key, object value)
- {
- OnInsert (key, value);
- dictionary.Add (key, value);
- OnInsertComplete (key, value);
- }
-
- /// <summary>
- /// Removes a Dictionary Entry based on its key
- /// </summary>
- void IDictionary.Remove (object key)
- {
- if (! dictionary.ContainsKey (key))
- return;
-
- object value = dictionary [key];
- OnRemove (key, value);
- dictionary.Remove (key);
- OnRemoveComplete (key, value);
- }
-
- /// <summary>
- /// Tests whether the dictionary contains an entry
- /// </summary>
- bool IDictionary.Contains (object key)
- {
- return dictionary.Contains (key);
- }
-
- bool ICollection.IsSynchronized {
- get {
- return dictionary.IsSynchronized;
- }
- }
-
- object ICollection.SyncRoot {
- get {
- return dictionary.SyncRoot;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return dictionary.GetEnumerator ();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/DictionaryEntry.cs b/mcs/class/corlib/System.Collections/DictionaryEntry.cs
deleted file mode 100644
index d2261df0640..00000000000
--- a/mcs/class/corlib/System.Collections/DictionaryEntry.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-
-namespace System.Collections {
-
- public struct DictionaryEntry {
- private object key;
- private object val;
-
- public DictionaryEntry( object k, object value) {
- key = k;
- val = value;
- }
-
- public object Key {
- get {return key;}
- set {key = value;}
- }
- public object Value {
- get {return val;}
- set {val = value;}
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/Hashtable.cs b/mcs/class/corlib/System.Collections/Hashtable.cs
deleted file mode 100644
index c7e4a2f6f88..00000000000
--- a/mcs/class/corlib/System.Collections/Hashtable.cs
+++ /dev/null
@@ -1,1048 +0,0 @@
-//
-// System.Collections.Hashtable
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-
-// TODO: 1. Interfaces to implement: ISerializable and IDeserializationCallback;
-// 2. Meaningfull error messages for all exceptions.
-// Probably we should use ResourceSet to translate
-// error codes to messages.
-
-
-namespace System.Collections {
-
- [MonoTODO]
- public class Hashtable : IDictionary, ICollection,
- IEnumerable, ICloneable, ISerializable
- {
-
- internal struct Slot {
- internal Object key;
-
- internal Object value;
-
- // Hashcode. Chains are also marked through this.
- internal int hashMix;
- }
-
- //
- // Private data
- //
-
- private readonly static int CHAIN_MARKER = ~Int32.MaxValue;
- private readonly static int ALLOC_GRAIN = 0x2F;
-
- // Used as indicator for the removed parts of a chain.
- private readonly static Object REMOVED_MARKER = new Object ();
-
-
- private int inUse;
- private int modificationCount;
- private float loadFactor;
- private Slot [] table;
- private int threshold;
-
- private IHashCodeProvider hcpRef;
- private IComparer comparerRef;
-
- public static int [] primeTbl = {
- 11,
- 19,
- 37,
- 73,
- 109,
- 163,
- 251,
- 367,
- 557,
- 823,
- 1237,
- 1861,
- 2777,
- 4177,
- 6247,
- 9371,
- 14057,
- 21089,
- 31627,
- 47431,
- 71143,
- 106721,
- 160073,
- 240101,
- 360163,
- 540217,
- 810343,
- 1215497,
- 1823231,
- 2734867,
- 4102283,
- 6153409,
- 9230113,
- 13845163
- };
-
- // Class constructor
-
- static Hashtable () {
- // NOTE: Precalculate primes table.
- // This precalculated table of primes is intended
- // to speed-up allocations/resize for relatively
- // small tables.
- // I'm not sure whether it's a good idea or not.
- // Also I am in doubt as for the quality of this
- // particular implementation, probably the increment
- // shouldn't be linear? Consider this as a hack
- // or as a placeholder for future improvements.
- /*int size = 0x2000/ALLOC_GRAIN;
- primeTbl = new int [size];
- for (int x = 53, i = 0;i<size;x+= ALLOC_GRAIN, i++) {
- primeTbl [i] = CalcPrime (x);
- }*/
- }
-
-
- //
- // Constructors
- //
-
- public Hashtable () : this (0, 1.0f) {}
-
-
- public Hashtable (int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer) {
- if (capacity<0)
- throw new ArgumentOutOfRangeException ("negative capacity");
-
- if (loadFactor<0.1 || loadFactor>1)
- throw new ArgumentOutOfRangeException ("load factor");
-
- if (capacity == 0) ++capacity;
- this.loadFactor = 0.75f*loadFactor;
- int size = (int) (capacity/this.loadFactor);
- size = ToPrime (size);
- this.SetTable (new Slot [size]);
-
- this.hcp = hcp;
- this.comparer = comparer;
-
- this.inUse = 0;
- this.modificationCount = 0;
-
- }
-
- public Hashtable (int capacity, float loadFactor) :
- this (capacity, loadFactor, null, null)
- {
- }
-
- public Hashtable (int capacity) : this (capacity, 1.0f)
- {
- }
-
- public Hashtable (int capacity,
- IHashCodeProvider hcp,
- IComparer comparer)
- : this (capacity, 1.0f, hcp, comparer)
- {
- }
-
-
- public Hashtable (IDictionary d, float loadFactor,
- IHashCodeProvider hcp, IComparer comparer)
- : this (d!=null ? d.Count : 0,
- loadFactor, hcp, comparer)
- {
-
- if (d == null)
- throw new ArgumentNullException ("dictionary");
-
- IDictionaryEnumerator it = d.GetEnumerator ();
- while (it.MoveNext ()) {
- Add (it.Key, it.Value);
- }
-
- }
-
- public Hashtable (IDictionary d, float loadFactor)
- : this (d, loadFactor, null, null)
- {
- }
-
-
- public Hashtable (IDictionary d) : this (d, 1.0f)
- {
- }
-
- public Hashtable (IDictionary d, IHashCodeProvider hcp, IComparer comparer)
- : this (d, 1.0f, hcp, comparer)
- {
- }
-
- public Hashtable (IHashCodeProvider hcp, IComparer comparer)
- : this (1, 1.0f, hcp, comparer)
- {
- }
-
- [MonoTODO]
- protected Hashtable (SerializationInfo info, StreamingContext context)
- {
-// loadFactor = info.GetValue ("LoadFactor", Type.GetType ("System.Float"));
-// comparerRef = info.GetValue ("Comparer", typeof (object));
-// hcpRef = info.GetValue ("HashCodeProvider", typeof (object));
-// this.Count = info.GetValue ("HashSize");
-// this.Keys = info.GetValue ("Keys");
-// this.Values = info.GetValue ("Values");
- }
-
- //
- // Properties
- //
-
- protected IComparer comparer {
- set {
- comparerRef = value;
- }
- get {
- return comparerRef;
- }
- }
-
- protected IHashCodeProvider hcp {
- set {
- hcpRef = value;
- }
- get {
- return hcpRef;
- }
- }
-
- // ICollection
-
- public virtual int Count {
- get {
- return inUse;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return false;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return this;
- }
- }
-
-
-
- // IDictionary
-
- public virtual bool IsFixedSize {
- get {
- return false;
- }
- }
-
-
- public virtual bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public virtual ICollection Keys {
- get {
- return new HashKeys (this);
- }
- }
-
- public virtual ICollection Values {
- get {
- return new HashValues (this);
- }
- }
-
-
-
- public virtual Object this [Object key] {
- get {
- return GetImpl (key);
- }
- set {
- PutImpl (key, value, true);
- }
- }
-
-
-
-
- //
- // Interface methods
- //
-
-
- // IEnumerable
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new Enumerator (this, EnumeratorMode.KEY_MODE);
- }
-
-
- // ICollection
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- IDictionaryEnumerator it = GetEnumerator ();
- int i = arrayIndex;
-
- while (it.MoveNext ()) {
- array.SetValue (it.Entry, i++);
- }
- }
-
-
- // IDictionary
-
- public virtual void Add (Object key, Object value)
- {
- PutImpl (key, value, false);
- }
-
- public virtual void Clear ()
- {
- for (int i = 0;i<table.Length;i++) {
- table [i].key = null;
- table [i].value = null;
- table [i].hashMix = 0;
- }
-
- inUse = 0;
- modificationCount++;
- }
-
- public virtual bool Contains (Object key)
- {
- return (Find (key) >= 0);
- }
-
- public virtual IDictionaryEnumerator GetEnumerator ()
- {
- return new Enumerator (this, EnumeratorMode.ENTRY_MODE);
- }
-
- public virtual void Remove (Object key)
- {
- int i = Find (key);
- Slot [] table = this.table;
- if (i >= 0) {
- int h = table [i].hashMix;
- h &= CHAIN_MARKER;
- table [i].hashMix = h;
- table [i].key = (h != 0)
- ? REMOVED_MARKER
- : null;
- table [i].value = null;
- --inUse;
- ++modificationCount;
- }
- }
-
-
-
-
- public virtual bool ContainsKey (object key)
- {
- return Contains (key);
- }
-
- public virtual bool ContainsValue (object value)
- {
- int size = this.table.Length;
- Slot [] table = this.table;
-
- for (int i = 0; i < size; i++) {
- Slot entry = table [i];
- if (entry.key != null && entry.key!= REMOVED_MARKER
- && value.Equals (entry.value)) {
- return true;
- }
- }
- return false;
- }
-
-
- // ICloneable
-
- public virtual object Clone ()
- {
- Hashtable ht = new Hashtable (Count, hcp, comparer);
- ht.modificationCount = this.modificationCount;
- ht.inUse = this.inUse;
- ht.AdjustThreshold ();
-
- // FIXME: maybe it's faster to simply
- // copy the back-end array?
-
- IDictionaryEnumerator it = GetEnumerator ();
- while (it.MoveNext ()) {
- ht [it.Key] = it.Value;
- }
-
- return ht;
- }
-
- [MonoTODO]
- public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("LoadFactor", loadFactor);
- info.AddValue ("Version", 0); // TODO?
- info.AddValue ("Comparer", comparerRef);
- info.AddValue ("HashCodeProvider", hcpRef);
- info.AddValue ("HashSize", this.Count );
- info.AddValue ("Keys", this.Keys);
- info.AddValue ("Values", this.Values);
- }
-
- //[MonoTODO]
- //public virtual void OnDeserialization (object sender);
-
- [MonoTODO]
- public override string ToString ()
- {
- // FIXME: What's it supposed to do?
- // Maybe print out some internals here? Anyway.
- return "mono::System.Collections.Hashtable";
- }
-
-
- /// <summary>
- /// Returns a synchronized (thread-safe)
- /// wrapper for the Hashtable.
- /// </summary>
- public static Hashtable Synchronized (Hashtable table)
- {
- return new SynchedHashtable (table);
- }
-
-
-
- //
- // Protected instance methods
- //
-
- /// <summary>Returns the hash code for the specified key.</summary>
- protected virtual int GetHash (Object key)
- {
- IHashCodeProvider hcp = this.hcp;
- return (hcp!= null)
- ? hcp.GetHashCode (key)
- : key.GetHashCode ();
- }
-
- /// <summary>
- /// Compares a specific Object with a specific key
- /// in the Hashtable.
- /// </summary>
- protected virtual bool KeyEquals (Object item, Object key)
- {
- IComparer c = this.comparer;
- if (c!= null)
- return (c.Compare (item, key) == 0);
- else
- return item.Equals (key);
- }
-
-
-
- //
- // Private instance methods
- //
-
- private void AdjustThreshold ()
- {
- int size = table.Length;
-
- threshold = (int) (size*loadFactor);
- if (this.threshold >= size)
- threshold = size-1;
- }
-
- private void SetTable (Slot [] table)
- {
- if (table == null)
- throw new ArgumentNullException ("table");
-
- this.table = table;
- AdjustThreshold ();
- }
-
- private Object GetImpl (Object key)
- {
- int i = Find (key);
-
- if (i >= 0)
- return table [i].value;
- else
- return null;
- }
-
-
- private int Find (Object key)
- {
- if (key == null)
- throw new ArgumentNullException ("null key");
-
- uint size = (uint) this.table.Length;
- int h = this.GetHash (key) & Int32.MaxValue;
- uint spot = (uint)h;
- uint step = (uint) ((h >> 5)+1) % (size-1)+1;
- Slot[] table = this.table;
-
- for (int i = 0; i < size;i++) {
- int indx = (int) (spot % size);
- Slot entry = table [indx];
- Object k = entry.key;
- if (k == null)
- return -1;
- if ((entry.hashMix & Int32.MaxValue) == h
- && this.KeyEquals (key, k)) {
- return indx;
- }
-
- if ((entry.hashMix & CHAIN_MARKER) == 0)
- return -1;
-
- spot+= step;
- }
- return -1;
- }
-
-
- private void Rehash ()
- {
- int oldSize = this.table.Length;
-
- // From the SDK docs:
- // Hashtable is automatically increased
- // to the smallest prime number that is larger
- // than twice the current number of Hashtable buckets
- uint newSize = (uint)ToPrime ((oldSize<<1)|1);
-
-
- Slot [] newTable = new Slot [newSize];
- Slot [] table = this.table;
-
- for (int i = 0;i<oldSize;i++) {
- Slot s = table [i];
- if (s.key!= null) {
- int h = s.hashMix & Int32.MaxValue;
- uint spot = (uint)h;
- uint step = ((uint) (h>>5)+1)% (newSize-1)+1;
- for (uint j = spot%newSize;;spot+= step, j = spot%newSize) {
- // No check for REMOVED_MARKER here,
- // because the table is just allocated.
- if (newTable [j].key == null) {
- newTable [j].key = s.key;
- newTable [j].value = s.value;
- newTable [j].hashMix |= h;
- break;
- } else {
- newTable [j].hashMix |= CHAIN_MARKER;
- }
- }
- }
- }
-
- ++this.modificationCount;
-
- this.SetTable (newTable);
- }
-
-
- private void PutImpl (Object key, Object value, bool overwrite)
- {
- if (key == null)
- throw new ArgumentNullException ("null key");
-
- uint size = (uint)this.table.Length;
- if (this.inUse >= this.threshold) {
- this.Rehash ();
- size = (uint)this.table.Length;
- }
-
- int h = this.GetHash (key) & Int32.MaxValue;
- uint spot = (uint)h;
- uint step = (uint) ((spot>>5)+1)% (size-1)+1;
- Slot [] table = this.table;
- Slot entry;
-
- int freeIndx = -1;
- for (int i = 0; i < size; i++) {
- int indx = (int) (spot % size);
- entry = table [indx];
-
- if (freeIndx == -1
- && entry.key == REMOVED_MARKER
- && (entry.hashMix & CHAIN_MARKER)!= 0)
- freeIndx = indx;
-
- if (entry.key == null ||
- (entry.key == REMOVED_MARKER
- && (entry.hashMix & CHAIN_MARKER)!= 0)) {
-
- if (freeIndx == -1)
- freeIndx = indx;
- break;
- }
-
- if ((entry.hashMix & Int32.MaxValue) == h && KeyEquals (key, entry.key)) {
- if (overwrite) {
- table [indx].value = value;
- ++this.modificationCount;
- } else {
- // Handle Add ():
- // An entry with the same key already exists in the Hashtable.
- throw new ArgumentException ("Key duplication");
- }
- return;
- }
-
- if (freeIndx == -1) {
- table [indx].hashMix |= CHAIN_MARKER;
- }
-
- spot+= step;
-
- }
-
- if (freeIndx!= -1) {
- table [freeIndx].key = key;
- table [freeIndx].value = value;
- table [freeIndx].hashMix |= h;
-
- ++this.inUse;
- ++this.modificationCount;
- }
-
- }
-
- private void CopyToArray (Array arr, int i,
- EnumeratorMode mode)
- {
- IEnumerator it = new Enumerator (this, mode);
-
- while (it.MoveNext ()) {
- arr.SetValue (it.Current, i++);
- }
- }
-
-
-
- //
- // Private static methods
- //
- private static bool TestPrime (int x)
- {
- if ((x & 1) != 0) {
- for (int n = 3; n< (int)Math.Sqrt (x); n += 2) {
- if ((x % n) == 0)
- return false;
- }
- return true;
- }
- // There is only one even prime - 2.
- return (x == 2);
- }
-
- private static int CalcPrime (int x)
- {
- for (int i = (x & (~1))-1; i< Int32.MaxValue; i += 2) {
- if (TestPrime (i)) return i;
- }
- return x;
- }
-
- private static int ToPrime (int x)
- {
- for (int i = x/ALLOC_GRAIN; i < primeTbl.Length; i++) {
- if (x <= primeTbl [i])
- return primeTbl [i];
- }
- return CalcPrime (x);
- }
-
-
-
-
- //
- // Inner classes
- //
-
- public enum EnumeratorMode : int {KEY_MODE = 0, VALUE_MODE, ENTRY_MODE};
-
- protected sealed class Enumerator : IDictionaryEnumerator, IEnumerator {
-
- private Hashtable host;
- private int stamp;
- private int pos;
- private int size;
- private EnumeratorMode mode;
-
- private Object currentKey;
- private Object currentValue;
-
- private readonly static string xstr = "Hashtable.Enumerator: snapshot out of sync.";
-
- public Enumerator (Hashtable host, EnumeratorMode mode) {
- this.host = host;
- stamp = host.modificationCount;
- size = host.table.Length;
- this.mode = mode;
- Reset ();
- }
-
- public Enumerator (Hashtable host)
- : this (host, EnumeratorMode.KEY_MODE) {}
-
-
- private void FailFast ()
- {
- if (host.modificationCount!= stamp) {
- throw new InvalidOperationException (xstr);
- }
- }
-
- public void Reset ()
- {
- FailFast ();
-
- pos = -1;
- currentKey = null;
- currentValue = null;
- }
-
- public bool MoveNext ()
- {
- FailFast ();
-
- if (pos < size) {
- while (++pos < size) {
- Slot entry = host.table [pos];
-
- if (entry.key != null && entry.key != REMOVED_MARKER) {
- currentKey = entry.key;
- currentValue = entry.value;
- return true;
- }
- }
- }
-
- currentKey = null;
- currentValue = null;
- return false;
- }
-
- public DictionaryEntry Entry
- {
- get {
- FailFast ();
- return new DictionaryEntry (currentKey, currentValue);
- }
- }
-
- public Object Key {
- get {
- FailFast ();
- return currentKey;
- }
- }
-
- public Object Value {
- get {
- FailFast ();
- return currentValue;
- }
- }
-
- public Object Current {
- get {
- FailFast ();
- switch (mode) {
- case EnumeratorMode.KEY_MODE:
- return currentKey;
- case EnumeratorMode.VALUE_MODE:
- return currentValue;
- case EnumeratorMode.ENTRY_MODE:
- return new DictionaryEntry (currentKey, currentValue);
- }
- throw new Exception ("should never happen");
- }
- }
- }
-
-
-
- protected class HashKeys : ICollection, IEnumerable {
-
- private Hashtable host;
- private int count;
-
- public HashKeys (Hashtable host) {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- this.count = host.Count;
- }
-
- // ICollection
-
- public virtual int Count {
- get {
- return count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return host.IsSynchronized;
- }
- }
-
- public virtual Object SyncRoot {
- get {return host.SyncRoot;}
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.KEY_MODE);
- }
-
- // IEnumerable
-
- public virtual IEnumerator GetEnumerator ()
- {
- return new Hashtable.Enumerator (host, EnumeratorMode.KEY_MODE);
- }
- }
-
-
- protected class HashValues : ICollection, IEnumerable {
-
- private Hashtable host;
- private int count;
-
- public HashValues (Hashtable host) {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- this.count = host.Count;
- }
-
- // ICollection
-
- public virtual int Count {
- get {
- return count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return host.IsSynchronized;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return host.SyncRoot;
- }
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.VALUE_MODE);
- }
-
- // IEnumerable
-
- public virtual IEnumerator GetEnumerator ()
- {
- return new Hashtable.Enumerator (host, EnumeratorMode.VALUE_MODE);
- }
- }
-
-
-
- protected class SynchedHashtable : Hashtable, IEnumerable {
-
- private Hashtable host;
-
- public SynchedHashtable (Hashtable host) {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- }
-
- // ICollection
-
- public override int Count {
- get {
- return host.Count;
- }
- }
-
- public override bool IsSynchronized {
- get {
- return true;
- }
- }
-
- public override Object SyncRoot {
- get {
- return host.SyncRoot;
- }
- }
-
-
-
- // IDictionary
-
- public override bool IsFixedSize {
- get {
- return host.IsFixedSize;
- }
- }
-
-
- public override bool IsReadOnly {
- get {
- return host.IsReadOnly;
- }
- }
-
- public override ICollection Keys {
- get {
- ICollection keys = null;
- lock (host.SyncRoot) {
- keys = host.Keys;
- }
- return keys;
- }
- }
-
- public override ICollection Values {
- get {
- ICollection vals = null;
- lock (host.SyncRoot) {
- vals = host.Values;
- }
- return vals;
- }
- }
-
-
-
- public override Object this [Object key] {
- get {
- return host.GetImpl (key);
- }
- set {
- lock (host.SyncRoot) {
- host.PutImpl (key, value, true);
- }
- }
- }
-
- // IEnumerable
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new Enumerator (host, EnumeratorMode.KEY_MODE);
- }
-
-
-
-
- // ICollection
-
- public override void CopyTo (Array array, int arrayIndex)
- {
- host.CopyTo (array, arrayIndex);
- }
-
-
- // IDictionary
-
- public override void Add (Object key, Object value)
- {
- lock (host.SyncRoot) {
- host.PutImpl (key, value, false);
- }
- }
-
- public override void Clear ()
- {
- lock (host.SyncRoot) {
- host.Clear ();
- }
- }
-
- public override bool Contains (Object key)
- {
- return (host.Find (key) >= 0);
- }
-
- public override IDictionaryEnumerator GetEnumerator ()
- {
- return new Enumerator (host, EnumeratorMode.ENTRY_MODE);
- }
-
- public override void Remove (Object key)
- {
- lock (host.SyncRoot) {
- host.Remove (key);
- }
- }
-
-
-
- public override bool ContainsKey (object key)
- {
- return host.Contains (key);
- }
-
- public override bool ContainsValue (object value)
- {
- return host.ContainsValue (value);
- }
-
-
- // ICloneable
-
- public override object Clone ()
- {
- return (host.Clone () as Hashtable);
- }
-
- } // SynchedHashtable
-
-
- } // Hashtable
-
-}
-
diff --git a/mcs/class/corlib/System.Collections/ICollection.cs b/mcs/class/corlib/System.Collections/ICollection.cs
deleted file mode 100644
index 2189931cae8..00000000000
--- a/mcs/class/corlib/System.Collections/ICollection.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.ICollection
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface ICollection : IEnumerable {
- int Count { get; }
-
- bool IsSynchronized { get; }
-
- object SyncRoot { get; }
-
- void CopyTo (Array array, int index);
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IComparer.cs b/mcs/class/corlib/System.Collections/IComparer.cs
deleted file mode 100644
index 3d1ee2ef609..00000000000
--- a/mcs/class/corlib/System.Collections/IComparer.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IComparer
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IComparer {
- int Compare (object x, object y);
- }
-
-}
diff --git a/mcs/class/corlib/System.Collections/IDictionary.cs b/mcs/class/corlib/System.Collections/IDictionary.cs
deleted file mode 100644
index a03ab07d904..00000000000
--- a/mcs/class/corlib/System.Collections/IDictionary.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IDictionary
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IDictionary : ICollection {
- // properties
-
- bool IsFixedSize { get; }
-
- bool IsReadOnly { get; }
-
- object this[object key] { get; set; }
-
- ICollection Keys { get; }
-
- ICollection Values { get; }
-
- // methods
-
- void Add (object key, object value);
-
- void Clear ();
-
- bool Contains (object key);
-
- new IDictionaryEnumerator GetEnumerator ();
-
- void Remove (object key);
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IDictionaryEnumerator.cs b/mcs/class/corlib/System.Collections/IDictionaryEnumerator.cs
deleted file mode 100644
index fb1998d55f0..00000000000
--- a/mcs/class/corlib/System.Collections/IDictionaryEnumerator.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IDictionaryEnumerator
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IDictionaryEnumerator : IEnumerator {
- DictionaryEntry Entry { get; }
- object Key { get; }
- object Value { get; }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IEnumerable.cs b/mcs/class/corlib/System.Collections/IEnumerable.cs
deleted file mode 100644
index de0a57475dc..00000000000
--- a/mcs/class/corlib/System.Collections/IEnumerable.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IEnumerable
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IEnumerable {
- IEnumerator GetEnumerator();
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IEnumerator.cs b/mcs/class/corlib/System.Collections/IEnumerator.cs
deleted file mode 100644
index 06d250c8b7e..00000000000
--- a/mcs/class/corlib/System.Collections/IEnumerator.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Collections.IEnumerator
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IEnumerator {
- object Current { get; }
-
- bool MoveNext ();
-
- void Reset ();
- }
-
-}
diff --git a/mcs/class/corlib/System.Collections/IHashCodeProvider.cs b/mcs/class/corlib/System.Collections/IHashCodeProvider.cs
deleted file mode 100644
index 15fc4df45bf..00000000000
--- a/mcs/class/corlib/System.Collections/IHashCodeProvider.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IHashCodeProvider
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IHashCodeProvider {
- int GetHashCode (object obj);
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IList.cs b/mcs/class/corlib/System.Collections/IList.cs
deleted file mode 100644
index e039a8358c3..00000000000
--- a/mcs/class/corlib/System.Collections/IList.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IList
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IList : ICollection, IEnumerable {
- // properties
-
- bool IsFixedSize { get; }
-
- bool IsReadOnly { get; }
-
- object this[int index] { get; set; }
-
- // methods
-
- int Add (object value);
-
- void Clear ();
-
- bool Contains (object value);
-
- int IndexOf (object value);
-
- void Insert (int index, object value);
-
- void Remove (object value);
-
- void RemoveAt (int index);
- }
-}
diff --git a/mcs/class/corlib/System.Collections/Queue.cs b/mcs/class/corlib/System.Collections/Queue.cs
deleted file mode 100644
index f9b17742fb4..00000000000
--- a/mcs/class/corlib/System.Collections/Queue.cs
+++ /dev/null
@@ -1,328 +0,0 @@
-//
-// System.Collections.Queue
-//
-// Author:
-// Ricardo Fernández Pascual
-//
-// (C) 2001 Ricardo Fernández Pascual
-//
-
-using System;
-using System.Collections;
-
-namespace System.Collections {
-
- public class Queue : ICollection, IEnumerable, ICloneable {
-
- private object[] contents;
- private int head = 0; // points to the first used slot
- private int count = 0;
- private int capacity = 16;
- private float growFactor = 2.0F;
- private int modCount = 0;
-
- public Queue () {
- contents = new object[capacity];
- }
-
- public Queue (ICollection collection) {
- capacity = collection.Count;
- contents = new object[capacity];
- count = capacity;
- collection.CopyTo (contents, 0);
- }
-
- public Queue (int initialCapacity) {
- capacity = initialCapacity;
- contents = new object[capacity];
- }
-
- public Queue (int initialCapacity, float growFactor) {
- capacity = initialCapacity;
- contents = new object[capacity];
- // LAMESPEC: The spec says nothing, but I think this
- // should throw an exception if growFactor <= 1.0
- this.growFactor = growFactor;
- }
-
- // from ICollection
-
- public virtual int Count {
- get { return count; }
- }
-
- public virtual bool IsSynchronized {
- get { return false; }
- }
-
- public virtual object SyncRoot {
- get { return this; }
- }
-
- public virtual void CopyTo (Array array, int index) {
- if (array == null) {
- throw new ArgumentNullException ();
- }
-
- if (index < 0) {
- throw new ArgumentOutOfRangeException ();
- }
-
- if (array.Rank > 1
- || index >= array.Length
- || count > array.Length - index) {
- throw new ArgumentException ();
- }
-
- // copy the contents of the circular array
- Array.Copy (contents, head, array, index,
- Math.Max (count, capacity - head));
- if (count > capacity - head)
- Array.Copy (contents, 0, array,
- index + capacity - head,
- count - (capacity - head));
- }
-
- // from IEnumerable
-
- public virtual IEnumerator GetEnumerator () {
- return new QueueEnumerator (this);
- }
-
- // from ICloneable
-
- public virtual object Clone () {
- Queue newQueue;
-
- newQueue = new Queue (); // FIXME: improve this...
-
- newQueue.contents = new object[this.contents.Length];
- Array.Copy (this.contents, 0, newQueue.contents, 0,
- this.contents.Length);
- newQueue.head = this.head;
- newQueue.count = this.count;
- newQueue.capacity = this.capacity;
- newQueue.growFactor = this.growFactor;
-
- return newQueue;
- }
-
- // FIXME: should override Equals?
-
- // from Queue spec
-
- public virtual bool IsReadOnly {
- get { return false; }
- }
-
- public virtual void Clear () {
- modCount++;
- head = 0;
- count = 0;
- // FIXME: Should allocate a new contents array?
- // Should null the current array?
- }
-
- public virtual bool Contains (object obj) {
- int tail = head + count;
- if (obj == null) {
- for (int i = head; i < tail; i++) {
- if (contents[i % capacity] == null)
- return true;
- }
- } else {
- for (int i = head; i < tail; i++) {
- if (obj.Equals (contents[i % capacity]))
- return true;
- }
- }
- return false;
- }
-
- public virtual object Dequeue ()
- {
- modCount++;
- if (count < 1)
- throw new InvalidOperationException ();
- object result = contents[head];
- head = (head + 1) % capacity;
- count--;
- return result;
- }
-
- public virtual void Enqueue (object obj) {
- modCount++;
- if (count == capacity)
- grow ();
- contents[(head + count) % capacity] = obj;
- count++;
- }
-
- public virtual object Peek () {
- if (count < 1)
- throw new InvalidOperationException ();
- return contents[head];
- }
-
- public static Queue Synchronized (Queue queue) {
- if (queue == null) {
- throw new ArgumentNullException ();
- }
- return new SyncQueue (queue);
- }
-
- public virtual object[] ToArray () {
- object[] ret = new object[count];
- CopyTo (ret, 0);
- return ret;
- }
-
- // private methods
-
- private void grow () {
- int newCapacity = (int) Math.Ceiling
- (capacity * growFactor);
- object[] newContents = new object[newCapacity];
- CopyTo (newContents, 0);
- contents = newContents;
- head = 0;
- }
-
- // private classes
-
- private class SyncQueue : Queue {
- Queue queue;
-
- internal SyncQueue (Queue queue) {
- this.queue = queue;
- }
-
- public override int Count {
- get {
- lock (queue) {
- return queue.count;
- }
- }
- }
-
- public override bool IsSynchronized {
- get {
- lock (queue) {
- return queue.IsSynchronized;
- }
- }
- }
-
- public override object SyncRoot {
- get {
- return queue.SyncRoot;
- }
- }
-
- public override void CopyTo (Array array, int index) {
- lock (queue) {
- queue.CopyTo (array, index);
- }
- }
-
- public override IEnumerator GetEnumerator () {
- lock (queue) {
- return queue.GetEnumerator ();
- }
- }
-
- public override object Clone () {
- lock (queue) {
- return queue.Clone ();
- }
- }
-
- public override bool IsReadOnly {
- get {
- lock (queue) {
- return queue.IsReadOnly;
- }
- }
- }
-
- public override void Clear () {
- lock (queue) {
- queue.Clear ();
- }
- }
-
- public override bool Contains (object obj) {
- lock (queue) {
- return queue.Contains (obj);
- }
- }
-
- public override object Dequeue () {
- lock (queue) {
- return queue.Dequeue ();
- }
- }
-
- public override void Enqueue (object obj) {
- lock (queue) {
- queue.Enqueue (obj);
- }
- }
-
- public override object Peek () {
- lock (queue) {
- return queue.Peek ();
- }
- }
-
- public override object[] ToArray () {
- lock (queue) {
- return queue.ToArray ();
- }
- }
- }
-
- private class QueueEnumerator : IEnumerator {
- Queue queue;
- private int modCount;
- private int current;
-
- internal QueueEnumerator (Queue q) {
- queue = q;
- modCount = q.modCount;
- current = -1; // one element before the head
- }
-
- public virtual object Current {
- get {
- if (modCount != queue.modCount
- || current < 0
- || current >= queue.count)
- throw new InvalidOperationException ();
- return queue.contents[(queue.head + current) % queue.capacity];
- }
- }
-
- public virtual bool MoveNext () {
- if (modCount != queue.modCount) {
- throw new InvalidOperationException ();
- }
-
- if (current >= queue.count) {
- return false;
- } else {
- current++;
- return true;
- }
- }
-
- public virtual void Reset () {
- if (modCount != queue.modCount) {
- throw new InvalidOperationException();
- }
- current = -1;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Collections/ReadOnlyCollectionBase.cs b/mcs/class/corlib/System.Collections/ReadOnlyCollectionBase.cs
deleted file mode 100644
index 89544feabdc..00000000000
--- a/mcs/class/corlib/System.Collections/ReadOnlyCollectionBase.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Collections.ReadOnlyCollectionBase.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-
-namespace System.Collections {
-
- public abstract class ReadOnlyCollectionBase : ICollection, IEnumerable {
-
- // private instance properties
- private System.Collections.ArrayList myList;
-
- // public instance properties
- public virtual int Count { get { return InnerList.Count; } }
-
- // Public Instance Methods
- public virtual System.Collections.IEnumerator GetEnumerator() { return InnerList.GetEnumerator(); }
-
- // Protected Instance Constructors
- protected ReadOnlyCollectionBase() {
- this.myList = new System.Collections.ArrayList();
- }
-
- // Protected Instance Properties
- protected virtual System.Collections.ArrayList InnerList {get { return this.myList; } }
-
- // ICollection methods
- void ICollection.CopyTo(Array array, int index) {
- lock (InnerList) { InnerList.CopyTo(array, index); }
- }
- object ICollection.SyncRoot {
- get { return InnerList.SyncRoot; }
- }
- bool ICollection.IsSynchronized {
- get { return InnerList.IsSynchronized; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/SortedList.cs b/mcs/class/corlib/System.Collections/SortedList.cs
deleted file mode 100644
index e87baf7390d..00000000000
--- a/mcs/class/corlib/System.Collections/SortedList.cs
+++ /dev/null
@@ -1,865 +0,0 @@
-//
-// System.Collections.SortedList
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-using System;
-using System.Collections;
-
-
-namespace System.Collections {
-
- /// <summary>
- /// Represents a collection of associated keys and values
- /// that are sorted by the keys and are accessible by key
- /// and by index.
- /// </summary>
- public class SortedList : IDictionary, ICollection,
- IEnumerable, ICloneable {
-
-
- internal struct Slot {
- internal Object key;
- internal Object value;
- }
-
- private readonly static int INITIAL_SIZE = 16;
-
- public enum EnumeratorMode : int {KEY_MODE = 0, VALUE_MODE}
-
- private int inUse;
- private int modificationCount;
- private Slot[] table;
- private IComparer comparer;
-
-
-
- //
- // Constructors
- //
- public SortedList () : this (INITIAL_SIZE)
- {
- }
-
- public SortedList (int initialCapacity)
- : this (null, initialCapacity)
- {
- }
-
- public SortedList (IComparer comparer, int initialCapacity)
- {
- this.comparer = comparer;
- InitTable (initialCapacity);
- }
-
- public SortedList (IComparer comparer)
- : this (comparer, 0)
- {
- }
-
-
- public SortedList (IDictionary d) : this (d, null)
- {
- }
-
- public SortedList (IDictionary d, IComparer comparer)
- {
- if (d == null)
- throw new ArgumentNullException ("dictionary");
-
- InitTable (d.Count);
- this.comparer = comparer;
-
- IDictionaryEnumerator it = d.GetEnumerator ();
- while (it.MoveNext ()) {
- if (it.Key is IComparable) {
- Add (it.Key, it.Value);
- } else {
- throw new InvalidCastException("!IComparable");
- }
- }
- }
-
-
-
-
- //
- // Properties
- //
-
-
- // ICollection
-
- public virtual int Count {
- get {
- return inUse;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return false;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return this;
- }
- }
-
-
- // IDictionary
-
- public virtual bool IsFixedSize {
- get {
- return false;
- }
- }
-
-
- public virtual bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public virtual ICollection Keys {
- get {
- return new ListKeys (this);
- }
- }
-
- public virtual ICollection Values {
- get {
- return new ListValues (this);
- }
- }
-
-
-
- public virtual Object this [Object key] {
- get {
- return GetImpl (key);
- }
- set {
- PutImpl (key, value, true);
- }
- }
-
-
-
-
- public virtual int Capacity {
- get {
- return table.Length;
- }
- set {
- Slot [] table = this.table;
- int current = table.Length;
-
- if (inUse > value)
- throw new ArgumentOutOfRangeException("capacity too small");
-
- if (value > current) {
- Slot [] newTable = new Slot [value];
- Array.Copy (table, newTable, current);
- this.table = newTable;
- }
- }
- }
-
-
-
- //
- // Public instance methods.
- //
-
-
- // IEnumerable
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new Enumerator (this, EnumeratorMode.KEY_MODE);
- }
-
-
- // IDictionary
-
- public virtual void Add (object key, object value)
- {
- PutImpl (key, value, false);
- }
-
-
- public virtual void Clear ()
- {
- this.table = new Slot [Capacity];
- inUse = 0;
- modificationCount++;
- }
-
- public virtual bool Contains (object key)
- {
- return (Find (key) >= 0);
- }
-
-
- public virtual IDictionaryEnumerator GetEnumerator ()
- {
- return new Enumerator (this, EnumeratorMode.KEY_MODE);
- }
-
- public virtual void Remove (object key)
- {
- int i = IndexOfKey (key);
- if (i >= 0) RemoveAt (i);
- }
-
-
- // ICollection
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- IDictionaryEnumerator it = GetEnumerator ();
- int i = arrayIndex;
-
- while (it.MoveNext ()) {
- array.SetValue (it.Entry, i++);
- }
- }
-
-
-
- // ICloneable
-
- public virtual object Clone ()
- {
- SortedList sl = new SortedList (this, comparer);
- sl.modificationCount = this.modificationCount;
- return sl;
- }
-
-
-
-
- //
- // SortedList
- //
-
- public virtual IList GetKeyList ()
- {
- return new ListKeys (this);
- }
-
-
- public virtual IList GetValueList ()
- {
- return new ListValues (this);
- }
-
-
- public virtual void RemoveAt (int index)
- {
- Slot [] table = this.table;
- int cnt = Count;
- if (index >= 0 && index < cnt) {
- if (index != cnt - 1) {
- Array.Copy (table, index+1, table, index, cnt-1);
- } else {
- table [index].key = null;
- table [index].value = null;
- }
- --inUse;
- ++modificationCount;
- } else {
- throw new ArgumentOutOfRangeException("index out of range");
- }
- }
-
-
-
-
-
- public virtual int IndexOfKey (object key)
- {
- int indx = Find (key);
- return (indx | (indx >> 31));
- }
-
-
- public virtual int IndexOfValue (object value)
- {
- Slot [] table = this.table;
- int len = table.Length;
-
- for (int i=0; i < len; i++) {
- if (table[i].value.Equals (value)) {
- return i;
- }
- }
-
- return -1;
- }
-
-
- public virtual bool ContainsKey (object key)
- {
- return Contains (key);
- }
-
-
- public virtual bool ContainsValue (object value)
- {
- return IndexOfValue (value) >= 0;
- }
-
-
- public virtual object GetByIndex (int index)
- {
- if (index >= 0 && index < Count) {
- return table [index].value;
- } else {
- throw new ArgumentOutOfRangeException("index out of range");
- }
- }
-
-
- public virtual void SetByIndex (int index, object value)
- {
- if (index >= 0 && index < Count) {
- table [index].value = value;
- } else {
- throw new ArgumentOutOfRangeException("index out of range");
- }
- }
-
-
- public virtual object GetKey (int index)
- {
- if (index >= 0 && index < Count) {
- return table [index].key;
- } else {
- throw new ArgumentOutOfRangeException("index out of range");
- }
- }
-
-
-
- public virtual void TrimToSize ()
- {
- // From Beta2:
- // Trimming an empty SortedList sets the capacity
- // of the SortedList to the default capacity,
- // not zero.
- if (Count == 0) Resize (INITIAL_SIZE, false);
- else Resize (Count, true);
- }
-
-
-
- public override string ToString ()
- {
- return "mono::System.Collections.SortedList";
- }
-
-
-
- //
- // Private methods
- //
-
-
- private void Resize (int n, bool copy)
- {
- Slot [] table = this.table;
- Slot [] newTable = new Slot [n];
- if (copy) Array.Copy (table, 0, newTable, 0, n);
- this.table = newTable;
- }
-
-
- private void EnsureCapacity (int n, int free)
- {
- Slot [] table = this.table;
- Slot [] newTable = null;
- int cap = Capacity;
- bool gap = (free >=0 && free < Count);
-
- if (n > cap) {
- newTable = new Slot [n << 1];
- }
-
- if (newTable != null) {
- if (gap) {
- int copyLen = free;
- if (copyLen > 0) {
- Array.Copy (table, 0, newTable, 0, copyLen);
- }
- copyLen = Count - free;
- if (copyLen > 0) {
- Array.Copy (table, free, newTable, free+1, copyLen);
- }
- } else {
- // Just a resizing, copy the entire table.
- Array.Copy (table, newTable, Count);
- }
- this.table = newTable;
- } else if (gap) {
- Array.Copy (table, free, table, free+1, Count - free);
- }
- }
-
-
- private void PutImpl (object key, object value, bool overwrite)
- {
- if (key == null)
- throw new ArgumentNullException ("null key");
-
- Slot [] table = this.table;
- int freeIndx = Find (key);
-
-
- if (freeIndx >= 0) {
- if (!overwrite)
- throw new ArgumentException("element already exists");
-
- table [freeIndx].value = value;
- return;
- }
-
- freeIndx = ~freeIndx;
-
- if (freeIndx > Capacity + 1)
- throw new Exception ("SortedList::internal error ("+key+", "+value+") at ["+freeIndx+"]");
-
-
- EnsureCapacity (Count+1, freeIndx);
-
- table = this.table;
- table [freeIndx].key = key;
- table [freeIndx].value = value;
-
- ++inUse;
- ++modificationCount;
-
- }
-
-
- private object GetImpl (object key)
- {
- int i = Find (key);
-
- if (i >= 0)
- return table [i].value;
- else
- return null;
- }
-
-
- private void InitTable (int capacity)
- {
- int size = (capacity + 1) & (~1);
- if (size < INITIAL_SIZE) size = INITIAL_SIZE;
- this.table = new Slot [size];
- this.inUse = 0;
- this.modificationCount = 0;
- }
-
-
- private void CopyToArray (Array arr, int i,
- EnumeratorMode mode)
- {
- IEnumerator it = new Enumerator (this, mode);
-
- while (it.MoveNext ()) {
- arr.SetValue (it.Current, i++);
- }
- }
-
-
- private int Find (object key)
- {
- Slot [] table = this.table;
- int len = Count;
-
- if (len == 0) return ~0;
-
- IComparer comparer = (this.comparer == null)
- ? Comparer.Default
- : this.comparer;
-
- int left = 0;
- int right = len-1;
-
- while (left <= right) {
- int guess = (left + right) >> 1;
-
- int cmp = comparer.Compare (key, table[guess].key);
-
- if (cmp == 0) return guess;
-
- cmp &= ~Int32.MaxValue;
-
- if (cmp == 0) left = guess+1;
- else right = guess-1;
- }
-
- return ~left;
- }
-
-
-
- //
- // Inner classes
- //
-
-
- protected sealed class Enumerator : IDictionaryEnumerator,
- IEnumerator {
-
- private SortedList host;
- private int stamp;
- private int pos;
- private int size;
- private EnumeratorMode mode;
-
- private object currentKey;
- private object currentValue;
-
- private readonly static string xstr = "SortedList.Enumerator: snapshot out of sync.";
-
- public Enumerator (SortedList host, EnumeratorMode mode)
- {
- this.host = host;
- stamp = host.modificationCount;
- size = host.Count;
- this.mode = mode;
- Reset ();
- }
-
- public Enumerator (SortedList host)
- : this (host, EnumeratorMode.KEY_MODE)
- {
- }
-
-
- private void FailFast ()
- {
- if (host.modificationCount != stamp) {
- throw new InvalidOperationException (xstr);
- }
- }
-
- public void Reset ()
- {
- FailFast ();
-
- pos = -1;
- currentKey = null;
- currentValue = null;
- }
-
- public bool MoveNext ()
- {
- FailFast ();
-
- Slot [] table = host.table;
-
- if (++pos < size) {
- Slot entry = table [pos];
-
- currentKey = entry.key;
- currentValue = entry.value;
- return true;
- }
-
- currentKey = null;
- currentValue = null;
- return false;
- }
-
- public DictionaryEntry Entry
- {
- get {
- FailFast ();
- return new DictionaryEntry (currentKey,
- currentValue);
- }
- }
-
- public Object Key {
- get {
- FailFast ();
- return currentKey;
- }
- }
-
- public Object Value {
- get {
- FailFast ();
- return currentValue;
- }
- }
-
- public Object Current {
- get {
- FailFast ();
- return (mode == EnumeratorMode.KEY_MODE)
- ? currentKey
- : currentValue;
- }
- }
- }
-
-
- protected class ListKeys : IList, IEnumerable {
-
- private SortedList host;
-
-
- public ListKeys (SortedList host)
- {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- }
-
- //
- // ICollection
- //
-
- public virtual int Count {
- get {
- return host.Count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return host.IsSynchronized;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return host.SyncRoot;
- }
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.KEY_MODE);
- }
-
-
- //
- // IList
- //
-
- public virtual bool IsFixedSize {
- get {
- return true;
- }
- }
-
- public virtual bool IsReadOnly {
- get {
- return true;
- }
- }
-
-
- public virtual object this [int index] {
- get {
- return host.GetKey (index);
- }
- set {
- throw new NotSupportedException("attempt to modify a key");
- }
- }
-
- public virtual int Add (object value)
- {
- throw new NotSupportedException("IList::Add not supported");
- }
-
- public virtual void Clear ()
- {
- throw new NotSupportedException("IList::Clear not supported");
- }
-
- public virtual bool Contains (object key)
- {
- return host.Contains (key);
- }
-
-
- public virtual int IndexOf (object key)
- {
- return host.IndexOfKey (key);
- }
-
-
- public virtual void Insert (int index, object value)
- {
- throw new NotSupportedException("IList::Insert not supported");
- }
-
-
- public virtual void Remove (object value)
- {
- throw new NotSupportedException("IList::Remove not supported");
- }
-
-
- public virtual void RemoveAt (int index)
- {
- throw new NotSupportedException("IList::RemoveAt not supported");
- }
-
-
- //
- // IEnumerable
- //
-
- public virtual IEnumerator GetEnumerator ()
- {
- return new SortedList.Enumerator (host, EnumeratorMode.KEY_MODE);
- }
-
-
- }
-
-
- protected class ListValues : IList, IEnumerable {
-
- private SortedList host;
-
-
- public ListValues (SortedList host)
- {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- }
-
- //
- // ICollection
- //
-
- public virtual int Count {
- get {
- return host.Count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return host.IsSynchronized;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return host.SyncRoot;
- }
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.VALUE_MODE);
- }
-
-
- //
- // IList
- //
-
- public virtual bool IsFixedSize {
- get {
- return true;
- }
- }
-
- public virtual bool IsReadOnly {
- get {
- return true;
- }
- }
-
-
- [MonoTODO]
- public virtual object this [int index] {
- get {
- return host.GetByIndex (index);
- }
- set {
- // FIXME: It seems (according to tests)
- // that modifications are allowed
- // in Beta2.
- // ? host.SetByIndex (index, value);
- throw new NotSupportedException("attempt to modify a value");
- }
- }
-
- public virtual int Add (object value)
- {
- throw new NotSupportedException("IList::Add not supported");
- }
-
- public virtual void Clear ()
- {
- throw new NotSupportedException("IList::Clear not supported");
- }
-
- public virtual bool Contains (object value)
- {
- return host.ContainsValue (value);
- }
-
-
- public virtual int IndexOf (object value)
- {
- return host.IndexOfValue (value);
- }
-
-
- public virtual void Insert (int index, object value)
- {
- throw new NotSupportedException("IList::Insert not supported");
- }
-
-
- public virtual void Remove (object value)
- {
- throw new NotSupportedException("IList::Remove not supported");
- }
-
-
- public virtual void RemoveAt (int index)
- {
- throw new NotSupportedException("IList::RemoveAt not supported");
- }
-
-
- //
- // IEnumerable
- //
-
- public virtual IEnumerator GetEnumerator ()
- {
- return new SortedList.Enumerator (host, EnumeratorMode.VALUE_MODE);
- }
-
-
- }
-
- } // SortedList
-
-} // System.Collections
diff --git a/mcs/class/corlib/System.Collections/Stack.cs b/mcs/class/corlib/System.Collections/Stack.cs
deleted file mode 100644
index f6e04320741..00000000000
--- a/mcs/class/corlib/System.Collections/Stack.cs
+++ /dev/null
@@ -1,315 +0,0 @@
-//
-// System.Collections.Stack
-//
-// Author:
-// Garrett Rooney (rooneg@electricjellyfish.net)
-//
-// (C) 2001 Garrett Rooney
-//
-
-namespace System.Collections {
-
- public class Stack : ICollection, IEnumerable, ICloneable {
-
- // properties
- private object[] contents;
- private int current = -1;
- private int count = 0;
- private int capacity = 16;
- private int modCount = 0;
-
- private void Resize(int ncapacity) {
- object[] ncontents = new object[ncapacity];
-
- Array.Copy(contents, ncontents, count);
-
- capacity = ncapacity;
- contents = ncontents;
- }
-
- public Stack() {
- contents = new object[capacity];
- }
-
- public Stack(ICollection collection) {
- capacity = collection.Count;
- contents = new object[capacity];
- current = capacity - 1;
- count = capacity;
-
- collection.CopyTo(contents, 0);
- }
-
- public Stack(int c) {
- capacity = c;
- contents = new object[capacity];
- }
-
- private class SyncStack : Stack {
-
- Stack stack;
-
- public SyncStack(Stack s) {
- stack = s;
- }
-
- public override int Count {
- get {
- lock (stack) {
- return stack.Count;
- }
- }
- }
-
- public override bool IsReadOnly {
- get {
- lock (stack) {
- return stack.IsReadOnly;
- }
- }
- }
-
- public override bool IsSynchronized {
- get { return true; }
- }
-
- public override object SyncRoot {
- get { return stack.SyncRoot; }
- }
-
- public override void Clear() {
- lock(stack) { stack.Clear(); }
- }
-
- public override object Clone() {
- lock (stack) {
- return Stack.Synchronized((Stack)stack.Clone());
- }
- }
-
- public override bool Contains(object obj) {
- lock (stack) { return stack.Contains(obj); }
- }
-
- public override void CopyTo(Array array, int index) {
- lock (stack) { stack.CopyTo(array, index); }
- }
-
- public override IEnumerator GetEnumerator() {
- lock (stack) {
- return new Enumerator(stack);
- }
- }
-
- public override object Peek() {
- lock (stack) { return stack.Peek(); }
- }
-
- public override object Pop() {
- lock (stack) { return stack.Pop(); }
- }
-
- public override void Push(object obj) {
- lock (stack) { stack.Push(obj); }
- }
-
- public override object[] ToArray() {
- lock (stack) { return stack.ToArray(); }
- }
- }
-
- public static Stack Synchronized(Stack s) {
- if (s == null) {
- throw new ArgumentNullException();
- }
-
- return new SyncStack(s);
- }
-
- public virtual int Count {
- get { return count; }
- }
-
- public virtual bool IsReadOnly {
- get { return false; }
- }
-
- public virtual bool IsSynchronized {
- get { return false; }
- }
-
- public virtual object SyncRoot {
- get { return this; }
- }
-
- public virtual void Clear() {
- modCount++;
-
- for (int i = 0; i < count; i++) {
- contents[i] = null;
- }
-
- count = 0;
- current = -1;
- }
-
- public virtual object Clone() {
- Stack stack;
-
- stack = new Stack();
-
- stack.current = current;
- stack.contents = contents;
- stack.count = count;
- stack.capacity = capacity;
-
- return stack;
- }
-
- public virtual bool Contains(object obj) {
- if (count == 0)
- return false;
-
- for (int i = 0; i < count; i++) {
- if (contents[i].Equals(obj))
- return true;
- }
-
- return false;
- }
-
- public virtual void CopyTo (Array array, int index) {
- if (array == null) {
- throw new ArgumentNullException();
- }
-
- if (index < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- if (array.Rank > 1 ||
- index >= array.Length ||
- count > array.Length - index) {
- throw new ArgumentException();
- }
-
- for (int i = current; i != -1; i--) {
- array.SetValue(contents[i],
- count - (i + 1) + index);
- }
- }
-
- private class Enumerator : IEnumerator {
-
- Stack stack;
- private int modCount;
- private int current;
-
- internal Enumerator(Stack s) {
- // this is odd. it seems that you need to
- // start one further ahead than current, since
- // MoveNext() gets called first when using an
- // Enumeration...
- stack = s;
- modCount = s.modCount;
- current = s.current + 1;
- }
-
- public virtual object Current {
- get {
- if (modCount != stack.modCount
- || current == -1
- || current > stack.count)
- throw new InvalidOperationException();
- return stack.contents[current];
- }
- }
-
- public virtual bool MoveNext() {
- if (modCount != stack.modCount
- || current == -1) {
- throw new InvalidOperationException();
- }
-
- current--;
-
- if (current == -1) {
- return false;
- } else {
- return true;
- }
- }
-
- public virtual void Reset() {
- if (modCount != stack.modCount) {
- throw new InvalidOperationException();
- }
-
- // start one ahead of stack.current, so the
- // first MoveNext() will put us at the top
- current = stack.current + 1;
- }
- }
-
- public virtual IEnumerator GetEnumerator() {
- return new Enumerator(this);
- }
-
- public virtual object Peek() {
- if (current == -1) {
- throw new InvalidOperationException();
- } else {
- return contents[current];
- }
- }
-
- public virtual object Pop() {
- if (current == -1) {
- throw new InvalidOperationException();
- } else {
- modCount++;
-
- object ret = contents[current];
-
- count--;
- current--;
-
- // if we're down to capacity/4, go back to a
- // lower array size. this should keep us from
- // sucking down huge amounts of memory when
- // putting large numbers of items in the Stack.
- // if we're lower than 16, don't bother, since
- // it will be more trouble than it's worth.
- if (count <= (capacity/4) && count > 16) {
- Resize(capacity/2);
- }
-
- return ret;
- }
- }
-
- public virtual void Push(Object o) {
- modCount++;
-
- if (capacity == count) {
- Resize(capacity * 2);
- }
-
- count++;
- current++;
-
- contents[current] = o;
- }
-
- public virtual object[] ToArray() {
- object[] ret = new object[count];
-
- Array.Copy(contents, ret, count);
-
- // ret needs to be in LIFO order
- Array.Reverse(ret);
-
- return ret;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHash.cs b/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHash.cs
deleted file mode 100644
index 70f539377ce..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHash.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-
-//
-// AssemblyHash.cs
-//
-// Implementation of the
-// System.Configuration.Assemblies.AssemblyHash
-// class for the Mono Class Library
-//
-// Author:
-// Tomas Restrepo (tomasr@mvps.org)
-//
-
-namespace System.Configuration.Assemblies {
-
- public struct AssemblyHash : System.ICloneable
- {
- private AssemblyHashAlgorithm _algorithm;
- private byte[] _value;
-
- public static readonly AssemblyHash Empty =
- new AssemblyHash(AssemblyHashAlgorithm.None,null);
-
-
- //
- // properties
- //
- public AssemblyHashAlgorithm Algorithm {
- get { return _algorithm; }
- set { _algorithm = value; }
- }
-
-
- //
- // construction
- //
- public AssemblyHash ( AssemblyHashAlgorithm algorithm, byte[] value )
- {
- _algorithm = algorithm;
- _value = null;
- if ( value != null )
- {
- int size = value.Length;
- _value = new byte[size];
- System.Array.Copy ( value, _value, size );
- }
- }
-
- public AssemblyHash ( byte[] value )
- : this(AssemblyHashAlgorithm.SHA1, value)
- {
- }
-
- public object Clone()
- {
- return new AssemblyHash(_algorithm,_value);
- }
-
- public byte[] GetValue()
- {
- return _value;
- }
- public void SetValue ( byte[] value )
- {
- _value = value;
- }
-
- } // class AssemblyHash
-
-} // namespace System.Configuration.Assemblies
-
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs b/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs
deleted file mode 100644
index f144df7bf79..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// AssemblyHashAlgorithm.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:38:03 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Configuration.Assemblies {
-
-
- /// <summary>
- /// </summary>
- public enum AssemblyHashAlgorithm {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- MD5 = 32771,
-
- /// <summary>
- /// </summary>
- SHA1 = 32772,
- } // AssemblyHashAlgorithm
-
-} // System.Configuration.Assemblies
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyVersionCompatibility.cs b/mcs/class/corlib/System.Configuration.Assemblies/AssemblyVersionCompatibility.cs
deleted file mode 100644
index 5e13d56fdf1..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyVersionCompatibility.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// AssemblyVersionCompatibility.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:38:13 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Configuration.Assemblies {
-
-
- /// <summary>
- /// </summary>
- public enum AssemblyVersionCompatibility {
-
- /// <summary>
- /// </summary>
- SameMachine = 1,
-
- /// <summary>
- /// </summary>
- SameProcess = 2,
-
- /// <summary>
- /// </summary>
- SameDomain = 3,
- } // AssemblyVersionCompatibility
-
-} // System.Configuration.Assemblies
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/ChangeLog b/mcs/class/corlib/System.Configuration.Assemblies/ChangeLog
deleted file mode 100644
index d9e7f8ea889..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/ChangeLog
+++ /dev/null
@@ -1,6 +0,0 @@
-2001-07-13 Tomas Restrepo (tomasr@mvps.org)
-
- * AssemblyHash finished
- * AssemblyHashAlgorithm finished
- * AssemblyVersion finished
- \ No newline at end of file
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/ProcessorID.cs b/mcs/class/corlib/System.Configuration.Assemblies/ProcessorID.cs
deleted file mode 100755
index 10cb2e9fe5d..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/ProcessorID.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-// ProcessorID.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:38:23 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Configuration.Assemblies {
-
-
- /// <summary>
- /// </summary>
- public enum ProcessorID {
-
- /// <summary>
- /// </summary>
- INTEL_386 = 386,
-
- /// <summary>
- /// </summary>
- INTEL_486 = 486,
-
- /// <summary>
- /// </summary>
- INTEL_PENTIUM = 586,
-
- /// <summary>
- /// </summary>
- MIPS_R4000 = 4000,
-
- /// <summary>
- /// </summary>
- ALPHA_21064 = 21064,
-
- /// <summary>
- /// </summary>
- PPC_601 = 601,
-
- /// <summary>
- /// </summary>
- PPC_603 = 603,
-
- /// <summary>
- /// </summary>
- PPC_604 = 604,
-
- /// <summary>
- /// </summary>
- PPC_620 = 620,
-
- /// <summary>
- /// </summary>
- HITACHI_SH3 = 10003,
-
- /// <summary>
- /// </summary>
- HITACHI_SH3E = 10004,
-
- /// <summary>
- /// </summary>
- HITACHI_SH4 = 10005,
-
- /// <summary>
- /// </summary>
- MOTOROLA_821 = 821,
-
- /// <summary>
- /// </summary>
- SHx_SH3 = 103,
-
- /// <summary>
- /// </summary>
- SHx_SH4 = 104,
-
- /// <summary>
- /// </summary>
- STRONGARM = 2577,
-
- /// <summary>
- /// </summary>
- ARM720 = 1824,
-
- /// <summary>
- /// </summary>
- ARM820 = 2080,
-
- /// <summary>
- /// </summary>
- ARM920 = 2336,
-
- /// <summary>
- /// </summary>
- ARM_7TDMI = 70001,
- } // ProcessorID
-
-} // System.Configuration.Assemblies
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ChangeLog b/mcs/class/corlib/System.Diagnostics.SymbolStore/ChangeLog
deleted file mode 100644
index bf8536f28fb..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ChangeLog
+++ /dev/null
@@ -1,13 +0,0 @@
-2002-02-05 Duncan Mak <duncan@ximian.com>
-
- * SymDocumentType.cs:
- * SymLanguageType.cs:
- * SymLanguageVendor.cs: Added to CVS.
-
-2002-01-07 Duco Fijma <duco@lorentz.xs4all.nl>
- * Finilized SymAddressKind enum
-
-2002-01-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * Created SymAddressKind enum
- * Created all interfaces
- * Created dummy implementation for SymbolToken struct
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolBinder.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolBinder.cs
deleted file mode 100755
index ea1779ca15c..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolBinder.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolBinder
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolBinder {
-
- ISymbolReader GetReader (int importer, string filename, string searchPath);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocument.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocument.cs
deleted file mode 100755
index b554cc4b193..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocument.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolDocument
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolDocument {
-
- Guid CheckSymAlgorithmId {get; }
- Guid DocumentType {get; }
- bool HasEmbeddedSource {get; }
- Guid Language {get; }
- Guid LanguageVendor {get; }
- int SourceLength {get; }
- string URL {get; }
-
- int FindClosestLine (int line);
- byte[] GetCheckSum ();
- byte[] GetSourceRange (int startLine, int startColumn, int endLine, int endColumn);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs
deleted file mode 100755
index 855b1a5cefc..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolDocumentWriter {
-
- void SetCheckSum (Guid algorithmId, byte[] checkSum);
- void SetSource (byte[] source);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolMethod.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolMethod.cs
deleted file mode 100755
index 768ace15710..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolMethod.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolMethod
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolMethod {
-
- ISymbolScope RootScope {get; }
- int SequencePointCount {get; }
- SymbolToken Token {get; }
-
- ISymbolNamespace GetNamespace ();
- int GetOffset (ISymbolDocument document, int line, int column);
- ISymbolVariable[] GetParameters ();
- int[] GetRanges (ISymbolDocument document, int line, int column);
- ISymbolScope GetScope (int offset);
- void GetSequencePoints (
- int[] offsets,
- ISymbolDocument[] documents,
- int[] lines,
- int[] columns,
- int[] endLines,
- int[] endColumns);
- bool GetSourceStartEnd (
- ISymbolDocument[] docs,
- int[] lines,
- int[] columns);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolNamespace.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolNamespace.cs
deleted file mode 100755
index 037a7198662..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolNamespace.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolNamespace
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolNamespace {
-
- string Name {get ;}
-
- ISymbolNamespace[] GetNamespaces ();
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolReader.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolReader.cs
deleted file mode 100755
index ee04f2b64b1..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolReader.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolReader
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolReader {
-
- SymbolToken UserEntryPoint {get; }
-
- ISymbolDocument GetDocument (
- string url,
- Guid language,
- Guid languageVendor,
- Guid documentType);
- ISymbolDocument[] GetDocuments ();
- ISymbolVariable[] GetGlobalVariables ();
-
- ISymbolMethod GetMethod (SymbolToken method);
- ISymbolMethod GetMethod (SymbolToken method, int version);
-
- ISymbolMethod GetMethodFromDocumentPosition (
- ISymbolDocument document,
- int line,
- int column);
- ISymbolNamespace[] GetNamespaces ();
- byte[] GetSymAttribute (SymbolToken parent, string name);
- ISymbolVariable[] GetVariables (SymbolToken parent);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolScope.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolScope.cs
deleted file mode 100755
index 6c3179ba67a..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolScope.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolScope
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolScope {
-
- int EndOffset {get ;}
- ISymbolMethod Method {get; }
- ISymbolScope Parent {get ;}
- int StartOffset {get ;}
-
- ISymbolScope[] GetChildren ();
- ISymbolVariable[] GetLocals ();
- ISymbolNamespace[] GetNamespaces ();
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolVariable.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolVariable.cs
deleted file mode 100755
index 11d4ee5f25d..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolVariable.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolVariable
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolVariable {
-
- int AddressField1 {get; }
- int AddressField2 {get; }
- int AddressField3 {get; }
- SymAddressKind AddressKind {get ;}
- object Attributes {get ;}
- int EndOffset {get; }
- string Name {get; }
- int StartOffset {get; }
-
- byte[] GetSignature ();
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolWriter.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolWriter.cs
deleted file mode 100755
index 05c3cb5c113..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolWriter.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolWriter
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-using System.Reflection;
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolWriter {
-
- void Close ();
- void CloseMethod ();
- void CloseNamespace ();
- void CloseScope (int endOffset);
- ISymbolDocumentWriter DefineDocument(
- string url,
- Guid language,
- Guid languageVendor,
- Guid documentType);
- void DefineField (
- SymbolToken parent,
- string name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3);
- void DefineGlobalVariable (
- string name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3);
- void DefineLocalVariable (
- string name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3,
- int startOffset,
- int endOffset);
- void DefineParameter (
- string name,
- FieldAttributes attributes,
- int sequence,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3);
- void DefineSequencePoints (
- ISymbolDocumentWriter document,
- int[] offsets,
- int[] lines,
- int[] columns,
- int[] endLines,
- int[] endColumns);
- void Initialize (IntPtr emitter, string filename, bool fFullBuild);
- void OpenMethod (SymbolToken method);
- void OpenNamespace (string name);
- int OpenScope (int startOffset);
- void SetMethodSourceRanger (
- ISymbolDocumentWriter startDoc,
- int startLine,
- int startColumn,
- ISymbolDocumentWriter endDoc,
- int endLine,
- int endColumn);
- void SetScopeRange (int scopeID, int startOffset, int endOffset);
- void SetSymAttribute (SymbolToken parent, string name, byte[] data);
- void SetUnderlyingWriter (IntPtr underlyingWriter);
- void SetUserEntryPoint (SymbolToken entryMethod);
- void UsingNamespace (string fullName);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymAddressKind.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymAddressKind.cs
deleted file mode 100755
index af3e5b32ef5..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymAddressKind.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymAddressKind
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public enum SymAddressKind {
- ILOffset = 1,
- NativeRVA = 2,
- NativeRegister = 3,
- NativeRegisterRelative = 4,
- NativeOffset = 5,
- NativeRegisterRegister = 6,
- NativeRegisterStack = 7,
- NativeStackRegister = 8,
- BitField = 9
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymDocumentType.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymDocumentType.cs
deleted file mode 100644
index 6bbabef32d6..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymDocumentType.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymDocumentType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics.SymbolStore
-{
- public class SymDocumentType
- {
- // Constructors
- public SymDocumentType ()
- {
- }
-
- // Fields
- public static readonly Guid Text;
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageType.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageType.cs
deleted file mode 100644
index 6dd232f081e..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageType.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymLanguageType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics.SymbolStore
-{
- public class SymLanguageType
- {
- // Constructors
- public SymLanguageType ()
- {
- }
-
- // Fields
- public static readonly Guid Basic;
- public static readonly Guid C;
- public static readonly Guid Cobol;
- public static readonly Guid CPlusPlus;
- public static readonly Guid CSharp;
- public static readonly Guid ILAssembly;
- public static readonly Guid Java;
- public static readonly Guid JScript;
- public static readonly Guid MCPlusPlus;
- public static readonly Guid Pascal;
- public static readonly Guid SMC;
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageVendor.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageVendor.cs
deleted file mode 100644
index 3110f7a5c90..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageVendor.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymLanguageVendor.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics.SymbolStore
-{
- public class SymLanguageVendor
- {
- // Constructors
- public SymLanguageVendor ()
- {
- }
-
- // Fields
- public static Guid Microsoft;
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymbolToken.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymbolToken.cs
deleted file mode 100755
index 756eb7aa115..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymbolToken.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymbolToken
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public struct SymbolToken {
-
- private int _val;
-
- public SymbolToken (int val) { _val = val; }
-
- [MonoTODO]
- public override bool Equals (object obj) { return false; }
-
- [MonoTODO]
- public override int GetHashCode() { return 0; }
-
- [MonoTODO]
- public int GetToken() { return 0; }
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics/ChangeLog b/mcs/class/corlib/System.Diagnostics/ChangeLog
deleted file mode 100644
index e85a03170d3..00000000000
--- a/mcs/class/corlib/System.Diagnostics/ChangeLog
+++ /dev/null
@@ -1,41 +0,0 @@
-2002-01-23 Duncan Mak <duncan@ximian.com>
-
- * DebuggerStepThroughAttribute.cs:
- * DebuggerHiddenAttribte.cs: Add to CVS.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * StackFrame.cs : Use the MonoTODO attribute to mark
- incomplete code.
-
- StackTrace.cs : Ditto.
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Moved TraceListener, TextWriterTraceListener, and
- DefaultTraceListener to System assembly....oops.
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
-
- * Added TextWriterTraceListener.cs, TraceListener.cs, and
- DefaultTraceListener.cs to the build.
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
-
- * Added Debugger.cs to the build.
-
-2001-09-02 Miguel de Icaza <miguel@ximian.com>
-
- * Moved BooleanSwitch, Switch, TraceLevel and TraceSwitch to the
- System assembly.
-
- * Added StackFrame.cs and StackTrace.cs to the build.
-
-2001-08-21 Nick Drochak <ndrochak@gol.com>
-
- * Implemented ConditionalAttribute.cs and DebuggableAttribute.cs
-
-2001-08-29 Alexander Klyubin <klyubin@aqris.com>
-
- * Skeletal implementation of StackFrame and StackTrace classes.
- The classes must be somehow connected to runtime environment in
- order to generate proper traces.
diff --git a/mcs/class/corlib/System.Diagnostics/ConditionalAttribute.cs b/mcs/class/corlib/System.Diagnostics/ConditionalAttribute.cs
deleted file mode 100644
index 1fd89a0f06d..00000000000
--- a/mcs/class/corlib/System.Diagnostics/ConditionalAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Collections.DebuggableAttribute.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-namespace System.Diagnostics
-{
-
- public sealed class ConditionalAttribute : System.Attribute
- {
-
- private string myCondition;
-
- // Public Instance Constructors
- public ConditionalAttribute(string conditionString)
- {
- myCondition = conditionString;
- }
-
- // Public Instance Properties
- public string ConditionString { get { return myCondition; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs b/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs
deleted file mode 100644
index 68d0958b04e..00000000000
--- a/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Collections.DebuggableAttribute.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-namespace System.Diagnostics {
-
- public sealed class DebuggableAttribute : System.Attribute {
-
- private bool JITTrackingEnabledFlag;
- private bool JITOptimizerDisabledFlag;
-
- // Public Instance Constructors
- public DebuggableAttribute(bool isJITTrackingEnabled, bool isJITOptimizerDisabled) {
- JITTrackingEnabledFlag = isJITTrackingEnabled;
- JITOptimizerDisabledFlag = isJITOptimizerDisabled;
- }
-
- // Public Instance Properties
- public bool IsJITTrackingEnabled { get { return JITTrackingEnabledFlag; } }
-
- public bool IsJITOptimizerDisabled { get { return JITOptimizerDisabledFlag; } }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/Debugger.cs b/mcs/class/corlib/System.Diagnostics/Debugger.cs
deleted file mode 100644
index 95669d9c675..00000000000
--- a/mcs/class/corlib/System.Diagnostics/Debugger.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// System.Diagnostics.Debugger.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-using System;
-
-namespace System.Diagnostics
-{
- /// <summary>
- /// Enables communication with a debugger.
- /// </summary>
- public sealed class Debugger
- {
- private static bool isAttached;
-
- /// <summary>
- /// Represents the default category of a message with a constant.
- /// </summary>
- public static readonly string DefaultCategory = "";
-
- /// <summary>
- /// Returns a Boolean indicating whether a debugger is attached to a process.
- /// </summary>
- /// <value>
- /// true if debugger is attached; otherwise, false.
- /// </value>
- public static bool IsAttached
- {
- get
- {
- return isAttached;
- }
- }
-
- /// <summary>
- /// Causes a breakpoint to be signaled to an attached debugger.
- /// </summary>
- public static void Break()
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Checks to see if logging is enabled by an attached debugger.
- /// </summary>
- public static bool IsLogging()
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Launches and attaches a debugger to the process.
- /// </summary>
- public static bool Launch()
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Posts a message for the attached debugger.
- /// </summary>
- /// <param name="level">
- /// A description of the importance of this message
- /// </param>
- /// <param name="category">
- /// A string describing the category of this message.
- /// </param>
- /// <param name="message">
- /// A string representing the message to show.
- /// </param>
- public static void Log(int level, string category, string message)
- {
- throw new NotImplementedException();
- }
-
- public Debugger()
- {
- isAttached = false;
-
- }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/DebuggerHiddenAttribute.cs b/mcs/class/corlib/System.Diagnostics/DebuggerHiddenAttribute.cs
deleted file mode 100644
index b57db27cb8b..00000000000
--- a/mcs/class/corlib/System.Diagnostics/DebuggerHiddenAttribute.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Diagnostics.DebuggerHiddenAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Diagnostics
-{
- [AttributeUsage (AttributeTargets.Constructor |
- AttributeTargets.Method | AttributeTargets.Property)]
- [Serializable]
- public sealed class DebuggerHiddenAttribute : Attribute
- {
- public DebuggerHiddenAttribute ()
- : base ()
- {
- }
- }
-}
-
-
diff --git a/mcs/class/corlib/System.Diagnostics/DebuggerStepThroughAttribute.cs b/mcs/class/corlib/System.Diagnostics/DebuggerStepThroughAttribute.cs
deleted file mode 100644
index 27d81891a1d..00000000000
--- a/mcs/class/corlib/System.Diagnostics/DebuggerStepThroughAttribute.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Diagnostics.DebuggerStepThroughAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Diagnostics
-{
- [AttributeUsage (AttributeTargets.Constructor |
- AttributeTargets.Method | AttributeTargets.Property)]
- [Serializable]
- public sealed class DebuggerStepThroughAttribute : Attribute
- {
- public DebuggerStepThroughAttribute ()
- : base ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/StackFrame.cs b/mcs/class/corlib/System.Diagnostics/StackFrame.cs
deleted file mode 100644
index 3482115fc69..00000000000
--- a/mcs/class/corlib/System.Diagnostics/StackFrame.cs
+++ /dev/null
@@ -1,315 +0,0 @@
-//
-// System.Diagnostics.StackFrame.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Reflection;
-
-namespace System.Diagnostics {
- /// <summary>
- /// Stack frame.
- /// TODO: more information.
- /// </summary>
- public class StackFrame {
- /// <value>
- /// Constant returned when the native or IL offset is unknown.
- /// </value>
- public const int OFFSET_UNKNOWN = -1;
-
- /// <value>
- /// Offset from the start of the IL code for the method
- /// being executed.
- /// </value>
- private int ilOffset = OFFSET_UNKNOWN;
-
- /// <value>
- /// Method associated with this stack frame.
- /// </value>
- private MethodBase methodBase;
-
- /// <value>
- /// File name.
- /// </value>
- private string fileName;
-
- /// <value>
- /// Line number.
- /// </value>
- private int lineNumber;
-
- /// <value>
- /// Column number.
- /// </value>
- private int columnNumber;
-
-
- /// <summary>
- /// Initializes a new StackFrame object corresponding to the
- /// active stack frame.
- /// </summary>
- public StackFrame() {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Initializes a new StackFrame object corresponding to the
- /// active stack frame.
- /// </summary>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackFrame(bool needFileInfo) : this() {
- if (needFileInfo) {
- PopulateFileInfo();
- }
- }
-
- /// <summary>
- /// Initializes a new StackFrame object corresponding to the
- /// active stack frame.
- /// </summary>
- /// <param name="skipFrames">
- /// The number of frames up the stack to skip.
- /// </param>
- public StackFrame(int skipFrames) {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Initializes a new StackFrame object corresponding to the
- /// active stack frame.
- /// </summary>
- /// <param name="skipFrames">
- /// The number of frames up the stack to skip.
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackFrame(int skipFrames, bool needFileInfo)
- : this(skipFrames) {
- if (needFileInfo) {
- PopulateFileInfo();
- }
- }
-
- /// <summary>
- /// Constructs a fake stack frame that just contains the
- /// given file name and line number. Use this constructor
- /// when you do not want to use the debugger's line mapping
- /// logic.
- /// </summary>
- /// <param name="fileName">
- /// The given file name.
- /// </param>
- /// <param name="lineNumber">
- /// The line number in the specified file.
- /// </param>
- public StackFrame(string fileName, int lineNumber)
- : this (fileName, lineNumber, 0) {}
-
- /// <summary>
- /// Constructs a fake stack frame that just contains the
- /// given file name and line number. Use this constructor
- /// when you do not want to use the debugger's line mapping
- /// logic.
- /// </summary>
- /// <param name="fileName">
- /// The given file name.
- /// </param>
- /// <param name="lineNumber">
- /// The line number in the specified file.
- /// </param>
- /// <param name="colNumber">
- /// The column number in the specified file.
- /// </param>
- public StackFrame(string fileName,
- int lineNumber,
- int colNumber) {
- this.methodBase = null;
- this.fileName = fileName;
- this.lineNumber = lineNumber;
- this.columnNumber = colNumber;
- }
-
-
- /// <summary>
- /// Gets the line number in the file containing the code
- /// being executed. This information is typically extracted
- /// from the debugging symbols for the executable.
- /// </summary>
- /// <returns>
- /// The file line number or zero if it cannot be determined.
- /// </returns>
- public virtual int GetFileLineNumber()
- {
- return lineNumber;
- }
-
- /// <summary>
- /// Gets the column number in the file containing the code
- /// being executed. This information is typically extracted
- /// from the debugging symbols for the executable.
- /// </summary>
- /// <returns>
- /// The file column number or zero if it cannot be determined.
- /// </returns>
- public virtual int GetFileColumnNumber()
- {
- return columnNumber;
- }
-
- /// <summary>
- /// Gets the file name containing the code being executed.
- /// This information is typically extracted from the
- /// debugging symbols for the executable.
- /// </summary>
- /// <returns>
- /// The file name or null if it cannot be determined.
- /// </returns>
- public virtual string GetFileName()
- {
- return fileName;
- }
-
- /// <summary>
- /// Gets the offset from the start of the IL code for the
- /// method being executed. This offset may be approximate
- /// depending on whether the JIT compiler is generating
- /// debugging code or not.
- /// </summary>
- /// <returns>
- /// The offset from the start of the IL code for the method
- /// being executed.
- /// </returns>
- public virtual int GetILOffset()
- {
- return ilOffset;
- }
-
- /// <summary>
- /// Gets the method in which the frame is executing.
- /// </summary>
- /// <returns>
- /// The method the frame is executing in.
- /// </returns>
- public virtual MethodBase GetMethod()
- {
- return methodBase;
- }
-
- /// <summary>
- /// Gets the offset from the start of the native
- /// (JIT-compiled) code for the method being executed.
- /// </summary>
- /// <returns>
- /// The offset from the start of the native (JIT-compiled)
- /// code or the method being executed.
- /// </returns>
- public virtual int GetNativeOffset()
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Builds a readable representation of the stack frame.
- /// </summary>
- /// <returns>
- /// A readable representation of the stack frame.
- /// </returns>
- public override string ToString() {
- string methodNameString =
- (GetMethod() == null)
- ? "<unknown method>"
- : GetMethod().Name;
- string offsetString =
- (GetILOffset() == OFFSET_UNKNOWN)
- ? "<unknown offset>"
- : "offset " + GetILOffset();
- string fileNameString =
- (GetFileName() == null)
- ? "<filename unknown>" : GetFileName();
- return methodNameString + " at " + offsetString
- + " in file:line:column " + fileNameString
- + ":" + GetFileLineNumber()
- + ":" + GetFileColumnNumber();
- }
-
- public override bool Equals(Object obj) {
- if ((obj == null) || (!(obj is StackFrame))) {
- return false;
- }
-
- StackFrame rhs = (StackFrame) obj;
-
- if (!ObjectsEqual(GetMethod(), rhs.GetMethod())) {
- return false;
- }
-
- if (!ObjectsEqual(GetFileName(), rhs.GetFileName())) {
- return false;
- }
-
- if (GetFileLineNumber() != rhs.GetFileLineNumber()) {
- return false;
- }
-
- if (GetFileColumnNumber() != rhs.GetFileColumnNumber()) {
- return false;
- }
-
- if (GetILOffset() != rhs.GetILOffset()) {
- return false;
- }
-
- if (GetNativeOffset() != rhs.GetNativeOffset()) {
- return false;
- }
-
- return true;
-
- }
-
- public override int GetHashCode() {
- return GetFileLineNumber();
- }
-
- /// <summary>
- /// Checks whether two objects are equal.
- /// The objects are assumed equal if and only if either
- /// both of the references are <code>null</code> or they
- /// equal via <code>Equals</code> method.
- /// </summary>
- /// <param name="obj1">
- /// First object.
- /// </param>
- /// <param name="obj2">
- /// Second object.
- /// </param>
- /// <returns>
- /// <code>true</code> if the two objects are equal,
- /// </code>false</code> otherwise.
- /// </returns>
- private static bool ObjectsEqual(Object obj1, Object obj2) {
- if (obj1 == null) {
- return (obj2 == null);
- } else {
- return obj1.Equals(obj2);
- }
- }
-
- /// <summary>
- /// Populates file information for this frame.
- /// </summary>
- [MonoTODO]
- private void PopulateFileInfo() {
- // TODO: Populate this.fileName, this.lineNumber and
- // this.columnNumber
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/StackTrace.cs b/mcs/class/corlib/System.Diagnostics/StackTrace.cs
deleted file mode 100644
index 50602fde6ee..00000000000
--- a/mcs/class/corlib/System.Diagnostics/StackTrace.cs
+++ /dev/null
@@ -1,290 +0,0 @@
-//
-// System.Diagnostics.StackTrace.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Reflection;
-using System.Threading;
-
-namespace System.Diagnostics {
- /// <summary>
- /// Stack trace.
- /// TODO: more information.
- /// </summary>
- public class StackTrace {
- /// <value>
- /// Uses a constant to define the number of methods that are
- /// to be omitted from the stack trace.
- /// </value>
- public const int METHODS_TO_SKIP = 0;
-
- /// <value>
- /// Frames. First frame is the last stack frame pushed.
- /// </value>
- private StackFrame[] frames;
-
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class.
- /// </summary>
- [MonoTODO]
- public StackTrace() {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class.
- /// </summary>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackTrace(bool needFileInfo) : this() {}
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class.
- /// </summary>
- /// <param name="e">
- /// TODO:
- /// </param>
- [MonoTODO]
- public StackTrace(Exception e) {
- throw new NotImplementedException();
- }
-
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class,
- /// using the provided exception object. The resulting stack
- /// trace describes the stack at the time of the exception.
- /// </summary>
- /// <param name="e">
- /// TODO:
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackTrace(Exception e, bool needFileInfo) : this(e) {}
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class,
- /// using the provided exception object. The resulting stack
- /// trace describes the stack at the time of the exception.
- /// </summary>
- /// <param name="e">
- /// Exception.
- /// </param>
- /// <param name="skipFrames">
- /// The number of frames up the stack to start the trace
- /// from.
- /// </param>
- [MonoTODO]
- public StackTrace(Exception e, int skipFrames) {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class,
- /// using the provided exception object. The resulting stack
- /// trace describes the stack at the time of the exception.
- /// </summary>
- /// <param name="e">
- /// Exception.
- /// </param>
- /// <param name="skipFrames">
- /// The number of frames up the stack to start the trace
- /// from.
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackTrace(Exception e, int skipFrames, bool needFileInfo)
- : this(e, skipFrames) {}
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class
- /// from the current location, in a caller's frame.
- /// </summary>
- /// <param name="skipFrames">
- /// The number of frames up the stack to start the trace
- /// from.
- /// </param>
- [MonoTODO]
- public StackTrace(int skipFrames) {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class
- /// containing a single frame.
- /// </summary>
- /// <param name="frame">
- /// The frame that the StackTrace object should contain.
- /// </param>
- public StackTrace(StackFrame frame) {
- this.frames = new StackFrame[1];
- this.frames[0] = frame;
- }
-
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class
- /// from the current location, in a caller's frame.
- /// </summary>
- /// <param name="skipFrames">
- /// The number of frames up the stack to start the trace
- /// from.
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackTrace(int skipFrames, bool needFileInfo)
- : this(skipFrames) {}
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class.
- /// </summary>
- /// <param name="targetThread">
- /// TODO:
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- [MonoTODO]
- public StackTrace(Thread targetThread, bool needFileInfo) {
- throw new NotImplementedException();
- }
-
-
-
- /// <summary>
- /// Holds the number of frames in the stack trace.
- /// </summary>
- public virtual int FrameCount {
- get {
- return (frames == null) ? 0 : frames.Length;
- }
- }
-
- /// <summary>
- /// Gets the specified stack frame.
- /// </summary>
- /// <param name="index">
- /// The index of the stack frame requested.
- /// </param>
- /// <returns>
- /// The specified stack frame. Returns <code>null</code> if
- /// frame with specified index does not exist in this stack
- /// trace.
- /// </returns>
- /// <remarks>
- /// Stack frames are numbered starting at zero, which is the
- /// last stack frame pushed.
- /// </remarks>
- public virtual StackFrame GetFrame(int index) {
- if ((index < 0) || (index >= FrameCount)) {
- return null;
- }
-
- return frames[index];
- }
-
- /// <summary>
- /// Builds a readable representation of the stack trace.
- /// </summary>
- /// <returns>
- /// A readable representation of the stack trace.
- /// </returns>
- public override string ToString() {
- string result = "";
- for (int i = 0; i < FrameCount; i++) {
- StackFrame frame = GetFrame(i);
- result += "\n\tat " + FrameToString(frame);
- }
-
- return result;
- }
-
- public override bool Equals(Object obj) {
- if ((obj == null) || (!(obj is StackTrace))) {
- return false;
- }
-
- StackTrace rhs = (StackTrace) obj;
-
- if (FrameCount != rhs.FrameCount) {
- return false;
- }
-
- for (int i = 0; i < FrameCount; i++) {
- if (!GetFrame(i).Equals(rhs.GetFrame(i))) {
- return false;
- }
- }
-
- return true;
- }
-
- public override int GetHashCode() {
- return FrameCount;
- }
-
- /// <summary>
- /// Converts single stack frame to string to be used in
- /// ToString method.
- /// </summary>
- /// <param name="frame">
- /// Frame to convert.
- /// </param>
- /// <returns>
- /// A readable representation of stack frame for using
- /// ToString.
- /// </returns>
- private static String FrameToString(StackFrame frame) {
- string locationInfo;
-
- if (frame.GetFileName() == null) {
- // File name not available
- locationInfo = "";
- } else {
- // File name available
- locationInfo = frame.GetFileName();
- if (frame.GetFileLineNumber() != 0) {
- // Line number information available
- locationInfo += ":line "
- + frame.GetFileLineNumber();
- if (frame.GetFileColumnNumber() != 0) {
- // Column number information available
- locationInfo += ":column"
- + frame.GetFileColumnNumber();
- }
- }
-
- }
-
- MethodBase method = frame.GetMethod();
- if (method != null) {
- // Method information available
- return method.DeclaringType.Name
- + "." + method.Name + "()"
- + ((locationInfo != null)
- ? " at " + locationInfo
- : "");
- } else {
- // Method information not available
- string methodInfo = "<unknown method>";
- if ("".Equals(locationInfo)) {
- // No location information available
- return methodInfo;
- }
-
- // Location information available
- return methodInfo + " at " + locationInfo;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/Calendar.cs b/mcs/class/corlib/System.Globalization/Calendar.cs
deleted file mode 100644
index f9c6fdfe4d8..00000000000
--- a/mcs/class/corlib/System.Globalization/Calendar.cs
+++ /dev/null
@@ -1,410 +0,0 @@
-// ::MONO
-//
-// System.Globalization.Calendar.cs
-//
-// Copyright (C) Wictor Wilén 2001 (wictor@iBizkit.se)
-//
-// Contributors: Marcel Narings, Wictor Wilén
-//
-// Revisions
-// 2001-09-14: First draft
-// 2001-09-15: First release
-//
-//
-// TODO: testing
-//
-//
-
-using System;
-
-namespace System.Globalization
-{
- /// <summary>
- /// Implmentation of the System.Globalization.Calendar class
- /// </summary>
- public abstract class Calendar
- {
- /// <summary>
- /// The Calendar Constructor
- /// </summary>
- protected Calendar ()
- {
- _MaxDateTime = DateTime.MaxValue;
- _MinDateTime = DateTime.MinValue;
- }
- [CLSCompliant(false)]
- protected int _TwoDigitYearMax;
-
- [CLSCompliant(false)]
- protected static int[] _DaysInMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
- [CLSCompliant(false)]
- protected static int[] _DaysInMonthLeap = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-
-
- // these can be overridden, for example using "new protected const int _MinYear = 1;"
- [CLSCompliant(false)]
- protected const int _MinYear = 1;
- [CLSCompliant(false)]
- protected const int _MaxYear = 9999;
- [CLSCompliant(false)]
- protected const int _MinDay = 0;
- [CLSCompliant(false)]
- protected const int _MinMonth = 1;
- [CLSCompliant(false)]
- protected const int _MaxMonth = 12;
- [CLSCompliant(false)]
- protected const int _MinHour = 0;
- [CLSCompliant(false)]
- protected const int _MaxHour = 23;
- [CLSCompliant(false)]
- protected const int _MinMinute = 0;
- [CLSCompliant(false)]
- protected const int _MaxMinute = 59;
- [CLSCompliant(false)]
- protected const int _MinSecond = 0;
- [CLSCompliant(false)]
- protected const int _MaxSecond = 59;
- [CLSCompliant(false)]
- protected const int _MinMillisecond = 0;
- [CLSCompliant(false)]
- protected const int _MaxMillisecond = 999;
-
- [CLSCompliant(false)]
- private const long _TicksPerMillisecond = 10000;
- [CLSCompliant(false)]
- private const long _TicksPerSecond = 10000000;
- [CLSCompliant(false)]
- private const long _TicksPerMinute = 600000000;
- [CLSCompliant(false)]
- private const long _TicksPerHour = 36000000000;
- [CLSCompliant(false)]
- private const long _TicksPerDay = 864000000000;
- [CLSCompliant(false)]
- private const long _TicksPerWeek = 6048000000000;
-
- [CLSCompliant(false)]
- protected DateTime _MaxDateTime;
- [CLSCompliant(false)]
- protected DateTime _MinDateTime;
-
-
- /// <summary>
- /// The Currentera constant
- /// </summary>
- public const int CurrentEra = 0;
-
- /// <summary>
- /// Returns an array of the available eras
- /// </summary>
- public abstract int[] Eras {get;}
-
- // DONE!
- /// <summary>
- /// The Two digit max
- /// </summary>
- public virtual int TwoDigitYearMax
- {
- get
- {
- return _TwoDigitYearMax;
- }
- set
- {
- _TwoDigitYearMax = value;
- }
- }
-
- // DONE!
- public virtual DateTime AddDays ( DateTime time, int days )
- {
- return new DateTime(time.Ticks).AddTicks(_TicksPerDay*days);
- }
-
- // DONE!
- public virtual DateTime AddHours ( DateTime time, int hours )
- {
- return new DateTime(time.Ticks).AddTicks(_TicksPerHour*hours);
- }
-
- // DONE!
- public virtual DateTime AddMilliseconds ( DateTime time, double milliseconds )
- {
- DateTime t = new DateTime(time.Ticks);
- return t.AddMilliseconds(milliseconds);
- }
-
- // DONE!
- public virtual DateTime AddMinutes ( DateTime time, int minutes )
- {
- return new DateTime(time.Ticks).AddTicks(_TicksPerMinute * minutes);
- }
-
- // DONE!
- /// <summary>
- /// Returns a DateTime that is the specified number of months away from the specified DateTime
- /// </summary>
- /// <param name="time"></param>
- /// <param name="months"></param>
- /// <returns></returns>
- /// <remarks>Calculates correct comapared to .NET Beta 2</remarks>
- public virtual DateTime AddMonths ( DateTime time, int months )
- {
- DateTime t = new DateTime(time.Ticks);
- return t.AddMonths(months);
- }
-
- // DONE!
- public virtual DateTime AddSeconds ( DateTime time, int seconds )
- {
- return new DateTime(time.Ticks).AddTicks(_TicksPerSecond * seconds);
- }
-
- // DONE!
- public virtual DateTime AddWeeks ( DateTime time, int weeks )
- {
- return new DateTime(time.Ticks).AddTicks(_TicksPerWeek * weeks);
- }
-
- // DONE!
- public virtual DateTime AddYears ( DateTime time, int years )
- {
- DateTime t = new DateTime(time.Ticks);
- return t.AddYears(years);
- }
-
-
-
- // DONE!
- public abstract int GetDayOfMonth ( DateTime time );
-
- // DONE!
- public abstract DayOfWeek GetDayOfWeek ( DateTime time );
-
- // DONE!
- public abstract int GetDayOfYear ( DateTime time );
-
- // DONE!
- public virtual int GetDaysInMonth ( int year, int month )
- {
- if(year < _MinYear || year > _MaxYear || month < _MinMonth || month > _MaxMonth)
- throw new System.ArgumentOutOfRangeException();
-
- if(this.IsLeapYear(year))
- return _DaysInMonthLeap[month];
- else
- return _DaysInMonth[month];
- }
-
- // DONE!
- public abstract int GetDaysInMonth ( int year, int month, int era );
-
- // DONE!
- public virtual int GetDaysInYear ( int year)
- {
- if( year < _MinYear || year > _MaxYear)
- throw new System.ArgumentOutOfRangeException();
-
- if(this.IsLeapYear(year))
- return 366;
- else
- return 365;
- }
-
- // DONE!
- public abstract int GetDaysInYear ( int year, int era );
-
- // DONE!
- public abstract int GetEra ( DateTime time );
-
- // DONE!
- public virtual int GetHour ( DateTime time )
- {
- return time.Hour;
- }
- // DONE!
- public virtual double GetMilliseconds ( DateTime time )
- {
- return time.Millisecond;
- }
- // DONE!
- public virtual int GetMinute ( DateTime time )
- {
- return time.Minute;
- }
-
- // DONE!
- public abstract int GetMonth ( DateTime time );
-
- // DONE!
- public virtual int GetMonthsInYear ( int year )
- {
- if( year < _MinYear || year > _MaxYear)
- throw new System.ArgumentException();
-
- return _MaxMonth;
- }
-
- // DONE!
- public abstract int GetMonthsInYear ( int year, int era );
-
- // DONE!
- public virtual int GetSecond ( DateTime time )
- {
- return time.Second;
- }
-
- // DONE!
- /// <summary>
- /// Gets the week of the year that includes the date in the specified DateTime
- /// </summary>
- /// <param name="time"></param>
- /// <param name="rule"></param>
- /// <param name="firstDayOfWeek"></param>
- /// <returns></returns>
- /// <remarks>.NET beta 2 calculates this erroneous, but this one is ok(? I think...)</remarks>
- public virtual int GetWeekOfYear ( DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek )
- {
- if( firstDayOfWeek < DayOfWeek.Sunday || firstDayOfWeek > DayOfWeek.Saturday)
- throw new System.ArgumentOutOfRangeException();
-
- int week;
- int days = 0;
-
- int[] dim;
- if(this.IsLeapYear(time.Year))
- dim = _DaysInMonthLeap;
- else
- dim = _DaysInMonth;
-
- DateTime jan1 = new DateTime(time.Year, 1, 1);
-
- for( int i = 0; i < time.Month-1; i++)
- days += dim[i];
- days += time.Day;
-
- switch(rule)
- {
- case CalendarWeekRule.FirstDay:
- while(jan1.DayOfWeek != firstDayOfWeek)
- {
- days--;
- jan1 = jan1.AddTicks(_TicksPerDay);
- }
- break;
- case CalendarWeekRule.FirstFourDayWeek:
- while(jan1.DayOfWeek < firstDayOfWeek)
- {
- days--;
- jan1 = jan1.AddTicks(_TicksPerDay);
- }
- break;
- case CalendarWeekRule.FirstFullWeek:
- if(jan1.DayOfWeek != firstDayOfWeek)
- {
- do
- {
- days--;
- jan1 = jan1.AddTicks(_TicksPerDay);
- }
- while(jan1.DayOfWeek != firstDayOfWeek);
- }
- break;
- default:
- throw new System.ArgumentOutOfRangeException();
- }
-
- if(days <= 0)
- week = GetWeekOfYear(new DateTime(time.Year-1,12,31), rule, firstDayOfWeek);
- else
- week = (--days / 7) + 1;
-
- return week;
- }
-
- // DONE!
- public abstract int GetYear ( DateTime time );
-
- // DONE!
- // TODO: verify this for the Calendar Class
- public virtual bool IsLeapDay ( int year, int month, int day )
- {
- int dim;
-
- if(day < _MinDay || month < _MinMonth || month > _MaxMonth)
- throw new System.ArgumentOutOfRangeException();
-
- if(this.IsLeapYear(year))
- dim = _DaysInMonthLeap[month-1];
- else
- dim = _DaysInMonth[month-1];
-
- if( day > dim)
- throw new System.ArgumentOutOfRangeException();
-
- if( month == 2 && day == 29)
- return true;
-
- return false;
- }
-
- // DONE!
- public abstract bool IsLeapDay ( int year, int month, int day, int era );
-
- // DONE!
- public virtual bool IsLeapMonth ( int year, int month )
- {
- if( year < _MinYear || year > _MaxYear || month < _MinMonth || month > _MaxMonth)
- throw new System.ArgumentOutOfRangeException();
-
- if(this.IsLeapYear(year))
- {
- return true;
- }
- else
- return false;
- }
-
- // DONE!
- public abstract bool IsLeapMonth ( int year, int month, int era );
-
- public virtual bool IsLeapYear ( int year )
- {
- if(year < _MinYear || year > _MaxYear )
- throw new System.ArgumentOutOfRangeException();
- if(year % 4 == 0) // TODO: verify this for the Calendar class!
- return true;
- return false;
- }
-
- // DONE!
- public abstract bool IsLeapYear ( int year, int era );
-
- // DONE!
- public virtual DateTime ToDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond )
- {
- int dim;
- dim = GetDaysInMonth(year,month);
- if( day < _MinDay || day > dim ||
- hour < _MinHour || hour > _MaxHour ||
- minute < _MinMinute || minute > _MaxMinute ||
- second < _MinSecond || second > _MaxSecond ||
- millisecond < _MinMillisecond || millisecond > _MaxMillisecond)
- throw new System.ArgumentOutOfRangeException();
-
- return new DateTime(year,month,day,hour,minute,second,millisecond,this);
- }
-
- // DONE!
- public abstract DateTime ToDateTime ( int year, int month, int date, int hour, int minute, int second, int millisecond, int era );
-
- // DONE!
- public virtual int ToFourDigitYear ( int year )
- {
- int i = year - ( _TwoDigitYearMax % 100 );
- if( year > 0 )
- return _TwoDigitYearMax - 100 + year;
- else
- return _TwoDigitYearMax + year;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/CalendarWeekRule.cs b/mcs/class/corlib/System.Globalization/CalendarWeekRule.cs
deleted file mode 100644
index 936a56e8469..00000000000
--- a/mcs/class/corlib/System.Globalization/CalendarWeekRule.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// ::MONO
-//
-// System.Globalization.CalendarWeekRule.cs
-//
-// Copyright (C) Wictor Wilén 2001 (wictor@iBizkit.se)
-//
-// Contributors: Wictor Wilén
-//
-// Revisions
-// 2001-09-14: First draft
-// 2001-09-15: First release
-
-using System;
-
-namespace System.Globalization
-{
- /// <summary>
- /// The System.Globalization.CalendarWeekRule enumeration
- /// </summary>
- public enum CalendarWeekRule
- {
- FirstDay = 0,
- FirstFullWeek = 1,
- FirstFourDayWeek = 2
-
- }
-
-}
diff --git a/mcs/class/corlib/System.Globalization/ChangeLog b/mcs/class/corlib/System.Globalization/ChangeLog
deleted file mode 100644
index a3126b2a3c1..00000000000
--- a/mcs/class/corlib/System.Globalization/ChangeLog
+++ /dev/null
@@ -1,74 +0,0 @@
-2002-02-12 Duncan Mak <duncan@ximian.com>
-
- * CultureInfo.cs: Added the Calendar property to make the TimeZone
- class build. It's marked as MonoTODO.
-
-2002-02-12 Nick Drochak <ndrochak@gol.com>
-
- * UnicodeCategory.cs: Fix typo.
-
-2002-02-01 Radek Doulik <rodo@ximian.com>
-
- * RegionInfo.cs: started work on RegionInfo
- implemented RegionInfo (string) constructor
-
- * CultureInfo.cs: added internal static function,
- which could be used from RegionInfo.cs
-
-2002-01-16 Miguel de Icaza <miguel@ximian.com>
-
- * CultureInfo.cs: Completed the tables. Now we need to actually
- fill it in.
-
-2002-01-15 Duncan Mak <duncan@ximian.com>
-
- * CultureInfo.cs: Convert it to unix text.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * GreogrianCalendar.cs : The same old MonoTODO attribute.
-
-2001-11-21 Miguel de Icaza <miguel@ximian.com>
-
- * Locale.cs: New file, a place holder for Locale.GetText.
-
-Wed Nov 14 16:47:07 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Calendar.cs: CLSCompliant updates.
-
-2001-11-04 Martin Weindel <martin.weindel@t-online.de>
- * NumberFormatInfo.cs: fixed minor bug in Clone with readonly flag
-
- * DateTimeFormatInfo.cs: added
-
- * CultureInfo.cs: some changed needed for compiling DateTimeFormatInfo.cs
-
-2001-10-26 Miguel de Icaza <miguel@ximian.com>
-
- * NumberFormatInfo.cs: Provide an internal constructor that takes
- as an argument a CultureInfo ID (LCID) so that we can construct
- different ones here.
-
- * CultureInfo.cs: Begun implementation.
-
-2001-10-09 Derek Holden <dholden@draper.com>
-
- * NumberFormatInfo.cs: Small typo in PercentPositivePattern
- and CurrencyPositivePattern
-
-2001-09-02 Miguel de Icaza <miguel@ximian.com>
-
- * Calendar.cs: Implement a bunch of missing features.
-
-2001-07-24 Derek Holden <dholden@draper.com>
-
- * NumberStyles.cs: Added ECMA values for Allow types and default
- styles.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * DateTimeStyles.cs, NumberStyles.cs: Add.
-
-2001-07-06 Joe Shaw <joe@ximian.com>
-
- * UnicodeCategory.cs: Added.
diff --git a/mcs/class/corlib/System.Globalization/CompareOptions.cs b/mcs/class/corlib/System.Globalization/CompareOptions.cs
deleted file mode 100755
index 88dd0fde81b..00000000000
--- a/mcs/class/corlib/System.Globalization/CompareOptions.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// CompareOptions.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:34:52 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Globalization {
-
-
- /// <summary>
- /// </summary>
- public enum CompareOptions {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- IgnoreCase = 1,
-
- /// <summary>
- /// </summary>
- IgnoreNonSpace = 2,
-
- /// <summary>
- /// </summary>
- IgnoreSymbols = 4,
-
- /// <summary>
- /// </summary>
- IgnoreKanaType = 8,
-
- /// <summary>
- /// </summary>
- IgnoreWidth = 16,
-
- /// <summary>
- /// </summary>
- StringSort = 536870912,
-
- /// <summary>
- /// </summary>
- Ordinal = 1073741824,
- } // CompareOptions
-
-} // System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/CultureInfo.cs b/mcs/class/corlib/System.Globalization/CultureInfo.cs
deleted file mode 100644
index b065280bd0f..00000000000
--- a/mcs/class/corlib/System.Globalization/CultureInfo.cs
+++ /dev/null
@@ -1,849 +0,0 @@
-//
-// System.Globalization.CultureInfo
-//
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. 2001 (http://www.ximian.com)
-//
-
-using System.Threading;
-
-namespace System.Globalization
-{
- public class CultureInfo : IFormatProvider
- {
- static CultureInfo invariant_culture_info;
- bool is_read_only;
- int lcid;
- bool use_user_override;
- NumberFormatInfo number_format;
- DateTimeFormatInfo datetime_format;
-
- private static readonly string MSG_READONLY = "This instance is read only";
-
- // <summary>
- // Returns the Invariant Culture Information ("iv")
- // </summary>
- static public CultureInfo InvariantCulture {
- get {
- if (invariant_culture_info != null)
- return invariant_culture_info;
-
- invariant_culture_info = new CultureInfo (0x07f, false);
- invariant_culture_info.is_read_only = true;
-
- return invariant_culture_info;
- }
- }
-
- //
- // Initializes the CultureInfo object for the specific culture_id
- //
- void InitializeByID (int culture_id, bool use_user_override)
- {
- switch (culture_id){
- case 0x0001: // ar Arabic
- case 0x0401: // ar-SA Arabic (Saudi Arabia)
- case 0x0801: // ar-IQ Arabic (Iraq)
- case 0x0C01: // ar-EG Arabic (Egypt)
- case 0x1001: // ar-LY Arabic (Libya)
- case 0x1401: // ar-DZ Arabic (Algeria)
- case 0x1801: // ar-MA Arabic (Morocco)
- case 0x1C01: // ar-TN Arabic (Tunisia)
- case 0x2001: // ar-OM Arabic (Oman)
- case 0x2401: // ar-YE Arabic (Yemen)
- case 0x2801: // ar-SY Arabic (Syria)
- case 0x2C01: // ar-JO Arabic (Jordan)
- case 0x3001: // ar-LB Arabic (Lebanon)
- case 0x3401: // ar-KW Arabic (Kuwait)
- case 0x3801: // ar-AE Arabic (U.A.E.)
- case 0x3C01: // ar-BH Arabic (Bahrain)
- case 0x4001: // ar-QA Arabic (Qatar)
- case 0x0002: // bg Bulgarian
- case 0x0402: // bg-BG Bulgarian (Bulgaria)
- case 0x0003: // ca Catalan
- case 0x0403: // ca-ES Catalan (Spain)
- case 0x0004: // zh-CHS Chinese (Simplified)
- case 0x0404: // zh-TW Chinese (Taiwan)
- case 0x0804: // zh-CN Chinese (People's Republic of China)
- case 0x0C04: // zh-HK Chinese (Hong Kong S.A.R.)
- case 0x1004: // zh-SG Chinese (Singapore)
- case 0x1404: // zh-MO Chinese (Macau S.A.R.)
- case 0x7C04: // zh-CHT Chinese (Traditional)
- case 0x0005: // cs Czech
- case 0x0405: // cs-CZ Czech (Czech Republic)
- case 0x0006: // da Danish
- case 0x0406: // da-DK Danish (Denmark)
- case 0x0007: // de German
- case 0x0407: // de-DE German (Germany)
- case 0x0807: // de-CH German (Switzerland)
- case 0x0C07: // de-AT German (Austria)
- case 0x1007: // de-LU German (Luxembourg)
- case 0x1407: // de-LI German (Liechtenstein)
- case 0x0008: // el Greek
- case 0x0408: // el-GR Greek (Greece)
- case 0x0009: // en English
- case 0x0409: // en-US English (United States)
- case 0x0809: // en-GB English (United Kingdom)
- case 0x0C09: // en-AU English (Australia)
- case 0x1009: // en-CA English (Canada)
- case 0x1409: // en-NZ English (New Zealand)
- case 0x1809: // en-IE English (Ireland)
- case 0x1C09: // en-ZA English (South Africa)
- case 0x2009: // en-JM English (Jamaica)
- case 0x2409: // en-CB English (Caribbean)
- case 0x2809: // en-BZ English (Belize)
- case 0x2C09: // en-TT English (Trinidad and Tobago)
- case 0x3009: // en-ZW English (Zimbabwe)
- case 0x3409: // en-PH English (Republic of the Philippines)
- case 0x000A: // es Spanish
- case 0x080A: // es-MX Spanish (Mexico)
- case 0x0C0A: // es-ES Spanish (Spain)
- case 0x100A: // es-GT Spanish (Guatemala)
- case 0x140A: // es-CR Spanish (Costa Rica)
- case 0x180A: // es-PA Spanish (Panama)
- case 0x1C0A: // es-DO Spanish (Dominican Republic)
- case 0x200A: // es-VE Spanish (Venezuela)
- case 0x240A: // es-CO Spanish (Colombia)
- case 0x280A: // es-PE Spanish (Peru)
- case 0x2C0A: // es-AR Spanish (Argentina)
- case 0x300A: // es-EC Spanish (Ecuador)
- case 0x340A: // es-CL Spanish (Chile)
- case 0x380A: // es-UY Spanish (Uruguay)
- case 0x3C0A: // es-PY Spanish (Paraguay)
- case 0x400A: // es-BO Spanish (Bolivia)
- case 0x440A: // es-SV Spanish (El Salvador)
- case 0x480A: // es-HN Spanish (Honduras)
- case 0x4C0A: // es-NI Spanish (Nicaragua)
- case 0x500A: // es-PR Spanish (Puerto Rico)
- case 0x000B: // fi Finnish
- case 0x040B: // fi-FI Finnish (Finland)
- case 0x000C: // fr French
- case 0x040C: // fr-FR French (France)
- case 0x080C: // fr-BE French (Belgium)
- case 0x0C0C: // fr-CA French (Canada)
- case 0x100C: // fr-CH French (Switzerland)
- case 0x140C: // fr-LU French (Luxembourg)
- case 0x180C: // fr-MC French (Principality of Monaco)
- case 0x000D: // he Hebrew
- case 0x040D: // he-IL Hebrew (Israel)
- case 0x000E: // hu Hungarian
- case 0x040E: // hu-HU Hungarian (Hungary)
- case 0x000F: // is Icelandic
- case 0x040F: // is-IS Icelandic (Iceland)
- case 0x0010: // it Italian
- case 0x0410: // it-IT Italian (Italy)
- case 0x0810: // it-CH Italian (Switzerland)
- case 0x0011: // ja Japanese
- case 0x0411: // ja-JP Japanese (Japan)
- case 0x0012: // ko Korean
- case 0x0412: // ko-KR Korean (Korea)
- case 0x0013: // nl Dutch
- case 0x0413: // nl-NL Dutch (Netherlands)
- case 0x0813: // nl-BE Dutch (Belgium)
- case 0x0014: // no Norwegian
- case 0x0414: // nb-NO Norwegian (Bokmål) (Norway)
- case 0x0814: // nn-NO Norwegian (Nynorsk) (Norway)
- case 0x0015: // pl Polish
- case 0x0415: // pl-PL Polish (Poland)
- case 0x0016: // pt Portuguese
- case 0x0416: // pt-BR Portuguese (Brazil)
- case 0x0816: // pt-PT Portuguese (Portugal)
- case 0x0018: // ro Romanian
- case 0x0418: // ro-RO Romanian (Romania)
- case 0x0019: // ru Russian
- case 0x0419: // ru-RU Russian (Russia)
- case 0x001A: // hr Croatian
- case 0x041A: // hr-HR Croatian (Croatia)
- case 0x081A: // Lt-sr-SP Serbian (Latin) (Serbia)
- case 0x0C1A: // Cy-sr-SP Serbian (Cyrillic) (Serbia)
- case 0x001B: // sk Slovak
- case 0x041B: // sk-SK Slovak (Slovakia)
- case 0x001C: // sq Albanian
- case 0x041C: // sq-AL Albanian (Albania)
- case 0x001D: // sv Swedish
- case 0x041D: // sv-SE Swedish (Sweden)
- case 0x081D: // sv-FI Swedish (Finland)
- case 0x001E: // th Thai
- case 0x041E: // th-TH Thai (Thailand)
- case 0x001F: // tr Turkish
- case 0x041F: // tr-TR Turkish (Turkey)
- case 0x0020: // ur Urdu
- case 0x0420: // ur-PK Urdu (Islamic Republic of Pakistan)
- case 0x0021: // id Indonesian
- case 0x0421: // id-ID Indonesian (Indonesia)
- case 0x0022: // uk Ukrainian
- case 0x0422: // uk-UA Ukrainian (Ukraine)
- case 0x0023: // be Belarusian
- case 0x0423: // be-BY Belarusian (Belarus)
- case 0x0024: // sl Slovenian
- case 0x0424: // sl-SI Slovenian (Slovenia)
- case 0x0025: // et Estonian
- case 0x0425: // et-EE Estonian (Estonia)
- case 0x0026: // lv Latvian
- case 0x0426: // lv-LV Latvian (Latvia)
- case 0x0027: // lt Lithuanian
- case 0x0427: // lt-LT Lithuanian (Lithuania)
- case 0x0029: // fa Farsi
- case 0x0429: // fa-IR Farsi (Iran)
- case 0x002A: // vi Vietnamese
- case 0x042A: // vi-VN Vietnamese (Viet Nam)
- case 0x002B: // hy Armenian
- case 0x042B: // hy-AM Armenian (Armenia)
- case 0x002C: // az Azeri
- case 0x042C: // Lt-az-AZ Azeri (Latin) (Azerbaijan)
- case 0x082C: // Cy-az-AZ Azeri (Cyrillic) (Azerbaijan)
- case 0x002D: // eu Basque
- case 0x042D: // eu-ES Basque (Spain)
- case 0x002F: // mk FYRO Macedonian
- case 0x042F: // mk-MK FYRO Macedonian (Former Yugoslav Republic of Macedonia)
- case 0x0036: // af Afrikaans
- case 0x0436: // af-ZA Afrikaans (South Africa)
- case 0x0037: // ka Georgian
- case 0x0437: // ka-GE Georgian (Georgia)
- case 0x0038: // fo Faeroese
- case 0x0438: // fo-FO Faeroese (Faeroe Islands)
- case 0x0039: // hi Hindi
- case 0x0439: // hi-IN Hindi (India)
- case 0x003E: // ms Malay
- case 0x043E: // ms-MY Malay (Malaysia)
- case 0x083E: // ms-BN Malay (Brunei Darussalam)
- case 0x003F: // kk Kazakh
- case 0x043F: // kk-KZ Kazakh (Kazakhstan)
- case 0x0040: // ky Kyrgyz
- case 0x0440: // ky-KZ Kyrgyz (Kyrgyzstan)
- case 0x0041: // sw Swahili
- case 0x0441: // sw-KE Swahili (Kenya)
- case 0x0043: // uz Uzbek
- case 0x0443: // Lt-uz-UZ Uzbek (Latin) (Uzbekistan)
- case 0x0843: // Cy-uz-UZ Uzbek (Cyrillic) (Uzbekistan)
- case 0x0044: // tt Tatar
- case 0x0444: // tt-TA Tatar (Tatarstan)
- case 0x0046: // pa Punjabi
- case 0x0446: // pa-IN Punjabi (India)
- case 0x0047: // gu Gujarati
- case 0x0447: // gu-IN Gujarati (India)
- case 0x0049: // ta Tamil
- case 0x0449: // ta-IN Tamil (India)
- case 0x004A: // te Telugu
- case 0x044A: // te-IN Telugu (India)
- case 0x004B: // kn Kannada
- case 0x044B: // kn-IN Kannada (India)
- case 0x004E: // mr Marathi
- case 0x044E: // mr-IN Marathi (India)
- case 0x004F: // sa Sanskrit
- case 0x044F: // sa-IN Sanskrit (India)
- case 0x0050: // mn Mongolian
- case 0x0450: // mn-MN Mongolian (Mongolia)
- case 0x0056: // gl Galician
- case 0x0456: // gl-ES Galician (Spain)
- case 0x0057: // kok Konkani
- case 0x0457: // kok-IN Konkani (India)
- case 0x005A: // syr Syriac
- case 0x045A: // syr-SY Syriac (Syria)
- case 0x0065: // div Divehi
- case 0x0465: // div-MV Divehi (Maldives)
- case 0x007F: // Invariant Language (Invariant Country)
- break;
-
- default:
- throw new ArgumentException ("CultureInfoCode");
- }
- lcid = culture_id;
- this.use_user_override = use_user_override;
- }
-
- //
- // Maps a name to a culture id
- //
- static int NameToID (string name)
- {
- switch (name){
- case "ar":
- return 0x0001;
- case "ar-SA":
- return 0x0401;
- case "ar-IQ":
- return 0x0801;
- case "ar-EG":
- return 0x0C01;
- case "ar-LY":
- return 0x1001;
- case "ar-DZ":
- return 0x1401;
- case "ar-MA":
- return 0x1801;
- case "ar-TN":
- return 0x1C01;
- case "ar-OM":
- return 0x2001;
- case "ar-YE":
- return 0x2401;
- case "ar-SY":
- return 0x2801;
- case "ar-JO":
- return 0x2C01;
- case "ar-LB":
- return 0x3001;
- case "ar-KW":
- return 0x3401;
- case "ar-AE":
- return 0x3801;
- case "ar-BH":
- return 0x3C01;
- case "ar-QA":
- return 0x4001;
- case "bg":
- return 0x0002;
- case "bg-BG":
- return 0x0402;
- case "ca":
- return 0x0003;
- case "ca-ES":
- return 0x0403;
- case "zh-CHS":
- return 0x0004;
- case "zh-TW":
- return 0x0404;
- case "zh-CN":
- return 0x0804;
- case "zh-HK":
- return 0x0C04;
- case "zh-SG":
- return 0x1004;
- case "zh-MO":
- return 0x1404;
- case "zh-CHT":
- return 0x7C04;
- case "cs":
- return 0x0005;
- case "cs-CZ":
- return 0x0405;
- case "da":
- return 0x0006;
- case "da-DK":
- return 0x0406;
- case "de":
- return 0x0007;
- case "de-DE":
- return 0x0407;
- case "de-CH":
- return 0x0807;
- case "de-AT":
- return 0x0C07;
- case "de-LU":
- return 0x1007;
- case "de-LI":
- return 0x1407;
- case "el":
- return 0x0008;
- case "el-GR":
- return 0x0408;
- case "en":
- return 0x0009;
- case "en-US":
- return 0x0409;
- case "en-GB":
- return 0x0809;
- case "en-AU":
- return 0x0C09;
- case "en-CA":
- return 0x1009;
- case "en-NZ":
- return 0x1409;
- case "en-IE":
- return 0x1809;
- case "en-ZA":
- return 0x1C09;
- case "en-JM":
- return 0x2009;
- case "en-CB":
- return 0x2409;
- case "en-BZ":
- return 0x2809;
- case "en-TT":
- return 0x2C09;
- case "en-ZW":
- return 0x3009;
- case "en-PH":
- return 0x3409;
- case "es":
- return 0x000A;
- case "es-MX":
- return 0x080A;
- case "es-ES":
- return 0x0C0A;
- case "es-GT":
- return 0x100A;
- case "es-CR":
- return 0x140A;
- case "es-PA":
- return 0x180A;
- case "es-DO":
- return 0x1C0A;
- case "es-VE":
- return 0x200A;
- case "es-CO":
- return 0x240A;
- case "es-PE":
- return 0x280A;
- case "es-AR":
- return 0x2C0A;
- case "es-EC":
- return 0x300A;
- case "es-CL":
- return 0x340A;
- case "es-UY":
- return 0x380A;
- case "es-PY":
- return 0x3C0A;
- case "es-BO":
- return 0x400A;
- case "es-SV":
- return 0x440A;
- case "es-HN":
- return 0x480A;
- case "es-NI":
- return 0x4C0A;
- case "es-PR":
- return 0x500A;
- case "fi":
- return 0x000B;
- case "fi-FI":
- return 0x040B;
- case "fr":
- return 0x000C;
- case "fr-FR":
- return 0x040C;
- case "fr-BE":
- return 0x080C;
- case "fr-CA":
- return 0x0C0C;
- case "fr-CH":
- return 0x100C;
- case "fr-LU":
- return 0x140C;
- case "fr-MC":
- return 0x180C;
- case "he":
- return 0x000D;
- case "he-IL":
- return 0x040D;
- case "hu":
- return 0x000E;
- case "hu-HU":
- return 0x040E;
- case "is":
- return 0x000F;
- case "is-IS":
- return 0x040F;
- case "it":
- return 0x0010;
- case "it-IT":
- return 0x0410;
- case "it-CH":
- return 0x0810;
- case "ja":
- return 0x0011;
- case "ja-JP":
- return 0x0411;
- case "ko":
- return 0x0012;
- case "ko-KR":
- return 0x0412;
- case "nl":
- return 0x0013;
- case "nl-NL":
- return 0x0413;
- case "nl-BE":
- return 0x0813;
- case "no":
- return 0x0014;
- case "nb-NO":
- return 0x0414;
- case "nn-NO":
- return 0x0814;
- case "pl":
- return 0x0015;
- case "pl-PL":
- return 0x0415;
- case "pt":
- return 0x0016;
- case "pt-BR":
- return 0x0416;
- case "pt-PT":
- return 0x0816;
- case "ro":
- return 0x0018;
- case "ro-RO":
- return 0x0418;
- case "ru":
- return 0x0019;
- case "ru-RU":
- return 0x0419;
- case "hr":
- return 0x001A;
- case "hr-HR":
- return 0x041A;
- case "Lt-sr-SP":
- return 0x081A;
- case "Cy-sr-SP":
- return 0x0C1A;
- case "sk":
- return 0x001B;
- case "sk-SK":
- return 0x041B;
- case "sq":
- return 0x001C;
- case "sq-AL":
- return 0x041C;
- case "sv":
- return 0x001D;
- case "sv-SE":
- return 0x041D;
- case "sv-FI":
- return 0x081D;
- case "th":
- return 0x001E;
- case "th-TH":
- return 0x041E;
- case "tr":
- return 0x001F;
- case "tr-TR":
- return 0x041F;
- case "ur":
- return 0x0020;
- case "ur-PK":
- return 0x0420;
- case "id":
- return 0x0021;
- case "id-ID":
- return 0x0421;
- case "uk":
- return 0x0022;
- case "uk-UA":
- return 0x0422;
- case "be":
- return 0x0023;
- case "be-BY":
- return 0x0423;
- case "sl":
- return 0x0024;
- case "sl-SI":
- return 0x0424;
- case "et":
- return 0x0025;
- case "et-EE":
- return 0x0425;
- case "lv":
- return 0x0026;
- case "lv-LV":
- return 0x0426;
- case "lt":
- return 0x0027;
- case "lt-LT":
- return 0x0427;
- case "fa":
- return 0x0029;
- case "fa-IR":
- return 0x0429;
- case "vi":
- return 0x002A;
- case "vi-VN":
- return 0x042A;
- case "hy":
- return 0x002B;
- case "hy-AM":
- return 0x042B;
- case "az":
- return 0x002C;
- case "Lt-az-AZ":
- return 0x042C;
- case "Cy-az-AZ":
- return 0x082C;
- case "eu":
- return 0x002D;
- case "eu-ES":
- return 0x042D;
- case "mk":
- return 0x002F;
- case "mk-MK":
- return 0x042F;
- case "af":
- return 0x0036;
- case "af-ZA":
- return 0x0436;
- case "ka":
- return 0x0037;
- case "ka-GE":
- return 0x0437;
- case "fo":
- return 0x0038;
- case "fo-FO":
- return 0x0438;
- case "hi":
- return 0x0039;
- case "hi-IN":
- return 0x0439;
- case "ms":
- return 0x003E;
- case "ms-MY":
- return 0x043E;
- case "ms-BN":
- return 0x083E;
- case "kk":
- return 0x003F;
- case "kk-KZ":
- return 0x043F;
- case "ky":
- return 0x0040;
- case "ky-KZ":
- return 0x0440;
- case "sw":
- return 0x0041;
- case "sw-KE":
- return 0x0441;
- case "uz":
- return 0x0043;
- case "Lt-uz-UZ":
- return 0x0443;
- case "Cy-uz-UZ":
- return 0x0843;
- case "tt":
- return 0x0044;
- case "tt-TA":
- return 0x0444;
- case "pa":
- return 0x0046;
- case "pa-IN":
- return 0x0446;
- case "gu":
- return 0x0047;
- case "gu-IN":
- return 0x0447;
- case "ta":
- return 0x0049;
- case "ta-IN":
- return 0x0449;
- case "te":
- return 0x004A;
- case "te-IN":
- return 0x044A;
- case "kn":
- return 0x004B;
- case "kn-IN":
- return 0x044B;
- case "mr":
- return 0x004E;
- case "mr-IN":
- return 0x044E;
- case "sa":
- return 0x004F;
- case "sa-IN":
- return 0x044F;
- case "mn":
- return 0x0050;
- case "mn-MN":
- return 0x0450;
- case "gl":
- return 0x0056;
- case "gl-ES":
- return 0x0456;
- case "kok":
- return 0x0057;
- case "kok-IN":
- return 0x0457;
- case "syr":
- return 0x005A;
- case "syr-SY":
- return 0x045A;
- case "div":
- return 0x0065;
- case "div-MV":
- return 0x0465;
- case "":
- return 0x007F;
- }
- return -1;
- }
-
- // <summary>
- // Creates a CultureInfo for a specific ID
- // </summary>
- public static CultureInfo CreateSpecificCulture (string name)
- {
- if (name == null)
- throw new ArgumentNullException ();
-
- int id = NameToID (name);
-
- if (id == -1)
- throw new ArgumentException ("name");
-
- return new CultureInfo (id, false);
- }
-
- /// <summary>
- /// CultureInfo instance that represents the culture used by the current thread
- /// </summary>
- public static CultureInfo CurrentCulture
- {
- get
- {
- return Thread.CurrentThread.CurrentCulture;
- }
-
- set
- {
- Thread.CurrentThread.CurrentCulture = value;
- }
- }
-
- /// <summary>
- /// CultureInfo instance that represents the current culture used by the ResourceManager to look up culture-specific resources at run time
- /// </summary>
- public static CultureInfo CurrentUICulture
- {
- get
- {
- return Thread.CurrentThread.CurrentUICulture;
- }
-
- set
- {
- Thread.CurrentThread.CurrentUICulture = value;
- }
- }
-
-
- public virtual int LCID {
- get {
- return lcid;
- }
- }
-
- // <summary>
- // Gets the string-encoded name of the culture
- // </summary>
- public virtual string Name {
- get {
- switch (lcid){
- case 0x007f:
- return "iv";
- }
- throw new Exception ("Miss constructed object for LCID: " + lcid);
- }
- }
-
- [MonoTODO]
- public virtual Calendar Calendar
- {
- get { return null; }
- }
-
- internal static bool IsIDNeutralCulture (int lcid) {
- return (lcid & 0xff00) == 0;
- }
-
- // <summary>
- // Returns whether the current culture is neutral (neutral cultures
- // only specify a language, not a country.
- // </summary>
- public virtual bool IsNeutralCulture {
- get {
- return IsIDNeutralCulture (lcid);
- }
- }
- // <summary>
- // Returns the NumberFormat for the current lcid
- // </summary>
- public virtual NumberFormatInfo NumberFormat {
- get {
- if (number_format == null){
- lock (this){
- if (number_format == null)
- number_format = new NumberFormatInfo (lcid);
- }
- }
-
- return number_format;
- }
-
- set {
- if (is_read_only) throw new InvalidOperationException(MSG_READONLY);
-
- if (value == null)
- throw new ArgumentNullException ("NumberFormat");
-
- number_format = value;
- }
- }
-
- public virtual DateTimeFormatInfo DateTimeFormat
- {
- get
- {
- if (datetime_format == null)
- {
- lock (this)
- {
- if (datetime_format == null)
- datetime_format = new DateTimeFormatInfo();
- }
- }
-
- return datetime_format;
- }
-
- set
- {
- if (is_read_only) throw new InvalidOperationException(MSG_READONLY);
-
- if (value == null)
- throw new ArgumentNullException ("DateTimeFormat");
-
- datetime_format = value;
- }
- }
-
- //
- // IFormatProvider implementation
- //
- public virtual object GetFormat( Type formatType )
- {
- object format = null;
-
- if ( formatType == typeof(NumberFormatInfo) )
- format = NumberFormat;
- else if ( formatType == typeof(DateTimeFormatInfo) )
- format = DateTimeFormat;
-
- return format;
- }
-
- //
- // Constructors
- //
- public CultureInfo (int culture, bool use_user_override)
- {
- if (culture < 0)
- throw new ArgumentOutOfRangeException ();
-
- InitializeByID (culture, use_user_override);
- }
-
- public CultureInfo (int culture) : this (culture, false)
- {
- }
-
- public CultureInfo (string name, bool use_user_override)
- {
- if (name == null)
- throw new ArgumentNullException ();
-
- InitializeByID (NameToID (name), use_user_override);
- }
-
- public CultureInfo (string name) : this (name, false) {}
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/CultureTypes.cs b/mcs/class/corlib/System.Globalization/CultureTypes.cs
deleted file mode 100755
index 5ec320af326..00000000000
--- a/mcs/class/corlib/System.Globalization/CultureTypes.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// CultureTypes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:35:02 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Globalization {
-
-
- /// <summary>
- /// </summary>
- public enum CultureTypes {
-
- /// <summary>
- /// </summary>
- NeutralCultures = 1,
-
- /// <summary>
- /// </summary>
- SpecificCultures = 2,
-
- /// <summary>
- /// </summary>
- AllCultures = 3,
-
- /// <summary>
- /// </summary>
- InstalledWin32Cultures = 4,
- } // CultureTypes
-
-} // System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs b/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs
deleted file mode 100644
index 937527dbefa..00000000000
--- a/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs
+++ /dev/null
@@ -1,519 +0,0 @@
-//
-// System.Globalization.DateTimeFormatInfo
-//
-// Some useful functions are missing in the ECMA specs.
-// They have been added following MS SDK Beta2
-//
-// Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel (martin.weindel@t-online.de)
-
-using System;
-using System.Threading;
-
-namespace System.Globalization
-{
- public sealed class DateTimeFormatInfo : ICloneable, IFormatProvider {
- private static readonly string MSG_READONLY = "This instance is read only";
- private static readonly string MSG_ARRAYSIZE_MONTH = "An array with exactly 13 elements is needed";
- private static readonly string MSG_ARRAYSIZE_DAY = "An array with exactly 7 elements is needed";
- private static readonly string[] INVARIANT_ABBREVIATED_DAY_NAMES
- = new string[7] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
- private static readonly string[] INVARIANT_DAY_NAMES
- = new string[7] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
- private static readonly string[] INVARIANT_ABBREVIATED_MONTH_NAMES
- = new string[13] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};
- private static readonly string[] INVARIANT_MONTH_NAMES
- = new string[13] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""};
-
- public static DateTimeFormatInfo theInvariantDateTimeFormatInfo;
-
- private bool readOnly;
- private string _AMDesignator;
- private string _PMDesignator;
- private string _DateSeparator;
- private string _TimeSeparator;
- private string _ShortDatePattern;
- private string _LongDatePattern;
- private string _ShortTimePattern;
- private string _LongTimePattern;
- private string _MonthDayPattern;
- private string _YearMonthPattern;
- private string _FullDateTimePattern;
- private string _RFC1123Pattern;
- private string _SortableDateTimePattern;
- private string _UniversalSortableDateTimePattern;
- private DayOfWeek _FirstDayOfWeek;
- private Calendar _Calendar;
- private CalendarWeekRule _CalendarWeekRule;
- private string[] _AbbreviatedDayNames;
- private string[] _DayNames;
- private string[] _MonthNames;
- private string[] _AbbreviatedMonthNames;
-
- public DateTimeFormatInfo()
- {
- readOnly = false;
- _AMDesignator = "AM";
- _PMDesignator = "PM";
- _DateSeparator = "/";
- _TimeSeparator = ":";
- _ShortDatePattern = "MM/dd/yyyy";
- _LongDatePattern = "dddd, dd MMMM yyyy";
- _ShortTimePattern = "HH:mm";
- _LongTimePattern = "HH:mm:ss";
- _MonthDayPattern = "MMMM dd";
- _YearMonthPattern = "yyyy MMMM";
- _FullDateTimePattern = "dddd, dd MMMM yyyy HH:mm:ss";
-
- // FIXME for the following three pattern: "The default value of this property is derived from the calendar that is set for CultureInfo.CurrentCulture or the default calendar of CultureInfo.CurrentCulture."
- _RFC1123Pattern = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'";
- _SortableDateTimePattern = "yyyy'-'MM'-'dd'T'HH':'mm':'ss";
- _UniversalSortableDateTimePattern = "yyyy'-'MM'-'dd HH':'mm':'ss'Z'";
-
- _FirstDayOfWeek = DayOfWeek.Sunday;
- _Calendar = new GregorianCalendar();
- _CalendarWeekRule = CalendarWeekRule.FirstDay;
-
- _AbbreviatedDayNames = INVARIANT_ABBREVIATED_DAY_NAMES;
- _DayNames = INVARIANT_DAY_NAMES;
- _AbbreviatedMonthNames = INVARIANT_ABBREVIATED_MONTH_NAMES;
- _MonthNames = INVARIANT_MONTH_NAMES;
- }
-
- // LAMESPEC: this is not in ECMA specs
- public static DateTimeFormatInfo GetInstance(IFormatProvider provider)
- {
- if (provider != null) {
- DateTimeFormatInfo dtfi;
- dtfi = (DateTimeFormatInfo)provider.GetFormat(typeof(DateTimeFormatInfo));
- if (dtfi != null)
- return dtfi;
- }
-
- return CurrentInfo;
- }
-
- public bool IsReadOnly {
- get {
- return readOnly;
- }
- }
-
- public static DateTimeFormatInfo ReadOnly(DateTimeFormatInfo dtfi)
- {
- DateTimeFormatInfo copy = (DateTimeFormatInfo)dtfi.Clone();
- copy.readOnly = true;
- return copy;
- }
-
- public object Clone ()
- {
- DateTimeFormatInfo clone = (DateTimeFormatInfo) MemberwiseClone();
- // clone is not read only
- clone.readOnly = false;
- return clone;
- }
-
- public object GetFormat(Type formatType)
- {
- return (formatType == GetType()) ? this : null;
- }
-
- public string GetAbbreviatedEraName(int era)
- {
- if (era < _Calendar.Eras.Length || era >= _Calendar.Eras.Length)
- throw new ArgumentOutOfRangeException();
- notImplemented();
- //FIXME: implement me
- return null;
- }
-
- public string GetAbbreviatedMonthName(int month)
- {
- if (month < 1 || month > 13) throw new ArgumentOutOfRangeException();
- return _AbbreviatedMonthNames[month-1];
- }
-
- public int GetEra(string eraName)
- {
- if (eraName == null) throw new ArgumentNullException();
- eraName = eraName.ToUpper();
- notImplemented();
- //FIXME: implement me
- return -1;
- }
-
- public string GetEraName(int era)
- {
- if (era < _Calendar.Eras.Length || era >= _Calendar.Eras.Length)
- throw new ArgumentOutOfRangeException();
- notImplemented();
- //FIXME: implement me
- return null;
- }
-
- public string GetMonthName(int month)
- {
- if (month < 1 || month > 13) throw new ArgumentOutOfRangeException();
- return _MonthNames[month-1];
- }
-
- public string[] AbbreviatedDayNames
- {
- get
- {
- return (string[]) _AbbreviatedDayNames.Clone();
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- if (value.GetLength(0) != 7) throw new ArgumentException(MSG_ARRAYSIZE_DAY);
- _AbbreviatedDayNames = (string[]) value.Clone();
- }
- }
-
- public string[] AbbreviatedMonthNames
- {
- get
- {
- return (string[]) _AbbreviatedMonthNames.Clone();
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- if (value.GetLength(0) != 13) throw new ArgumentException(MSG_ARRAYSIZE_MONTH);
- _AbbreviatedMonthNames = (string[]) value.Clone();
- }
- }
-
- public string[] DayNames
- {
- get
- {
- return (string[]) _DayNames.Clone();
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- if (value.GetLength(0) != 7) throw new ArgumentException(MSG_ARRAYSIZE_DAY);
- _DayNames = (string[]) value.Clone();
- }
- }
-
- public string[] MonthNames
- {
- get
- {
- return (string[]) _MonthNames.Clone();
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- if (value.GetLength(0) != 13) throw new ArgumentException(MSG_ARRAYSIZE_MONTH);
- _MonthNames = (string[]) value.Clone();
- }
- }
-
- public string AMDesignator
- {
- get
- {
- return _AMDesignator;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _AMDesignator = value;
- }
- }
-
- public string PMDesignator
- {
- get
- {
- return _PMDesignator;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _PMDesignator = value;
- }
- }
-
- public string DateSeparator
- {
- get
- {
- return _DateSeparator;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _DateSeparator = value;
- }
- }
-
- public string TimeSeparator
- {
- get
- {
- return _TimeSeparator;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _TimeSeparator = value;
- }
- }
-
- public string LongDatePattern
- {
- get
- {
- return _LongDatePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _LongDatePattern = value;
- }
- }
-
- public string ShortDatePattern
- {
- get
- {
- return _ShortDatePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _ShortDatePattern = value;
- }
- }
-
- public string ShortTimePattern
- {
- get
- {
- return _ShortTimePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _ShortTimePattern = value;
- }
- }
-
- public string LongTimePattern
- {
- get
- {
- return _LongTimePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _LongTimePattern = value;
- }
- }
-
- public string MonthDayPattern
- {
- get
- {
- return _MonthDayPattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _MonthDayPattern = value;
- }
- }
-
- public string YearMonthPattern
- {
- get
- {
- return _YearMonthPattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _YearMonthPattern = value;
- }
- }
-
- public string FullDateTimePattern
- {
- get
- {
- return _FullDateTimePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _FullDateTimePattern = value;
- }
- }
-
- public static DateTimeFormatInfo CurrentInfo
- {
- get
- {
- return Thread.CurrentThread.CurrentCulture.DateTimeFormat;
- }
- }
-
- public static DateTimeFormatInfo InvariantInfo
- {
- get
- {
- if (theInvariantDateTimeFormatInfo == null)
- {
- theInvariantDateTimeFormatInfo =
- DateTimeFormatInfo.ReadOnly(new DateTimeFormatInfo());
- }
- return theInvariantDateTimeFormatInfo;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public DayOfWeek FirstDayOfWeek
- {
- get
- {
- return _FirstDayOfWeek;
- }
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if ((int) value < 0 || (int) value > 6) throw new ArgumentOutOfRangeException();
- _FirstDayOfWeek = value;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public Calendar Calendar
- {
- get
- {
- return _Calendar;
- }
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _Calendar = value;
- }
- }
-
- public CalendarWeekRule CalendarWeekRule
- {
- get
- {
- return _CalendarWeekRule;
- }
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- _CalendarWeekRule = value;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string RFC1123Pattern
- {
- get
- {
- return _RFC1123Pattern;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string SortableDateTimePattern
- {
- get
- {
- return _SortableDateTimePattern;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string UniversalSortableDateTimePattern
- {
- get
- {
- return _UniversalSortableDateTimePattern;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string[] GetAllDateTimePatterns()
- {
- notImplemented();
- //FIXME: implement me
- return null;
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string[] GetAllDateTimePatterns(char format)
- {
- notImplemented();
- //FIXME: implement me
- return null;
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string GetDayName(DayOfWeek dayofweek)
- {
- int index = (int) dayofweek;
- if (index < 0 || index > 6) throw new ArgumentOutOfRangeException();
- return _DayNames[index];
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string GetAbbreviatedDayName(DayOfWeek dayofweek)
- {
- int index = (int) dayofweek;
- if (index < 0 || index > 6) throw new ArgumentOutOfRangeException();
- return _AbbreviatedDayNames[index];
- }
-
- private static void notImplemented()
- {
- throw new Exception("Not implemented");
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/DateTimeStyles.cs b/mcs/class/corlib/System.Globalization/DateTimeStyles.cs
deleted file mode 100644
index 0e65c4d966d..00000000000
--- a/mcs/class/corlib/System.Globalization/DateTimeStyles.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// DateTimeStyles.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:32:07 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Globalization {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum DateTimeStyles {
-
- /// <summary>
- /// </summary>
- None = 0x00000000,
-
- /// <summary>
- /// </summary>
- AllowLeadingWhite = 0x00000001,
-
- /// <summary>
- /// </summary>
- AllowTrailingWhite = 0x00000002,
-
- /// <summary>
- /// </summary>
- AllowInnerWhite = 0x00000004,
-
- /// <summary>
- /// </summary>
- AllowWhiteSpaces = AllowLeadingWhite | AllowTrailingWhite | AllowInnerWhite,
-
- /// <summary>
- /// </summary>
- NoCurrentDateDefault = 0x00000008,
-
- /// <summary>
- /// </summary>
- AdjustToUniversal = 0x00000010,
- } // DateTimeStyles
-
-} // System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/DaylightTime.cs b/mcs/class/corlib/System.Globalization/DaylightTime.cs
deleted file mode 100755
index 384b509eb3b..00000000000
--- a/mcs/class/corlib/System.Globalization/DaylightTime.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Globalization.DaylightTime
-//
-// Author:
-// Chris Hynes (chrish@assistedsolutions.com)
-//
-// (C) 2001 Chris Hynes
-//
-
-using System.Globalization;
-
-namespace System.Globalization
-{
- public class DaylightTime
- {
- DateTime start, end;
- TimeSpan delta;
-
- public DaylightTime(DateTime start, DateTime end, TimeSpan delta)
- {
- this.start = start;
- this.end = end;
- this.delta = delta;
- }
-
- public DateTime Start
- {
- get
- {
- return start;
- }
- }
-
- public DateTime End
- {
- get
- {
- return end;
- }
- }
-
- public TimeSpan Delta
- {
- get
- {
- return delta;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/GregorianCalendar.cs b/mcs/class/corlib/System.Globalization/GregorianCalendar.cs
deleted file mode 100644
index 1bdf99bf62b..00000000000
--- a/mcs/class/corlib/System.Globalization/GregorianCalendar.cs
+++ /dev/null
@@ -1,254 +0,0 @@
-// ::MONO
-//
-// System.Globalization.GregorianCalendar.cs
-//
-// Copyright (C) Wictor Wilén 2001 (wictor@iBizkit.se)
-//
-// Contributors: Wictor Wilén
-//
-// Revisions
-// 2001-09-15: First draft
-//
-//
-// TODO: testing
-//
-//
-
-using System;
-
-namespace System.Globalization
-{
-
-
- /// <summary>
- /// Represents the Gregorian calendar.
- /// </summary>
- /// <remarks>The Gregorian calendar recognizes two eras: B.C. (before Christ) or B.C.E. (before common era), and A.D. (Latin "Anno Domini", which means "in the year of the Lord") or C.E. (common era). This implementation of the GregorianCalendar class recognizes only the current era (A.D. or C.E.).</remarks>
- // TODO: implement the BC era
- [MonoTODO]
- public class GregorianCalendar : Calendar
- {
- // private members
- private GregorianCalendarTypes _CalendarType;
-
-
- // Public Constants
- public const int ADEra = 1;
-
- // Public Instance Constructors
- // DONE!
- public GregorianCalendar()
- {
- _CalendarType = GregorianCalendarTypes.Localized;
- }
-
- // DONE!
- public GregorianCalendar(GregorianCalendarTypes type)
- {
- _CalendarType = type;
- }
-
- // DONE!
- public GregorianCalendarTypes CalendarType
- {
- get
- {
- return _CalendarType;
- }
- set
- {
- _CalendarType = value;
- }
- }
-
- // Public Instance Properties
- // DONE!
- public override int[] Eras
- {
- get
- {
- return new int[] {1};
- }
- }
- // DONE!
- public override int TwoDigitYearMax
- {
- get
- {
- return _TwoDigitYearMax;
- }
- set
- {
- _TwoDigitYearMax = value;
- }
- }
-
- // Public Instance Methods
- // DONE!
- public override DateTime AddMonths ( DateTime time, int months )
- {
- if(months < -120000 || months > 120000)
- throw new System.ArgumentOutOfRangeException();
- DateTime dt = new DateTime(time.Ticks);
- dt = dt.AddMonths(months);
- return dt;
-
- }
- // DONE!
- public override DateTime AddYears ( DateTime time, int years )
- {
- DateTime dt = new DateTime(time.Ticks);
- return dt.AddYears(years);
- }
-
- // DONE!
- public override int GetDayOfMonth ( DateTime time )
- {
- return time.Day;
- }
-
- // DONE!
- public override DayOfWeek GetDayOfWeek ( DateTime time )
- {
- return time.DayOfWeek;
- }
-
- // DONE!
- public override int GetDayOfYear ( DateTime time )
- {
- return time.DayOfYear;
- }
-
- // DONE!
- public override int GetDaysInMonth ( int year, int month, int era )
- {
- if( year < _MinYear || year > _MaxYear ||
- month < _MinMonth || month > _MaxMonth )
- throw new System.ArgumentOutOfRangeException();
-
- if( era != ADEra)
- throw new System.ArgumentException();
-
- if(this.IsLeapYear(year))
- return _DaysInMonthLeap[month];
- else
- return _DaysInMonth[month];
- }
-
-
- // DONE!
- public override int GetDaysInYear ( int year, int era )
- {
- if(year < _MinYear || year > _MaxYear)
- throw new System.ArgumentOutOfRangeException();
-
- if( era != ADEra)
- throw new System.ArgumentException();
-
- return this.GetDaysInYear(year);
- }
-
- // DONE!
- public override int GetEra ( DateTime time )
- {
- return ADEra;
- }
- // DONE!
- public override int GetMonth ( DateTime time )
- {
- return time.Month;
- }
-
- // DONE!
- public override int GetMonthsInYear ( int year, int era )
- {
- if(year < _MinYear || year > _MaxYear || era != ADEra )
- throw new System.ArgumentOutOfRangeException();
-
- return _MaxMonth;
- }
-
- // DONE!
- public override int GetYear ( DateTime time )
- {
- return time.Year;
- }
-
- // DONE!
- public override bool IsLeapDay ( int year, int month, int day, int era )
- {
- int dim;
-
- if(day < _MinDay || month < _MinMonth || month > _MaxMonth)
- throw new System.ArgumentException();
-
- if(this.IsLeapYear(year,era))
- dim = _DaysInMonthLeap[month-1];
- else
- dim = _DaysInMonth[month-1];
-
- if( day > dim)
- throw new System.ArgumentException();
-
- if( month == 2 && day == 29)
- return true;
-
- return false;
- }
- // DONE!
- public override bool IsLeapMonth ( int year, int month )
- {
- if( year < _MinYear || year > _MaxYear || month < _MinMonth || month > _MaxMonth)
- throw new System.ArgumentException();
- return false;
- }
- // DONE!
- public override bool IsLeapMonth ( int year, int month, int era )
- {
- if( year < _MinYear || year > _MaxYear || month < _MinMonth || month > _MaxMonth || era != ADEra)
- throw new System.ArgumentException();
- return false;
- }
-
- // DONE!
- public override bool IsLeapYear ( int year, int era )
- {
- if(year < _MinYear || year > _MaxYear || era != ADEra)
- throw new System.ArgumentOutOfRangeException();
- if( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) )
- return true;
- return false;
- }
-
- // DONE!
- public override DateTime ToDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond, int era )
- {
- // INFO: year, era and month is checked by GetDaysInMonth()
- int dim;
- dim = GetDaysInMonth(year,month);
- if( day < _MinDay || day > dim ||
- hour < _MinHour || hour > _MaxHour ||
- minute < _MinMinute || minute > _MaxMinute ||
- second < _MinSecond || second > _MaxSecond ||
- millisecond < _MinMillisecond || millisecond > _MaxMillisecond)
- throw new System.ArgumentException();
-
- return new DateTime(year,month,day,hour,minute,second,millisecond,this);
- }
-
- // DONE!
- public override int ToFourDigitYear ( int year )
- {
- int y = _TwoDigitYearMax % 100;
- if( year > y )
- y = _TwoDigitYearMax - y - 100 + year;
- else
- y = _TwoDigitYearMax - y + year;
-
- if( y < _MinYear || y > _MaxYear)
- throw new System.ArgumentException();
- return y;
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs b/mcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs
deleted file mode 100755
index 2d571fdd13b..00000000000
--- a/mcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// GregorianCalendarTypes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:35:19 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Globalization {
-
-
- /// <summary>
- /// </summary>
- public enum GregorianCalendarTypes {
-
- /// <summary>
- /// </summary>
- Localized = 1,
-
- /// <summary>
- /// </summary>
- USEnglish = 2,
-
- /// <summary>
- /// </summary>
- MiddleEastFrench = 9,
-
- /// <summary>
- /// </summary>
- Arabic = 10,
-
- /// <summary>
- /// </summary>
- TransliteratedEnglish = 11,
-
- /// <summary>
- /// </summary>
- TransliteratedFrench = 12,
- } // GregorianCalendarTypes
-
-} // System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/JulianCalendar.cs b/mcs/class/corlib/System.Globalization/JulianCalendar.cs
deleted file mode 100644
index f246d154c99..00000000000
--- a/mcs/class/corlib/System.Globalization/JulianCalendar.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-// ::MONO
-//
-// System.Globalization.JulianCalendar.cs
-//
-// Copyright (C) Wictor Wilén 2001 (wictor@iBizkit.se)
-//
-// Contributors:
-//
-// Revisions
-// 2001-09-14: First draft
-// 2001-09-15: First release
-//
-//
-// TODO: testing
-//
-//
-
-using System;
-
-namespace System.Globalization
-{
-
-
- /// <summary>
- /// Summary description for JulianCalendar.
- /// </summary>
- public class JulianCalendar : System.Globalization.Calendar
- {
-
-
- // Public Static (Shared) Fields
- // DONE!
- public static int JulianEra
- {
- get
- {
- return 1;
- }
- }
-
- // Public Instance Constructors
- // DONE!
- public JulianCalendar()
- {
- }
-
- // Public Instance Properties
- // DONE!
- public override int[] Eras
- {
- get
- {
- return new int[] {1};
- }
- }
- // DONE!
- public override int TwoDigitYearMax
- {
- get
- {
- return _TwoDigitYearMax;
- }
- set
- {
- _TwoDigitYearMax = value;
- }
- }
-
- // Public Instance Methods
- // DONE!
- public override DateTime AddMonths ( DateTime time, int months )
- {
- if(months < -120000 || months > 120000)
- throw new System.ArgumentOutOfRangeException();
- DateTime dt = new DateTime(time.Ticks);
- dt = dt.AddMonths(months);
- return dt;
-
- }
- // DONE!
- public override DateTime AddYears ( DateTime time, int years )
- {
- DateTime dt = new DateTime(time.Ticks);
- return dt.AddYears(years);
- }
-
- // DONE!
- public override int GetDayOfMonth ( DateTime time )
- {
- return time.Day;
- }
-
- // DONE!
- public override DayOfWeek GetDayOfWeek ( DateTime time )
- {
- return time.DayOfWeek;
- }
-
- // DONE!
- public override int GetDayOfYear ( DateTime time )
- {
- return time.DayOfYear;
- }
-
- // DONE!
- public override int GetDaysInMonth ( int year, int month, int era )
- {
- if( year < _MinYear || year > _MaxYear ||
- month < _MinMonth || month > _MaxMonth ||
- era != JulianEra)
- throw new System.ArgumentOutOfRangeException();
-
- if(this.IsLeapYear(year))
- return _DaysInMonthLeap[month];
- else
- return _DaysInMonth[month];
- }
-
-
- // DONE!
- public override int GetDaysInYear ( int year, int era )
- {
- if(year < _MinYear || year > _MaxYear || era != JulianEra)
- throw new System.ArgumentOutOfRangeException();
- return this.GetDaysInYear(year);
- }
-
- // DONE!
- public override int GetEra ( DateTime time )
- {
- return JulianEra;
- }
- // DONE!
- public override int GetMonth ( DateTime time )
- {
- return time.Month;
- }
-
- // DONE!
- public override int GetMonthsInYear ( int year, int era )
- {
- if(year < _MinYear || year > _MaxYear || era != JulianEra)
- throw new System.ArgumentOutOfRangeException();
- return _MaxMonth;
- }
-
- // DONE!
- public override int GetYear ( DateTime time )
- {
- return time.Year;
- }
-
- // DONE!
- public override bool IsLeapDay ( int year, int month, int day, int era )
- {
- int dim;
-
- if(day < _MinDay || month < _MinMonth || month > _MaxMonth)
- throw new System.ArgumentOutOfRangeException();
-
- if(this.IsLeapYear(year,era))
- dim = _DaysInMonthLeap[month-1];
- else
- dim = _DaysInMonth[month-1];
-
- if( day > dim)
- throw new System.ArgumentOutOfRangeException();
-
- if( month == 2 && day == 29)
- return true;
-
- return false;
- }
- // DONE!
- public override bool IsLeapMonth ( int year, int month )
- {
- if( year < _MinYear || year > _MaxYear || month < _MinMonth || month > _MaxMonth)
- throw new System.ArgumentException();
- return false;
- }
- // DONE!
- public override bool IsLeapMonth ( int year, int month, int era )
- {
- if( year < _MinYear || year > _MaxYear || month < _MinMonth || month > _MaxMonth || era != JulianEra)
- throw new System.ArgumentException();
- return false;
- }
-
- // DONE!
- public override bool IsLeapYear ( int year, int era )
- {
- if(year < _MinYear || year > _MaxYear || era != JulianEra)
- throw new System.ArgumentOutOfRangeException();
- if(year % 4 == 0)
- return true;
- return false;
- }
-
- // DONE!
- public override DateTime ToDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond, int era )
- {
- // INFO: year, era and month is checked by GetDaysInMonth()
- int dim;
- dim = GetDaysInMonth(year,month);
- if( day < _MinDay || day > dim ||
- hour < _MinHour || hour > _MaxHour ||
- minute < _MinMinute || minute > _MaxMinute ||
- second < _MinSecond || second > _MaxSecond ||
- millisecond < _MinMillisecond || millisecond > _MaxMillisecond)
- throw new System.ArgumentOutOfRangeException();
-
- return new DateTime(year,month,day,hour,minute,second,millisecond,this);
- }
-
- // DONE!
- public override int ToFourDigitYear ( int year )
- {
- int y = _TwoDigitYearMax % 100;
- if( year > y )
- y = _TwoDigitYearMax - y - 100 + year;
- else
- y = _TwoDigitYearMax - y + year;
-
- if( y < _MinYear || y > _MaxYear)
- throw new System.ArgumentException();
- return y;
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/Locale.cs b/mcs/class/corlib/System.Globalization/Locale.cs
deleted file mode 100755
index 539184dbde4..00000000000
--- a/mcs/class/corlib/System.Globalization/Locale.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Globalization.Locale.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Globalization {
-
- internal class Locale {
-
- /// <summary>
- /// Returns the translated message for the current locale
- /// </summary>
- public static string GetText (string msg)
- {
- return msg;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs b/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs
deleted file mode 100644
index e3062012f81..00000000000
--- a/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs
+++ /dev/null
@@ -1,669 +0,0 @@
-//
-// System.Globalization.NumberFormatInfo.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-// Bob Smith (bob@thestuff.net)
-//
-// (C) Derek Holden
-// (C) Bob Smith http://www.thestuff.net
-//
-
-//
-// NumberFormatInfo. One can only assume it is the class gotten
-// back from a GetFormat() method from an IFormatProvider /
-// IFormattable implementer. There are some discrepencies with the
-// ECMA spec and the SDK docs, surprisingly. See my conversation
-// with myself on it at:
-// http://lists.ximian.com/archives/public/mono-list/2001-July/000794.html
-//
-// Other than that this is totally ECMA compliant.
-//
-
-namespace System.Globalization {
-
- public sealed class NumberFormatInfo : ICloneable, IFormatProvider {
- private bool readOnly;
-
- // Currency Related Format Info
- private int currencyDecimalDigits;
- private string currencyDecimalSeparator;
- private string currencyGroupSeparator;
- private int[] currencyGroupSizes;
- private int currencyNegativePattern;
- private int currencyPositivePattern;
- private string currencySymbol;
-
- private string naNSymbol;
- private string negativeInfinitySymbol;
- private string negativeSign;
-
- // Number Related Format Info
- private int numberDecimalDigits;
- private string numberDecimalSeparator;
- private string numberGroupSeparator;
- private int[] numberGroupSizes;
- private int numberNegativePattern;
-
- // Percent Related Format Info
- private int percentDecimalDigits;
- private string percentDecimalSeparator;
- private string percentGroupSeparator;
- private int[] percentGroupSizes;
- private int percentNegativePattern;
- private int percentPositivePattern;
- private string percentSymbol;
-
- private string perMilleSymbol;
- private string positiveInfinitySymbol;
- private string positiveSign;
-
- internal NumberFormatInfo (int lcid)
- {
- switch (lcid){
-
- // The Invariant Culture Info ID.
- case 0x007f:
- readOnly = false;
-
- // Currency Related Format Info
- currencyDecimalDigits = 2;
- currencyDecimalSeparator = ".";
- currencyGroupSeparator = ",";
- currencyGroupSizes = new int[1] { 3 };
- currencyNegativePattern = 0;
- currencyPositivePattern = 0;
- currencySymbol = "$";
-
- naNSymbol = "NaN";
- negativeInfinitySymbol = "-Infinity";
- negativeSign = "-";
-
- // Number Related Format Info
- numberDecimalDigits = 2;
- numberDecimalSeparator = ".";
- numberGroupSeparator = ",";
- numberGroupSizes = new int[1] { 3 };
- numberNegativePattern = 0;
-
- // Percent Related Format Info
- percentDecimalDigits = 2;
- percentDecimalSeparator = ".";
- percentGroupSeparator = ",";
- percentGroupSizes = new int[1] { 3 };
- percentNegativePattern = 0;
- percentPositivePattern = 0;
- percentSymbol= "%";
-
- perMilleSymbol = "\u2030";
- positiveInfinitySymbol = "Infinity";
- positiveSign = "+";
- break;
- }
- }
-
- public NumberFormatInfo () : this (0x007f)
- {
- }
-
- // =========== Currency Format Properties =========== //
-
- public int CurrencyDecimalDigits {
- get {
- return currencyDecimalDigits;
- }
-
- set {
- if (value < 0 || value > 99)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 99");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyDecimalDigits = value;
- }
- }
-
- public string CurrencyDecimalSeparator {
- get {
- return currencyDecimalSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyDecimalSeparator = value;
- }
- }
-
-
- public string CurrencyGroupSeparator {
- get {
- return currencyGroupSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyGroupSeparator = value;
- }
- }
-
- public int[] CurrencyGroupSizes {
- get {
- return currencyGroupSizes;
- }
-
- set {
- if (value == null || value.Length == 0)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- // All elements except last need to be in range 1 - 9, last can be 0.
- int last = value.Length - 1;
-
- for (int i = 0; i < last; i++)
- if (value[i] < 1 || value[i] > 9)
- throw new ArgumentOutOfRangeException
- ("One of the elements in the array specified is not between 1 and 9");
-
- if (value[last] < 0 || value[last] > 9)
- throw new ArgumentOutOfRangeException
- ("Last element in the array specified is not between 0 and 9");
-
- currencyGroupSizes = (int[]) value.Clone();
- }
- }
-
- public int CurrencyNegativePattern {
- get {
- // See ECMA NumberFormatInfo page 8
- return currencyNegativePattern;
- }
-
- set {
- if (value < 0 || value > 15)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 15");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyNegativePattern = value;
- }
- }
-
- public int CurrencyPositivePattern {
- get {
- // See ECMA NumberFormatInfo page 11
- return currencyPositivePattern;
- }
-
- set {
- if (value < 0 || value > 3)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 3");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyPositivePattern = value;
- }
- }
-
- public string CurrencySymbol {
- get {
- return currencySymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencySymbol = value;
- }
- }
-
- // =========== Static Read-Only Properties =========== //
-
- public static NumberFormatInfo CurrentInfo {
- get {
- // This should be culture specific
- NumberFormatInfo nfi = new NumberFormatInfo ();
- nfi.readOnly = true;
- return nfi;
- }
- }
-
- public static NumberFormatInfo InvariantInfo {
- get {
- // This uses invariant info, which is same as in the constructor
- NumberFormatInfo nfi = new NumberFormatInfo ();
- nfi.readOnly = true;
- return nfi;
- }
- }
-
- public bool IsReadOnly {
- get {
- return readOnly;
- }
- }
-
-
-
- public string NaNSymbol {
- get {
- return naNSymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- naNSymbol = value;
- }
- }
-
- public string NegativeInfinitySymbol {
- get {
- return negativeInfinitySymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- negativeInfinitySymbol = value;
- }
- }
-
- public string NegativeSign {
- get {
- return negativeSign;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- negativeSign = value;
- }
- }
-
- // =========== Number Format Properties =========== //
-
- public int NumberDecimalDigits {
- get {
- return numberDecimalDigits;
- }
-
- set {
- if (value < 0 || value > 99)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 99");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- numberDecimalDigits = value;
- }
- }
-
- public string NumberDecimalSeparator {
- get {
- return numberDecimalSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- numberDecimalSeparator = value;
- }
- }
-
-
- public string NumberGroupSeparator {
- get {
- return numberGroupSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- numberGroupSeparator = value;
- }
- }
-
- public int[] NumberGroupSizes {
- get {
- return numberGroupSizes;
- }
-
- set {
- if (value == null || value.Length == 0)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- // All elements except last need to be in range 1 - 9, last can be 0.
- int last = value.Length - 1;
-
- for (int i = 0; i < last; i++)
- if (value[i] < 1 || value[i] > 9)
- throw new ArgumentOutOfRangeException
- ("One of the elements in the array specified is not between 1 and 9");
-
- if (value[last] < 0 || value[last] > 9)
- throw new ArgumentOutOfRangeException
- ("Last element in the array specified is not between 0 and 9");
-
- numberGroupSizes = (int[]) value.Clone();
- }
- }
-
- public int NumberNegativePattern {
- get {
- // See ECMA NumberFormatInfo page 27
- return numberNegativePattern;
- }
-
- set {
- if (value < 0 || value > 4)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 15");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- numberNegativePattern = value;
- }
- }
-
- // =========== Percent Format Properties =========== //
-
- public int PercentDecimalDigits {
- get {
- return percentDecimalDigits;
- }
-
- set {
- if (value < 0 || value > 99)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 99");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentDecimalDigits = value;
- }
- }
-
- public string PercentDecimalSeparator {
- get {
- return percentDecimalSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentDecimalSeparator = value;
- }
- }
-
-
- public string PercentGroupSeparator {
- get {
- return percentGroupSeparator;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentGroupSeparator = value;
- }
- }
-
- public int[] PercentGroupSizes {
- get {
- return percentGroupSizes;
- }
-
- set {
- if (value == null || value.Length == 0)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- // All elements except last need to be in range 1 - 9, last can be 0.
- int last = value.Length - 1;
-
- for (int i = 0; i < last; i++)
- if (value[i] < 1 || value[i] > 9)
- throw new ArgumentOutOfRangeException
- ("One of the elements in the array specified is not between 1 and 9");
-
- if (value[last] < 0 || value[last] > 9)
- throw new ArgumentOutOfRangeException
- ("Last element in the array specified is not between 0 and 9");
-
- percentGroupSizes = (int[]) value.Clone();
- }
- }
-
- public int PercentNegativePattern {
- get {
- // See ECMA NumberFormatInfo page 8
- return percentNegativePattern;
- }
-
- set {
- if (value < 0 || value > 2)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 15");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentNegativePattern = value;
- }
- }
-
- public int PercentPositivePattern {
- get {
- // See ECMA NumberFormatInfo page 11
- return percentPositivePattern;
- }
-
- set {
- if (value < 0 || value > 2)
- throw new ArgumentOutOfRangeException
- ("The value specified for the property is less than 0 or greater than 3");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentPositivePattern = value;
- }
- }
-
- public string PercentSymbol {
- get {
- return percentSymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentSymbol = value;
- }
- }
-
- public string PerMilleSymbol {
- get {
- return perMilleSymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- perMilleSymbol = value;
- }
- }
-
- public string PositiveInfinitySymbol {
- get {
- return positiveInfinitySymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- positiveInfinitySymbol = value;
- }
- }
-
- public string PositiveSign {
- get {
- return positiveSign;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- positiveSign = value;
- }
- }
-
- public object GetFormat (Type formatType)
- {
- return (formatType == GetType()) ? this : null;
- }
-
- public object Clone ()
- {
- NumberFormatInfo clone = (NumberFormatInfo) MemberwiseClone();
- // clone is not read only
- clone.readOnly = false;
- return clone;
- }
-
- public static NumberFormatInfo ReadOnly (NumberFormatInfo nfi)
- {
- NumberFormatInfo copy = (NumberFormatInfo)nfi.Clone();
- copy.readOnly = true;
- return copy;
- }
-
- public static NumberFormatInfo GetInstance(IFormatProvider provider)
- {
- if (provider != null) {
- NumberFormatInfo nfi;
- nfi = (NumberFormatInfo)provider.GetFormat(typeof(NumberFormatInfo));
- if (nfi != null)
- return nfi;
- }
-
- return CurrentInfo;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/NumberStyles.cs b/mcs/class/corlib/System.Globalization/NumberStyles.cs
deleted file mode 100644
index 543f8cf3220..00000000000
--- a/mcs/class/corlib/System.Globalization/NumberStyles.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Globalization.NumberStyles.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Thu 07/18/2001
-//
-// Modified: 7/20/01, Derek Holden (dholden@draper.com)
-// Added ECMA values for allows and masks for data types
-//
-//------------------------------------------------------------------------------
-
-namespace System.Globalization {
-
- [Flags]
- public enum NumberStyles {
- None = 0x00000000,
- AllowLeadingWhite = 0x00000001,
- AllowTrailingWhite = 0x00000002,
- AllowLeadingSign = 0x00000004,
- AllowTrailingSign = 0x00000008,
- AllowParentheses = 0x00000010,
- AllowDecimalPoint = 0x00000020,
- AllowThousands = 0x00000040,
- AllowExponent = 0x00000080,
- AllowCurrencySymbol = 0x00000100,
- AllowHexSpecifier = 0x00000200,
-
- Integer = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign ),
- HexNumber = ( AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier ),
- Number = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
- AllowTrailingSign | AllowDecimalPoint | AllowThousands ),
- Float = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
- AllowDecimalPoint | AllowExponent ),
- Currency = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
- AllowTrailingSign | AllowParentheses | AllowDecimalPoint |
- AllowThousands | AllowCurrencySymbol ),
- Any = ( AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
- AllowTrailingSign | AllowParentheses | AllowDecimalPoint |
- AllowThousands | AllowExponent | AllowCurrencySymbol ),
- }
-
-} // Namespace
diff --git a/mcs/class/corlib/System.Globalization/RegionInfo.cs b/mcs/class/corlib/System.Globalization/RegionInfo.cs
deleted file mode 100644
index 54850f6ec8e..00000000000
--- a/mcs/class/corlib/System.Globalization/RegionInfo.cs
+++ /dev/null
@@ -1,1688 +0,0 @@
-using System.Globalization;
-
-namespace System.Globalization {
-
- public class RegionInfo {
- int NLS_id;
-
- public RegionInfo (int culture) {
-
- if (CultureInfo.IsIDNeutralCulture (culture))
- throw new ArgumentException ("Culture ID " + culture
- + " (0x" + culture.ToString ("X4")
- + ") is a neutral culture. A region can not be created from it.");
-
- switch (culture) {
- case 0x0401: // ar-SA Arabic (Saudi Arabia)
- NLS_id = 682;
- break;
- case 0x0801: // ar-IQ Arabic (Iraq)
- NLS_id = 368;
- break;
- case 0x0C01: // ar-EG Arabic (Egypt)
- NLS_id = 818;
- break;
- case 0x1001: // ar-LY Arabic (Libya)
- NLS_id = 434;
- break;
- case 0x1401: // ar-DZ Arabic (Algeria)
- NLS_id = 12;
- break;
- case 0x1801: // ar-MA Arabic (Morocco)
- NLS_id = 504;
- break;
- case 0x1C01: // ar-TN Arabic (Tunisia)
- NLS_id = 788;
- break;
- case 0x2001: // ar-OM Arabic (Oman)
- NLS_id = 512;
- break;
- case 0x2401: // ar-YE Arabic (Yemen)
- NLS_id = 887;
- break;
- case 0x2801: // ar-SY Arabic (Syria)
- NLS_id = 760;
- break;
- case 0x2C01: // ar-JO Arabic (Jordan)
- NLS_id = 400;
- break;
- case 0x3001: // ar-LB Arabic (Lebanon)
- NLS_id = 422;
- break;
- case 0x3401: // ar-KW Arabic (Kuwait)
- NLS_id = 414;
- break;
- case 0x3801: // ar-AE Arabic (U.A.E.)
- NLS_id = 784;
- break;
- case 0x3C01: // ar-BH Arabic (Bahrain)
- NLS_id = 48;
- break;
- case 0x4001: // ar-QA Arabic (Qatar)
- NLS_id = 634;
- break;
- case 0x0402: // bg-BG Bulgarian (Bulgaria)
- NLS_id = 100;
- break;
- case 0x0403: // ca-ES Catalan (Spain)
- NLS_id = 724;
- break;
- case 0x0404: // zh-TW Chinese (Taiwan)
- NLS_id = 158;
- break;
- case 0x0804: // zh-CN Chinese (People's Republic of China)
- NLS_id = 156;
- break;
- case 0x0C04: // zh-HK Chinese (Hong Kong S.A.R.)
- NLS_id = 344;
- break;
- case 0x1004: // zh-SG Chinese (Singapore)
- NLS_id = 702;
- break;
- case 0x1404: // zh-MO Chinese (Macau S.A.R.)
- NLS_id = 446;
- break;
- case 0x0405: // cs-CZ Czech (Czech Republic)
- NLS_id = 203;
- break;
- case 0x0406: // da-DK Danish (Denmark)
- NLS_id = 208;
- break;
- case 0x0407: // de-DE German (Germany)
- NLS_id = 276;
- break;
- case 0x0807: // de-CH German (Switzerland)
- NLS_id = 756;
- break;
- case 0x0C07: // de-AT German (Austria)
- NLS_id = 40;
- break;
- case 0x1007: // de-LU German (Luxembourg)
- NLS_id = 442;
- break;
- case 0x1407: // de-LI German (Liechtenstein)
- NLS_id = 438;
- break;
- case 0x0408: // el-GR Greek (Greece)
- NLS_id = 300;
- break;
- case 0x0409: // en-US English (United States)
- NLS_id = 840;
- break;
- case 0x0809: // en-GB English (United Kingdom)
- NLS_id = 826;
- break;
- case 0x0C09: // en-AU English (Australia)
- NLS_id = 36;
- break;
- case 0x1009: // en-CA English (Canada)
- NLS_id = 124;
- break;
- case 0x1409: // en-NZ English (New Zealand)
- NLS_id = 554;
- break;
- case 0x1809: // en-IE English (Ireland)
- NLS_id = 372;
- break;
- case 0x1C09: // en-ZA English (South Africa)
- NLS_id = 710;
- break;
- case 0x2009: // en-JM English (Jamaica)
- NLS_id = 388;
- break;
- case 0x2809: // en-BZ English (Belize)
- NLS_id = 84;
- break;
- case 0x2C09: // en-TT English (Trinidad and Tobago)
- NLS_id = 780;
- break;
- case 0x3009: // en-ZW English (Zimbabwe)
- NLS_id = 716;
- break;
- case 0x3409: // en-PH English (Republic of the Philippines)
- NLS_id = 608;
- break;
- case 0x080A: // es-MX Spanish (Mexico)
- NLS_id = 484;
- break;
- case 0x0C0A: // es-ES Spanish (Spain)
- NLS_id = 724;
- break;
- case 0x100A: // es-GT Spanish (Guatemala)
- NLS_id = 320;
- break;
- case 0x140A: // es-CR Spanish (Costa Rica)
- NLS_id = 188;
- break;
- case 0x180A: // es-PA Spanish (Panama)
- NLS_id = 591;
- break;
- case 0x1C0A: // es-DO Spanish (Dominican Republic)
- NLS_id = 214;
- break;
- case 0x200A: // es-VE Spanish (Venezuela)
- NLS_id = 862;
- break;
- case 0x240A: // es-CO Spanish (Colombia)
- NLS_id = 170;
- break;
- case 0x280A: // es-PE Spanish (Peru)
- NLS_id = 604;
- break;
- case 0x2C0A: // es-AR Spanish (Argentina)
- NLS_id = 32;
- break;
- case 0x300A: // es-EC Spanish (Ecuador)
- NLS_id = 218;
- break;
- case 0x340A: // es-CL Spanish (Chile)
- NLS_id = 152;
- break;
- case 0x380A: // es-UY Spanish (Uruguay)
- NLS_id = 858;
- break;
- case 0x3C0A: // es-PY Spanish (Paraguay)
- NLS_id = 600;
- break;
- case 0x400A: // es-BO Spanish (Bolivia)
- NLS_id = 68;
- break;
- case 0x440A: // es-SV Spanish (El Salvador)
- NLS_id = 222;
- break;
- case 0x480A: // es-HN Spanish (Honduras)
- NLS_id = 340;
- break;
- case 0x4C0A: // es-NI Spanish (Nicaragua)
- NLS_id = 558;
- break;
- case 0x500A: // es-PR Spanish (Puerto Rico)
- NLS_id = 630;
- break;
- case 0x040B: // fi-FI Finnish (Finland)
- NLS_id = 246;
- break;
- case 0x040C: // fr-FR French (France)
- NLS_id = 250;
- break;
- case 0x080C: // fr-BE French (Belgium)
- NLS_id = 56;
- break;
- case 0x0C0C: // fr-CA French (Canada)
- NLS_id = 124;
- break;
- case 0x100C: // fr-CH French (Switzerland)
- NLS_id = 756;
- break;
- case 0x140C: // fr-LU French (Luxembourg)
- NLS_id = 442;
- break;
- case 0x180C: // fr-MC French (Principality of Monaco)
- NLS_id = 492;
- break;
- case 0x040D: // he-IL Hebrew (Israel)
- NLS_id = 376;
- break;
- case 0x040E: // hu-HU Hungarian (Hungary)
- NLS_id = 348;
- break;
- case 0x040F: // is-IS Icelandic (Iceland)
- NLS_id = 352;
- break;
- case 0x0410: // it-IT Italian (Italy)
- NLS_id = 380;
- break;
- case 0x0810: // it-CH Italian (Switzerland)
- NLS_id = 756;
- break;
- case 0x0411: // ja-JP Japanese (Japan)
- NLS_id = 392;
- break;
- case 0x0412: // ko-KR Korean (Korea)
- NLS_id = 410;
- break;
- case 0x0413: // nl-NL Dutch (Netherlands)
- NLS_id = 528;
- break;
- case 0x0813: // nl-BE Dutch (Belgium)
- NLS_id = 56;
- break;
- case 0x0414: // nb-NO Norwegian (Bokm†l) (Norway)
- NLS_id = 578;
- break;
- case 0x0814: // nn-NO Norwegian (Nynorsk) (Norway)
- NLS_id = 578;
- break;
- case 0x0415: // pl-PL Polish (Poland)
- NLS_id = 616;
- break;
- case 0x0416: // pt-BR Portuguese (Brazil)
- NLS_id = 76;
- break;
- case 0x0816: // pt-PT Portuguese (Portugal)
- NLS_id = 620;
- break;
- case 0x0418: // ro-RO Romanian (Romania)
- NLS_id = 642;
- break;
- case 0x0419: // ru-RU Russian (Russia)
- NLS_id = 643;
- break;
- case 0x041A: // hr-HR Croatian (Croatia)
- NLS_id = 191;
- break;
- case 0x041B: // sk-SK Slovak (Slovakia)
- NLS_id = 703;
- break;
- case 0x041C: // sq-AL Albanian (Albania)
- NLS_id = 8;
- break;
- case 0x041D: // sv-SE Swedish (Sweden)
- NLS_id = 752;
- break;
- case 0x081D: // sv-FI Swedish (Finland)
- NLS_id = 246;
- break;
- case 0x041E: // th-TH Thai (Thailand)
- NLS_id = 764;
- break;
- case 0x041F: // tr-TR Turkish (Turkey)
- NLS_id = 792;
- break;
- case 0x0420: // ur-PK Urdu (Islamic Republic of Pakistan)
- NLS_id = 586;
- break;
- case 0x0421: // id-ID Indonesian (Indonesia)
- NLS_id = 360;
- break;
- case 0x0422: // uk-UA Ukrainian (Ukraine)
- NLS_id = 804;
- break;
- case 0x0423: // be-BY Belarusian (Belarus)
- NLS_id = 112;
- break;
- case 0x0424: // sl-SI Slovenian (Slovenia)
- NLS_id = 705;
- break;
- case 0x0425: // et-EE Estonian (Estonia)
- NLS_id = 233;
- break;
- case 0x0426: // lv-LV Latvian (Latvia)
- NLS_id = 428;
- break;
- case 0x0427: // lt-LT Lithuanian (Lithuania)
- NLS_id = 440;
- break;
- case 0x0429: // fa-IR Farsi (Iran)
- NLS_id = 364;
- break;
- case 0x042A: // vi-VN Vietnamese (Viet Nam)
- NLS_id = 704;
- break;
- case 0x042B: // hy-AM Armenian (Armenia)
- NLS_id = 51;
- break;
- case 0x042C: // Lt-az-AZ Azeri (Latin) (Azerbaijan)
- NLS_id = 31;
- break;
- case 0x082C: // Cy-az-AZ Azeri (Cyrillic) (Azerbaijan)
- NLS_id = 31;
- break;
- case 0x042D: // eu-ES Basque (Spain)
- NLS_id = 724;
- break;
- case 0x042F: // mk-MK FYRO Macedonian (Former Yugoslav Republic of Macedonia)
- NLS_id = 807;
- break;
- case 0x0436: // af-ZA Afrikaans (South Africa)
- NLS_id = 710;
- break;
- case 0x0437: // ka-GE Georgian (Georgia)
- NLS_id = 268;
- break;
- case 0x0438: // fo-FO Faeroese (Faeroe Islands)
- NLS_id = 234;
- break;
- case 0x0439: // hi-IN Hindi (India)
- NLS_id = 356;
- break;
- case 0x043E: // ms-MY Malay (Malaysia)
- NLS_id = 458;
- break;
- case 0x083E: // ms-BN Malay (Brunei Darussalam)
- NLS_id = 96;
- break;
- case 0x043F: // kk-KZ Kazakh (Kazakhstan)
- NLS_id = 398;
- break;
- case 0x0440: // ky-KZ Kyrgyz (Kyrgyzstan)
- NLS_id = 398;
- break;
- case 0x0441: // sw-KE Swahili (Kenya)
- NLS_id = 404;
- break;
- case 0x0443: // Lt-uz-UZ Uzbek (Latin) (Uzbekistan)
- NLS_id = 860;
- break;
- case 0x0843: // Cy-uz-UZ Uzbek (Cyrillic) (Uzbekistan)
- NLS_id = 860;
- break;
- case 0x0446: // pa-IN Punjabi (India)
- NLS_id = 356;
- break;
- case 0x0447: // gu-IN Gujarati (India)
- NLS_id = 356;
- break;
- case 0x0449: // ta-IN Tamil (India)
- NLS_id = 356;
- break;
- case 0x044A: // te-IN Telugu (India)
- NLS_id = 356;
- break;
- case 0x044B: // kn-IN Kannada (India)
- NLS_id = 356;
- break;
- case 0x044E: // mr-IN Marathi (India)
- NLS_id = 356;
- break;
- case 0x044F: // sa-IN Sanskrit (India)
- NLS_id = 356;
- break;
- case 0x0450: // mn-MN Mongolian (Mongolia)
- NLS_id = 496;
- break;
- case 0x0456: // gl-ES Galician (Spain)
- NLS_id = 724;
- break;
- case 0x0457: // kok-IN Konkani (India)
- NLS_id = 356;
- break;
- case 0x045A: // syr-SY Syriac (Syria)
- NLS_id = 760;
- break;
- case 0x0465: // div-MV Divehi (Maldives)
- NLS_id = 462;
- break;
- case 0x007F: // Invariant Language (Invariant Country)
- throw new ArgumentException ("There is no region associated with the Invariant Culture (Culture ID: 0x7F).");
- default:
- throw new ArgumentException ("Culture ID " + culture + " (0x" + culture.ToString ("X4")
- + ") is not a supported culture.");
- }
- }
-
- public RegionInfo (string name) {
- switch (name.ToUpper ()) {
- case "AF": // Afghanistan
- NLS_id = 004;
- break;
- case "AL": // Albania
- NLS_id = 008;
- break;
- case "DZ": // Algeria
- NLS_id = 012;
- break;
- case "AS": // American Samoa
- NLS_id = 016;
- break;
- case "AD": // Andorra
- NLS_id = 020;
- break;
- case "AO": // Angola
- NLS_id = 024;
- break;
- case "AI": // Anguilla
- NLS_id = 660;
- break;
- case "AQ": // Antarctica
- NLS_id = 010;
- break;
- case "AG": // Antigua and Barbuda
- NLS_id = 028;
- break;
- case "AR": // Argentina
- NLS_id = 032;
- break;
- case "AM": // Armenia
- NLS_id = 051;
- break;
- case "AW": // Aruba
- NLS_id = 533;
- break;
- case "AU": // Australia
- NLS_id = 036;
- break;
- case "AT": // Austria
- NLS_id = 040;
- break;
- case "AZ": // Azerbaijan
- NLS_id = 031;
- break;
- case "BS": // Bahamas
- NLS_id = 044;
- break;
- case "BH": // Bahrain
- NLS_id = 048;
- break;
- case "BD": // Bangladesh
- NLS_id = 050;
- break;
- case "BB": // Barbados
- NLS_id = 052;
- break;
- case "BY": // Belarus
- NLS_id = 112;
- break;
- case "BE": // Belgium
- NLS_id = 056;
- break;
- case "BZ": // Belize
- NLS_id = 084;
- break;
- case "BJ": // Benin
- NLS_id = 204;
- break;
- case "BM": // Bermuda
- NLS_id = 060;
- break;
- case "BT": // Bhutan
- NLS_id = 064;
- break;
- case "BO": // Bolivia
- NLS_id = 068;
- break;
- case "BA": // Bosnia and Herzegowina
- NLS_id = 070;
- break;
- case "BW": // Botswana
- NLS_id = 072;
- break;
- case "BV": // Bouvet Island
- NLS_id = 074;
- break;
- case "BR": // Brazil
- NLS_id = 076;
- break;
- case "IO": // British Indian Ocean Territory
- NLS_id = 086;
- break;
- case "BN": // Brunei Darussalam
- NLS_id = 096;
- break;
- case "BG": // Bulgaria
- NLS_id = 100;
- break;
- case "BF": // Burkina Faso
- NLS_id = 854;
- break;
- case "BI": // Burundi
- NLS_id = 108;
- break;
- case "KH": // Cambodia
- NLS_id = 116;
- break;
- case "CM": // Cameroon
- NLS_id = 120;
- break;
- case "CA": // Canada
- NLS_id = 124;
- break;
- case "CV": // Cape Verde
- NLS_id = 132;
- break;
- case "KY": // Cayman Islands
- NLS_id = 136;
- break;
- case "CF": // Central African Republic
- NLS_id = 140;
- break;
- case "TD": // Chad
- NLS_id = 148;
- break;
- case "CL": // Chile
- NLS_id = 152;
- break;
- case "CN": // China
- NLS_id = 156;
- break;
- case "CX": // Christmas Island
- NLS_id = 162;
- break;
- case "CC": // Cocos (Keeling) Islands
- NLS_id = 166;
- break;
- case "CO": // Colombia
- NLS_id = 170;
- break;
- case "KM": // Comoros
- NLS_id = 174;
- break;
- case "CG": // Congo
- NLS_id = 178;
- break;
- case "CK": // Cook Islands
- NLS_id = 184;
- break;
- case "CR": // Costa Rica
- NLS_id = 188;
- break;
- case "CI": // Cote D'Ivoire
- NLS_id = 384;
- break;
- case "HR": // Croatia (Local Name: Hrvatska)
- NLS_id = 191;
- break;
- case "CU": // Cuba
- NLS_id = 192;
- break;
- case "CY": // Cyprus
- NLS_id = 196;
- break;
- case "CZ": // Czech Republic
- NLS_id = 203;
- break;
- case "DK": // Denmark
- NLS_id = 208;
- break;
- case "DJ": // Djibouti
- NLS_id = 262;
- break;
- case "DM": // Dominica
- NLS_id = 212;
- break;
- case "DO": // Dominican Republic
- NLS_id = 214;
- break;
- case "TP": // East Timor
- NLS_id = 626;
- break;
- case "EC": // Ecuador
- NLS_id = 218;
- break;
- case "EG": // Egypt
- NLS_id = 818;
- break;
- case "SV": // El Salvador
- NLS_id = 222;
- break;
- case "GQ": // Equatorial Guinea
- NLS_id = 226;
- break;
- case "ER": // Eritrea
- NLS_id = 232;
- break;
- case "EE": // Estonia
- NLS_id = 233;
- break;
- case "ET": // Ethiopia
- NLS_id = 231;
- break;
- case "FK": // Falkland Islands (Malvinas)
- NLS_id = 238;
- break;
- case "FO": // Faroe Islands
- NLS_id = 234;
- break;
- case "FJ": // Fiji
- NLS_id = 242;
- break;
- case "FI": // Finland
- NLS_id = 246;
- break;
- case "FR": // France
- NLS_id = 250;
- break;
- case "FX": // France, Metropolitan
- NLS_id = 249;
- break;
- case "GF": // French Guiana
- NLS_id = 254;
- break;
- case "PF": // French Polynesia
- NLS_id = 258;
- break;
- case "TF": // French Southern Territories
- NLS_id = 260;
- break;
- case "GA": // Gabon
- NLS_id = 266;
- break;
- case "GM": // Gambia
- NLS_id = 270;
- break;
- case "GE": // Georgia
- NLS_id = 268;
- break;
- case "DE": // Germany
- NLS_id = 276;
- break;
- case "GH": // Ghana
- NLS_id = 288;
- break;
- case "GI": // Gibraltar
- NLS_id = 292;
- break;
- case "GR": // Greece
- NLS_id = 300;
- break;
- case "GL": // Greenland
- NLS_id = 304;
- break;
- case "GD": // Grenada
- NLS_id = 308;
- break;
- case "GP": // Guadeloupe
- NLS_id = 312;
- break;
- case "GU": // Guam
- NLS_id = 316;
- break;
- case "GT": // Guatemala
- NLS_id = 320;
- break;
- case "GN": // Guinea
- NLS_id = 324;
- break;
- case "GW": // Guinea-Bissau
- NLS_id = 624;
- break;
- case "GY": // Guyana
- NLS_id = 328;
- break;
- case "HT": // Haiti
- NLS_id = 332;
- break;
- case "HM": // Heard and Mc Donald Islands
- NLS_id = 334;
- break;
- case "VA": // Holy See (Vatican City State)
- NLS_id = 336;
- break;
- case "HN": // Honduras
- NLS_id = 340;
- break;
- case "HK": // Hong Kong
- NLS_id = 344;
- break;
- case "HU": // Hungary
- NLS_id = 348;
- break;
- case "IS": // Iceland
- NLS_id = 352;
- break;
- case "IN": // India
- NLS_id = 356;
- break;
- case "ID": // Indonesia
- NLS_id = 360;
- break;
- case "IR": // Iran (Islamic Republic of)
- NLS_id = 364;
- break;
- case "IQ": // Iraq
- NLS_id = 368;
- break;
- case "IE": // Ireland
- NLS_id = 372;
- break;
- case "IL": // Israel
- NLS_id = 376;
- break;
- case "IT": // Italy
- NLS_id = 380;
- break;
- case "JM": // Jamaica
- NLS_id = 388;
- break;
- case "JP": // Japan
- NLS_id = 392;
- break;
- case "JO": // Jordan
- NLS_id = 400;
- break;
- case "KZ": // Kazakhstan
- NLS_id = 398;
- break;
- case "KE": // Kenya
- NLS_id = 404;
- break;
- case "KI": // Kiribati
- NLS_id = 296;
- break;
- case "KP": // Korea, Democratic People's Republic of
- NLS_id = 408;
- break;
- case "KR": // Korea, Republic of
- NLS_id = 410;
- break;
- case "KW": // Kuwait
- NLS_id = 414;
- break;
- case "KG": // Kyrgyzstan
- NLS_id = 417;
- break;
- case "LA": // Lao People's Democratic Republic
- NLS_id = 418;
- break;
- case "LV": // Latvia
- NLS_id = 428;
- break;
- case "LB": // Lebanon
- NLS_id = 422;
- break;
- case "LS": // Lesotho
- NLS_id = 426;
- break;
- case "LR": // Liberia
- NLS_id = 430;
- break;
- case "LY": // Libyan Arab Jamahiriya
- NLS_id = 434;
- break;
- case "LI": // Liechtenstein
- NLS_id = 438;
- break;
- case "LT": // Lithuania
- NLS_id = 440;
- break;
- case "LU": // Luxembourg
- NLS_id = 442;
- break;
- case "MO": // Macau
- NLS_id = 446;
- break;
- case "MK": // Macedonia, The Former Yugoslav Republic of
- NLS_id = 807;
- break;
- case "MG": // Madagascar
- NLS_id = 450;
- break;
- case "MW": // Malawi
- NLS_id = 454;
- break;
- case "MY": // Malaysia
- NLS_id = 458;
- break;
- case "MV": // Maldives
- NLS_id = 462;
- break;
- case "ML": // Mali
- NLS_id = 466;
- break;
- case "MT": // Malta
- NLS_id = 470;
- break;
- case "MH": // Marshall Islands
- NLS_id = 584;
- break;
- case "MQ": // Martinique
- NLS_id = 474;
- break;
- case "MR": // Mauritania
- NLS_id = 478;
- break;
- case "MU": // Mauritius
- NLS_id = 480;
- break;
- case "YT": // Mayotte
- NLS_id = 175;
- break;
- case "MX": // Mexico
- NLS_id = 484;
- break;
- case "FM": // Micronesia, Federated States of
- NLS_id = 583;
- break;
- case "MD": // Moldova, Republic of
- NLS_id = 498;
- break;
- case "MC": // Monaco
- NLS_id = 492;
- break;
- case "MN": // Mongolia
- NLS_id = 496;
- break;
- case "MS": // Montserrat
- NLS_id = 500;
- break;
- case "MA": // Morocco
- NLS_id = 504;
- break;
- case "MZ": // Mozambique
- NLS_id = 508;
- break;
- case "MM": // Myanmar
- NLS_id = 104;
- break;
- case "NA": // Namibia
- NLS_id = 516;
- break;
- case "NR": // Nauru
- NLS_id = 520;
- break;
- case "NP": // Nepal
- NLS_id = 524;
- break;
- case "NL": // Netherlands
- NLS_id = 528;
- break;
- case "AN": // Netherlands Antilles
- NLS_id = 530;
- break;
- case "NC": // New Caledonia
- NLS_id = 540;
- break;
- case "NZ": // New Zealand
- NLS_id = 554;
- break;
- case "NI": // Nicaragua
- NLS_id = 558;
- break;
- case "NE": // Niger
- NLS_id = 562;
- break;
- case "NG": // Nigeria
- NLS_id = 566;
- break;
- case "NU": // Niue
- NLS_id = 570;
- break;
- case "NF": // Norfolk Island
- NLS_id = 574;
- break;
- case "MP": // Northern Mariana Islands
- NLS_id = 580;
- break;
- case "NO": // Norway
- NLS_id = 578;
- break;
- case "OM": // Oman
- NLS_id = 512;
- break;
- case "PK": // Pakistan
- NLS_id = 586;
- break;
- case "PW": // Palau
- NLS_id = 585;
- break;
- case "PA": // Panama
- NLS_id = 591;
- break;
- case "PG": // Papua New Guinea
- NLS_id = 598;
- break;
- case "PY": // Paraguay
- NLS_id = 600;
- break;
- case "PE": // Peru
- NLS_id = 604;
- break;
- case "PH": // Philippines
- NLS_id = 608;
- break;
- case "PN": // Pitcairn
- NLS_id = 612;
- break;
- case "PL": // Poland
- NLS_id = 616;
- break;
- case "PT": // Portugal
- NLS_id = 620;
- break;
- case "PR": // Puerto Rico
- NLS_id = 630;
- break;
- case "QA": // Qatar
- NLS_id = 634;
- break;
- case "RE": // Reunion
- NLS_id = 638;
- break;
- case "RO": // Romania
- NLS_id = 642;
- break;
- case "RU": // Russian Federation
- NLS_id = 643;
- break;
- case "RW": // Rwanda
- NLS_id = 646;
- break;
- case "KN": // Saint Kitts and Nevis
- NLS_id = 659;
- break;
- case "LC": // Saint Lucia
- NLS_id = 662;
- break;
- case "VC": // Saint Vincent and The Grenadines
- NLS_id = 670;
- break;
- case "WS": // Samoa
- NLS_id = 882;
- break;
- case "SM": // San Marino
- NLS_id = 674;
- break;
- case "ST": // Sao Tome and Principe
- NLS_id = 678;
- break;
- case "SA": // Saudi Arabia
- NLS_id = 682;
- break;
- case "SN": // Senegal
- NLS_id = 686;
- break;
- case "SC": // Seychelles
- NLS_id = 690;
- break;
- case "SL": // Sierra Leone
- NLS_id = 694;
- break;
- case "SG": // Singapore
- NLS_id = 702;
- break;
- case "SK": // Slovakia (Slovak Republic)
- NLS_id = 703;
- break;
- case "SI": // Slovenia
- NLS_id = 705;
- break;
- case "SB": // Solomon Islands
- NLS_id = 090;
- break;
- case "SO": // Somalia
- NLS_id = 706;
- break;
- case "ZA": // South Africa
- NLS_id = 710;
- break;
- case "GS": // South Georgia and The South Sandwich Islands
- NLS_id = 239;
- break;
- case "ES": // Spain
- NLS_id = 724;
- break;
- case "LK": // Sri Lanka
- NLS_id = 144;
- break;
- case "SH": // St. Helena
- NLS_id = 654;
- break;
- case "PM": // St. Pierre and Miquelon
- NLS_id = 666;
- break;
- case "SD": // Sudan
- NLS_id = 736;
- break;
- case "SR": // Suriname
- NLS_id = 740;
- break;
- case "SJ": // Svalbard and Jan Mayen Islands
- NLS_id = 744;
- break;
- case "SZ": // Swaziland
- NLS_id = 748;
- break;
- case "SE": // Sweden
- NLS_id = 752;
- break;
- case "CH": // Switzerland
- NLS_id = 756;
- break;
- case "SY": // Syrian Arab Republic
- NLS_id = 760;
- break;
- case "TW": // Taiwan, Province of China
- NLS_id = 158;
- break;
- case "TJ": // Tajikistan
- NLS_id = 762;
- break;
- case "TZ": // Tanzania, United Republic of
- NLS_id = 834;
- break;
- case "TH": // Thailand
- NLS_id = 764;
- break;
- case "TG": // Togo
- NLS_id = 768;
- break;
- case "TK": // Tokelau
- NLS_id = 772;
- break;
- case "TO": // Tonga
- NLS_id = 776;
- break;
- case "TT": // Trinidad and Tobago
- NLS_id = 780;
- break;
- case "TN": // Tunisia
- NLS_id = 788;
- break;
- case "TR": // Turkey
- NLS_id = 792;
- break;
- case "TM": // Turkmenistan
- NLS_id = 795;
- break;
- case "TC": // Turks and Caicos Islands
- NLS_id = 796;
- break;
- case "TV": // Tuvalu
- NLS_id = 798;
- break;
- case "UG": // Uganda
- NLS_id = 800;
- break;
- case "UA": // Ukraine
- NLS_id = 804;
- break;
- case "AE": // United Arab Emirates
- NLS_id = 784;
- break;
- case "GB": // United Kingdom
- NLS_id = 826;
- break;
- case "US": // United States
- NLS_id = 840;
- break;
- case "UM": // United States Minor Outlying Islands
- NLS_id = 581;
- break;
- case "UY": // Uruguay
- NLS_id = 858;
- break;
- case "UZ": // Uzbekistan
- NLS_id = 860;
- break;
- case "VU": // Vanuatu
- NLS_id = 548;
- break;
- case "VE": // Venezuela
- NLS_id = 862;
- break;
- case "VN": // Viet Nam
- NLS_id = 704;
- break;
- case "VG": // Virgin Islands (British)
- NLS_id = 092;
- break;
- case "VI": // Virgin Islands (U.S.)
- NLS_id = 850;
- break;
- case "WF": // Wallis and Futuna Islands
- NLS_id = 876;
- break;
- case "EH": // Western Sahara
- NLS_id = 732;
- break;
- case "YE": // Yemen
- NLS_id = 887;
- break;
- case "YU": // Yugoslavia
- NLS_id = 891;
- break;
- case "ZR": // Zaire
- NLS_id = 180;
- break;
- case "ZM": // Zambia
- NLS_id = 894;
- break;
- case "ZW": // Zimbabwe
- NLS_id = 716;
- break;
- default:
- throw new ArgumentException ("Region name " + name + " is not supported.");
- }
- }
-
- public virtual string CurrencySymbol {
- get {
- switch (NLS_id) {
- default:
- throw new Exception ("Dunno what is currency symbol for " + NLS_id + " Region. FIXME.");
- }
- }
- }
-
- [MonoTODO]
- public static RegionInfo CurrentRegion {
- get {
- return null;
- }
- }
-
- public virtual string DisplayName {
- get {
- switch (NLS_id) {
- case 203: // Czech republic
- return "Èeská republika";
- case 840: // United States
- return "United States";
- default:
- throw new Exception ("FIXME. Please add your region name in language used in this region.");
- }
- }
- }
-
- public virtual string EnglishName {
- get {
- switch (NLS_id) {
- case 004:
- return "Afghanistan";
- case 008:
- return "Albania";
- case 012:
- return "Algeria";
- case 016:
- return "American Samoa";
- case 020:
- return "Andorra";
- case 024:
- return "Angola";
- case 660:
- return "Anguilla";
- case 010:
- return "Antarctica";
- case 028:
- return "Antigua and Barbuda";
- case 032:
- return "Argentina";
- case 051:
- return "Armenia";
- case 533:
- return "Aruba";
- case 036:
- return "Australia";
- case 040:
- return "Austria";
- case 031:
- return "Azerbaijan";
- case 044:
- return "Bahamas";
- case 048:
- return "Bahrain";
- case 050:
- return "Bangladesh";
- case 052:
- return "Barbados";
- case 112:
- return "Belarus";
- case 056:
- return "Belgium";
- case 084:
- return "Belize";
- case 204:
- return "Benin";
- case 060:
- return "Bermuda";
- case 064:
- return "Bhutan";
- case 068:
- return "Bolivia";
- case 070:
- return "Bosnia and Herzegowina";
- case 072:
- return "Botswana";
- case 074:
- return "Bouvet Island";
- case 076:
- return "Brazil";
- case 086:
- return "British Indian Ocean Territory";
- case 096:
- return "Brunei Darussalam";
- case 100:
- return "Bulgaria";
- case 854:
- return "Burkina Faso";
- case 108:
- return "Burundi";
- case 116:
- return "Cambodia";
- case 120:
- return "Cameroon";
- case 124:
- return "Canada";
- case 132:
- return "Cape Verde";
- case 136:
- return "Cayman Islands";
- case 140:
- return "Central African Republic";
- case 148:
- return "Chad";
- case 152:
- return "Chile";
- case 156:
- return "China";
- case 162:
- return "Christmas Island";
- case 166:
- return "Cocos (Keeling) Islands";
- case 170:
- return "Colombia";
- case 174:
- return "Comoros";
- case 178:
- return "Congo";
- case 184:
- return "Cook Islands";
- case 188:
- return "Costa Rica";
- case 384:
- return "Cote D'Ivoire";
- case 191:
- return "Croatia (Local Name: Hrvatska)";
- case 192:
- return "Cuba";
- case 196:
- return "Cyprus";
- case 203:
- return "Czech Republic";
- case 208:
- return "Denmark";
- case 262:
- return "Djibouti";
- case 212:
- return "Dominica";
- case 214:
- return "Dominican Republic";
- case 626:
- return "East Timor";
- case 218:
- return "Ecuador";
- case 818:
- return "Egypt";
- case 222:
- return "El Salvador";
- case 226:
- return "Equatorial Guinea";
- case 232:
- return "Eritrea";
- case 233:
- return "Estonia";
- case 231:
- return "Ethiopia";
- case 238:
- return "Falkland Islands (Malvinas)";
- case 234:
- return "Faroe Islands";
- case 242:
- return "Fiji";
- case 246:
- return "Finland";
- case 250:
- return "France";
- case 249:
- return "France, Metropolitan";
- case 254:
- return "French Guiana";
- case 258:
- return "French Polynesia";
- case 260:
- return "French Southern Territories";
- case 266:
- return "Gabon";
- case 270:
- return "Gambia";
- case 268:
- return "Georgia";
- case 276:
- return "Germany";
- case 288:
- return "Ghana";
- case 292:
- return "Gibraltar";
- case 300:
- return "Greece";
- case 304:
- return "Greenland";
- case 308:
- return "Grenada";
- case 312:
- return "Guadeloupe";
- case 316:
- return "Guam";
- case 320:
- return "Guatemala";
- case 324:
- return "Guinea";
- case 624:
- return "Guinea-Bissau";
- case 328:
- return "Guyana";
- case 332:
- return "Haiti";
- case 334:
- return "Heard and Mc Donald Islands";
- case 336:
- return "Holy See (Vatican City State)";
- case 340:
- return "Honduras";
- case 344:
- return "Hong Kong";
- case 348:
- return "Hungary";
- case 352:
- return "Iceland";
- case 356:
- return "India";
- case 360:
- return "Indonesia";
- case 364:
- return "Iran (Islamic Republic of)";
- case 368:
- return "Iraq";
- case 372:
- return "Ireland";
- case 376:
- return "Israel";
- case 380:
- return "Italy";
- case 388:
- return "Jamaica";
- case 392:
- return "Japan";
- case 400:
- return "Jordan";
- case 398:
- return "Kazakhstan";
- case 404:
- return "Kenya";
- case 296:
- return "Kiribati";
- case 408:
- return "Korea, Democratic People's Republic of";
- case 410:
- return "Korea, Republic of";
- case 414:
- return "Kuwait";
- case 417:
- return "Kyrgyzstan";
- case 418:
- return "Lao People's Democratic Republic";
- case 428:
- return "Latvia";
- case 422:
- return "Lebanon";
- case 426:
- return "Lesotho";
- case 430:
- return "Liberia";
- case 434:
- return "Libyan Arab Jamahiriya";
- case 438:
- return "Liechtenstein";
- case 440:
- return "Lithuania";
- case 442:
- return "Luxembourg";
- case 446:
- return "Macau";
- case 807:
- return "Macedonia, The Former Yugoslav Republic of";
- case 450:
- return "Madagascar";
- case 454:
- return "Malawi";
- case 458:
- return "Malaysia";
- case 462:
- return "Maldives";
- case 466:
- return "Mali";
- case 470:
- return "Malta";
- case 584:
- return "Marshall Islands";
- case 474:
- return "Martinique";
- case 478:
- return "Mauritania";
- case 480:
- return "Mauritius";
- case 175:
- return "Mayotte";
- case 484:
- return "Mexico";
- case 583:
- return "Micronesia, Federated States of";
- case 498:
- return "Moldova, Republic of";
- case 492:
- return "Monaco";
- case 496:
- return "Mongolia";
- case 500:
- return "Montserrat";
- case 504:
- return "Morocco";
- case 508:
- return "Mozambique";
- case 104:
- return "Myanmar";
- case 516:
- return "Namibia";
- case 520:
- return "Nauru";
- case 524:
- return "Nepal";
- case 528:
- return "Netherlands";
- case 530:
- return "Netherlands Antilles";
- case 540:
- return "New Caledonia";
- case 554:
- return "New Zealand";
- case 558:
- return "Nicaragua";
- case 562:
- return "Niger";
- case 566:
- return "Nigeria";
- case 570:
- return "Niue";
- case 574:
- return "Norfolk Island";
- case 580:
- return "Northern Mariana Islands";
- case 578:
- return "Norway";
- case 512:
- return "Oman";
- case 586:
- return "Pakistan";
- case 585:
- return "Palau";
- case 591:
- return "Panama";
- case 598:
- return "Papua New Guinea";
- case 600:
- return "Paraguay";
- case 604:
- return "Peru";
- case 608:
- return "Philippines";
- case 612:
- return "Pitcairn";
- case 616:
- return "Poland";
- case 620:
- return "Portugal";
- case 630:
- return "Puerto Rico";
- case 634:
- return "Qatar";
- case 638:
- return "Reunion";
- case 642:
- return "Romania";
- case 643:
- return "Russian Federation";
- case 646:
- return "Rwanda";
- case 659:
- return "Saint Kitts and Nevis";
- case 662:
- return "Saint Lucia";
- case 670:
- return "Saint Vincent and The Grenadines";
- case 882:
- return "Samoa";
- case 674:
- return "San Marino";
- case 678:
- return "Sao Tome and Principe";
- case 682:
- return "Saudi Arabia";
- case 686:
- return "Senegal";
- case 690:
- return "Seychelles";
- case 694:
- return "Sierra Leone";
- case 702:
- return "Singapore";
- case 703:
- return "Slovakia (Slovak Republic)";
- case 705:
- return "Slovenia";
- case 090:
- return "Solomon Islands";
- case 706:
- return "Somalia";
- case 710:
- return "South Africa";
- case 239:
- return "South Georgia and The South Sandwich Islands";
- case 724:
- return "Spain";
- case 144:
- return "Sri Lanka";
- case 654:
- return "St. Helena";
- case 666:
- return "St. Pierre and Miquelon";
- case 736:
- return "Sudan";
- case 740:
- return "Suriname";
- case 744:
- return "Svalbard and Jan Mayen Islands";
- case 748:
- return "Swaziland";
- case 752:
- return "Sweden";
- case 756:
- return "Switzerland";
- case 760:
- return "Syrian Arab Republic";
- case 158:
- return "Taiwan, Province of China";
- case 762:
- return "Tajikistan";
- case 834:
- return "Tanzania, United Republic of";
- case 764:
- return "Thailand";
- case 768:
- return "Togo";
- case 772:
- return "Tokelau";
- case 776:
- return "Tonga";
- case 780:
- return "Trinidad and Tobago";
- case 788:
- return "Tunisia";
- case 792:
- return "Turkey";
- case 795:
- return "Turkmenistan";
- case 796:
- return "Turks and Caicos Islands";
- case 798:
- return "Tuvalu";
- case 800:
- return "Uganda";
- case 804:
- return "Ukraine";
- case 784:
- return "United Arab Emirates";
- case 826:
- return "United Kingdom";
- case 840:
- return "United States";
- case 581:
- return "United States Minor Outlying Islands";
- case 858:
- return "Uruguay";
- case 860:
- return "Uzbekistan";
- case 548:
- return "Vanuatu";
- case 862:
- return "Venezuela";
- case 704:
- return "Viet Nam";
- case 092:
- return "Virgin Islands (British)";
- case 850:
- return "Virgin Islands (U.S.)";
- case 876:
- return "Wallis and Futuna Islands";
- case 732:
- return "Western Sahara";
- case 887:
- return "Yemen";
- case 891:
- return "Yugoslavia";
- case 180:
- return "Zaire";
- case 894:
- return "Zambia";
- case 716:
- return "Zimbabwe";
- default:
- throw new Exception ("This code should not be reached.");
- }
- }
- }
-
- public virtual bool IsMetric {
- get {
- switch (NLS_id) {
- case 203: // Czech Republic
- return true;
- case 840: // United States
- return false;
- default:
- throw new Exception ("FIXME. Please define.");
- }
- }
- }
-
- public virtual string ISOCurrencySymbol {
- get {
- switch (NLS_id) {
- default:
- throw new Exception ("This code should not be reached.");
- }
- }
- }
-
- //
- // methods
-
- public override bool Equals(object value) {
- return value == this;
- }
-
- public override int GetHashCode () {
- return NLS_id.GetHashCode ();
- }
- }
-
-}
diff --git a/mcs/class/corlib/System.Globalization/UnicodeCategory.cs b/mcs/class/corlib/System.Globalization/UnicodeCategory.cs
deleted file mode 100644
index 35c2f015ab8..00000000000
--- a/mcs/class/corlib/System.Globalization/UnicodeCategory.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Globalization.UnicodeCategory.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Globalization {
-
- public enum UnicodeCategory {
- UppercaseLetter = 0,
- LowercaseLetter = 1,
- TitlecaseLetter = 2,
- ModifierLetter = 3,
- OtherLetter = 4,
- NonSpacingMark = 5,
- SpaceCombiningMark = 6,
- EnclosingMark = 7,
- DecimalDigitNumber = 8,
- LetterNumber = 9,
- OtherNumber = 10,
- SpaceSeparator = 11,
- LineSeperator = 12,
- ParagraphSeperator = 13,
- Control = 14,
- Format = 15,
- Surrogate = 16,
- PrivateUse = 17,
- ConnectorPunctuation = 18,
- DashPunctuation = 19,
- OpenPunctuation = 20,
- ClosePunctuation = 21,
- InitialQuotePunctuation = 22,
- FinalQuotePunctuation = 23,
- OtherPunctuation = 24,
- MathSymbol = 25,
- CurrencySymbol = 26,
- ModifierSymbol = 27,
- OtherSymbol = 28,
- OtherNotAssigned = 29,
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog b/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog
deleted file mode 100644
index da93dff9265..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog
+++ /dev/null
@@ -1,19 +0,0 @@
-2002-02-19 Duncan Mak <duncan@ximian.com>
-
- * IsolatedStorageFileStream.cs: Added MonoTODO here. This class
- is completely stubbed out (over the summer) and didn't get
- properly MonoTODO'd.
-
-2002-02-08 Duncan Mak <duncan@ximian.com>
-
- * IsolatedStorage.cs: Looked at MemberInfo.cs, another fellow
- abstract class. Oh, that's what it means! Removed unnesscessary
- MonoTODO attributes.
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * IsolatedStorage.cs: Added to CVS, stubbed out the API.
- * IsolatedStorageException.cs: Implemented.
-
-2002-01-07 Duco Fijma <duco@lorentz.xs4all.nl>
- * Created INormalizeForIsolatedStorage
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs b/mcs/class/corlib/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs
deleted file mode 100644
index 56d9069d48e..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.IO.IsolatedStorage.INormalizeForIsolatedStorage
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.IO.IsolatedStorage {
-
-public interface INormalizeForIsolatedStorage {
-
- object Normalize ();
-
-}
-
-}
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs
deleted file mode 100644
index 60c5e325e25..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.IO.IsolatedStorage.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.IO.IsolatedStorage
-{
- public abstract class IsolatedStorage : MarshalByRefObject
- {
- // Constructor
- protected IsolatedStorage ()
- : base ()
- {
- }
-
- // Properties
- [MonoTODO]
- public object AssemblyIdentity
- {
- get { return null; }
- }
-
- [CLSCompliant (false)]
- [MonoTODO]
- public virtual ulong CurrentSize
- {
- get { return 0; }
- }
-
- [MonoTODO]
- public object DomainIdentity
- {
- get { return null; }
- }
-
- [CLSCompliant (false)]
- [MonoTODO]
- public virtual ulong MaximumSize
- {
- get { return 0; }
- }
-
- [MonoTODO]
- public IsolatedStorageScope Scope
- {
- get { return 0; }
- }
-
- [MonoTODO]
- protected virtual char SeperatorExternal
- {
- get { return Char.MinValue; }
- }
-
- [MonoTODO]
- protected virtual char SerperatorInternal
- {
- get { return Char.MinValue; }
- }
-
- // Methods
- protected abstract IsolatedStoragePermission GetPermission (PermissionSet ps);
-
- [MonoTODO]
- protected void InitStore (IsolatedStorageScope scope, Type domainEvidenceType,
- Type assemblyEvidenceType)
- {
- }
-
- protected abstract void Remove ();
- }
-}
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageException.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageException.cs
deleted file mode 100644
index 51268d65550..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageException.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.IO.IsolatedStorage.IsolatedstorageException
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002, Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.IO.IsolatedStorage
-{
- [Serializable]
- public class IsolatedStorageException : Exception
- {
- public IsolatedStorageException ()
- : base (Locale.GetText ("An Isolated storage operation failed."))
- {
- }
-
- public IsolatedStorageException (string message)
- : base (message)
- {
- }
-
- public IsolatedStorageException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected IsolatedStorageException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs
deleted file mode 100644
index a8ca0e96fe7..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// System.IO.IsolatedStorage.IsolatedStorageFileStream
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-using System.IO;
-
-namespace System.IO.IsolatedStorage
-{
- [MonoTODO]
- public class IsolatedStorageFileStream : FileStream
- {
- public IsolatedStorageFileStream (string name, FileMode mode)
- : base(name, mode)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs
deleted file mode 100755
index 9960511a168..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// IsolatedStorageScope.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:41:21 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO.IsolatedStorage {
-
-
- /// <summary>
- /// </summary>
- public enum IsolatedStorageScope {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- User = 1,
-
- /// <summary>
- /// </summary>
- Domain = 2,
-
- /// <summary>
- /// </summary>
- Assembly = 4,
- } // IsolatedStorageScope
-
-} // System.IO.IsolatedStorage
diff --git a/mcs/class/corlib/System.IO/BinaryReader.cs b/mcs/class/corlib/System.IO/BinaryReader.cs
deleted file mode 100644
index 7090a6b5f87..00000000000
--- a/mcs/class/corlib/System.IO/BinaryReader.cs
+++ /dev/null
@@ -1,362 +0,0 @@
-//
-// System.IO.BinaryReader
-//
-// Author:
-// Matt Kimball (matt@kimball.net)
-//
-
-using System;
-using System.Text;
-
-namespace System.IO {
- public class BinaryReader : IDisposable {
- Stream m_stream;
- Encoding m_encoding;
- int m_encoding_max_byte;
-
- byte[] m_buffer;
- int m_buffer_used;
- int m_buffer_pos;
-
-
- public BinaryReader(Stream input) : this(input, Encoding.UTF8) {
- }
-
- public BinaryReader(Stream input, Encoding encoding) {
- if (input == null || encoding == null)
- throw new ArgumentNullException();
- if (!input.CanRead)
- throw new ArgumentException();
-
- m_stream = input;
- m_encoding = encoding;
- m_encoding_max_byte = m_encoding.GetMaxByteCount(1);
- }
-
- public virtual Stream BaseStream {
- get {
- return m_stream;
- }
- }
-
- public virtual void Close() {
- Dispose();
- m_stream.Close();
- }
-
- public virtual void Dispose() {
- m_buffer = null;
- m_buffer_used = 0;
- }
-
- protected virtual void FillBuffer(int bytes) {
- if (!EnsureBuffered(m_buffer_used - m_buffer_pos + bytes)) {
- throw new EndOfStreamException();
- }
- }
-
- public virtual int PeekChar() {
- EnsureBuffered(m_encoding_max_byte);
-
- int i;
- for (i = 1; m_encoding.GetCharCount(m_buffer, m_buffer_pos, i) == 0; i++) {
- if (m_buffer_pos + i >= m_buffer_used) {
- return -1;
- }
- }
-
- char[] decode = m_encoding.GetChars(m_buffer, m_buffer_pos, i);
- return decode[0];
- }
-
- public virtual int Read() {
- char[] decode = new char[1];
-
- Read(decode, 0, 1);
- return decode[0];
- }
-
- public virtual int Read(byte[] buffer, int index, int count) {
- if (buffer == null) {
- throw new ArgumentNullException();
- }
- if (buffer.Length - index < count) {
- throw new ArgumentException();
- }
- if (index < 0 || count < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- EnsureBuffered(count);
-
- if (m_buffer_used - m_buffer_pos < count) {
- count = m_buffer_used - m_buffer_pos;
- }
-
- Array.Copy(m_buffer, m_buffer_pos, buffer, index, count);
-
- ConsumeBuffered(count);
- return count;
- }
-
- public virtual int Read(char[] buffer, int index, int count) {
- if (buffer == null) {
- throw new ArgumentNullException();
- }
- if (buffer.Length - index < count) {
- throw new ArgumentException();
- }
- if (index < 0 || count < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- EnsureBuffered(m_encoding_max_byte * count);
-
- int i;
- for (i = 1; m_encoding.GetCharCount(m_buffer, m_buffer_pos, i) < count; i++) {
- if (m_buffer_pos + i >= m_buffer_used) {
- break;
- }
- }
-
- count = m_encoding.GetCharCount(m_buffer, m_buffer_pos, i);
-
- char[] dec = m_encoding.GetChars(m_buffer, m_buffer_pos, i);
- Array.Copy(dec, 0, buffer, index, count);
-
- ConsumeBuffered(i);
- return count;
- }
-
- protected int Read7BitEncodedInt() {
- int ret = 0;
- int shift = 0;
- int count = 0;
- byte b;
-
- do {
- if (!EnsureBuffered(++count)) {
- throw new EndOfStreamException();
- }
- b = m_buffer[m_buffer_pos + count - 1];
-
- ret = ret | ((b & 0x7f) << shift);
- shift += 7;
- } while ((b & 0x80) == 0x80);
-
- ConsumeBuffered(count);
- return ret;
- }
-
- public virtual bool ReadBoolean() {
- if (!EnsureBuffered(1)) {
- throw new EndOfStreamException();
- }
-
- bool ret = BitConverter.ToBoolean(m_buffer, m_buffer_pos);
- ConsumeBuffered(1);
- return ret;
- }
-
- public virtual byte ReadByte() {
- if (!EnsureBuffered(1)) {
- throw new EndOfStreamException();
- }
-
- byte ret = m_buffer[m_buffer_pos];
- ConsumeBuffered(1);
- return ret;
- }
-
- public virtual byte[] ReadBytes(int count) {
- if (count < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- EnsureBuffered(count);
-
- if (count > m_buffer_used - m_buffer_pos) {
- count = m_buffer_used - m_buffer_pos;
- }
-
- if (count == 0) {
- throw new EndOfStreamException();
- }
-
- byte[] buf = new byte[count];
- Read(buf, 0, count);
- return buf;
- }
-
- public virtual char ReadChar() {
- char[] buf = ReadChars(1);
- return buf[0];
- }
-
- public virtual char[] ReadChars(int count) {
- if (count < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- char[] full = new char[count];
- count = Read(full, 0, count);
-
- if (count != full.Length) {
- char[] ret = new char[count];
- Array.Copy(full, 0, ret, 0, count);
- return ret;
- } else {
- return full;
- }
- }
-
- unsafe public virtual decimal ReadDecimal() {
- if (!EnsureBuffered(16)) {
- throw new EndOfStreamException();
- }
-
- decimal ret;
- byte* ret_ptr = (byte *)&ret;
- for (int i = 0; i < 16; i++) {
- ret_ptr[i] = m_buffer[m_buffer_pos + i];
- }
-
- ConsumeBuffered(16);
- return ret;
- }
-
- public virtual double ReadDouble() {
- if (!EnsureBuffered(8)) {
- throw new EndOfStreamException();
- }
-
- double ret = BitConverter.ToDouble(m_buffer, m_buffer_pos);
- ConsumeBuffered(8);
- return ret;
- }
-
- public virtual short ReadInt16() {
- if (!EnsureBuffered(2)) {
- throw new EndOfStreamException();
- }
-
- short ret = BitConverter.ToInt16(m_buffer, m_buffer_pos);
- ConsumeBuffered(2);
- return ret;
- }
-
- public virtual int ReadInt32() {
- if (!EnsureBuffered(1)) {
- throw new EndOfStreamException();
- }
-
- int ret = BitConverter.ToInt32(m_buffer, m_buffer_pos);
- ConsumeBuffered(1);
- return ret;
- }
-
- public virtual long ReadInt64() {
- if (!EnsureBuffered(8)) {
- throw new EndOfStreamException();
- }
-
- long ret = BitConverter.ToInt64(m_buffer, m_buffer_pos);
- ConsumeBuffered(8);
- return ret;
- }
-
- [CLSCompliant(false)]
- unsafe public virtual sbyte ReadSByte() {
- if (!EnsureBuffered(1)) {
- throw new EndOfStreamException();
- }
-
- sbyte ret;
- byte* ret_ptr = (byte *)&ret;
- ret_ptr[0] = m_buffer[m_buffer_pos];
-
- ConsumeBuffered(1);
- return ret;
- }
-
- public virtual string ReadString() {
- int len = Read7BitEncodedInt();
-
- char[] str = ReadChars(len);
- string ret = "";
- for (int i = 0; i < str.Length; i++) {
- ret = ret + str[i];
- }
-
- return ret;
- }
-
- public virtual float ReadSingle() {
- if (!EnsureBuffered(4)) {
- throw new EndOfStreamException();
- }
-
- float ret = BitConverter.ToSingle(m_buffer, m_buffer_pos);
- ConsumeBuffered(4);
- return ret;
- }
-
- [CLSCompliant(false)]
- public virtual ushort ReadUInt16() {
- if (!EnsureBuffered(2)) {
- throw new EndOfStreamException();
- }
-
- ushort ret = BitConverter.ToUInt16(m_buffer, m_buffer_pos);
- ConsumeBuffered(2);
- return ret;
- }
-
- [CLSCompliant(false)]
- public virtual uint ReadUInt32() {
- if (!EnsureBuffered(4)) {
- throw new EndOfStreamException();
- }
-
- uint ret = BitConverter.ToUInt32(m_buffer, m_buffer_pos);
- ConsumeBuffered(4);
- return ret;
- }
-
- [CLSCompliant(false)]
- public virtual ulong ReadUInt64() {
- if (!EnsureBuffered(8)) {
- throw new EndOfStreamException();
- }
-
- ulong ret = BitConverter.ToUInt64(m_buffer, m_buffer_pos);
- ConsumeBuffered(8);
- return ret;
- }
-
-
- bool EnsureBuffered(int bytes) {
- int needed = bytes - (m_buffer_used - m_buffer_pos);
- if (needed <= 0)
- return true;
-
- if (m_buffer_used + needed > m_buffer.Length) {
- byte[] old_buffer = m_buffer;
- m_buffer = new byte[m_buffer_used + needed];
- Array.Copy(old_buffer, 0, m_buffer, 0, m_buffer_used);
- }
-
- m_buffer_used += m_stream.Read(m_buffer, m_buffer_used, needed);
-
- return (m_buffer_used >= m_buffer_pos + bytes);
- }
-
-
- void ConsumeBuffered(int bytes) {
- m_buffer_pos += bytes;
- if (m_buffer_pos == m_buffer_used) {
- m_buffer_pos = 0;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/BinaryWriter.cs b/mcs/class/corlib/System.IO/BinaryWriter.cs
deleted file mode 100755
index 7e184e18ef8..00000000000
--- a/mcs/class/corlib/System.IO/BinaryWriter.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-//
-// System.IO.BinaryWriter
-//
-// Author:
-// Matt Kimball (matt@kimball.net)
-//
-
-using System;
-using System.Text;
-
-namespace System.IO {
- public class BinaryWriter : IDisposable {
- public static readonly BinaryWriter Null;
-
- protected Stream OutStream;
- Encoding m_encoding;
-
- protected BinaryWriter() {
- m_encoding = Encoding.UTF8;
- }
-
- public BinaryWriter(Stream output) : this(output, Encoding.UTF8) {
- }
-
- public BinaryWriter(Stream output, Encoding encoding) {
- if (output == null || encoding == null)
- throw new ArgumentNullException();
- if (!output.CanWrite)
- throw new ArgumentException();
-
- OutStream = output;
- m_encoding = encoding;
- }
-
- public virtual Stream BaseStream {
- get {
- return OutStream;
- }
- }
-
- public virtual void Close() {
- Dispose();
- }
-
- public virtual void Dispose() {
- OutStream.Close();
- OutStream.Dispose();
- }
-
- public virtual void Flush() {
- OutStream.Flush();
- }
-
- public virtual long Seek(int offset, SeekOrigin origin) {
- return OutStream.Seek(offset, origin);
- }
-
- public virtual void Write(bool value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 1);
- }
-
- public virtual void Write(byte value) {
- OutStream.WriteByte(value);
- }
-
- public virtual void Write(byte[] value) {
- OutStream.Write(value, 0, value.Length);
- }
-
- public virtual void Write(byte[] value, int offset, int length) {
- OutStream.Write(value, offset, length);
- }
-
- public virtual void Write(char value) {
- char[] dec = new char[1];
- dec[0] = value;
- byte[] enc = m_encoding.GetBytes(dec, 0, 1);
- OutStream.Write(enc, 0, enc.Length);
- }
-
- public virtual void Write(char[] value) {
- byte[] enc = m_encoding.GetBytes(value, 0, value.Length);
- OutStream.Write(enc, 0, enc.Length);
- }
-
- public virtual void Write(char[] value, int offset, int length) {
- byte[] enc = m_encoding.GetBytes(value, offset, length);
- OutStream.Write(enc, 0, enc.Length);
- }
-
- unsafe public virtual void Write(decimal value) {
- byte[] to_write = new byte[16];
- byte* value_ptr = (byte *)&value;
- for (int i = 0; i < 16; i++) {
- to_write[i] = value_ptr[i];
- }
-
- OutStream.Write(to_write, 0, 16);
- }
-
- public virtual void Write(double value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 8);
- }
-
- public virtual void Write(short value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 2);
- }
-
- public virtual void Write(int value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 4);
- }
-
- public virtual void Write(long value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 8);
- }
-
- [CLSCompliant(false)]
- unsafe public virtual void Write(sbyte value) {
- byte[] to_write = new byte[1];
-
- to_write[0] = *(byte *)&value;
- OutStream.Write(to_write, 0, 1);
- }
-
- public virtual void Write(float value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 4);
- }
-
- public virtual void Write(string value) {
- Write7BitEncodedInt(value.Length);
- byte[] enc = m_encoding.GetBytes(value);
- OutStream.Write(enc, 0, enc.Length);
- }
-
- [CLSCompliant(false)]
- public virtual void Write(ushort value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 2);
- }
-
- [CLSCompliant(false)]
- public virtual void Write(uint value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 4);
- }
-
- [CLSCompliant(false)]
- public virtual void Write(ulong value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 8);
- }
-
- protected void Write7BitEncodedInt(int value) {
- do {
- int high = (value >> 7) & 0x01ffffff;
- byte b = (byte)(value & 0x7f);
-
- if (high != 0) {
- b = (byte)(b | 0x80);
- }
-
- Write(b);
- value = high;
- } while(value != 0);
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/BufferedStream.cs b/mcs/class/corlib/System.IO/BufferedStream.cs
deleted file mode 100644
index 38e7ca181d2..00000000000
--- a/mcs/class/corlib/System.IO/BufferedStream.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// System.IO.BufferedStream
-//
-// Author:
-// Matt Kimball (matt@kimball.net)
-//
-
-namespace System.IO {
- public sealed class BufferedStream : Stream {
- Stream m_stream;
- byte[] m_buffer;
- int m_buffer_pos;
- int m_buffer_read_ahead;
- bool m_buffer_reading;
-
- public BufferedStream(Stream stream) : this(stream, 4096) {
- }
-
- public BufferedStream(Stream stream, int buffer_size) {
- m_stream = stream;
- m_buffer = new byte[buffer_size];
- }
-
- public override bool CanRead {
- get {
- return m_stream.CanRead;
- }
- }
-
- public override bool CanWrite {
- get {
- return m_stream.CanWrite;
- }
- }
-
- public override bool CanSeek {
- get {
- return m_stream.CanSeek;
- }
- }
-
- public override long Length {
- get {
- return m_stream.Length;
- }
- }
-
- public override long Position {
- get {
- return m_stream.Position - m_buffer_read_ahead + m_buffer_pos;
- }
-
- set {
- Flush();
- m_stream.Position = value;
- }
- }
-
- public override void Close() {
- Flush();
- m_stream.Close();
- Dispose();
- }
-
- public override void Dispose() {
- m_stream.Dispose();
- m_buffer = null;
- }
-
- public override void Flush() {
- if (m_buffer_reading) {
- m_stream.Position = Position;
- } else {
- m_stream.Write(m_buffer, 0, m_buffer_pos);
- }
-
- m_buffer_read_ahead = 0;
- m_buffer_pos = 0;
- }
-
- public override long Seek(long offset, SeekOrigin origin) {
- Flush();
- return m_stream.Seek(offset, origin);
- }
-
- public override void SetLength(long value) {
- m_stream.SetLength(value);
- }
-
- public override int ReadByte() {
- byte[] b = new byte[1];
-
- if (Read(b, 0, 1) == 1) {
- return b[0];
- } else {
- return -1;
- }
- }
-
- public override void WriteByte(byte value) {
- byte[] b = new byte[1];
-
- b[0] = value;
- Write(b, 0, 1);
- }
-
- public override int Read(byte[] array, int offset, int count) {
- if (!m_buffer_reading) {
- Flush();
- m_buffer_reading = true;
- }
-
- if (count <= m_buffer_read_ahead - m_buffer_pos) {
- Array.Copy(m_buffer, m_buffer_pos, array, offset, count);
-
- m_buffer_pos += count;
- if (m_buffer_pos == m_buffer_read_ahead) {
- m_buffer_pos = 0;
- m_buffer_read_ahead = 0;
- }
-
- return count;
- }
-
- int ret = m_buffer_read_ahead - m_buffer_pos;
- Array.Copy(m_buffer, m_buffer_pos, array, offset, ret);
- m_buffer_pos = 0;
- m_buffer_read_ahead = 0;
- offset += ret;
- count -= ret;
-
- if (count >= m_buffer.Length) {
- ret += m_stream.Read(array, offset, count);
- } else {
- m_buffer_read_ahead = m_stream.Read(m_buffer, 0, m_buffer.Length);
-
- if (count < m_buffer_read_ahead) {
- Array.Copy(m_buffer, 0, array, offset, count);
- m_buffer_pos = count;
- ret += count;
- } else {
- Array.Copy(m_buffer, 0, array, offset, m_buffer_read_ahead);
- ret += m_buffer_read_ahead;
- m_buffer_read_ahead = 0;
- }
- }
-
- return ret;
- }
-
- public override void Write(byte[] array, int offset, int count) {
- if (m_buffer_reading) {
- Flush();
- m_buffer_reading = false;
- }
-
- if (m_buffer_pos + count >= m_buffer.Length) {
- Flush();
- m_stream.Write(array, offset, count);
- } else {
- Array.Copy(array, offset, m_buffer, m_buffer_pos, count);
- m_buffer_pos += count;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/ChangeLog b/mcs/class/corlib/System.IO/ChangeLog
deleted file mode 100644
index 59d0bcf8285..00000000000
--- a/mcs/class/corlib/System.IO/ChangeLog
+++ /dev/null
@@ -1,160 +0,0 @@
-2002-02-12 Nick Drochak <ndrochak@gol.com>
-
- * PathTooLongException.cs: put it in the correct namespace
- * EndOfStreamException.cs: put it in the correct namespace
-
-Thu Jan 31 17:32:32 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Directory.cs: handle opendir() return NULL and absolute filenames.
-
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * FileLoadException.cs:
- * FileNotFoundException: Added missing bits for serialization.
-
-Thu Jan 24 17:42:54 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Directory.cs: allow directories in GetFiles() mask.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * FileInfo.c (CopyTo, MoveTo): Implement.
-
- * FileStream.cs: Add argument checking to the constructor.
-
- * File.cs: Rewrote most of the file. Implement Copy, Open, Create,
- OpenText, OpenWrite, Move. Made pending methods flagged as MonoTODO.
-
- * Directory.cs (Delete): reimplement without using DirectoryInfo.
- (Delete): Implement the recursive version.
- (GetCreationTime, GetLastWriteTime, GetLastAccessTime): Implement.
- (Move): Reimplement.
- (getNames): dead code removal.
-
- * Path.cs: define an internal DirectorySeparatorStr that we use in
- a few spots.
-
- * Wrapper.cs: Updated to new version.
-
- * DirectoryInfo (Delete): Implement using the Directory API.
-
- * DirectoryInfo.cs (GetFiles, GetDirectories, GetFileSystemInfos,
- Delete, Create, Parent, Exists, MoveTo): Implement.
-
- * Directory.cs (GetListing): implement new utility function.
- (GetDirectories): Implement.
- (GetFileSystemEntries): Implement.
- (GetFiles): Implement.
-
- * CheckArgument.cs (Path): Do not allow null by default.
-
-Tue Jan 22 22:53:23 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * DirectoryInfo.cs, FileInfo.cs: do not use Debug from the system
- assembly in corlib.
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * SeekOrigin.cs: Added Serializable attribute.
-
-2002-01-19 Duncan Mak <duncan@ximian.com>
-
- * PathTooLongException.cs:
- * EndOfStreamException.cs: Added to CVS.
-
-Thu Jan 10 12:06:46 MST 2002 Matt Kimball <matt@kimball.net>
-
- * BufferedStream.cs: Initial implemenation. The synchronous
- methods for both reading and writing are implemented. I'll do the
- asynchronous methods in a bit.
-
-Wed Jan 9 16:04:39 MST 2002 Matt Kimball <matt@kimball.net>
-
- * BinaryWriter.cs: Initial implementation. And it's all there.
-
- * BinaryReader.cs: The constructor now uses the passed in encoding,
- not UTF8 always.
-
-Wed Jan 9 13:54:28 MST 2002 Matt Kimball <matt@kimbal.net>
-
- * BinaryReader.cs: Initial implementation. I think it's complete.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * CheckArgument.cs, CheckPermission.cs, Directory.cs: MonoTODO
- attribute decorations.
-
- * DirectoryInfo.cs, File.cs, FileInfo.cs, FileSystemInfo.cs,
- Path.cs, TextReader.cs, TextWriter.cs : Ditto.
-
- * FileLoadException.cs, FileNotFoundException.cs, StreamReader.cs:
- Ditto.
-
-2001-12-11 Dick Porter <dick@ximian.com>
-
- * FileStream.cs: Use handles rather than casting file descriptors.
- Added Handle property.
-
-Wed Nov 14 16:47:47 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * CheckPermission.cs: disable ModeAccess() code: it's wrong.
- * FileStream.cs: only trow an exception if the read failed in ReadByte().
- * StreamReader.cs: implement Peek and Read.
- * TextWriter.cs: CLSCompliant updates.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * FileNotFoundException.cs: Added some constructors
-
- * Path.cs (GetFullPath): Fixed implementation
-
-Fri Nov 2 18:27:58 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * DirectoryNotFoundException.cs: implemented.
-
-Tue Sep 25 18:54:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * File.cs: fix signatures of the Open() and OpenRead() functions
- (they are static).
-
-Thu Sep 13 18:04:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * FileLoadException.cs, FileNotFoundException.cs: added.
-
-2001-08-28 Dietmar Maurer <dietmar@ximian.com>
-
- * TextReader.cs: implemented the Read method
-
- * StreamReader.cs: impl. stubs
-
- * StreamWriter.cs: impl.
-
- * TextWriter.cs: implemented Write and WriteLine methods
-
-Sun Aug 26 23:01:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * FileAccess.cs, FileMode.cs: change values to be compatible with
- the ms ones.
-
-Sun Aug 26 11:47:56 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * IOException.cs: Implemented System.IO.Exception.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- *SeekOrigin.cs.cs, FileShare.cs, FileMode.cs, FileAccess.cs: Add.
-
-2001-07-19 Marcin Szczepanski <marcins@zipworld.com.au>
-
- * System.IO.MemoryStream.cs: Added. Had quite a few cases of
- "LAMESPEC", but the tests work against the MS implementation so
- the major functions are right (ie. Read/Write/Seek). Some more
- tests required for the various constructors and exceptions.
-
-2001-07-16 Marcin Szczepanski <marcins@zipworld.com.au>
-
- * StringReader.cs, StringWriter.cs, TextReader.cs, TextWriter.cs:
- New class implemenations.
-
- * StringReaderTest.cs, StringWriterTest.cs: Test suite for the above.
-
diff --git a/mcs/class/corlib/System.IO/CheckArgument.cs b/mcs/class/corlib/System.IO/CheckArgument.cs
deleted file mode 100644
index eaf20c0002e..00000000000
--- a/mcs/class/corlib/System.IO/CheckArgument.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.CheckArgument.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Saturday, August 25, 2001
-//
-// NOTE: All contributors can freely add to this class or make modifications
-// that do not break existing usage of methods
-//------------------------------------------------------------------------------
-
-
-using System;
-using System.IO;
-
-namespace System.IO
-{
- /// <summary>
- /// A utility class to assist with various argument validations in System.IO
- /// </summary>
- internal sealed class CheckArgument
- {
- /// <summary>
- /// Generates and exception if arg contains whitepace only
- /// </summary>
- public static void WhitespaceOnly (string arg, string desc)
- {
- if (arg != null && arg.Length > 0)
- {
- string temp = arg;
- temp.Trim ();
- if (temp.Length == 0)
- {
- throw new ArgumentException (desc);
- }
- }
- }
-
- /// <summary>
- /// Generates and exception if arg contains whitepace only
- /// </summary>
- public static void WhitespaceOnly (string arg)
- {
- WhitespaceOnly (arg, "Argument string consists of whitespace characters only.");
- }
-
- /// <summary>
- /// Generates and exception if arg is empty
- /// </summary>
- public static void Empty (string arg, string desc)
- {
- if (arg != null && arg.Length == 0)
- {
- throw new ArgumentException (desc);
- }
- }
-
- /// <summary>
- /// Generates and exception if arg is empty
- /// </summary>
- public static void Empty (string arg)
- {
- Empty (arg, "Argument string is empty.");
- }
-
- /// <summary>
- /// Generates and exception if arg is null
- /// </summary>
- public static void Null (Object arg, string desc)
- {
- if (arg == null)
- {
- throw new ArgumentNullException (desc);
- }
- }
-
- /// <summary>
- /// Generates and exception if arg is null
- /// </summary>
- public static void Null (Object arg)
- {
- if (arg == null)
- {
- throw new ArgumentNullException ();
- }
- }
-
- /// <summary>
- /// Generates and exception if path contains invalid path characters
- /// </summary>
- public static void PathChars (string path, string desc)
- {
- if (path != null)
- {
- if (path.IndexOfAny (System.IO.Path.InvalidPathChars) > -1)
- {
- throw new ArgumentException (desc);
- }
- }
- }
-
- /// <summary>
- /// Generates and exception if path contains invalid path characters
- /// </summary>
- public static void PathChars (string path)
- {
- PathChars (path, "Path contains invalid characters");
- }
-
- /// <summary>
- /// Generates and exception if path too long
- /// </summary>
- [MonoTODO]
- public static void PathLength (string path, string desc)
- {
- //TODO: find out how long is too long
- }
-
- /// <summary>
- /// Generates and exception if path too long
- /// </summary>
- public static void PathLength (string path)
- {
- PathLength (path);
- }
-
- /// <summary>
- /// Generates and exception if path is illegal
- /// </summary>
- public static void Path (string path, bool bAllowNull, bool bLength)
- {
- if (path != null) //allow null
- {
- Empty (path, "Path cannot be the empty string"); // path can't be empty
- WhitespaceOnly (path, "Path cannot be all whitespace"); // path can't be all whitespace
- PathChars (path); // path can't contain invalid characters
- if (bLength)
- {
- PathLength ("Path too long");
- }
- }
- else if (!bAllowNull)
- {
- throw new ArgumentNullException ("Parameter name: path");
- }
- }
-
- /// <summary>
- /// Generates and exception if path is illegal
- /// </summary>
- public static void Path (string path, bool bAllowNull)
- {
- Path (path, bAllowNull, false);
- }
-
- /// <summary>
- /// Generates and exception if path is illegal
- /// </summary>
- public static void Path (string path)
- {
- Path (path, false, false);
- }
-
- }
-} // namespace System.IO.Private
diff --git a/mcs/class/corlib/System.IO/CheckPermission.cs b/mcs/class/corlib/System.IO/CheckPermission.cs
deleted file mode 100644
index 3418850c065..00000000000
--- a/mcs/class/corlib/System.IO/CheckPermission.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.CheckPermission.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Saturday, August 25, 2001
-//
-// NOTE: All contributors can freely add to this class or make modifications
-// that do not break existing usage of methods
-//------------------------------------------------------------------------------
-
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.IO
-{
- /// <summary>
- /// A utility class to assist with various permission validation in System.IO
- /// </summary>
- internal sealed class CheckPermission
- {
- /// <summary>
- /// Generates and exception if caller doesn't have flags access to filesystem item specified by path
- /// </summary>
- [MonoTODO]
- public static void Demand(FileIOPermissionAccess flags, string path)
- {
- FileIOPermission ioPerm = new FileIOPermission(flags, path);
- // FIXME: FileIOPermission is not yet implemented
- //ioPerm.Demand();
- }
-
- public static void Access(FileAccess access, string path)
- {
- switch(access)
- {
- case FileAccess.Read:
- Demand(FileIOPermissionAccess.Read, path);
- break;
- case FileAccess.Write:
- Demand(FileIOPermissionAccess.Write, path);
- break;
- case FileAccess.ReadWrite:
- Demand(FileIOPermissionAccess.Read | FileIOPermissionAccess.Write, path);
- break;
- default:
- // TODO: determine what best to do here
- throw new ArgumentException("Invalid FileAccess parameter");
- }
- }
-
- [MonoTODO]
- public static void ModeAccess(FileMode mode, FileAccess access, string path, bool exists)
- {
-#if false
- // TODO: this logic isn't entirely complete and accurate, yet
- if((mode & (FileMode.CreateNew | FileMode.Create)) != 0)
- {
- CheckPermission.Demand(FileIOPermissionAccess.Write, Path.GetDirectoryName(path));
- }
- else if((mode & FileMode.OpenOrCreate) != 0)
- {
- if(!exists)
- {
- CheckPermission.Demand(FileIOPermissionAccess.Write, Path.GetDirectoryName(path));
- }
- else
- {
- CheckPermission.Access(access, path);
- }
- }
- else if(exists)
- {
- CheckPermission.Access(access, path);
- }
- else
- {
- throw new FileNotFoundException();
- }
-#endif
- }
- }
-} // namespace System.IO.Private
diff --git a/mcs/class/corlib/System.IO/Directory.cs b/mcs/class/corlib/System.IO/Directory.cs
deleted file mode 100644
index d5e21705431..00000000000
--- a/mcs/class/corlib/System.IO/Directory.cs
+++ /dev/null
@@ -1,388 +0,0 @@
-//
-// System.IO.Directory.cs
-//
-// Authors:
-// Jim Richardson (develop@wtfo-guru.com)
-// Miguel de Icaza (miguel@ximian.com)
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-// Copyright (C) 2002 Ximian, Inc.
-//
-// Created: Monday, August 13, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Security.Permissions;
-using System.Collections;
-using System.Private;
-
-namespace System.IO
-{
- public sealed class Directory : Object
- {
- public static DirectoryInfo CreateDirectory (string path)
- {
- if (path == null)
- throw new ArgumentNullException ();
- if (path == "" || path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- int code;
-
- if ((code = Wrapper.mkdir (path, 0777)) != 0)
- throw new IOException (Errno.Message (code));
-
- return new DirectoryInfo (path);
- }
-
- public static void Delete (string path)
- {
- if (path == null)
- throw new ArgumentNullException ();
- if (path == "" || path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- int code = Wrapper.rmdir (path);
-
- if (code != 0)
- throw new IOException (Errno.Message (code));
- }
-
- static void RecursiveDelete (string path)
- {
- ArrayList list = GetListing (path, "*");
- if (list == null)
- throw new DirectoryNotFoundException ();
-
- if (!path.EndsWith (Path.DirectorySeparatorStr))
- path = path + Path.DirectorySeparatorChar;
-
- foreach (string n in list){
- string full = path + n;
-
- unsafe {
- stat s;
-
- if (Wrapper.stat (full, &s) != 0)
- continue;
-
- if ((s.st_mode & Wrapper.S_IFDIR) != 0){
- RecursiveDelete (full);
- } else {
- Wrapper.unlink (full);
- }
- }
- }
- }
-
- public static void Delete (string path, bool recurse)
- {
- if (path == null)
- throw new ArgumentNullException ();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Path contains invalid characters");
-
- if (recurse == false){
- Delete (path);
- return;
- }
-
- RecursiveDelete (path);
- }
-
- public static bool Exists (string path)
- {
- unsafe {
- stat s;
-
- if (Wrapper.stat (path, &s) == 0)
- return true;
- else
- return false;
- }
- }
-
- enum Time { Creation, Modified, Access }
-
- static DateTime GetTime (string path, Time kind)
- {
-
- if (path == null)
- throw new ArgumentNullException ();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Path contains invalid characters");
-
- unsafe {
- stat s;
- int code;
-
- code = Wrapper.stat (path, &s);
-
- if (code == 0){
- switch (kind){
- case Time.Creation:
- return new DateTime (DateTime.UnixEpoch + s.st_ctime);
- case Time.Modified:
- return new DateTime (DateTime.UnixEpoch + s.st_mtime);
- case Time.Access:
- return new DateTime (DateTime.UnixEpoch + s.st_atime);
- }
- }
- if (code == Wrapper.ENOTDIR)
- throw new DirectoryNotFoundException ();
- throw new IOException (Errno.Message (code));
- }
- }
-
- public static DateTime GetLastAccessTime (string path)
- {
- return GetTime (path, Time.Access);
- }
-
- public static DateTime GetLastWriteTime (string path)
- {
- return GetTime (path, Time.Modified);
- }
-
- public static DateTime GetCreationTime (string path)
- {
- return GetTime (path, Time.Creation);
- }
-
- public static string GetCurrentDirectory ()
- { // Implementation complete 08/25/2001 14:24 except for
- // LAMESPEC: documentation specifies invalid exceptions (i think)
- // also shouldn't need Write to getcurrrent should we?
- string str = Environment.CurrentDirectory;
- CheckPermission.Demand (FileIOPermissionAccess.Read & FileIOPermissionAccess.Write, str);
- return str;
- }
-
- internal static ArrayList GetListing (string path, string pattern)
- {
- IntPtr dir_handle;
- IntPtr glob_handle = (IntPtr) 0;
- ArrayList list;
- string name, subdir = "";
- int slashpos;
-
- if (path == null)
- return null;
-
- if (!path.EndsWith (Path.DirectorySeparatorStr))
- path = path + Path.DirectorySeparatorChar;
-
- if (pattern [0] == '/') // need to adapt to windows conventions...
- path = "";
-
- if (pattern == "*")
- pattern = null;
- else {
- // do we need to handle globbing in directory names, too?
- if ((slashpos = pattern.LastIndexOf (Path.DirectorySeparatorStr)) >= 0) {
- subdir = pattern.Substring (0, slashpos + 1);
- path += subdir;
- pattern = pattern.Substring (slashpos + 1);
- }
- glob_handle = Wrapper.mono_glob_compile (pattern);
- }
-
- dir_handle = Wrapper.opendir (path);
- if (dir_handle == IntPtr.Zero)
- return null;
- list = new ArrayList ();
- while ((name = Wrapper.readdir (dir_handle)) != null){
- if (pattern == null){
- list.Add (name);
- continue;
- }
-
- if (Wrapper.mono_glob_match (glob_handle, name) != 0)
- list.Add (subdir + name);
- }
- if (pattern != null)
- Wrapper.mono_glob_dispose (glob_handle);
- Wrapper.closedir (dir_handle);
-
- return list;
- }
-
- public static string[] GetDirectories (string path)
- {
- return GetDirectories (path, "*");
- }
-
- enum Kind {
- Files = 1,
- Dirs = 2,
- All = Files | Dirs
- }
-
- static string [] GetFileListing (ArrayList list, string path, Kind kind)
- {
- ArrayList result_list = new ArrayList ();
-
- if (!path.EndsWith (Path.DirectorySeparatorStr))
- path = path + Path.DirectorySeparatorChar;
-
- foreach (string name in list){
- string full = path + name;
-
- if (name [0] == '/') // update for windows stuff
- full = name;
-
- unsafe {
- stat s;
-
- if (Wrapper.stat (full, &s) != 0)
- continue;
-
- if ((s.st_mode & Wrapper.S_IFDIR) != 0){
- if ((kind & Kind.Dirs) != 0)
- result_list.Add (full);
- } else {
- if ((kind & Kind.Files) != 0)
- result_list.Add (full);
- }
- }
- }
- string [] names = new string [result_list.Count];
- result_list.CopyTo (names);
- return names;
- }
-
- public static string[] GetDirectories (string path, string mask)
- {
- if (path == null || mask == null)
- throw new ArgumentNullException ();
-
- ArrayList list = GetListing (path, mask);
- if (list == null)
- throw new DirectoryNotFoundException ();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Path contains invalid characters");
-
- return GetFileListing (list, path, Kind.Dirs);
- }
-
- public static string GetDirectoryRoot (string path)
- {
- return "" + Path.DirectorySeparatorChar;
- }
-
- public static string[] GetFiles (string path)
- {
- return GetFiles (path, "*");
- }
-
- public static string[] GetFiles (string path, string mask)
- {
- if (path == null || mask == null)
- throw new ArgumentNullException ();
-
- ArrayList list = GetListing (path, mask);
- if (list == null)
- throw new DirectoryNotFoundException ();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Path contains invalid characters");
-
- return GetFileListing (list, path, Kind.Files);
- }
-
- public static string[] GetFileSystemEntries (string path)
- {
- return GetFileSystemEntries (path, "*");
- }
-
- public static string[] GetFileSystemEntries (string path, string mask)
- {
- if (path == null || mask == null)
- throw new ArgumentNullException ();
-
- ArrayList list = GetListing (path, mask);
- if (list == null)
- throw new DirectoryNotFoundException ();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Path contains invalid characters");
-
- return GetFileListing (list, path, Kind.All);
- }
-
- public static string[] GetLogicalDrives ()
- {
- return new string [] { "A:\\", "C:\\" };
- }
-
- [MonoTODO]
- public static DirectoryInfo GetParent (string path)
- { // TODO: Implement
- return null;
- }
-
- public static void Move (string src, string dst)
- {
- if (src == null || dst == null)
- throw new ArgumentNullException ();
- if (src.IndexOfAny (Path.InvalidPathChars) != -1 ||
- dst.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- int code;
-
- code = Wrapper.rename (src, dst);
- if (code == 0)
- return;
-
- throw new IOException (Errno.Message (code));
- }
-
- [MonoTODO]
- public static void SetCreationTime (string path, DateTime creationTime)
- {
- if (path == null)
- throw new ArgumentNullException ();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- long ticks = creationTime.Ticks;
- if (ticks < DateTime.UnixEpoch)
- throw new ArgumentOutOfRangeException ();
-
- long res = ticks - DateTime.UnixEpoch;
- if (res > UInt32.MaxValue)
- throw new ArgumentOutOfRangeException ();
-
- throw new Exception ("Unimplemented");
- }
-
- public static void SetCurrentDirectory (string path)
- { // Implementation complete 08/25/2001 14:24 except for
- // LAMESPEC: documentation specifies invalid exceptions IOException (i think)
- CheckArgument.Path (path, true);
- CheckPermission.Demand (FileIOPermissionAccess.Read & FileIOPermissionAccess.Write, path);
- if (!Exists (path))
- {
- throw new DirectoryNotFoundException ("Directory \"" + path + "\" not found.");
- }
- Environment.CurrentDirectory = path;
- }
-
- [MonoTODO]
- public static void SetLastAccessTime (string path, DateTime accessTime)
- {
- throw new Exception ("Unimplemented");
- }
-
- [MonoTODO]
- public static void SetLastWriteTime (string path, DateTime modifiedTime)
- {
- throw new Exception ("Unimplemented");
- }
-
- private static DirectoryInfo getInfo (string path)
- {
- return new DirectoryInfo (path);
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/DirectoryInfo.cs b/mcs/class/corlib/System.IO/DirectoryInfo.cs
deleted file mode 100644
index 4a7789a2c41..00000000000
--- a/mcs/class/corlib/System.IO/DirectoryInfo.cs
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-// System.IO.DirectoryInfo.cs
-//
-// Author:
-// Miguel de Icaza, miguel@ximian.com
-// Jim Richardson, develop@wtfo-guru.com
-//
-// Copyright (C) 2002 Ximian, Inc.
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-
-using System;
-using System.Collections;
-using System.Private;
-
-namespace System.IO
-{
- public sealed class DirectoryInfo : FileSystemInfo
- {
- string path;
-
- public DirectoryInfo (string path)
- {
- if (path == null)
- throw new ArgumentNullException ();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Invalid characters in pathname");
-
- this.path = path;
-
- unsafe {
- stat s;
- int code;
-
- code = Wrapper.stat (path, &s);
- if (code != 0)
- throw new DirectoryNotFoundException ();
- }
- }
-
- public override bool Exists
- {
- get {
- unsafe {
- stat s;
- int code;
-
- code = Wrapper.stat (path, &s);
- return (code == 0);
- }
- }
- }
-
- public DirectoryInfo Parent {
- get {
- return new DirectoryInfo (path + Path.PathSeparator + "..");
- }
- }
-
- public override string Name
- {
- get {
- return path;
- }
- }
-
- public DirectoryInfo Root
- {
- get {
- return new DirectoryInfo ("" + Path.PathSeparator);
- }
- }
-
- public void Create ()
- {
- Wrapper.mkdir (path, 0777);
- }
-
- [MonoTODO]
- DirectoryInfo CreateSubdirectory (string path)
- {
- return null;
- }
-
- public override void Delete ()
- {
- if (Wrapper.rmdir (path) == Wrapper.ENOTEMPTY)
- throw new IOException ("Directory not empty");
- }
-
- [MonoTODO]
- public void Delete (bool recursive)
- {
- if (recursive == false)
- Delete ();
- }
-
- public DirectoryInfo[] GetDirectories (string path)
- {
- return GetDirectories ("*");
- }
-
- public static DirectoryInfo[] GetDirectories (string path, string mask)
- {
- if (path == null)
- throw new ArgumentNullException ("path is null");
- if (mask == null)
- throw new ArgumentNullException ("mask is null");
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Invalid characters in path");
-
- ArrayList list = Directory.GetListing (path, "*");
- if (list == null)
- throw new DirectoryNotFoundException ();
-
- ArrayList dir_list = new ArrayList ();
-
- foreach (string name in list){
- string full = path + Path.DirectorySeparatorChar + name;
-
- unsafe {
- stat s;
-
- if (Wrapper.stat (full, &s) != 0)
- continue;
-
- if ((s.st_mode & Wrapper.S_IFDIR) != 0)
- dir_list.Add (new DirectoryInfo (full));
- }
- }
-
- DirectoryInfo [] di_array = new DirectoryInfo [dir_list.Count];
- dir_list.CopyTo (di_array);
-
- return di_array;
- }
-
- public static FileInfo[] GetFiles (string path)
- {
- return GetFiles (path, "*");
- }
-
- public static FileInfo[] GetFiles (string path, string mask)
- {
- if (path == null)
- throw new ArgumentNullException ("path is null");
- if (mask == null)
- throw new ArgumentNullException ("mask is null");
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Invalid characters in path");
-
- ArrayList list = Directory.GetListing (path, "*");
- if (list == null)
- throw new DirectoryNotFoundException ();
-
- ArrayList file_list = new ArrayList ();
-
- foreach (string name in list){
- string full = path + Path.DirectorySeparatorChar + name;
-
- unsafe {
- stat buf;
-
- if (Wrapper.stat (full, &buf) != 0)
- continue;
-
- if ((buf.st_mode & Wrapper.S_IFDIR) == 0)
- file_list.Add (new FileInfo (full));
- }
- }
- FileInfo [] fi_array = new FileInfo [file_list.Count];
- file_list.CopyTo (fi_array);
-
- return fi_array;
- }
-
- public static FileSystemInfo[] GetFileSystemInfos (string path)
- {
- return GetFileSystemInfos (path, "*");
- }
-
- public static FileSystemInfo[] GetFileSystemInfos (string path, string mask)
- {
- if (path == null)
- throw new ArgumentNullException ("path is null");
- if (mask == null)
- throw new ArgumentNullException ("mask is null");
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Invalid characters in path");
-
- ArrayList list = Directory.GetListing (path, "*");
- if (list == null)
- throw new DirectoryNotFoundException ();
-
- FileSystemInfo [] fi = new FileSystemInfo [list.Count];
- int i = 0;
- foreach (string s in list){
- string name = path + Path.DirectorySeparatorChar + s;
-
- unsafe {
- stat buf;
-
- if (Wrapper.stat (name, &buf) != 0)
- continue;
- if ((buf.st_mode & Wrapper.S_IFDIR) == 0)
- fi [i++] = new FileInfo (name);
- else
- fi [i++] = new DirectoryInfo (name);
- }
- }
-
- return fi;
- }
-
- public void MoveTo (string dest)
- {
- if (dest == null)
- throw new ArgumentNullException ();
- if (dest == "")
- throw new ArgumentException ();
-
- if (Wrapper.rename (path, dest) != 0)
- throw new IOException ();
- }
-
- public override string ToString ()
- {
- return FullName;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs b/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs
deleted file mode 100755
index 9f91589bbc4..00000000000
--- a/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.IO.DirectoryNotFoundException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.IO {
-
- public class DirectoryNotFoundException : IOException {
- // Constructors
- public DirectoryNotFoundException ()
- : base ("Directory not found")
- {
- }
-
- public DirectoryNotFoundException (string message)
- : base (message)
- {
- }
-
- public DirectoryNotFoundException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/EndOfStreamException.cs b/mcs/class/corlib/System.IO/EndOfStreamException.cs
deleted file mode 100644
index 3e3292865cb..00000000000
--- a/mcs/class/corlib/System.IO/EndOfStreamException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.IO.EndOfStreamException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.IO
-{
- [Serializable]
- public class EndOfStreamException : SystemException
- {
- // Constructors
- public EndOfStreamException ()
- : base (Locale.GetText ("Failed to read past end of stream."))
- {
- }
-
- public EndOfStreamException (string message)
- : base (message)
- {
- }
-
- protected EndOfStreamException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public EndOfStreamException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/File.cs b/mcs/class/corlib/System.IO/File.cs
deleted file mode 100644
index f3ae249a77c..00000000000
--- a/mcs/class/corlib/System.IO/File.cs
+++ /dev/null
@@ -1,190 +0,0 @@
-//
-// System.IO.File.cs
-//
-//
-// Authors:
-// Miguel de Icaza (miguel@ximian.com)
-// Jim Richardson (develop@wtfo-guru.com)
-//
-// Copyright 2002 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-
-using System;
-using System.Private;
-
-namespace System.IO
-{
- /// <summary>
- ///
- /// </summary>
- public sealed class File : Object
- {
- const int COPY_BLOCK_SIZE = 32 * 1024;
-
- public static StreamWriter AppendText (string path)
- {
- return new StreamWriter (path, true);
- }
-
- public static void Copy (string sourceFilename, string destFilename)
- {
- Copy (sourceFilename, destFilename, true);
- }
-
- public static void Copy (string src, string dest, bool overrite)
- {
- if (src == null || dest == null)
- throw new ArgumentNullException ();
- if (src == "" || dest == null ||
- src.IndexOfAny (Path.InvalidPathChars) != -1 ||
- dest.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- using (FileStream src_stream = new FileStream (
- src, FileMode.Open, FileAccess.Read, FileShare.Read, COPY_BLOCK_SIZE),
- dst_stream = new FileStream (
- dest, FileMode.CreateNew, FileAccess.Write, FileShare.None,
- COPY_BLOCK_SIZE)){
- byte [] buffer = new byte [COPY_BLOCK_SIZE];
- int count;
-
- while ((count = src_stream.Read (buffer, 0, COPY_BLOCK_SIZE)) != 0)
- dst_stream.Write (buffer, 0, count);
- }
- }
-
- public static FileStream Create (string path)
- {
- return Create (path, 8192);
- }
-
- public static FileStream Create (string path, int buffersize)
- {
- return new FileStream (path, FileMode.Create, FileAccess.ReadWrite,
- FileShare.None, buffersize);
- }
-
- public static void Delete (string path)
- {
- int code;
-
- if (path == null)
- throw new ArgumentNullException ();
- if (path == "" || path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- code = Wrapper.unlink (path);
- if (code == Wrapper.EISDIR)
- throw new UnauthorizedAccessException ();
- else
- throw new IOException (Errno.Message (code));
- }
-
- public static bool Exists (string path)
- {
- unsafe {
- stat s;
-
- if (Wrapper.stat (path, &s) == 0)
- return true;
- return false;
- }
- }
-
- [MonoTODO]
- public static FileAttributes GetAttributes (string path)
- {
- throw new Exception ("Unimplemented");
- }
-
- [MonoTODO]
- public static DateTime GetCreationTime (string path)
- {
- throw new Exception ("Unimplemented");
- }
-
- [MonoTODO]
- public static DateTime GetLastAccessTime (string path)
- {
- throw new Exception ("Unimplemented");
- }
-
- [MonoTODO]
- public static DateTime GetLastWriteTime (string path)
- {
- throw new Exception ("Unimplemented");
- }
-
-
- public static void Move (string src, string dest)
- {
- if (src == null || dest == null)
- throw new ArgumentNullException ();
- if (src == "" || dest == null ||
- src.IndexOfAny (Path.InvalidPathChars) != -1 ||
- dest.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- int code = Wrapper.rename (src, dest);
- if (code == 0)
- return;
- throw new Exception (Errno.Message (code));
- }
-
- public static FileStream Open (string path, FileMode mode)
- {
- return new FileStream (path, mode, FileAccess.ReadWrite, FileShare.None);
- }
-
- public static FileStream Open (string path, FileMode mode, FileAccess access)
- {
- return new FileStream (path, mode, access, FileShare.None);
- }
-
- public static FileStream Open (string path, FileMode mode, FileAccess access,
- FileShare share)
- {
- return new FileStream (path, mode, access, share);
- }
-
- public static FileStream OpenRead (string path)
- {
- return new FileStream (path, FileMode.Open, FileAccess.Read, FileShare.Read);
- }
-
- public static StreamReader OpenText (string path)
- {
- return new StreamReader (path);
- }
-
- public FileStream OpenWrite (string path)
- {
- return new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);
- }
-
- [MonoTODO]
- public static void SetAttributes (string path, FileAttributes attributes)
- {
- throw new Exception ("Unimplemented");
- }
-
- [MonoTODO]
- public static void SetCreationTime (string path, DateTime creationTime)
- {
- throw new Exception ("Unimplemented");
- }
-
- [MonoTODO]
- public static void SetLastAccessTime (string path, DateTime accessTime)
- {
- throw new Exception ("Unimplemented");
- }
-
- [MonoTODO]
- public static void SetLastWriteTime (string path, DateTime modifiedTime)
- {
- throw new Exception ("Unimplemented");
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileAccess.cs b/mcs/class/corlib/System.IO/FileAccess.cs
deleted file mode 100644
index c6eefb3aa6f..00000000000
--- a/mcs/class/corlib/System.IO/FileAccess.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// FileAccess.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:32:20 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum FileAccess : int {
-
- /// <summary>
- /// </summary>
- Read = 0x00000001,
-
- /// <summary>
- /// </summary>
- Write = 0x00000002,
-
- /// <summary>
- /// </summary>
- ReadWrite = Read | Write,
- } // FileAccess
-
-} // System.IO
diff --git a/mcs/class/corlib/System.IO/FileAttributes.cs b/mcs/class/corlib/System.IO/FileAttributes.cs
deleted file mode 100644
index 674bc249827..00000000000
--- a/mcs/class/corlib/System.IO/FileAttributes.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.FileAttributes.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Monday, August 13, 2001
-//
-//------------------------------------------------------------------------------
-
-
-namespace System.IO
-{
- [Flags]
- public enum FileAttributes : int
- {
- Archive,
- Compressed,
- Device, // Reserved for future use.
- Directory,
- Encrypted,
- Hidden,
- Normal,
- NotContentIndexed,
- Offline,
- ReadOnly,
- ReparsePoint,
- SparseFile,
- System,
- Temporary
- }
-
-}
diff --git a/mcs/class/corlib/System.IO/FileInfo.cs b/mcs/class/corlib/System.IO/FileInfo.cs
deleted file mode 100644
index 94b97510b74..00000000000
--- a/mcs/class/corlib/System.IO/FileInfo.cs
+++ /dev/null
@@ -1,196 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.FileInfo.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Monday, August 13, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.PAL;
-//using System.Diagnostics;
-using System.Security.Permissions;
-
-namespace System.IO
-{
- /// <summary>
- ///
- /// </summary>
- public sealed class FileInfo : FileSystemInfo
- {
- private OpSys _os = Platform.OS;
-
- public FileInfo (string fileName)
- {
- CheckArgument.Path (fileName, false);
- //LAMESPEC: Does not throw security exception in constructor
- OriginalPath = fileName;
- }
-
- private bool existsOnDisk (bool exNotFound, bool exIsDirectory)
- {
- bool bRetCode;
-
- try
- {
- Refresh ();
- if ((getAttributes () & FileAttributes.Directory) != 0)
- {
- if (exIsDirectory)
- {
- throw new UnauthorizedAccessException ();
- }
- bRetCode = false;
- }
- else
- {
- bRetCode = true;
- }
- }
- catch (ArgumentException)
- {
- if (exNotFound)
- {
- throw new FileNotFoundException ();
- }
- bRetCode = false;
- }
- return bRetCode;
- }
-
- public override bool Exists
- {
- get
- {
- return existsOnDisk (false, false);
- }
- }
-
- public override string Name
- {
- get
- {
- return Path.GetFileName (getPathName ());
- }
- }
-
- /// <summary>
- /// Gets the parent directory info
- /// </summary>
- public DirectoryInfo Directory
- {
- get
- {
- return new DirectoryInfo (Path.GetDirectoryName (getPathName ()));
- }
- }
-
- /// <summary>
- /// Get the path of the file
- /// </summary>
- public string DirectoryName
- {
- get
- {
- return Path.GetDirectoryName (getPathName ());
- }
- }
-
- /// <summary>
- /// Get the length of the file
- /// </summary>
- public long Length
- {
- get
- {
- try
- {
- Refresh ();
- }
- catch (ArgumentException)
- {
- throw new FileNotFoundException ();
- }
- return _os.FileLength (getPathName ());
- }
- }
-
- [MonoTODO]
- public StreamWriter AppendText ()
- {
- return File.AppendText (OriginalPath);
- }
-
- public FileStream Create ()
- {
- return File.Create (OriginalPath);
- }
-
- [MonoTODO]
- public StreamWriter CreateText ()
- {
- return new StreamWriter (Open (FileMode.Create, FileAccess.Write));
- }
-
- public FileStream Open (FileMode mode)
- {
- return Open (mode, FileAccess.ReadWrite);
- }
-
- public FileStream Open (FileMode mode, FileAccess access)
- {
- return Open (mode, access, FileShare.None);
- }
-
- public FileStream Open (FileMode mode, FileAccess access, FileShare share)
- {
- bool bExists = existsOnDisk (false, true); // throw is directory;
- string path = getPathName ();
- CheckPermission.ModeAccess (mode, access, path, bExists);
- return new FileStream (path, mode, access, share);
- }
-
- [MonoTODO]
- public FileStream OpenRead ()
- {
- return Open (FileMode.Open, FileAccess.Read, FileShare.Read);
- }
-
- [MonoTODO]
- public StreamReader OpenText ()
- {
- return new StreamReader (Open (FileMode.OpenOrCreate, FileAccess.ReadWrite));
- }
-
- public FileStream OpenWrite ()
- {
- return Open (FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
- }
-
- public FileInfo CopyTo (string destFile)
- {
- return CopyTo (destFile, false);
- }
-
- public FileInfo CopyTo (string destFile, bool bOverwrite)
- {
- File.Copy (OriginalPath, destFile);
- return new FileInfo (destFile);
- }
-
- public override void Delete ()
- {
- existsOnDisk (true, true); // throw not found, is directory
- CheckPermission.Demand (FileIOPermissionAccess.AllAccess, getPathName ());
- _os.DeleteFile (getPathName ());
- }
-
- public void MoveTo (string destName)
- {
- File.Move (OriginalPath, destName);
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileLoadException.cs b/mcs/class/corlib/System.IO/FileLoadException.cs
deleted file mode 100755
index cf125c98be2..00000000000
--- a/mcs/class/corlib/System.IO/FileLoadException.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.IO.FileLoadException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.IO {
- [Serializable]
- public class FileLoadException : SystemException {
-
- // Fields
- string msg;
- Exception inner;
- string fileName;
- string fusionLog;
-
- // Constructors
- public FileLoadException ()
- : base (Locale.GetText ("I/O Error"))
- {
- msg = Locale.GetText ("I/O Error");
- }
-
- public FileLoadException (string message)
- : base (message)
- {
- msg = message;
- }
-
- public FileLoadException (string message, Exception inner)
- : base (message, inner)
- {
- msg = message;
- this.inner = inner;
- }
-
- protected FileLoadException (SerializationInfo info, StreamingContext context)
- {
- fileName = info.GetString ("FileLoad_FileName");
- fusionLog = info.GetString ("FileLoad_FusionLog");
- }
-
- // Properties
- public override string Message
- {
- get { return msg; }
- }
-
- public string FileName
- {
- get { return fileName; }
- }
-
- public string FusionLog
- {
- get { return fusionLog; }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("FileLoad_FileName", fileName);
- info.AddValue ("FileLoad_FusionLog", fusionLog);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileMode.cs b/mcs/class/corlib/System.IO/FileMode.cs
deleted file mode 100644
index 2f6fbbee30f..00000000000
--- a/mcs/class/corlib/System.IO/FileMode.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// FileMode.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:32:13 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO {
-
-
- /// <summary>
- /// </summary>
- public enum FileMode : int {
-
- /// <summary>
- /// </summary>
- CreateNew = 1,
-
- /// <summary>
- /// </summary>
- Create = 2,
-
- /// <summary>
- /// </summary>
- Open = 3,
-
- /// <summary>
- /// </summary>
- OpenOrCreate = 4,
-
- /// <summary>
- /// </summary>
- Truncate = 5,
-
- /// <summary>
- /// </summary>
- Append = 6,
- } // FileMode
-
-} // System.IO
diff --git a/mcs/class/corlib/System.IO/FileNotFoundException.cs b/mcs/class/corlib/System.IO/FileNotFoundException.cs
deleted file mode 100755
index e5b772193ed..00000000000
--- a/mcs/class/corlib/System.IO/FileNotFoundException.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// System.IO.FileNotFoundException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.IO {
-
- public class FileNotFoundException : SystemException {
- private string fileName;
- private string fusionLog;
- private string msg;
- private Exception inner;
-
- // Constructors
- public FileNotFoundException ()
- : base (Locale.GetText ("File not found"))
- {
- msg = "File not found";
- }
-
- public FileNotFoundException (string message)
- : base (message)
- {
- msg = message;
- }
-
- public FileNotFoundException (string message, Exception inner)
- : base (message, inner)
- {
- msg = message;
- this.inner = inner;
- }
-
- public FileNotFoundException (string message, string fileName)
- : base (message)
- {
- msg = message;
- this.fileName = fileName;
- }
-
- public FileNotFoundException (string message, string fileName, Exception innerException)
- : base (message, innerException)
- {
- msg = message;
- this.fileName = fileName;
- inner = innerException;
- }
-
- protected FileNotFoundException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- fileName = info.GetString ("FileNotFound_FileName");
- fusionLog = info.GetString ("FileNotFound_FusionLog");
-
- }
-
- public string FileName
- {
- get { return fileName; }
- }
-
- public string FusionLog
- {
- get { return fusionLog; }
- }
-
- public override string Message
- {
- get { return Locale.GetText (msg); }
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("FileNotFound_FileName", fileName);
- info.AddValue ("FileNotFound_FusionLog", fusionLog);
- }
-
- public override string ToString ()
- {
- return inner.ToString();
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileShare.cs b/mcs/class/corlib/System.IO/FileShare.cs
deleted file mode 100644
index 626b369e75a..00000000000
--- a/mcs/class/corlib/System.IO/FileShare.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// FileShare.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:32:26 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum FileShare : int {
-
- /// <summary>
- /// </summary>
- None = 0x00000000,
-
- /// <summary>
- /// </summary>
- Read = 0x00000001,
-
- /// <summary>
- /// </summary>
- Write = 0x00000002,
-
- /// <summary>
- /// </summary>
- ReadWrite = Read | Write,
- } // FileShare
-
-} // System.IO
diff --git a/mcs/class/corlib/System.IO/FileStream.cs b/mcs/class/corlib/System.IO/FileStream.cs
deleted file mode 100644
index 78ff1a42de7..00000000000
--- a/mcs/class/corlib/System.IO/FileStream.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-//
-// System.IO/FileStream.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System;
-using System.PAL;
-using System.Runtime.InteropServices;
-using System.Threading;
-
-// fixme: I do not know how to handle errno when calling PInvoke functions
-// fixme: emit the correct exceptions everywhere
-
-namespace System.IO
-{
-
- public class FileStream : Stream
- {
- private OpSys _os = Platform.OS;
- private IntPtr fdhandle;
- private FileAccess acc;
- private bool owner;
-
- public FileStream (IntPtr handle, FileAccess access)
- : this (handle, access, true, 0, false) {}
-
- public FileStream (IntPtr handle, FileAccess access, bool ownsHandle)
- : this (handle, access, ownsHandle, 0, false) {}
-
- public FileStream (IntPtr handle, FileAccess access, bool ownsHandle, int bufferSize)
- : this (handle, access, ownsHandle, bufferSize, false) {}
-
- public FileStream (IntPtr handle, FileAccess access, bool ownsHandle,
- int bufferSize, bool isAsync)
- {
- fdhandle = handle;
-
- //acc = access;
- //owner = ownsHandle;
- }
-
- public FileStream (string name, FileMode mode)
- : this (name, mode, FileAccess.ReadWrite, FileShare.ReadWrite, 0, false) {}
-
- public FileStream (string name, FileMode mode, FileAccess access)
- : this (name, mode, access, FileShare.ReadWrite, 0, false) {}
-
- public FileStream (string name, FileMode mode, FileAccess access, FileShare share)
- : this (name, mode, access, share, 0, false) {}
-
- public FileStream (string name, FileMode mode, FileAccess access,
- FileShare share, int buferSize)
- : this (name, mode, access, share, 0, false) {}
-
- // fixme: implement all share, buffer, async
- public FileStream (string name, FileMode mode, FileAccess access, FileShare share,
- int buferSize, bool useAsync)
- {
- if (name == null)
- throw new ArgumentNullException ();
- if (name == "" || name.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- fdhandle = _os.OpenFile (name, mode, access, share);
-
- /* Implement error checking, with some sort of access
- to the errno error reason
- if(fdhandle == error) {
- throw new IOException();
- }
- */
-
- acc = access;
- owner = true;
- }
-
- public override bool CanRead
- {
- get {
- switch (acc) {
- case FileAccess.Read:
- case FileAccess.ReadWrite:
- return true;
- case FileAccess.Write:
- default:
- return false;
- }
- }
- }
-
- public override bool CanSeek
- {
- get {
- // fixme: not alway true
- return true;
- }
- }
-
- public override bool CanWrite
- {
- get {
- switch (acc) {
- case FileAccess.Write:
- case FileAccess.ReadWrite:
- return true;
- default:
- return false;
- }
- }
- }
-
- unsafe public override long Length
- {
- get {
- return _os.FileLength (fdhandle);
- }
- }
-
- public override long Position
- {
- get {
- return _os.SeekFile (fdhandle, 0, SeekOrigin.Current);
- }
- set {
- _os.SeekFile (fdhandle, value, SeekOrigin.Begin);
- }
- }
-
- public override void Flush ()
- {
- }
-
- public override void Close ()
- {
- if (owner) {
- _os.CloseFile (fdhandle);
- }
- }
-
- public unsafe override int Read (byte[] buffer,
- int offset,
- int count)
- {
- return _os.ReadFile (fdhandle, buffer, offset, count);
- }
-
- public unsafe override int ReadByte ()
- {
- byte[] val = new byte[1];
- int res = Read (val, 0, 1);
-
- if (res == -1)
- throw new IOException();
- if (res == 0)
- return -1;
-
- return val[0];
- }
-
- public override long Seek (long offset,
- SeekOrigin origin)
- {
- return _os.SeekFile (fdhandle, offset, origin);
- }
-
- public override void SetLength (long value)
- {
- _os.SetLengthFile (fdhandle, value);
- }
-
- public unsafe override void Write (byte[] buffer,
- int offset,
- int count)
- {
- int res = _os.WriteFile (fdhandle, buffer, offset, count);
-
- if (res != count)
- throw new IOException();
- }
-
- public unsafe override void WriteByte (byte value)
- {
- byte[] buf = new byte[1];
-
- buf[0] = value;
-
- Write (buf, 0, 1);
- }
-
- public virtual IntPtr Handle
- {
- get {
- return(fdhandle);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileSystemInfo.cs b/mcs/class/corlib/System.IO/FileSystemInfo.cs
deleted file mode 100644
index a2a68b8abd8..00000000000
--- a/mcs/class/corlib/System.IO/FileSystemInfo.cs
+++ /dev/null
@@ -1,220 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.FileSystemInfo.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Monday, August 13, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace System.IO
-{
- /// <summary>
- ///
- /// </summary>
- public abstract class FileSystemInfo : MarshalByRefObject
- {
- // protected stat status;
- private bool inited;
-
- protected string FullPath;
- protected string OriginalPath;
-
- protected FileSystemInfo ()
- {
- /*
- status.st_dev = 0;
- status.st_mode = 0;
- status.st_nlink = 0;
- status.st_uid = 0;
- status.st_gid = 0;
- status.st_size = 0;
- status.st_atime = 0;
- status.st_mtime = 0;
- status.st_ctime = 0;
- */
-
- FullPath = OriginalPath = String.Empty;
- }
-
- [MonoTODO]
- public FileAttributes Attributes
- {
- get
- {
- return getAttributes ();
- }
- set
- {
- //TODO: Implement
- }
- }
-
- [MonoTODO]
- public DateTime CreationTime
- {
- get
- {
- if (!inited)
- {
- update ();
- }
- // TODO: fix next line as far as my research has taken me so far, Unix/Linux don't
- // have a creation time and according to my man the ctime if the last time
- // one of the chmod flags was changed
- return c2csharpTime (10);//status.st_ctime);
- }
- set
- {
- //TODO: Implement
- }
- }
-
- public abstract bool Exists {get;}
- public abstract string Name {get;}
- public abstract void Delete ();
-
- /// <summary>
- /// Get the extension of this item
- /// </summary>
- public string Extension
- {
- get
- {
- return Path.GetExtension (getPathName ());
- }
- }
-
- public string FullName
- {
- get
- {
- return getPathName ();
- }
- }
-
- [MonoTODO]
- public DateTime LastAccessTime
- {
- get
- {
- if (!inited)
- {
- update ();
- }
- return c2csharpTime (1);//status.st_atime);
- }
-
- set
- {
- // TODO: Implement
- }
- }
-
- [MonoTODO]
- public DateTime LastWriteTime
- { // TODO: Implement
- get
- {
- if (!inited)
- {
- update ();
- }
- return c2csharpTime (1);//status.st_mtime);
- }
- set
- { // TODO: Implement
- }
- }
-
- public override int GetHashCode ()
- {
- return getPathName ().GetHashCode ();
- }
-
- [MonoTODO]
- public override bool Equals (object obj)
- { // TODO: Implement
- return false;
- }
-
- [MonoTODO]
- new public static bool Equals (object obj1, object obj2)
- { // TODO: Implement
- return false;
- }
-
- public void Refresh ()
- {
- update ();
- }
-
-
- unsafe private void update ()
- {
- /*
- stat fs;
- int nRetCode = Wrapper.stat (getPathName (), &fs);
- status = fs;
- switch (nRetCode)
- {
- case 0:
- break;
- case Wrapper.ENOENT:
- case Wrapper.ENOTDIR:
- throw new ArgumentException ("File not found");
- //break; generates warning CS0162 unreachable code
- default:
- throw new IOException ();
- //break; generates warning CS0162 unreachable code
- }
- */
- inited = true;
- }
-
- [MonoTODO]
- private DateTime c2csharpTime (double seconds)
- { // TODO: determine if UTC time which the
- // calculation below is in is correct
- DateTime dt = new DateTime (1970, 1, 1, 0, 0, 0);
- dt.AddSeconds (seconds);
- return dt;
- }
-
- protected string getPathName ()
- {
- if (FullPath == String.Empty)
- FullPath = Path.GetFullPath (OriginalPath);
- return FullPath;
- }
-
- [MonoTODO]
- protected FileAttributes getAttributes ()
- {
- if (!inited)
- {
- update ();
- }
-
- // TODO: lots more attribute work needed
-
- FileAttributes attrib = 0;
- /*
- if (((status.st_mode & Wrapper.S_IFMT) & Wrapper.S_IFDIR) != 0)
- {
- attrib |= FileAttributes.Directory;
- }
- else
- {
- attrib |= FileAttributes.Normal;
- }
- */
-
- return attrib;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/IOException.cs b/mcs/class/corlib/System.IO/IOException.cs
deleted file mode 100644
index 44c06ffc4d1..00000000000
--- a/mcs/class/corlib/System.IO/IOException.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.IO.IOException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.IO {
-
- public class IOException : SystemException {
- // Constructors
- public IOException ()
- : base ("I/O Error")
- {
- }
-
- public IOException (string message)
- : base (message)
- {
- }
-
- public IOException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/MemoryStream.cs b/mcs/class/corlib/System.IO/MemoryStream.cs
deleted file mode 100644
index ce2a5e9c82a..00000000000
--- a/mcs/class/corlib/System.IO/MemoryStream.cs
+++ /dev/null
@@ -1,403 +0,0 @@
-//
-// System.IO.MemoryStream
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Clarify some of the lamespec issues
-//
-
-namespace System.IO {
- public class MemoryStream : Stream {
- private bool canRead;
- private bool canSeek;
- private bool canWrite;
-
- private bool allowGetBuffer;
-
- private int capacity;
-
- private byte[] internalBuffer;
-
- private int initialLength;
- private bool expandable;
-
- private bool streamClosed = false;
-
- private long position = 0;
-
- public MemoryStream() {
- canRead = true;
- canSeek = true;
- canWrite = true;
-
- capacity = 0;
-
- internalBuffer = new byte[0];
-
- allowGetBuffer = true;
- expandable = true;
- }
-
- public MemoryStream( byte[] buffer ) {
- InternalConstructor( buffer, 0, buffer.Length, true, false );
- }
-
- public MemoryStream( int capacity ) {
-
- canRead = true;
- canSeek = true;
- canWrite = true;
-
- this.capacity = capacity;
- initialLength = capacity;
- internalBuffer = new byte[ capacity ];
-
- expandable = true;
- allowGetBuffer = true;
- }
-
- public MemoryStream( byte[] buffer, bool writeable ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- }
-
- InternalConstructor( buffer, 0, buffer.Length, writeable, true );
-
- }
-
- public MemoryStream( byte[] buffer, int index, int count ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- }
-
- InternalConstructor( buffer, index, count, true, false );
- }
-
- public MemoryStream( byte[] buffer, int index, int count, bool writeable ) {
-
- if( buffer == null ) {
- throw new ArgumentNullException();
- }
-
- InternalConstructor( buffer, index, count, writeable, true );
- }
-
- public MemoryStream( byte[] buffer, int index, int count, bool writeable, bool publicallyVisible ) {
- InternalConstructor( buffer, index, count, writeable, publicallyVisible );
- }
-
- private void InternalConstructor( byte[] buffer, int index, int count, bool writeable, bool publicallyVisible ) {
-
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if ( index < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- } else if ( buffer.Length - index < count ) {
- throw new ArgumentException();
- }
-
- // LAMESPEC: The spec says to throw an UnauthorisedAccessException if
- // publicallyVisibile is fale?! Doesn't that defy the point of having
- // it there in the first place. I'll leave it out for now.
-
- canRead = true;
- canSeek = true;
- canWrite = writeable;
-
- initialLength = count;
-
- internalBuffer = new byte[ count ];
- capacity = count;
-
- Array.Copy( buffer, index, internalBuffer, 0, count );
-
- allowGetBuffer = publicallyVisible;
- expandable = false;
- }
-
- public override bool CanRead {
- get {
- return this.canRead;
- }
- }
-
- public override bool CanSeek {
- get {
- return this.canSeek;
- }
- }
-
- public override bool CanWrite {
- get {
- return this.canWrite;
- }
- }
-
- public virtual int Capacity {
- get {
- return this.capacity;
- }
-
- set {
- if( value < 0 || value < capacity ) {
- throw new ArgumentOutOfRangeException( "New capacity cannot be negative or less than the current capacity" );
- } else if( !expandable ) {
- throw new NotSupportedException( "Cannot expand this MemoryStream" );
- }
-
- byte[] newBuffer = new byte[ value ];
- Array.Copy( internalBuffer, 0, newBuffer, 0, capacity );
- capacity = value;
- }
- }
-
- public override long Length {
- get {
- // LAMESPEC: The spec says to throw an IOException if the
- // stream is closed and an ObjectDisposedException if
- // "methods were called after the stream was closed". What
- // is the difference?
-
- if( streamClosed ) {
- throw new IOException( "MemoryStream is closed" );
- }
-
- return internalBuffer.Length;
- }
- }
-
- public override long Position {
- get {
- if( streamClosed ) {
- throw new IOException( "MemoryStream is closed" );
- }
-
- return position;
- }
-
- set {
-
- if( position < 0 ) {
- throw new ArgumentOutOfRangeException( "Position cannot be negative" );
- } else if( streamClosed ) {
- throw new IOException( "MemoryStream is closed" );
- }
-
- position = value;
-
- if( position > internalBuffer.Length + 1 ) {
- position = internalBuffer.Length + 1;
- }
- }
- }
-
- public override void Close() {
- if( streamClosed ) {
- throw new IOException( "MemoryStream already closed" );
- }
-
- streamClosed = true;
- Dispose( true );
- }
-
- protected override void Dispose( bool disposing ) { }
-
- public override void Flush() { }
-
- public virtual byte[] GetBuffer() {
- if( !allowGetBuffer ) {
- throw new UnauthorizedAccessException();
- }
-
- return internalBuffer;
- }
-
- public override int Read( byte[] buffer, int offset, int count ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if( offset < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- } else if( internalBuffer.Length - offset < count ) {
- throw new ArgumentException();
- } else if ( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- }
-
- long ReadTo;
-
- if( position + count > internalBuffer.Length ) {
- ReadTo = internalBuffer.Length;
- } else {
- ReadTo = position + (long)count;
- }
-
- Array.Copy( internalBuffer, (int)position, buffer, offset, (int)(ReadTo - position) );
-
- int bytesRead = (int)(ReadTo - position);
-
- position = ReadTo;
-
- return bytesRead;
- }
-
- public override int ReadByte( ) {
- if( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- }
-
-
- // LAMESPEC: What happens if we're at the end of the stream? It's unspecified in the
- // docs but tests against the MS impl. show it returns -1
- //
-
- if( position >= internalBuffer.Length ) {
- return -1;
- } else {
- return internalBuffer[ position++ ];
- }
- }
-
- public override long Seek( long offset, SeekOrigin loc ) {
- long refPoint;
-
- if( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- }
-
- switch( loc ) {
- case SeekOrigin.Begin:
- refPoint = 0;
- break;
- case SeekOrigin.Current:
- refPoint = position;
- break;
- case SeekOrigin.End:
- refPoint = internalBuffer.Length;
- break;
- default:
- throw new ArgumentException( "Invalid SeekOrigin" );
- }
-
- // LAMESPEC: My goodness, how may LAMESPECs are there in this
- // class! :) In the spec for the Position property it's stated
- // "The position must not be more than one byte beyond the end of the stream."
- // In the spec for seek it says "Seeking to any location beyond the length of the
- // stream is supported." That's a contradiction i'd say.
- // I guess seek can go anywhere but if you use position it may get moved back.
-
- if( refPoint + offset < 0 ) {
- throw new IOException( "Attempted to seek before start of MemoryStream" );
- } else if( offset > internalBuffer.Length ) {
- throw new ArgumentOutOfRangeException( "Offset cannot be greater than length of MemoryStream" );
- }
-
- position = refPoint + offset;
-
- return position;
- }
-
-
- public override void SetLength( long value ) {
- if( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- } else if( !expandable && value > capacity ) {
- throw new NotSupportedException( "Expanding this MemoryStream is not supported" );
- } else if( !canWrite ) {
- throw new IOException( "Cannot write to this MemoryStream" );
- } else if( value < 0 ) {
-
- // LAMESPEC: AGAIN! It says to throw this exception if value is
- // greater than "the maximum length of the MemoryStream". I haven't
- // seen anywhere mention what the maximum length of a MemoryStream is and
- // since we're this far this memory stream is expandable.
-
- throw new ArgumentOutOfRangeException();
- }
-
- byte[] newBuffer;
- newBuffer = new byte[ value ];
-
- if( value < capacity ) {
- // truncate
- Array.Copy( internalBuffer, 0, newBuffer, 0, (int)value );
- } else {
- // expand
- Array.Copy( internalBuffer, 0, newBuffer, 0, internalBuffer.Length );
- }
- internalBuffer = newBuffer;
- capacity = (int)value;
-
- }
-
-
- public virtual byte[] ToArray() {
-
- if( streamClosed ) {
- throw new ArgumentException( "The MemoryStream has been closed" );
- }
-
- byte[] outBuffer = new byte[capacity];
- Array.Copy( internalBuffer, 0, outBuffer, 0, capacity);
- return outBuffer;
- }
-
- // LAMESPEC: !! It says that "offset" is "offset in buffer at which
- // to begin writing", I presume this should be "offset in buffer at which
- // to begin reading"
-
- public override void Write( byte[] buffer, int offset, int count ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if( !canWrite ) {
- throw new NotSupportedException();
- } else if( buffer.Length - offset < count ) {
- throw new ArgumentException();
- } else if( offset < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- } else if( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- }
-
- if( position + count > capacity ) {
- if( expandable ) {
- // expand the buffer
- SetLength( position + count );
- } else {
- // only write as many bytes as will fit
- count = (int)((long)capacity - position);
- }
- }
-
- Array.Copy( buffer, offset, internalBuffer, (int)position, count );
- position += count;
-
- }
-
-
- public override void WriteByte( byte value ) {
- if( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- }
-
- if( position >= capacity ) {
- SetLength( capacity + 1 );
- }
-
- internalBuffer[ position++ ] = value;
- }
-
-
- public virtual void WriteTo( Stream stream ) {
- if( stream == null ) {
- throw new ArgumentNullException();
- }
-
- stream.Write( internalBuffer, 0, internalBuffer.Length );
-
- }
-
-
- }
-
-
-}
diff --git a/mcs/class/corlib/System.IO/Path.cs b/mcs/class/corlib/System.IO/Path.cs
deleted file mode 100644
index 8aa628da5a1..00000000000
--- a/mcs/class/corlib/System.IO/Path.cs
+++ /dev/null
@@ -1,240 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.Path.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Saturday, August 11, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.PAL;
-
-namespace System.IO
-{
- public class Path
- {
- private static OpSys _os = Platform.OS;
-
- public static readonly char AltDirectorySeparatorChar = _os.AltDirectorySeparator;
- public static readonly char DirectorySeparatorChar = _os.DirectorySeparator;
- public static readonly char[] InvalidPathChars = _os.InvalidPathChars;
- public static readonly char PathSeparator = _os.PathSeparator;
- internal static readonly string DirectorySeparatorStr = _os.DirectorySeparator + "";
- public static readonly char VolumeSeparatorChar = _os.VolumeSeparator;
-
- private static readonly char[] PathSeparatorChars = { DirectorySeparatorChar,
- AltDirectorySeparatorChar,
- VolumeSeparatorChar };
-
- // class methods
- public static string ChangeExtension (string path, string extension)
- {
- if (path == null)
- {
- return null;
- }
-
- int iExt = findExtension (path);
-
- if (iExt < 0)
- {
- return extension == null ? path : path + extension;
- }
- else if (iExt > 0)
- {
- string temp = path.Substring (0, iExt);
- if (extension != null)
- {
- return temp + extension;
- }
- return temp;
- }
-
- return extension;
- }
-
- [MonoTODO]
- public static string Combine (string path1, string path2)
- {
- if (path1 == null || path2 == null)
- {
- return null;
- }
-
- CheckArgument.Empty (path2);
-
- // TODO: Check for invalid DirectoryInfo characters
- // although I don't think it is necesary for linux
-
- // TODO: Verify functionality further after NUnit tests written
- // since the documentation was rather sketchy
-
- if (IsPathRooted (path2))
- {
- if (path1.Equals (string.Empty))
- {
- return path2;
- }
- throw new ArgumentException ("Rooted path");
- }
-
- string dirSep = new string (DirectorySeparatorChar, 1);
- string altSep = new string (AltDirectorySeparatorChar, 1);
-
- bool b1 = path1.EndsWith (dirSep) || path1.EndsWith (dirSep);
- bool b2 = path2.StartsWith (dirSep) || path2.StartsWith (altSep);
- if (b1 && b2)
- {
- throw new ArgumentException ("Invalid combination");
- }
-
- if (!b1 && !b2)
- {
- return path1 + dirSep + path2;
- }
-
- return path1 + path2;
- }
-
- public static string GetDirectoryName (string path)
- {
- if (path != null)
- {
- CheckArgument.Empty (path);
- CheckArgument.WhitespaceOnly (path);
- CheckArgument.PathChars (path);
-
- if (path.Length > 2)
- {
- int nLast = path.LastIndexOfAny (PathSeparatorChars, path.Length - 2);
-
- if (nLast > 0)
- {
- return path.Substring (0, nLast);
- }
- }
- }
- return path;
- }
-
- public static string GetExtension (string path)
- {
- if (path == null)
- {
- return string.Empty;
- }
-
- CheckArgument.Empty (path);
- CheckArgument.WhitespaceOnly (path);
-
- int iExt = findExtension (path);
- int iLastSep = path.LastIndexOfAny ( PathSeparatorChars );
-
- if (iExt > -1)
- { // okay it has an extension
- return path.Substring (iExt);
- }
- return string.Empty;
- }
-
- public static string GetFileName (string path)
- {
- if (path == null)
- {
- return string.Empty;
- }
-
- CheckArgument.Empty (path);
- CheckArgument.WhitespaceOnly (path);
-
- int nLast = path.LastIndexOfAny (PathSeparatorChars);
-
- if (nLast > 0)
- {
- return path.Substring (nLast + 1);
- }
-
- return nLast == 0 ? null : path;
- }
-
- public static string GetFileNameWithoutExtension (string path)
- {
- return ChangeExtension (GetFileName (path), null);
- }
-
- public static string GetFullPath (string path)
- {
- if (path == null)
- throw (new ArgumentNullException (
- "path",
- "You must specify a path when calling System.IO.Path.GetFullPath"));
-
- if (path.StartsWith (new string (DirectorySeparatorChar, 1)) ||
- path.StartsWith (new string (AltDirectorySeparatorChar, 1)))
- return path;
-
- return Directory.GetCurrentDirectory () + new string (DirectorySeparatorChar, 1) + path;
- }
-
- public static string GetPathRoot (string path)
- {
- if (path != null ||
- (path.StartsWith (new string (DirectorySeparatorChar, 1)) ||
- path.StartsWith (new string (AltDirectorySeparatorChar, 1))))
- {
- return path.Substring (0, 1);
- }
- return null;
- }
-
- [MonoTODO]
- public static string GetTempFileName ()
- {
- //TODO: Implement method
- return string.Empty;
- }
-
- /// <summary>
- /// Returns the path of the current systems temp directory
- /// </summary>
- [MonoTODO]
- public static string GetTempPath ()
- { // TODO: This might vary with distribution and there
- // might be an api to provide it. Research is needed
- return "/tmp";
- }
-
- public static bool HasExtension (string path)
- {
- CheckArgument.Null (path);
- CheckArgument.Empty (path);
- CheckArgument.WhitespaceOnly (path);
-
- return findExtension (path) > -1;
- }
-
- public static bool IsPathRooted (string path)
- {
- return path.StartsWith (new string (VolumeSeparatorChar,1));
- }
-
- // private class methods
-
- private static int findExtension (string path)
- {
- // method should return the index of the path extension
- // start or -1 if no valid extension
- if (path != null){
- int iLastDot = path.LastIndexOf (".");
- int iLastSep = path.LastIndexOfAny ( PathSeparatorChars );
-
- if (iLastDot > iLastSep)
- return iLastDot;
- }
- return -1;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/PathTooLongException.cs b/mcs/class/corlib/System.IO/PathTooLongException.cs
deleted file mode 100644
index 80fa3b32672..00000000000
--- a/mcs/class/corlib/System.IO/PathTooLongException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.IO.PathTooLongException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.IO
-{
- [Serializable]
- public class PathTooLongException : SystemException
- {
- // Constructors
- public PathTooLongException ()
- : base (Locale.GetText ("Pathname is longer than the maximum length"))
- {
- }
-
- public PathTooLongException (string message)
- : base (message)
- {
- }
-
- protected PathTooLongException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public PathTooLongException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/SeekOrigin.cs b/mcs/class/corlib/System.IO/SeekOrigin.cs
deleted file mode 100644
index 1cd2cf84165..00000000000
--- a/mcs/class/corlib/System.IO/SeekOrigin.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// SeekOrigin.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:32:32 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO {
-
-
- /// <summary>
- /// </summary>
- [Serializable]
- public enum SeekOrigin : int {
-
- /// <summary>
- /// </summary>
- Begin = 0,
-
- /// <summary>
- /// </summary>
- Current = 1,
-
- /// <summary>
- /// </summary>
- End = 2,
- } // SeekOrigin
-
-} // System.IO
diff --git a/mcs/class/corlib/System.IO/Stream.cs b/mcs/class/corlib/System.IO/Stream.cs
deleted file mode 100755
index 3edd77eb240..00000000000
--- a/mcs/class/corlib/System.IO/Stream.cs
+++ /dev/null
@@ -1,210 +0,0 @@
-//
-// System.IO/Stream.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Threading;
-
-namespace System.IO
-{
-
- public abstract class Stream : MarshalByRefObject, IDisposable
- {
- // public static readonly Stream Null;
-
- static Stream ()
- {
- //Null = new NullStream ();
- }
-
- protected Stream ()
- {
- }
-
- public abstract bool CanRead
- {
- get;
- }
-
- public abstract bool CanSeek
- {
- get;
- }
-
- public abstract bool CanWrite
- {
- get;
- }
-
- public abstract long Length
- {
- get;
- }
-
- public abstract long Position
- {
- get;
- set;
- }
-
-
- public virtual void Close ()
- {
- Flush ();
- }
-
- public virtual void Dispose ()
- {
- }
-
- protected virtual WaitHandle CreateWaitHandle()
- {
- return(null);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- }
-
- ~Stream ()
- {
- }
-
- public abstract void Flush ();
-
- public abstract int Read (byte[] buffer,
- int offset,
- int count);
-
- public virtual int ReadByte ()
- {
- byte[] buffer = new byte [1];
-
- if (Read (buffer, 0, 1) == 1)
- return buffer [0];
-
- return -1;
- }
-
- public abstract long Seek (long offset,
- SeekOrigin origin);
-
- public abstract void SetLength (long value);
-
- public abstract void Write (byte[] buffer,
- int offset,
- int count);
-
- public virtual void WriteByte (byte value)
- {
- byte[] buffer = new byte [1];
-
- buffer [0] = value;
-
- Write (buffer, 0, 1);
- }
- }
-
- class NullStream : Stream
- {
- private long position = 0;
- private long length = System.Int64.MaxValue;
-
- public override bool CanRead
- {
- get {
- return true;
- }
- }
-
- public override bool CanSeek
- {
- get {
- return true;
- }
- }
-
- public override bool CanWrite
- {
- get {
- return true;
- }
- }
-
- public override long Length
- {
- get {
- return length;
- }
- }
-
- public override long Position
- {
- get {
- return position;
- }
- set {
- position = value;
- }
- }
-
- public override void Flush ()
- {
- }
-
- public override int Read (byte[] buffer,
- int offset,
- int count)
- {
- int max = offset + count;
-
- for (int i = offset; i < max; i++)
- buffer [i] = 0;
-
- return count;
- }
-
- public override int ReadByte ()
- {
- return 0;
- }
-
- public override long Seek (long offset,
- SeekOrigin origin)
- {
- switch (origin) {
- case SeekOrigin.Begin:
- position = offset;
- break;
- case SeekOrigin.Current:
- position = position + offset;
- break;
- case SeekOrigin.End:
- position = Length - offset;
- break;
- }
-
- return position;
- }
-
- public override void SetLength (long value)
- {
- length = value;
- }
-
- public override void Write (byte[] buffer,
- int offset,
- int count)
- {
- }
-
- public override void WriteByte (byte value)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/StreamReader.cs b/mcs/class/corlib/System.IO/StreamReader.cs
deleted file mode 100644
index 3175cec0c7c..00000000000
--- a/mcs/class/corlib/System.IO/StreamReader.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// System.IO.StreamReader.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-using System;
-using System.Text;
-
-namespace System.IO {
-
- public class StreamReader : TextReader {
-
- private Encoding internalEncoding;
-
- private Stream internalStream;
-
- // new public static readonly StreamReader Null;
-
- public StreamReader(Stream stream)
- : this (stream, null, false, 0) { }
-
- public StreamReader(Stream stream, bool detectEncodingFromByteOrderMarks)
- : this (stream, null, detectEncodingFromByteOrderMarks, 0) { }
-
- public StreamReader(Stream stream, Encoding encoding)
- : this (stream, encoding, false, 0) { }
-
- public StreamReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks)
- : this (stream, encoding, detectEncodingFromByteOrderMarks, 0) { }
-
- public StreamReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize)
- {
- internalStream = stream;
-
- if (encoding == null)
- internalEncoding = Encoding.UTF8;
- else
- internalEncoding = encoding;
-
- }
-
- public StreamReader(string path)
- : this (path, null, false, 0) { }
-
- public StreamReader(string path, bool detectEncodingFromByteOrderMarks)
- : this (path, null, detectEncodingFromByteOrderMarks, 0) { }
-
- public StreamReader(string path, Encoding encoding)
- : this (path, encoding, false, 0) { }
-
- public StreamReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks)
- : this (path, encoding, detectEncodingFromByteOrderMarks, 0) { }
-
- public StreamReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize)
- {
- //internalStream = stream;
-
- if (encoding == null)
- internalEncoding = Encoding.UTF8;
- else
- internalEncoding = encoding;
-
- }
-
- public virtual Stream BaseStream
- {
- get {
- return internalStream;
- }
- }
-
- public Encoding CurrentEncoding
- {
- get {
- return internalEncoding;
- }
- }
-
- [MonoTODO]
- public override int Peek ()
- {
- // FIXME: handle encoding....
- int val = internalStream.ReadByte ();
- if (val != -1)
- internalStream.Seek (-1, SeekOrigin.Current);
- return val;
- }
-
- public override int Read ()
- {
- return internalStream.ReadByte ();
- }
-
- public override int Read (char[] buffer, int index, int count)
- {
- return 0;
- }
-
- public override string ReadLine()
- {
- return String.Empty;
- }
-
- public override string ReadToEnd()
- {
- return String.Empty;
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/StreamWriter.cs b/mcs/class/corlib/System.IO/StreamWriter.cs
deleted file mode 100644
index e4d4e28b110..00000000000
--- a/mcs/class/corlib/System.IO/StreamWriter.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// System.IO.StreamWriter.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Text;
-
-namespace System.IO {
-
- public class StreamWriter : TextWriter {
-
- private Encoding internalEncoding;
-
- private Stream internalStream;
-
- private bool iflush;
-
- // new public static readonly StreamWriter Null;
-
- public StreamWriter (Stream stream)
- : this (stream, null, 0) {}
-
- public StreamWriter (Stream stream, Encoding encoding)
- : this (stream, encoding, 0) {}
-
- public StreamWriter (Stream stream, Encoding encoding, int bufferSize)
- {
- internalStream = stream;
-
- if (encoding == null)
- internalEncoding = Encoding.UTF8;
- else
- internalEncoding = encoding;
- }
-
- public StreamWriter (string path)
- : this (path, true, null, 0) {}
-
- public StreamWriter (string path, bool append)
- : this (path, append, null, 0) {}
-
- public StreamWriter (string path, bool append, Encoding encoding)
- : this (path, append, encoding, 0) {}
-
- public StreamWriter (string path, bool append, Encoding encoding, int bufferSize)
- {
- FileMode mode;
-
- if (append)
- mode = FileMode.Append;
- else
- mode = FileMode.Create;
-
- internalStream = new FileStream (path, mode, FileAccess.Write);
-
- if (encoding == null)
- internalEncoding = Encoding.UTF8;
- else
- internalEncoding = encoding;
-
- }
-
- public virtual bool AutoFlush
- {
-
- get {
- return iflush;
- }
-
- set {
- iflush = value;
- }
- }
-
- public virtual Stream BaseStream
- {
- get {
- return internalStream;
- }
- }
-
- public override Encoding Encoding
- {
- get {
- return internalEncoding;
- }
- }
-
- protected override void Dispose( bool disposing )
- {
- // fixme: implement me
- }
-
- public override void Flush ()
- {
- // fixme: implement me
- }
-
- public override void Write (char[] buffer, int index, int count)
- {
- byte[] res = new byte [internalEncoding.GetMaxByteCount (buffer.Length)];
- int len;
-
- len = internalEncoding.GetBytes (buffer, index, count, res, 0);
-
- internalStream.Write (res, 0, len);
-
- }
-
- public override void Write(string value)
- {
- Write (value.ToCharArray (), 0, value.Length);
- }
-
-
- }
-}
-
-
diff --git a/mcs/class/corlib/System.IO/StringReader.cs b/mcs/class/corlib/System.IO/StringReader.cs
deleted file mode 100644
index 713327a3797..00000000000
--- a/mcs/class/corlib/System.IO/StringReader.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// System.IO.StringReader
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-
-
-using System;
-
-namespace System.IO {
- public class StringReader : TextReader {
-
- protected string source;
- protected char[] sourceChars;
-
- protected int nextChar;
- protected int sourceLength;
-
- public StringReader( string s ) {
- this.source = s;
- nextChar = 0;
- sourceLength = s.Length;
- sourceChars = s.ToCharArray();
- }
-
- public override void Close() {
- Dispose( true );
- }
-
- protected override void Dispose( bool disposing ) {
- return;
- }
-
- public override int Peek() {
- if( nextChar > sourceLength ) {
- return -1;
- } else {
- return (int)source[ nextChar ];
- }
- }
-
- public override int Read() {
- if( nextChar > sourceLength ) {
- return -1;
- } else {
- return (int)source[ nextChar++ ];
- }
- }
-
-
- // The method will read up to count characters from the StringReader
- // into the buffer character array starting at position index. Returns
- // the actual number of characters read, or zero if the end of the string
- // has been reached and no characters are read.
-
- public override int Read( char[] buffer, int index, int count ) {
-
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if( buffer.Length - index < count ) {
- throw new ArgumentException();
- } else if( index < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- }
-
- int charsToRead;
-
- if( nextChar + count > sourceLength ) {
- charsToRead = sourceLength - nextChar;
- } else {
- charsToRead = count;
- }
-
- Array.Copy(sourceChars, nextChar, buffer, index, charsToRead );
-
- nextChar += count;
-
- return charsToRead;
- }
-
- public override string ReadLine() {
- // Reads until next \r or \n or \r\n, otherwise return null
-
- // LAMESPEC:
- // The Beta 2 SDK help says that the ReadLine method returns
- // "The next line from the input stream [...] A line is defined as a sequence of
- // characters followed by a carriage return (\r), a line feed (\n), or a carriage
- // return immediately followed by a line feed (\r\n). [...]
- // The returned value is a null reference if the end of the input stream has been reached."
- //
- // HOWEVER, the MS implementation returns the rest of the string if no \r and/or \n is found
- // in the string
-
-
- int nextCR = source.IndexOf( '\r', nextChar );
- int nextLF = source.IndexOf( '\n', nextChar );
-
- if( nextCR == -1 && nextLF == -1 ) {
- return ReadToEnd();
- }
-
- if( nextChar > sourceLength ) return null;
-
- int readTo;
-
- if( nextCR == -1 ) {
- readTo = nextLF;
- } else {
- readTo = nextCR;
- }
-
- string nextLine = source.Substring( nextChar, readTo - nextChar );
-
- if( nextLF == nextCR + 1 ) {
- nextChar = readTo + 2;
- } else {
- nextChar = readTo + 1;
- }
-
- return nextLine;
- }
-
- public override string ReadToEnd() {
- string toEnd = source.Substring( nextChar, sourceLength - nextChar );
- nextChar = sourceLength;
- return toEnd;
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/StringWriter.cs b/mcs/class/corlib/System.IO/StringWriter.cs
deleted file mode 100644
index 39e80663c86..00000000000
--- a/mcs/class/corlib/System.IO/StringWriter.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-
-using System.Text;
-
-namespace System.IO {
- public class StringWriter : TextWriter {
-
- protected StringBuilder internalString;
-
- public StringWriter() {
- internalString = new StringBuilder();
- }
-
- public StringWriter( IFormatProvider formatProvider ) {
- internalFormatProvider = formatProvider;
- }
-
- public StringWriter( StringBuilder sb ) {
- internalString = sb;
- }
-
- public StringWriter( StringBuilder sb, IFormatProvider formatProvider ) {
- internalString = sb;
- internalFormatProvider = formatProvider;
- }
-
- public override System.Text.Encoding Encoding {
- get {
- // TODO: Implement
- return null;
- }
- }
-
- public override void Close() {
- Dispose( true );
- }
-
- protected override void Dispose( bool disposing ) { }
-
- public virtual StringBuilder GetStringBuilder() {
- return internalString;
- }
-
- public override string ToString() {
- return internalString.ToString();
- }
-
- public override void Write( char value ) {
- internalString.Append( value );
- }
-
- public override void Write( string value ) {
- internalString.Append( value );
- }
-
- public override void Write( char[] buffer, int index, int count ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if( index < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- } else if( index > buffer.Length || index + count > buffer.Length ) {
- throw new ArgumentException();
- }
-
- char[] writeBuffer = new char[ count ];
-
- Array.Copy( buffer, index, writeBuffer, 0, count );
-
- internalString.Append( writeBuffer );
- }
-
- }
-}
-
-
diff --git a/mcs/class/corlib/System.IO/TextReader.cs b/mcs/class/corlib/System.IO/TextReader.cs
deleted file mode 100644
index d6ac7b70ad5..00000000000
--- a/mcs/class/corlib/System.IO/TextReader.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.IO.TextReader
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Implement the Thread Safe stuff
-//
-
-using System;
-
-namespace System.IO {
-
- [MonoTODO]
- public abstract class TextReader : MarshalByRefObject, IDisposable {
-
- protected TextReader() { }
-
- public static readonly TextReader Null;
-
- public virtual void Close()
- {
- Dispose(true);
- }
-
- void System.IDisposable.Dispose()
- {
- Dispose(true);
- }
-
- protected virtual void Dispose( bool disposing )
- {
- return;
- }
-
- public virtual int Peek()
- {
- return -1;
- }
-
- public virtual int Read()
- {
- return -1;
- }
-
- // LAMESPEC: The Beta2 docs say this should be Read( out char[] ...
- // whereas the MS implementation is just Read( char[] ... )
- // Not sure which one is right, we'll see in Beta3 :)
-
- public virtual int Read (char[] buffer, int index, int count)
- {
- int c, i;
-
- for (i = 0; i < count; i++) {
- if ((c = Read ()) == -1)
- return i;
- buffer [index + i] = (char)c;
- }
-
- return i;
- }
-
- public virtual int ReadBlock( char[] buffer, int index, int count )
- {
- return 0;
- }
-
- public virtual string ReadLine()
- {
- return String.Empty;
- }
-
- public virtual string ReadToEnd()
- {
- return String.Empty;
- }
-
- [MonoTODO]
- public static TextReader Synchronised( TextReader reader )
- {
- // TODO: Implement
- return Null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/TextWriter.cs b/mcs/class/corlib/System.IO/TextWriter.cs
deleted file mode 100644
index a43ffe331af..00000000000
--- a/mcs/class/corlib/System.IO/TextWriter.cs
+++ /dev/null
@@ -1,271 +0,0 @@
-//
-// System.IO.TextWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Implement the Thread Safe stuff
-
-namespace System.IO {
-
- [MonoTODO]
- public abstract class TextWriter : MarshalByRefObject, IDisposable {
-
- protected TextWriter() {
- coreNewLine = "\n".ToCharArray ();
- }
-
- protected TextWriter( IFormatProvider formatProvider ) {
- internalFormatProvider = formatProvider;
- }
-
- protected char[] coreNewLine;
-
- protected IFormatProvider internalFormatProvider;
-
- public static readonly TextWriter Null;
-
- public abstract System.Text.Encoding Encoding { get; }
-
- public virtual IFormatProvider FormatProvider {
- get {
- return internalFormatProvider;
- }
- }
-
- public virtual string NewLine {
- get {
- return new String(coreNewLine);
- }
-
- set {
- coreNewLine = value.ToCharArray();
- }
- }
-
- public virtual void Close () {
- Dispose (true);
- }
-
- protected virtual void Dispose (bool disposing) { }
-
- void System.IDisposable.Dispose () {
- Dispose (true);
- }
-
-
- public virtual void Flush()
- {
- // do nothing
- }
-
- [MonoTODO]
- public static TextWriter Synchronised (TextWriter writer)
- {
- // TODO: Implement.
-
- return Null;
- }
-
- public virtual void Write (bool value)
- {
- Write (value.ToString ());
- }
-
- public virtual void Write (char value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (char[] value)
- {
- Write (new String (value));
- }
-
- public virtual void Write (decimal value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (double value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (int value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (long value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (object value)
- {
- Write (value.ToString ());
- }
-
- public virtual void Write (float value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (string value)
- {
- // do nothing
- }
-
- [CLSCompliant(false)]
- public virtual void Write (uint value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- [CLSCompliant(false)]
- public virtual void Write (ulong value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (string format, object arg0)
- {
- Write (String.Format (format, arg0));
- }
-
- public virtual void Write (string format, params object[] arg)
- {
- Write (String.Format (format, arg));
- }
-
- public virtual void Write (char[] buffer, int index, int count)
- {
- Write (new String (buffer, index, count));
- }
-
- public virtual void Write (string format, object arg0, object arg1)
- {
- Write (String.Format (format, arg0, arg1));
- }
-
- public virtual void Write (string format, object arg0, object arg1, object arg2 )
- {
- Write (String.Format (format, arg0, arg1, arg2));
- }
-
- public virtual void WriteLine ()
- {
- Write (NewLine);
- }
-
- public virtual void WriteLine (bool value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (char value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (char[] value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (decimal value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (double value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (int value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (long value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (object value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (float value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (string value)
- {
- Write (value);
- WriteLine();
- }
-
- [CLSCompliant(false)]
- public virtual void WriteLine (uint value)
- {
- Write (value);
- WriteLine();
- }
-
- [CLSCompliant(false)]
- public virtual void WriteLine (ulong value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (string format, object arg0)
- {
- Write (format, arg0);
- WriteLine();
- }
-
- public virtual void WriteLine (string format, params object[] arg)
- {
- Write (format, arg);
- WriteLine();
- }
-
- public virtual void WriteLine (char[] buffer, int index, int count)
- {
- Write (buffer, index, count);
- WriteLine();
- }
-
- public virtual void WriteLine (string format, object arg0, object arg1)
- {
- Write (format, arg0, arg1);
- WriteLine();
- }
-
- public virtual void WriteLine (string format, object arg0, object arg1, object arg2)
- {
- Write (format, arg0, arg1, arg2);
- WriteLine();
- }
-
- }
-}
-
-
-
-
-
diff --git a/mcs/class/corlib/System.PAL/IOperatingSystem.cs b/mcs/class/corlib/System.PAL/IOperatingSystem.cs
deleted file mode 100644
index 15c57faae36..00000000000
--- a/mcs/class/corlib/System.PAL/IOperatingSystem.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-/*---------------------------------------------------------------------
-
- XX X XXX
- XX XX
- XXX XX XXX XXXXX XX
- XX XXX XX XX XX
- XX XX XX XX XXXXX XX
- XX XX XX XX XX XX X XX
- XXXX XX XX XXX XXXXXXX XXXX
- XX
- XXXXX
-
-Copyright (c) 2001 Intel Corporation. All Rights Reserved.
-
-CREATED: August 08, 2001
-OWNER: Scott D Smith, Joel Marcey
-VERSION: 1.0
----------------------------------------------------------------------*/
-
-
-using System;
-using System.IO;
-using System.Collections;
-
-namespace System.PlatformAbstractionLayer
-{
- /// <summary>
- /// Definition of functionality needed by the library that can only be provided by the underlying OS.
- /// </summary>
- internal interface IOperatingSystem
- {
-
- // System.IO services
-
- int ReadStdInput(byte[] buffer, int offset, int count);
-
- void FlushStdOutput(byte[] byteBuf);
-
-
-
- // System.File services
-
- int ReadFile(IntPtr handle, byte[] buffer, int offset, int count);
-
- int WriteFile(IntPtr handle, byte[] buffer, int offset, int count);
-
- void FlushFile(IntPtr handle, byte[] byteBuf);
-
- int SetLengthFile(IntPtr handle, long length);
-
- IntPtr OpenFile(string path, FileMode mode, FileAccess access, FileShare share);
-
- void CloseFile(IntPtr handle);
-
- long SeekFile(IntPtr handle, long offset, SeekOrigin origin);
-
- IntPtr CreateFile(string path, FileMode mode, FileAccess access, FileShare share);
-
- void DeleteFile(string path);
-
- bool ExistsFile(string path);
-
- DateTime GetCreationTimeFile(string path);
-
- DateTime GetLastAccessTimeFile(string path);
-
- DateTime GetLastWriteTimeFile(string path);
-
- void SetCreationTimeFile(string path, DateTime creationTime);
-
- void SetLastAccessTimeFile(string path, DateTime lastAccessTime);
-
- void SetLastWriteTimeFile(string path, DateTime lastWriteTime);
-
- long FileLength(string path);
-
- long FileLength(IntPtr handle);
-
-
- // System.Environment services
-
- string NewLineSequence {get;}
-
- char DirectorySeparator {get;}
-
- char AltDirectorySeparator {get;}
-
- char PathSeparator {get;}
-
- char VolumeSeparator {get;}
-
- char[] DirVolSeparatorChars {get;}
-
- char[] InvalidPathChars {get;}
-
- string GetEnvironmentVariable(string eVar);
-
- char ExtensionCharacter {get;}
-
- string CommandLine {get;}
-
- IDictionary EnvironmentVariables {get;}
-
- string MachineName {get;}
-
- OperatingSystem OSVersion {get;}
-
- // System.Path services
- // Note: Although some of these do not require direct acccess to the OS,
- // some platforms don't support some of these methods
-
- string ChangeExtension(string path, string extension);
-
- string GetExtension(string path);
-
- string GetFileName(string path);
-
- string GetFileNameWithoutExtension(string path);
-
- string GetPathRoot(string path);
-
- string GetTempFileName();
-
- string GetTempPath();
-
- bool HasExtension(string path);
-
- bool IsPathRooted(string path);
-
- string GetFullPath(string path);
-
-
- // System.Directory services
-
- void DeleteDirectory(string path, bool recursive);
-
- bool ExistsDirectory(string path);
-
- DateTime GetCreationTimeDirectory(string path);
-
- string GetCurrentDirectory();
-
- string[] GetDirectories(string path, string searchPattern);
-
- string[] GetFiles(string path, string searchPattern);
-
- string[] GetFileSystemEntries(string path, string searchPattern);
-
- DateTime GetLastAccessTimeDirectory(string path);
-
- DateTime GetLastWriteTimeDirectory(string path);
-
- void MoveDirectory(string sourceDirName, string destDirName);
-
- void SetCreationTimeDirectory(string path, DateTime creationTime);
-
- void SetCurrentDirectory(string path);
-
- void SetLastAccessTimeDirectory(string path, DateTime lastAccessTime);
-
- void SetLastWriteTimeDirectory(string path, DateTime lastWriteTime);
-
- double Acos(double d);
-
- double Asin(double d);
-
- double Atan(double d);
-
- double Atan2(double y, double x);
-
- double Cos(double d);
-
- double Cosh(double value);
-
- double Exp(dobule d);
-
- double Log(double d);
-
- double Log10(double d);
-
- double Pow(double x, double y);
-
- double Sin(double d);
-
- double Sinh(double d);
-
- double Sqrt(double d);
-
- double Tan(double d);
-
- double Tanh(double d);
-
- }
-}
diff --git a/mcs/class/corlib/System.PAL/Platform.cs b/mcs/class/corlib/System.PAL/Platform.cs
deleted file mode 100644
index bfaa276dbc5..00000000000
--- a/mcs/class/corlib/System.PAL/Platform.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Sean MacIsaac
-// Only want to have 1 OperatingSystemObject around.
-// We get the correct one from compile time.
-
-namespace System.PAL
-{
- internal class Platform
- {
- private static OpSys _os;
-
- public static OpSys OS
- {
-
- get
- {
- if (_os == null) {
- _os = new OpSys ();
- }
- return _os;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
deleted file mode 100755
index 43eb66c7c46..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// System.Reflection.Emit/AssemblyBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Resources;
-using System.IO;
-using System.Security.Policy;
-using System.Runtime.Serialization;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
-
- public sealed class AssemblyBuilder : Assembly {
- private IntPtr dynamic_assembly;
- private MethodInfo entry_point;
- private ModuleBuilder[] modules;
- private string name;
- private CustomAttributeBuilder[] cattrs;
- private int[] table_indexes;
-
- internal AssemblyBuilder (AssemblyName n, AssemblyBuilderAccess access) {
- name = n.Name;
- }
-
- internal int get_next_table_index (int table, bool inc) {
- if (table_indexes == null) {
- table_indexes = new int [64];
- for (int i=0; i < 64; ++i)
- table_indexes [i] = 1;
- }
- // Console.WriteLine ("getindex for table "+table.ToString()+" got "+table_indexes [table].ToString());
- if (inc)
- return table_indexes [table]++;
- return table_indexes [table];
- }
-
- public override string CodeBase {
- get {
- return null;
- }
- }
-
- public override MethodInfo EntryPoint {
- get {
- return entry_point;
- }
- }
-
- public override string Location {
- get {
- return null;
- }
- }
-
- public void AddResourceFile (string name, string fileName)
- {
- }
-
- public void AddResourceFile (string name, string fileName, ResourceAttributes attribute)
- {
- }
-
- public override ModuleBuilder DefineDynamicModule (string name)
- {
- return DefineDynamicModule (name, name, false);
- }
-
- public override ModuleBuilder DefineDynamicModule (string name, bool emitSymbolInfo)
- {
- return DefineDynamicModule (name, name, emitSymbolInfo);
- }
-
- public ModuleBuilder DefineDynamicModule(string name, string fileName)
- {
- return DefineDynamicModule (name, fileName, false);
- }
-
- public ModuleBuilder DefineDynamicModule (string name, string fileName,
- bool emitSymbolInfo)
- {
- ModuleBuilder r = new ModuleBuilder (this, name, fileName);
-
- if (modules != null) {
- ModuleBuilder[] new_modules = new ModuleBuilder [modules.Length + 1];
- System.Array.Copy(modules, new_modules, modules.Length);
- new_modules [modules.Length] = r;
- modules = new_modules;
- } else {
- modules = new ModuleBuilder [1];
- modules [0] = r;
- }
- return r;
- }
-
- public IResourceWriter DefineResource (string name, string description, string fileName)
- {
- return null;
- }
-
- public IResourceWriter DefineResource (string name, string description,
- string fileName, ResourceAttributes attribute)
- {
- return null;
- }
-
- public void DefineUnmanagedResource (byte[] resource)
- {
- }
-
- public void DefineUnmanagedResource (string resourceFileName)
- {
- }
-
- public void DefineVersionInfoResource ()
- {
- }
-
- public void DefineVersionInfoResource (string product, string productVersion,
- string company, string copyright, string trademark)
- {
- }
-
- public ModuleBuilder GetDynamicModule (string name)
- {
- return null;
- }
-
- public override Type[] GetExportedTypes ()
- {
- return null;
- }
-
- public override FileStream GetFile (string name)
- {
- return null;
- }
-
- /*public virtual FileStream[] GetFiles() {
- return null;
- }
- public override FileStream[] GetFiles(bool getResourceModules) {
- return null;
- }*/
-
- /*public virtual ManifestResourceInfo GetManifestResourceInfo(string resourceName)
- {
- return null;
- }
- public virtual string[] GetManifestResourceNames() {
- return null;
- }
- public virtual Stream GetManifestResourceStream(string name) {
- return null;
- }
- public virtual Stream GetManifestResourceStream(Type type, string name) {
- return null;
- }*/
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int getUSIndex (AssemblyBuilder ab, string str);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int getToken (AssemblyBuilder ab, MemberInfo member);
-
- internal int GetToken (string str) {
- return getUSIndex (this, str);
- }
-
- internal int GetToken (MemberInfo member) {
- return getToken (this, member);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int getDataChunk (AssemblyBuilder ab, int type, byte[] buf);
-
- public void Save (string assemblyFileName)
- {
- byte[] buf = new byte [65536];
- FileStream file;
- int count;
-
- file = new FileStream (assemblyFileName, FileMode.OpenOrCreate, FileAccess.Write);
-
- count = getDataChunk (this, 0, buf);
- if (count != 0) {
- file.Write (buf, 0, count);
- count = getDataChunk (this, 1, buf); /* may be a too small buffer */
- file.Write (buf, 0, count);
- }
-
- file.Close ();
- }
-
- public void SetEntryPoint (MethodInfo entryMethod)
- {
- entry_point = entryMethod;
- }
-
- public void SetEntryPoint (MethodInfo entryMethod, PEFileKinds fileKind)
- {
- entry_point = entryMethod;
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs b/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
deleted file mode 100644
index 2c6a97d9aca..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//--------------------------
-// System.Reflection.Emit
-// Author: Mandar Nanivadekar
-//
-// Created: 29/08/2001
-//------------------------------
-
-namespace System.Reflection.Emit
-{
- public enum AssemblyBuilderAccess
- {
- Run = 1,
- Save = 2,
- RunAndSave = 3
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/ChangeLog b/mcs/class/corlib/System.Reflection.Emit/ChangeLog
deleted file mode 100644
index 6229ff42250..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ChangeLog
+++ /dev/null
@@ -1,128 +0,0 @@
-
-Wed Feb 20 22:30:49 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: upped compiled assembly size limit.
- Implemented SetCustomAttribute () methods.
- * CustomAttributeBuilder.cs: implemented the needed constructor
- stuff.
- * Cosntructorbuilder.cs, EnumBuilder.cs, FieldBuilder.cs,
- MethodBuilder.cs, ModuleBuilder.cs, ParameterBuilder.cs,
- PropertyBuilder.cs, TypeBuilder.cs: Implemented SetCustomAttribute () methods.
-
-Wed Feb 20 14:54:01 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: add SetCustomAttribute () to keep the compiler
- going.
-
-Fri Feb 15 18:15:04 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: finally block support and fixes.
-
-Thu Feb 14 18:55:52 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * FieldBuilder.cs: Add SetRVAData().
- * ILGenerator.cs: speed up code array growth.
- * TypeBuilder.cs: fix IsValueTypeImpl(). Add class_size member.
- Implement DefineInitializedData().
-
-Tue Jan 22 23:01:11 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * EnumBuilder.cs, TypeBuilder.cs: updates for changes in Type.cs.
- * ModuleBuilder.cs: fix lookup of nested types.
-
-Tue Jan 15 22:46:21 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: implement some of the exception support methods.
-
-Mon Jan 14 17:07:32 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ModulerBuilder.cs: search also for subtypes in GetTypes().
- * TypeBuilder.cs: bugfix in FullName. Implemented DefineNestedType().
-
-Fri Jan 11 19:00:29 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MethodBuilder.cs, ConstructorBuilder.cs: save parameter info.
-
-Thu Jan 10 21:07:54 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: handle type tokens (used for box opcode).
-
-Wed Jan 9 19:37:55 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: emit float and doubles.
- * ModuleBuilder.cs: off-by-one error fix and GetType()
- implementations.
- * TypeBuilder.cs: AttributesImpl added.
- * UnmanagedMarshal.cs: stubbed out class.
-
-Sat Jan 5 15:59:05 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: fix emission of two-bytes opcodes.
- Missing slot for locals array. Throw exceptions on unimplemented
- methods.
- * OpCode.cs: add a comment: the Value property is useless.
- * OpCodes.cs: fix name of tail opcode (Tail -> Tailcall).
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ConstructorBuilder.cs : Use the MonoTODO attribute.
-
- * ILGenerator.cs, Label.cs, MethodBuilder.cs, ModuleBuilder.cs,
- ParameterBuilder.cs, TypeBuilder.cs : Ditto.
-
-Thu Jan 3 23:26:15 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: typo fix.
-
-Mon Dec 24 17:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * TypeBuilder.cs: added DefineMethodOverride().
- * MethodBuilder.cs: add override_method member and setter.
-
-Mon Nov 19 13:58:01 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: add method to register a string in the "#US"
- stream.
- * EnumBuilder.cs, SignatureHelper.cs: added stubs.
- * ILGenerator.cs: more stuff implemented.
- * LocalBuilder.cs: keep track of local var index.
-
-Thu Nov 15 18:11:23 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * ConstructorBuilder.cs: implement the interesting methods.
- * ILGenerator.cs: adapt for use with both a MethodBuilder and a
- ConstructorBuilder.
- * MethodBuilder.cs: add ImplAttributes.
- * ParameterBuilder.cs: adapt for ConstructorBuilder.
- * TypeBuilder.cs: add constructors handling.
-
-Wed Nov 14 17:01:45 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * ConstructorBuilder.cs: added missing stubs and some implementation.
- * CustomAttributeBuilder.cs: added.
- * EventBuilder.cs: added.
- * FieldBuilder.cs: updates.
- * MethodBuilder.cs: stuff to implement P/Invoke methods.
- * ModuleBuilder.cs: added GetArrayMethod() stub.
- * ParameterBuilder.cs, PropertyBuilder.cs: updates.
- * TypeBuilder.cs: updates and stubs.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * TypeBuilder.cs: Added implementation for TypeHandle.
-
-Tue Nov 6 09:13:45 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: define an internal constructor.
-
-2001-10-07 Miguel de Icaza <miguel@ximian.com>
-
- * AssemblyBuilder.cs: Reformatted.
-
- Added override keywords to those that needed them.
-
- Removed methods that we do not override, but just inherit
-
-Tue Sep 25 16:53:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * TypeBuilder.cs, ConstructorBuilder.cs, ModuleBuilder.cs: added.
diff --git a/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
deleted file mode 100644
index 098d0a5af12..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// System.Reflection.Emit/ConstructorBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Reflection.Emit {
- public sealed class ConstructorBuilder : ConstructorInfo {
- private ILGenerator ilgen;
- private Type[] parameters;
- private MethodAttributes attrs;
- private MethodImplAttributes iattrs;
- private int table_idx;
- private CallingConventions call_conv;
- private TypeBuilder type;
- private ParameterBuilder[] pinfo;
- private CustomAttributeBuilder[] cattrs;
-
- internal ConstructorBuilder (TypeBuilder tb, MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes) {
- attrs = attributes;
- call_conv = callingConvention;
- if (parameterTypes != null) {
- this.parameters = new Type [parameterTypes.Length];
- System.Array.Copy (parameterTypes, this.parameters, parameterTypes.Length);
- }
- type = tb;
- table_idx = get_next_table_index (0x06, true);
- }
-
- internal TypeBuilder TypeBuilder {
- get {return type;}
- }
-
- public override MethodImplAttributes GetMethodImplementationFlags() {
- return iattrs;
- }
- public override ParameterInfo[] GetParameters() {
- return null;
- }
- public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- return null;
- }
- public override object Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) {
- return null;
- }
-
- public override RuntimeMethodHandle MethodHandle { get {return new RuntimeMethodHandle ();} }
- public override MethodAttributes Attributes {
- get {return attrs;}
- }
- public override Type ReflectedType { get {return type;}}
- public override Type DeclaringType { get {return type;}}
- public Type ReturnType { get {return null;}}
- public override string Name {
- get {return (attrs & MethodAttributes.Static) != 0 ? ".cctor" : ".ctor";}
- }
- public string Signature {
- get {return "constructor signature";}
- }
-
- [MonoTODO]
- public bool InitLocals { /* FIXME */
- get {return false;}
- set {return;}
- }
-
- public void AddDeclarativeSecurity( SecurityAction action, PermissionSet pset) {
- }
-
- [MonoTODO]
- public ParameterBuilder DefineParameter(int iSequence, ParameterAttributes attributes, string strParamName)
- {
- ParameterBuilder pb = new ParameterBuilder (this, iSequence, attributes, strParamName);
- // check iSequence
- if (pinfo == null)
- pinfo = new ParameterBuilder [parameters.Length + 1];
- pinfo [iSequence] = pb;
- return pb;
- }
-
- public override bool IsDefined (Type attribute_type, bool inherit) {return false;}
-
- public override object [] GetCustomAttributes (bool inherit) {return null;}
-
- public override object [] GetCustomAttributes (Type attribute_type, bool inherit) {return null;}
-
- public ILGenerator GetILGenerator () {
- return GetILGenerator (256);
- }
- public ILGenerator GetILGenerator (int size) {
- ilgen = new ILGenerator (this, size);
- return ilgen;
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- public void SetImplementationFlags( MethodImplAttributes attributes) {
- iattrs = attributes;
- }
- public Module GetModule() {
- return null;
- }
- public MethodToken GetToken() {
- return new MethodToken (0x06000000 | table_idx);
- }
- public void SetSymCustomAttribute( string name, byte[] data) {
- }
- public override string ToString() {
- return "constructor";
- }
-
- internal void fixup () {
- if (ilgen != null)
- ilgen.label_fixup ();
- }
- internal override int get_next_table_index (int table, bool inc) {
- return type.get_next_table_index (table, inc);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
deleted file mode 100755
index d0d8038aa84..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-
-//
-// System.Reflection.Emit/CustomAttributeBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
- public class CustomAttributeBuilder {
- ConstructorInfo ctor;
- byte[] data;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static extern byte[] GetBlob(ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues, FieldInfo[] namedFields, object[] fieldValues);
-
- internal CustomAttributeBuilder( ConstructorInfo con, byte[] cdata) {
- ctor = con;
- data = (byte[])cdata.Clone ();
- /* should we check that the user supplied data is correct? */
- }
-
- public CustomAttributeBuilder( ConstructorInfo con, object[] constructorArgs)
- : this (con, constructorArgs, null, null, null, null) {
- }
- public CustomAttributeBuilder( ConstructorInfo con, object[] constructorArgs, FieldInfo[] namedFields, object[] fieldValues)
- : this (con, constructorArgs, null, null, namedFields, fieldValues) {
- }
- public CustomAttributeBuilder( ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues)
- : this (con, constructorArgs, namedProperties, propertyValues, null, null) {
- }
- public CustomAttributeBuilder( ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues, FieldInfo[] namedFields, object[] fieldValues) {
- ctor = con;
- data = GetBlob (con, constructorArgs, namedProperties, propertyValues, namedFields, fieldValues);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs
deleted file mode 100755
index ffed7590c3e..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-
-//
-// System.Reflection.Emit/EnumBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
- public sealed class EnumBuilder : Type {
- CustomAttributeBuilder[] cattrs;
-
- public override Assembly Assembly {
- get {return null;}
- }
- public override string AssemblyQualifiedName {
- get {return null;}
- }
- public override Type BaseType {
- get {return null;}
- }
- public override Type DeclaringType {
- get {return null;}
- }
- public override string FullName {
- get {return null;}
- }
- public override Guid GUID {
- get {return Guid.Empty;}
- }
- public override Module Module {
- get {return null;}
- }
- public override string Name {
- get {return null;}
- }
- public override string Namespace {
- get {return null;}
- }
- public override Type ReflectedType {
- get {return null;}
- }
- public override RuntimeTypeHandle TypeHandle {
- get {return new RuntimeTypeHandle ();}
- }
- public TypeToken TypeToken {
- get {return new TypeToken ();}
- }
- public FieldBuilder UnderlyingField {
- get {return null;}
- }
- public override Type UnderlyingSystemType {
- get {return null;}
- }
- public override MemberTypes MemberType {
- get {return MemberTypes.TypeInfo;}
- }
-
- internal EnumBuilder (ModuleBuilder mb, string name, TypeAttributes visibility, Type underlyingType) {
- }
- public Type CreateType() {
- return null;
- }
- public FieldBuilder DefineLiteral( string literalName, object literalValue) {
- return null;
- }
- protected override TypeAttributes GetAttributeFlagsImpl() {
- return (TypeAttributes)0;
- }
- protected override ConstructorInfo GetConstructorImpl( BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- return null;
- }
- public override ConstructorInfo[] GetConstructors( BindingFlags bindingAttr) {
- return null;
- }
- public override object[] GetCustomAttributes(bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return null;
- }
- public override Type GetElementType() {
- throw new NotSupportedException ();
- }
- public override EventInfo GetEvent( string name, BindingFlags bindingAttr) {
- return null;
- }
- public override EventInfo[] GetEvents() {
- return null;
- }
- public override EventInfo[] GetEvents( BindingFlags bindingAttr) {
- return null;
- }
- public override FieldInfo GetField( string name, BindingFlags bindingAttr) {
- return null;
- }
- public override FieldInfo[] GetFields( BindingFlags bindingAttr) {
- return null;
- }
- public override Type GetInterface( string name, bool ignoreCase) {
- return null;
- }
- public override InterfaceMapping GetInterfaceMap( Type interfaceType) {
- throw new NotImplementedException ();
- }
- public override Type[] GetInterfaces() {
- return null;
- }
- public override MemberInfo[] GetMember( string name, MemberTypes type, BindingFlags bindingAttr) {
- return null;
- }
- public override MemberInfo[] GetMembers( BindingFlags bindingAttr) {
- return null;
- }
- protected override MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- return null;
- }
-
- public override MethodInfo[] GetMethods( BindingFlags bindingAttr) {
- return null;
- }
- public override Type GetNestedType( string name, BindingFlags bindingAttr) {
- return null;
- }
- public override Type[] GetNestedTypes( BindingFlags bindingAttr) {
- return null;
- }
- public override PropertyInfo[] GetProperties( BindingFlags bindingAttr) {
- return null;
- }
- protected override PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
- return null;
- }
- protected override bool HasElementTypeImpl() {
- throw new NotSupportedException ();
- }
- public override object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
- return null;
- }
- protected override bool IsArrayImpl() {
- return false;
- }
- protected override bool IsByRefImpl() {
- return false;
- }
- protected override bool IsCOMObjectImpl() {
- return false;
- }
- protected override bool IsPointerImpl() {
- return false;
- }
- protected override bool IsPrimitiveImpl() {
- return false;
- }
- protected override bool IsValueTypeImpl() {
- return true;
- }
- public override bool IsDefined( Type attributeType, bool inherit) {
- return false;
- }
- /*protected override bool IsPointerImpl() {
- return false;
- }
- protected override bool IsPrimitiveImpl() {
- return false;
- }
- protected override bool IsValueTypeImpl() {
- return true;
- }*/
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/EventBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/EventBuilder.cs
deleted file mode 100755
index 02844a33187..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/EventBuilder.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-
-//
-// System.Reflection.Emit/EventBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection.Emit {
- public sealed class EventBuilder {
- public void AddOtherMethod( MethodBuilder mdBuilder) {
- }
- public EventToken GetEventToken() {
- return new EventToken();
- }
- public void SetAddOnMethod( MethodBuilder mdBuilder) {
- }
- public void SetRaiseMethod( MethodBuilder mdBuilder) {
- }
- public void SetRemoveOnMethod( MethodBuilder mdBuilder) {
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- }
-
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/EventToken.cs b/mcs/class/corlib/System.Reflection.Emit/EventToken.cs
deleted file mode 100644
index ae077c0c7e0..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/EventToken.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// EventToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Event.
- /// </summary>
- public struct EventToken {
-
- internal int tokValue;
-
- public static readonly EventToken Empty;
-
-
- static EventToken ()
- {
- Empty = new EventToken ();
- }
-
-
- internal EventToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is EventToken;
-
- if (res) {
- EventToken that = (EventToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// EventToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Event.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs
deleted file mode 100755
index 32ac52c5e93..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-//
-// System.Reflection.Emit/FieldBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
- public sealed class FieldBuilder : FieldInfo {
- private FieldAttributes attrs;
- private Type type;
- private String name;
- private object def_value;
- private int offset;
- private int table_idx;
- internal TypeBuilder typeb;
- private byte[] rva_data;
- private CustomAttributeBuilder[] cattrs;
-
- internal FieldBuilder (TypeBuilder tb, string fieldName, Type type, FieldAttributes attributes) {
- attrs = attributes;
- name = fieldName;
- this.type = type;
- offset = -1;
- typeb = tb;
- table_idx = tb.get_next_table_index (0x04, true);
- }
-
- public override FieldAttributes Attributes {
- get {return attrs;}
- }
- public override Type DeclaringType {
- get {return typeb;}
- }
- public override RuntimeFieldHandle FieldHandle {
- get {return new RuntimeFieldHandle();}
- }
- public override Type FieldType {
- get {return type;}
- }
- public override string Name {
- get {return name;}
- }
- public override Type ReflectedType {
- get {return null;}
- }
-
- public override object[] GetCustomAttributes(bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return null;
- }
- public FieldToken GetToken() {
- return new FieldToken (0x04000000 | table_idx);
- }
- public override object GetValue(object obj) {
- return null;
- }
- public override bool IsDefined( Type attributeType, bool inherit) {
- return false;
- }
- internal void SetRVAData (byte[] data) {
- rva_data = (byte[])data.Clone ();
- }
- public void SetConstant( object defaultValue) {
- /*if (defaultValue.GetType() != type)
- throw new ArgumentException ("Constant doesn't match field type");*/
- def_value = defaultValue;
- }
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- public void SetMarshal( UnmanagedMarshal unmanagedMarshal) {
- }
- public void SetOffset( int iOffset) {
- offset = iOffset;
- }
- public override void SetValue( object obj, object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture) {
- }
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/FieldToken.cs b/mcs/class/corlib/System.Reflection.Emit/FieldToken.cs
deleted file mode 100644
index dfb8435b9f1..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/FieldToken.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// FieldToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Field.
- /// </summary>
- public struct FieldToken {
-
- internal int tokValue;
-
- public static readonly FieldToken Empty;
-
-
- static FieldToken ()
- {
- Empty = new FieldToken ();
- }
-
-
- internal FieldToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is FieldToken;
-
- if (res) {
- FieldToken that = (FieldToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// FieldToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Field.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/FlowControl.cs b/mcs/class/corlib/System.Reflection.Emit/FlowControl.cs
deleted file mode 100644
index b714362cb11..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/FlowControl.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// FlowControl.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Describes how an instruction alters the flow of control.
- /// </summary>
- public enum FlowControl {
-
- /// <summary>
- /// Branch instruction (ex: br, leave).
- /// </summary>
- Branch = 0,
-
- /// <summary>
- /// Break instruction (ex: break).
- /// </summary>
- Break = 1,
-
- /// <summary>
- /// Call instruction (ex: jmp, call, callvirt).
- /// </summary>
- Call = 2,
-
- /// <summary>
- /// Conditional branch instruction (ex: brtrue, brfalse).
- /// </summary>
- Cond_Branch = 3,
-
- /// <summary>
- /// Changes the behaviour of or provides additional
- /// about a subsequent instruction.
- /// (ex: prefixes such as volatile, unaligned).
- /// </summary>
- Meta = 4,
-
- /// <summary>
- /// Transition to the next instruction.
- /// </summary>
- Next = 5,
-
- /// <summary>
- /// Annotation for ann.phi instruction.
- /// </summary>
- Phi = 6,
-
- /// <summary>
- /// Return instruction.
- /// </summary>
- Return = 7,
-
- /// <summary>
- /// Throw instruction.
- /// </summary>
- Throw = 8
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs b/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
deleted file mode 100644
index 898fd94d30f..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
+++ /dev/null
@@ -1,494 +0,0 @@
-
-//
-// System.Reflection.Emit/ILGenerator.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Diagnostics.SymbolStore;
-
-namespace System.Reflection.Emit {
-
- internal struct ILExceptionBlock {
- public const int CATCH = 0;
- public const int FILTER = 1;
- public const int FINALLY = 2;
- public const int FAULT = 4;
-
- internal Type extype;
- internal int type;
- internal int start;
- internal int len;
- internal int filter_offset;
-
- internal void Debug () {
- System.Console.Write ("\ttype="+type.ToString()+" start="+start.ToString()+" len="+len.ToString());
- if (extype != null)
- System.Console.WriteLine (" extype="+extype.ToString());
- else
- System.Console.WriteLine ("");
- }
- }
- internal struct ILExceptionInfo {
- ILExceptionBlock[] handlers;
- internal int start;
- int len;
- internal Label end;
-
- internal void AddCatch (Type extype, int offset) {
- int i;
- End (offset);
- add_block (offset);
- i = handlers.Length - 1;
- handlers [i].type = ILExceptionBlock.CATCH;
- handlers [i].start = offset;
- handlers [i].extype = extype;
- }
-
- internal void AddFinally (int offset) {
- int i;
- End (offset);
- add_block (offset);
- i = handlers.Length - 1;
- handlers [i].type = ILExceptionBlock.FINALLY;
- handlers [i].start = offset;
- handlers [i].extype = null;
- }
-
- internal void End (int offset) {
- if (handlers == null)
- return;
- int i = handlers.Length - 1;
- if (i >= 0)
- handlers [i].len = offset - handlers [i].start;
- }
-
- internal int LastClauseType () {
- if (handlers != null)
- return handlers [handlers.Length-1].type;
- else
- return ILExceptionBlock.CATCH;
- }
-
- internal void Debug () {
- if (false) {
- System.Console.WriteLine ("Handler at "+start.ToString()+ " len: "+len.ToString());
- for (int i = 0; i < handlers.Length; ++i)
- handlers [i].Debug ();
- }
- }
-
- void add_block (int offset) {
- if (handlers != null) {
- int i = handlers.Length;
- ILExceptionBlock[] new_b = new ILExceptionBlock [i + 1];
- System.Array.Copy (handlers, new_b, i);
- handlers = new_b;
- handlers [i].len = offset - handlers [i].start;
- } else {
- handlers = new ILExceptionBlock [1];
- len = offset - start;
- }
- }
- }
-
- public class ILGenerator: Object {
- private struct LabelFixup {
- public int size;
- public int pos;
- public int label_idx;
- };
- private byte[] code;
- private MethodBase mbuilder; /* a MethodBuilder or ConstructorBuilder */
- private int code_len;
- private int max_stack;
- private int cur_stack;
- private LocalBuilder[] locals;
- private ILExceptionInfo[] ex_handlers;
- private int[] label_to_addr;
- private int num_labels;
- private LabelFixup[] fixups;
- private int num_fixups;
- private AssemblyBuilder abuilder;
- private int cur_block;
-
- internal ILGenerator (MethodBase mb, int size) {
- if (size < 0)
- size = 256;
- code_len = 0;
- code = new byte [size];
- mbuilder = mb;
- cur_stack = max_stack = 0;
- num_fixups = num_labels = 0;
- cur_block = -1;
- label_to_addr = new int [16];
- fixups = new LabelFixup [16];
- if (mb is MethodBuilder) {
- abuilder = (AssemblyBuilder)((MethodBuilder)mb).TypeBuilder.Module.Assembly;
- } else if (mb is ConstructorBuilder) {
- abuilder = (AssemblyBuilder)((ConstructorBuilder)mb).TypeBuilder.Module.Assembly;
- }
- }
-
- private void make_room (int nbytes) {
- if (code_len + nbytes < code.Length)
- return;
- byte[] new_code = new byte [code.Length * 2 + 128];
- System.Array.Copy (code, 0, new_code, 0, code.Length);
- code = new_code;
- }
- private void emit_int (int val) {
- code [code_len++] = (byte) (val & 0xFF);
- code [code_len++] = (byte) ((val >> 8) & 0xFF);
- code [code_len++] = (byte) ((val >> 16) & 0xFF);
- code [code_len++] = (byte) ((val >> 24) & 0xFF);
- }
- /* change to pass by ref to avoid copy */
- private void ll_emit (OpCode opcode) {
- /*
- * there is already enough room allocated in code.
- */
- // access op1 and op2 directly since the Value property is useless
- if (opcode.Size == 2)
- code [code_len++] = opcode.op1;
- code [code_len++] = opcode.op2;
- /*
- * We should probably keep track of stack needs here.
- * Or we may want to run the verifier on the code before saving it
- * (this may be needed anyway when the ILGenerator is not used...).
- */
- switch (opcode.StackBehaviourPush) {
- case StackBehaviour.Push1:
- case StackBehaviour.Pushi:
- case StackBehaviour.Pushi8:
- case StackBehaviour.Pushr4:
- case StackBehaviour.Pushr8:
- case StackBehaviour.Pushref:
- case StackBehaviour.Varpush: /* again we are conservative and assume it pushes 1 */
- cur_stack ++;
- break;
- case StackBehaviour.Push1_push1:
- cur_stack += 2;
- break;
- }
- if (max_stack < cur_stack)
- max_stack = cur_stack;
- /*
- * Note that we adjust for the pop behaviour _after_ setting max_stack.
- */
- switch (opcode.StackBehaviourPop) {
- case StackBehaviour.Varpop:
- break; /* we are conservative and assume it doesn't decrease the stack needs */
- case StackBehaviour.Pop1:
- case StackBehaviour.Popi:
- case StackBehaviour.Popref:
- cur_stack --;
- break;
- case StackBehaviour.Pop1_pop1:
- case StackBehaviour.Popi_pop1:
- case StackBehaviour.Popi_popi:
- case StackBehaviour.Popi_popi8:
- case StackBehaviour.Popi_popr4:
- case StackBehaviour.Popi_popr8:
- case StackBehaviour.Popref_pop1:
- case StackBehaviour.Popref_popi:
- cur_stack -= 2;
- break;
- case StackBehaviour.Popi_popi_popi:
- case StackBehaviour.Popref_popi_popi:
- case StackBehaviour.Popref_popi_popi8:
- case StackBehaviour.Popref_popi_popr4:
- case StackBehaviour.Popref_popi_popr8:
- case StackBehaviour.Popref_popi_popref:
- cur_stack -= 3;
- break;
- }
- }
-
- private static int target_len (OpCode opcode) {
- if (opcode.operandType == OperandType.InlineBrTarget)
- return 4;
- return 1;
- }
-
- private void InternalEndClause () {
- switch (ex_handlers [cur_block].LastClauseType ()) {
- case ILExceptionBlock.CATCH:
- // how could we optimize code size here?
- Emit (OpCodes.Leave, ex_handlers [cur_block].end);
- break;
- case ILExceptionBlock.FAULT:
- case ILExceptionBlock.FINALLY:
- Emit (OpCodes.Endfinally);
- break;
- case ILExceptionBlock.FILTER:
- Emit (OpCodes.Endfilter);
- break;
- }
- }
-
- public virtual void BeginCatchBlock (Type exceptionType) {
- if (cur_block < 0)
- throw new NotSupportedException ("Not in an exception block");
- InternalEndClause ();
- ex_handlers [cur_block].AddCatch (exceptionType, code_len);
- //System.Console.WriteLine ("Begin catch Block: "+exceptionType.ToString());
- //throw new NotImplementedException ();
- }
- public virtual void BeginExceptFilterBlock () {
- throw new NotImplementedException ();
- }
- public virtual Label BeginExceptionBlock () {
- //System.Console.WriteLine ("Begin Block");
-
- ++ cur_block;
- if (ex_handlers != null) {
- ILExceptionInfo[] new_ex = new ILExceptionInfo [cur_block + 1];
- System.Array.Copy (ex_handlers, new_ex, cur_block);
- ex_handlers = new_ex;
- } else {
- ex_handlers = new ILExceptionInfo [1];
- }
- ex_handlers [cur_block].start = code_len;
- return ex_handlers [cur_block].end = DefineLabel ();
- }
- public virtual void BeginFaultBlock() {
- if (cur_block < 0)
- throw new NotSupportedException ("Not in an exception block");
- //System.Console.WriteLine ("Begin fault Block");
- //throw new NotImplementedException ();
- }
- public virtual void BeginFinallyBlock() {
- if (cur_block < 0)
- throw new NotSupportedException ("Not in an exception block");
- //System.Console.WriteLine ("Begin finally Block");
- InternalEndClause ();
- ex_handlers [cur_block].AddFinally (code_len);
- //throw new NotImplementedException ();
- }
- public virtual void BeginScope () {
- throw new NotImplementedException ();
- }
- public virtual LocalBuilder DeclareLocal (Type localType) {
- LocalBuilder res = new LocalBuilder (localType);
- if (locals != null) {
- LocalBuilder[] new_l = new LocalBuilder [locals.Length + 1];
- System.Array.Copy (locals, new_l, locals.Length);
- new_l [locals.Length] = res;
- locals = new_l;
- } else {
- locals = new LocalBuilder [1];
- locals [0] = res;
- }
- res.position = locals.Length - 1;
- return res;
- }
- public virtual Label DefineLabel () {
- if (num_labels >= label_to_addr.Length) {
- int[] new_l = new int [label_to_addr.Length + 16];
- System.Array.Copy (label_to_addr, new_l, label_to_addr.Length);
- label_to_addr = new_l;
- }
- label_to_addr [num_labels] = -1;
- return new Label (num_labels++);
- }
- public virtual void Emit (OpCode opcode) {
- make_room (2);
- ll_emit (opcode);
- }
- public virtual void Emit (OpCode opcode, Byte val) {
- make_room (3);
- ll_emit (opcode);
- code [code_len++] = val;
- }
- public virtual void Emit (OpCode opcode, ConstructorInfo constructor) {
- int token = abuilder.GetToken (constructor);
- make_room (6);
- ll_emit (opcode);
- emit_int (token);
- }
- public virtual void Emit (OpCode opcode, Double val) {
- byte[] s = System.BitConverter.GetBytes (val);
- make_room (10);
- ll_emit (opcode);
- System.Array.Copy (s, 0, code, code_len, 8);
- code_len += 8;
- }
- public virtual void Emit (OpCode opcode, FieldInfo field) {
- int token = abuilder.GetToken (field);
- make_room (6);
- ll_emit (opcode);
- emit_int (token);
- }
- public virtual void Emit (OpCode opcode, Int16 val) {
- make_room (4);
- ll_emit (opcode);
- code [code_len++] = (byte) (val & 0xFF);
- code [code_len++] = (byte) ((val >> 8) & 0xFF);
- }
- public virtual void Emit (OpCode opcode, Int32 val) {
- make_room (6);
- ll_emit (opcode);
- emit_int (val);
- }
- public virtual void Emit (OpCode opcode, Int64 val) {
- make_room (10);
- ll_emit (opcode);
- code [code_len++] = (byte) (val & 0xFF);
- code [code_len++] = (byte) ((val >> 8) & 0xFF);
- code [code_len++] = (byte) ((val >> 16) & 0xFF);
- code [code_len++] = (byte) ((val >> 24) & 0xFF);
- code [code_len++] = (byte) ((val >> 32) & 0xFF);
- code [code_len++] = (byte) ((val >> 40) & 0xFF);
- code [code_len++] = (byte) ((val >> 48) & 0xFF);
- code [code_len++] = (byte) ((val >> 56) & 0xFF);
- }
- public virtual void Emit (OpCode opcode, Label label) {
- int tlen = target_len (opcode);
- make_room (6);
- ll_emit (opcode);
- if (num_fixups >= fixups.Length) {
- LabelFixup[] newf = new LabelFixup [fixups.Length + 16];
- System.Array.Copy (fixups, newf, fixups.Length);
- fixups = newf;
- }
- fixups [num_fixups].size = tlen;
- fixups [num_fixups].pos = code_len;
- fixups [num_fixups].label_idx = label.label;
- num_fixups++;
- code_len += tlen;
-
- }
- public virtual void Emit (OpCode opcode, Label[] labels) {
- /* opcode needs to be switch. */
- int count = labels.Length;
- make_room (6 + count * 4);
- ll_emit (opcode);
- emit_int (count);
- if (num_fixups + count >= fixups.Length) {
- LabelFixup[] newf = new LabelFixup [fixups.Length + count + 16];
- System.Array.Copy (fixups, newf, fixups.Length);
- fixups = newf;
- }
- for (int i = 0; i < count; ++i) {
- fixups [num_fixups].size = 4;
- fixups [num_fixups].pos = code_len;
- fixups [num_fixups].label_idx = labels [i].label;
- num_fixups++;
- code_len += 4;
- }
- }
- public virtual void Emit (OpCode opcode, LocalBuilder lbuilder) {
- make_room (6);
- ll_emit (opcode);
- code [code_len++] = (byte) (lbuilder.position & 0xFF);
- if (opcode.operandType == OperandType.InlineVar) {
- code [code_len++] = (byte) ((lbuilder.position >> 8) & 0xFF);
- }
- }
- public virtual void Emit (OpCode opcode, MethodInfo method) {
- int token = abuilder.GetToken (method);
- make_room (6);
- ll_emit (opcode);
- emit_int (token);
- }
- [CLSCompliant(false)]
- public virtual void Emit (OpCode opcode, sbyte val) {
- make_room (3);
- ll_emit (opcode);
- code [code_len++] = (byte)val;
- }
-
- [MonoTODO]
- public virtual void Emit (OpCode opcode, SignatureHelper shelper) {
- int token = 0; // FIXME: request a token from the modulebuilder
- make_room (6);
- ll_emit (opcode);
- emit_int (token);
- }
- public virtual void Emit (OpCode opcode, float val) {
- byte[] s = System.BitConverter.GetBytes (val);
- make_room (6);
- ll_emit (opcode);
- System.Array.Copy (s, 0, code, code_len, 4);
- code_len += 4;
- }
- public virtual void Emit (OpCode opcode, string val) {
- int token = abuilder.GetToken (val);
- make_room (3);
- ll_emit (opcode);
- emit_int (token);
- }
- public virtual void Emit (OpCode opcode, Type type) {
- make_room (6);
- ll_emit (opcode);
- emit_int (abuilder.GetToken (type));
- }
-
- public void EmitCall (OpCode opcode, MethodInfo methodinfo, Type[] optionalParamTypes) {
- throw new NotImplementedException ();
- }
- public void EmitCalli (OpCode opcode, CallingConventions call_conv, Type returnType, Type[] paramTypes, Type[] optionalParamTypes) {
- throw new NotImplementedException ();
- }
-
- public virtual void EmitWriteLine (FieldInfo field) {
- throw new NotImplementedException ();
- }
- public virtual void EmitWriteLine (LocalBuilder lbuilder) {
- throw new NotImplementedException ();
- }
- public virtual void EmitWriteLine (string val) {
- throw new NotImplementedException ();
- }
-
- public virtual void EndExceptionBlock () {
- if (cur_block < 0)
- throw new NotSupportedException ("Not in an exception block");
- InternalEndClause ();
- MarkLabel (ex_handlers [cur_block].end);
- ex_handlers [cur_block].End (code_len);
- ex_handlers [cur_block].Debug ();
- //System.Console.WriteLine ("End Block");
- //throw new NotImplementedException ();
- }
- public virtual void EndScope () {
- throw new NotImplementedException ();
- }
- public virtual void MarkLabel (Label loc) {
- if (loc.label < 0 || loc.label >= num_labels)
- throw new System.ArgumentException ("The label is not valid");
- if (label_to_addr [loc.label] >= 0)
- throw new System.ArgumentException ("The label was already defined");
- label_to_addr [loc.label] = code_len;
- }
- public virtual void MarkSequencePoint (ISymbolDocumentWriter document, int startLine, int startColumn, int endLine, int EndColumn) {
- throw new NotImplementedException ();
- }
- public virtual void ThrowException (Type exceptionType) {
- throw new NotImplementedException ();
- }
- public virtual void UsingNamespace (String usingNamespace) {
- throw new NotImplementedException ();
- }
-
- internal void label_fixup () {
- int i;
- for (i = 0; i < num_fixups; ++i) {
- int diff = label_to_addr [fixups [i].label_idx] - fixups [i].pos;
- if (fixups [i].size == 1) {
- code [fixups [i].pos] = (byte)((sbyte) diff - 1);
- } else {
- int old_cl = code_len;
- code_len = fixups [i].pos;
- emit_int (diff - 4);
- code_len = old_cl;
- }
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/Label.cs b/mcs/class/corlib/System.Reflection.Emit/Label.cs
deleted file mode 100644
index 7050f951dad..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/Label.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Reflection.Emit/Label.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection.Emit {
- public struct Label {
- internal int label;
-
- internal Label (int val) {
- label = val;
- }
-
- [MonoTODO]
- public override bool Equals (object obj) {
- /* FIXME */
- return false;
- }
-
- public override int GetHashCode () {
- return label.GetHashCode ();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/LocalBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/LocalBuilder.cs
deleted file mode 100755
index 38dcd20d2dd..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/LocalBuilder.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-
-//
-// System.Reflection.Emit/LocalBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
- public sealed class LocalBuilder {
- private Type type;
- private string name;
- internal int position;
-
- internal LocalBuilder (Type t) {
- type = t;
- }
- public void SetLocalSymInfo( string lname) {
- name = lname;
- }
- public void SetLocalSymInfo( string lname, int startOffset, int endOffset) {
- name = lname;
- }
-
- public Type LocalType {
- get {return type;}
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
deleted file mode 100755
index bc27331ec71..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-
-//
-// System.Reflection.Emit/MethodBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection.Emit {
- public sealed class MethodBuilder : MethodInfo {
- private RuntimeMethodHandle mhandle;
- private Type rtype;
- private Type[] parameters;
- private MethodAttributes attrs;
- private MethodImplAttributes iattrs;
- private string name;
- private int table_idx;
- private byte[] code;
- private ILGenerator ilgen;
- private TypeBuilder type;
- private ParameterBuilder[] pinfo;
- private CustomAttributeBuilder[] cattrs;
- private MethodInfo override_method;
- private string pi_dll;
- private string pi_entry;
- private CharSet ncharset;
- private CallingConvention native_cc;
- private CallingConventions call_conv;
-
- internal MethodBuilder (TypeBuilder tb, string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
- this.name = name;
- this.attrs = attributes;
- this.call_conv = callingConvention;
- this.rtype = returnType;
- if (parameterTypes != null) {
- this.parameters = new Type [parameterTypes.Length];
- System.Array.Copy (parameterTypes, this.parameters, parameterTypes.Length);
- }
- type = tb;
- table_idx = get_next_table_index (0x06, true);
- //Console.WriteLine ("index for "+name+" set to "+table_idx.ToString());
- }
-
- internal MethodBuilder (TypeBuilder tb, string name, MethodAttributes attributes,
- CallingConventions callingConvention, Type returnType, Type[] parameterTypes,
- String dllName, String entryName, CallingConvention nativeCConv, CharSet nativeCharset)
- : this (tb, name, attributes, callingConvention, returnType, parameterTypes) {
- pi_dll = dllName;
- pi_entry = entryName;
- native_cc = nativeCConv;
- ncharset = nativeCharset;
- }
-
- internal TypeBuilder TypeBuilder {
- get {return type;}
- }
-
- public override Type ReturnType {get {return rtype;}}
- public override Type ReflectedType {get {return type;}}
- public override Type DeclaringType {get {return type;}}
- public override string Name {get {return name;}}
- public override RuntimeMethodHandle MethodHandle {get {return mhandle;}}
- public override MethodAttributes Attributes {get {return attrs;}}
- public override ICustomAttributeProvider ReturnTypeCustomAttributes {
- get {return null;}
- }
- public MethodToken GetToken() {
- return new MethodToken(0x06000000 | table_idx);
- }
-
- public override MethodInfo GetBaseDefinition() {
- return null;
- }
- public override MethodImplAttributes GetMethodImplementationFlags() {
- return iattrs;
- }
- public override ParameterInfo[] GetParameters() {
- return null;
- }
-
- public void CreateMethodBody( byte[] il, int count) {
- code = new byte [count];
- System.Array.Copy(il, code, count);
- }
- public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- return null;
- }
- public override bool IsDefined (Type attribute_type, bool inherit) {
- return false;
- }
- public override object[] GetCustomAttributes( bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return null;
- }
- public ILGenerator GetILGenerator () {
- return GetILGenerator (256);
- }
- public ILGenerator GetILGenerator (int size) {
- ilgen = new ILGenerator (this, size);
- return ilgen;
- }
-
- [MonoTODO]
- public ParameterBuilder DefineParameter (int position, ParameterAttributes attributes, string strParamName)
- {
- ParameterBuilder pb = new ParameterBuilder (this, position, attributes, strParamName);
- // check position
- if (pinfo == null)
- pinfo = new ParameterBuilder [parameters.Length + 1];
- pinfo [position] = pb;
- return pb;
- }
-
- internal void fixup () {
- if (ilgen != null)
- ilgen.label_fixup ();
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- public void SetImplementationFlags( MethodImplAttributes attributes) {
- iattrs = attributes;
- }
- internal override int get_next_table_index (int table, bool inc) {
- return type.get_next_table_index (table, inc);
- }
-
- internal void set_override (MethodInfo mdecl) {
- override_method = mdecl;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/MethodToken.cs b/mcs/class/corlib/System.Reflection.Emit/MethodToken.cs
deleted file mode 100644
index 8b97da85980..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/MethodToken.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// MethodToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Method.
- /// </summary>
- public struct MethodToken {
-
- internal int tokValue;
-
- public static readonly MethodToken Empty;
-
-
- static MethodToken ()
- {
- Empty = new MethodToken ();
- }
-
-
- internal MethodToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is MethodToken;
-
- if (res) {
- MethodToken that = (MethodToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// MethodToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Method.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
deleted file mode 100644
index 98cba3185e3..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-
-//
-// System.Reflection.Emit/ModuleBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
- public class ModuleBuilder : Module {
- private TypeBuilder[] types;
- private CustomAttributeBuilder[] cattrs;
- private int table_idx;
- private AssemblyBuilder assemblyb;
-
- internal ModuleBuilder (AssemblyBuilder assb, string name, string fullyqname) {
- this.name = this.scopename = name;
- this.fqname = fullyqname;
- this.assembly = this.assemblyb = assb;
- table_idx = get_next_table_index (0x00, true);
- }
-
- public override string FullyQualifiedName {get { return fqname;}}
-
- [MonoTODO]
- public TypeBuilder DefineType (string name) {
- // FIXME: LAMESPEC: what other attributes should we use here as default?
- return DefineType (name, TypeAttributes.Public, typeof(object), null);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr) {
- return DefineType (name, attr, typeof(object), null);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent) {
- return DefineType (name, attr, parent, null);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
- TypeBuilder res = new TypeBuilder (this, name, attr, parent, interfaces);
- if (types != null) {
- TypeBuilder[] new_types = new TypeBuilder [types.Length + 1];
- System.Array.Copy (types, new_types, types.Length);
- new_types [types.Length] = res;
- types = new_types;
- } else {
- types = new TypeBuilder [1];
- types [0] = res;
- }
- return res;
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, int typesize) {
- return DefineType (name, attr, parent, null);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, PackingSize packsize) {
- return DefineType (name, attr, parent, null);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, PackingSize packsize, int typesize) {
- return DefineType (name, attr, parent, null);
- }
-
- public MethodInfo GetArrayMethod( Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
- return null;
- }
-
- public EnumBuilder DefineEnum( string name, TypeAttributes visibility, Type underlyingType) {
- EnumBuilder eb = new EnumBuilder (this, name, visibility, underlyingType);
- return eb;
- }
-
- public override Type GetType( string className) {
- return GetType (className, false, false);
- }
-
- public override Type GetType( string className, bool ignoreCase) {
- return GetType (className, false, ignoreCase);
- }
-
- private TypeBuilder search_in_array (TypeBuilder[] arr, string className, bool ignoreCase) {
- int i;
- for (i = 0; i < arr.Length; ++i) {
- if (String.Compare (className, arr [i].FullName, ignoreCase) == 0) {
- return arr [i];
- }
- }
- return null;
- }
-
- public override Type GetType( string className, bool throwOnError, bool ignoreCase) {
- int subt;
- TypeBuilder result = null;
-
- if (types == null && throwOnError)
- throw new TypeLoadException (className);
- subt = className.IndexOf ('+');
- if (subt < 0) {
- result = search_in_array (types, className, ignoreCase);
- } else {
- string pname, rname;
- pname = className.Substring (0, subt);
- rname = className.Substring (subt + 1);
- result = search_in_array (types, pname, ignoreCase);
- if ((result != null) && (result.subtypes != null))
- result = search_in_array (result.subtypes, rname, ignoreCase);
- else
- result = null;
- }
- if ((result == null) && throwOnError)
- throw new TypeLoadException (className);
- return result;
- }
-
- internal int get_next_table_index (int table, bool inc) {
- return assemblyb.get_next_table_index (table, inc);
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/OpCode.cs b/mcs/class/corlib/System.Reflection.Emit/OpCode.cs
deleted file mode 100644
index 1bdd19fcc9b..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/OpCode.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// System.Reflection.Emit.OpCode
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-
-
-namespace System.Reflection.Emit {
-
- public struct OpCode {
-
- internal string name;
- internal int size;
- internal OpCodeType type;
- internal OperandType operandType;
- internal StackBehaviour pop;
- internal StackBehaviour push;
- internal FlowControl flowCtrl;
- internal byte op1;
- internal byte op2;
-
- internal OpCode (string name, int size,
- OpCodeType opcodeType,
- OperandType operandType,
- StackBehaviour pop,
- StackBehaviour push,
- FlowControl flowCtrl,
- byte op1, byte op2)
- {
- this.name = name;
- this.size = size;
- this.type = opcodeType;
- this.operandType = operandType;
- this.pop = pop;
- this.push = push;
- this.flowCtrl = flowCtrl;
- this.op1 = op1;
- this.op2 = op2;
- }
-
-
-
- /// <summary>
- /// </summary>
- public string Name {
- get {
- return name;
- }
- }
-
- /// <summary>
- /// </summary>
- public int Size {
- get {
- return size;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public OpCodeType OpCodeType {
- get {
- return type;
- }
- }
-
- /// <summary>
- /// </summary>
- public OperandType OperandType {
- get {
- return operandType;
- }
- }
-
- /// <summary>
- /// </summary>
- public FlowControl FlowControl {
- get {
- return flowCtrl;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public StackBehaviour StackBehaviourPop {
- get {
- return pop;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public StackBehaviour StackBehaviourPush {
- get {
- return push;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public short Value {
- get {
- if (size == 1) {
- return op2;
- } else {
- // two byte instruction - combine
- // give the same values as the mscorlib impl
- // this makes the Value property useless
- return (short) ((op1 << 2) | op2);
- }
- }
- }
-
- } // OpCode
-
-} // System.Reflection.Emit
diff --git a/mcs/class/corlib/System.Reflection.Emit/OpCodeType.cs b/mcs/class/corlib/System.Reflection.Emit/OpCodeType.cs
deleted file mode 100644
index 2733369ecbe..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/OpCodeType.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// OpCodeType.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Describes the types of MSIL instructions.
- /// </summary>
- public enum OpCodeType {
-
- /// <summary>
- /// "Ignorable" instruction.
- /// Such instruction are used to supply
- /// additional information to particular
- /// MSIL processor.
- /// </summary>
- Annotation = 0,
-
- /// <summary>
- /// Denotes "shorthand" instruction.
- /// Such instructions take less space
- /// than their full-size equivalents
- /// (ex. ldarg.0 vs. ldarg 0).
- /// </summary>
- Macro = 1,
-
- /// <summary>
- /// Denotes instruction reserved for internal use.
- /// </summary>
- Nternal = 2,
-
- /// <summary>
- /// Denotes instruction to deal with objects.
- /// (ex. ldobj).
- /// </summary>
- Objmodel = 3,
-
- /// <summary>
- /// </summary>
- Prefix = 4,
-
- /// <summary>
- /// </summary>
- Primitive = 5
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/OpCodes.cs b/mcs/class/corlib/System.Reflection.Emit/OpCodes.cs
deleted file mode 100644
index ff1ed953f6f..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/OpCodes.cs
+++ /dev/null
@@ -1,486 +0,0 @@
-// OpCodes.cs
-// Mechanically generated - DO NOT EDIT!
-//
-// (C) Sergey Chaban (serge@wildwestsoftware.com)
-
-using System;
-using System.Reflection.Emit;
-
-namespace System.Reflection.Emit {
-
-
-
- public class OpCodes {
- public static readonly OpCode Add;
- public static readonly OpCode Add_Ovf;
- public static readonly OpCode Add_Ovf_Un;
- public static readonly OpCode And;
- public static readonly OpCode Arglist;
- public static readonly OpCode Beq;
- public static readonly OpCode Beq_S;
- public static readonly OpCode Bge;
- public static readonly OpCode Bge_S;
- public static readonly OpCode Bge_Un;
- public static readonly OpCode Bge_Un_S;
- public static readonly OpCode Bgt;
- public static readonly OpCode Bgt_S;
- public static readonly OpCode Bgt_Un;
- public static readonly OpCode Bgt_Un_S;
- public static readonly OpCode Ble;
- public static readonly OpCode Ble_S;
- public static readonly OpCode Ble_Un;
- public static readonly OpCode Ble_Un_S;
- public static readonly OpCode Blt;
- public static readonly OpCode Blt_S;
- public static readonly OpCode Blt_Un;
- public static readonly OpCode Blt_Un_S;
- public static readonly OpCode Bne_Un;
- public static readonly OpCode Bne_Un_S;
- public static readonly OpCode Box;
- public static readonly OpCode Boxval;
- public static readonly OpCode Br;
- public static readonly OpCode Br_S;
- public static readonly OpCode Break;
- public static readonly OpCode Brfalse;
- public static readonly OpCode Brfalse_S;
- public static readonly OpCode Brtrue;
- public static readonly OpCode Brtrue_S;
- public static readonly OpCode Call;
- public static readonly OpCode Calli;
- public static readonly OpCode Callvirt;
- public static readonly OpCode Castclass;
- public static readonly OpCode Ceq;
- public static readonly OpCode Cgt;
- public static readonly OpCode Cgt_Un;
- public static readonly OpCode Ckfinite;
- public static readonly OpCode Clt;
- public static readonly OpCode Clt_Un;
- public static readonly OpCode Conv_I;
- public static readonly OpCode Conv_I1;
- public static readonly OpCode Conv_I2;
- public static readonly OpCode Conv_I4;
- public static readonly OpCode Conv_I8;
- public static readonly OpCode Conv_Ovf_I;
- public static readonly OpCode Conv_Ovf_I_Un;
- public static readonly OpCode Conv_Ovf_I1;
- public static readonly OpCode Conv_Ovf_I1_Un;
- public static readonly OpCode Conv_Ovf_I2;
- public static readonly OpCode Conv_Ovf_I2_Un;
- public static readonly OpCode Conv_Ovf_I4;
- public static readonly OpCode Conv_Ovf_I4_Un;
- public static readonly OpCode Conv_Ovf_I8;
- public static readonly OpCode Conv_Ovf_I8_Un;
- public static readonly OpCode Conv_Ovf_U;
- public static readonly OpCode Conv_Ovf_U_Un;
- public static readonly OpCode Conv_Ovf_U1;
- public static readonly OpCode Conv_Ovf_U1_Un;
- public static readonly OpCode Conv_Ovf_U2;
- public static readonly OpCode Conv_Ovf_U2_Un;
- public static readonly OpCode Conv_Ovf_U4;
- public static readonly OpCode Conv_Ovf_U4_Un;
- public static readonly OpCode Conv_Ovf_U8;
- public static readonly OpCode Conv_Ovf_U8_Un;
- public static readonly OpCode Conv_R_Un;
- public static readonly OpCode Conv_R4;
- public static readonly OpCode Conv_R8;
- public static readonly OpCode Conv_U;
- public static readonly OpCode Conv_U1;
- public static readonly OpCode Conv_U2;
- public static readonly OpCode Conv_U4;
- public static readonly OpCode Conv_U8;
- public static readonly OpCode Cpblk;
- public static readonly OpCode Cpobj;
- public static readonly OpCode Div;
- public static readonly OpCode Div_Un;
- public static readonly OpCode Dup;
- public static readonly OpCode Endfilter;
- public static readonly OpCode Endfinally;
- public static readonly OpCode Initblk;
- public static readonly OpCode Initobj;
- public static readonly OpCode Isinst;
- public static readonly OpCode Jmp;
- public static readonly OpCode Ldarg;
- public static readonly OpCode Ldarg_0;
- public static readonly OpCode Ldarg_1;
- public static readonly OpCode Ldarg_2;
- public static readonly OpCode Ldarg_3;
- public static readonly OpCode Ldarg_S;
- public static readonly OpCode Ldarga;
- public static readonly OpCode Ldarga_S;
- public static readonly OpCode Ldc_I4;
- public static readonly OpCode Ldc_I4_0;
- public static readonly OpCode Ldc_I4_1;
- public static readonly OpCode Ldc_I4_2;
- public static readonly OpCode Ldc_I4_3;
- public static readonly OpCode Ldc_I4_4;
- public static readonly OpCode Ldc_I4_5;
- public static readonly OpCode Ldc_I4_6;
- public static readonly OpCode Ldc_I4_7;
- public static readonly OpCode Ldc_I4_8;
- public static readonly OpCode Ldc_I4_M1;
- public static readonly OpCode Ldc_I4_S;
- public static readonly OpCode Ldc_I8;
- public static readonly OpCode Ldc_R4;
- public static readonly OpCode Ldc_R8;
- public static readonly OpCode Ldelem_I;
- public static readonly OpCode Ldelem_I1;
- public static readonly OpCode Ldelem_I2;
- public static readonly OpCode Ldelem_I4;
- public static readonly OpCode Ldelem_I8;
- public static readonly OpCode Ldelem_R4;
- public static readonly OpCode Ldelem_R8;
- public static readonly OpCode Ldelem_Ref;
- public static readonly OpCode Ldelem_U1;
- public static readonly OpCode Ldelem_U2;
- public static readonly OpCode Ldelem_U4;
- public static readonly OpCode Ldelema;
- public static readonly OpCode Ldfld;
- public static readonly OpCode Ldflda;
- public static readonly OpCode Ldftn;
- public static readonly OpCode Ldind_I;
- public static readonly OpCode Ldind_I1;
- public static readonly OpCode Ldind_I2;
- public static readonly OpCode Ldind_I4;
- public static readonly OpCode Ldind_I8;
- public static readonly OpCode Ldind_R4;
- public static readonly OpCode Ldind_R8;
- public static readonly OpCode Ldind_Ref;
- public static readonly OpCode Ldind_U1;
- public static readonly OpCode Ldind_U2;
- public static readonly OpCode Ldind_U4;
- public static readonly OpCode Ldlen;
- public static readonly OpCode Ldloc;
- public static readonly OpCode Ldloc_0;
- public static readonly OpCode Ldloc_1;
- public static readonly OpCode Ldloc_2;
- public static readonly OpCode Ldloc_3;
- public static readonly OpCode Ldloc_S;
- public static readonly OpCode Ldloca;
- public static readonly OpCode Ldloca_S;
- public static readonly OpCode Ldnull;
- public static readonly OpCode Ldobj;
- public static readonly OpCode Ldsfld;
- public static readonly OpCode Ldsflda;
- public static readonly OpCode Ldstr;
- public static readonly OpCode Ldtoken;
- public static readonly OpCode Ldvirtftn;
- public static readonly OpCode Leave;
- public static readonly OpCode Leave_S;
- public static readonly OpCode Localloc;
- public static readonly OpCode Mkrefany;
- public static readonly OpCode Mul;
- public static readonly OpCode Mul_Ovf;
- public static readonly OpCode Mul_Ovf_Un;
- public static readonly OpCode Neg;
- public static readonly OpCode Newarr;
- public static readonly OpCode Newobj;
- public static readonly OpCode Nop;
- public static readonly OpCode Not;
- public static readonly OpCode Or;
- public static readonly OpCode Pop;
- public static readonly OpCode Prefix1;
- public static readonly OpCode Prefix2;
- public static readonly OpCode Prefix3;
- public static readonly OpCode Prefix4;
- public static readonly OpCode Prefix5;
- public static readonly OpCode Prefix6;
- public static readonly OpCode Prefix7;
- public static readonly OpCode Prefixref;
- public static readonly OpCode Refanytype;
- public static readonly OpCode Refanyval;
- public static readonly OpCode Rem;
- public static readonly OpCode Rem_Un;
- public static readonly OpCode Ret;
- public static readonly OpCode Rethrow;
- public static readonly OpCode Shl;
- public static readonly OpCode Shr;
- public static readonly OpCode Shr_Un;
- public static readonly OpCode Sizeof;
- public static readonly OpCode Starg;
- public static readonly OpCode Starg_S;
- public static readonly OpCode Stelem_I;
- public static readonly OpCode Stelem_I1;
- public static readonly OpCode Stelem_I2;
- public static readonly OpCode Stelem_I4;
- public static readonly OpCode Stelem_I8;
- public static readonly OpCode Stelem_R4;
- public static readonly OpCode Stelem_R8;
- public static readonly OpCode Stelem_Ref;
- public static readonly OpCode Stfld;
- public static readonly OpCode Stind_I;
- public static readonly OpCode Stind_I1;
- public static readonly OpCode Stind_I2;
- public static readonly OpCode Stind_I4;
- public static readonly OpCode Stind_I8;
- public static readonly OpCode Stind_R4;
- public static readonly OpCode Stind_R8;
- public static readonly OpCode Stind_Ref;
- public static readonly OpCode Stloc;
- public static readonly OpCode Stloc_0;
- public static readonly OpCode Stloc_1;
- public static readonly OpCode Stloc_2;
- public static readonly OpCode Stloc_3;
- public static readonly OpCode Stloc_S;
- public static readonly OpCode Stobj;
- public static readonly OpCode Stsfld;
- public static readonly OpCode Sub;
- public static readonly OpCode Sub_Ovf;
- public static readonly OpCode Sub_Ovf_Un;
- public static readonly OpCode Switch;
- public static readonly OpCode Tailcall;
- public static readonly OpCode Throw;
- public static readonly OpCode Unaligned;
- public static readonly OpCode Unbox;
- public static readonly OpCode Volatile;
- public static readonly OpCode Xor;
-
-
-
- static OpCodes ()
- {
-
- Nop = new OpCode("nop", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x0);
- Arglist = new OpCode("arglist", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x0);
- Break = new OpCode("break", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Break, 0xFF, 0x1);
- Ceq = new OpCode("ceq", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x1);
- Starg_S = new OpCode("starg.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x10);
- Ldloc_S = new OpCode("ldloc.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x11);
- Endfilter = new OpCode("endfilter", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Return, 0xFE, 0x11);
- Ldloca_S = new OpCode("ldloca.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x12);
- Unaligned = new OpCode("unaligned.", 2, OpCodeType.Prefix, OperandType.ShortInlineI, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFE, 0x12);
- Stloc_S = new OpCode("stloc.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x13);
- Volatile = new OpCode("volatile.", 2, OpCodeType.Prefix, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFE, 0x13);
- Ldnull = new OpCode("ldnull", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x14);
- Tailcall = new OpCode("tail.", 2, OpCodeType.Prefix, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFE, 0x14);
- Ldc_I4_M1 = new OpCode("ldc.i4.m1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x15);
- Initobj = new OpCode("initobj", 2, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0x15);
- Ldc_I4_0 = new OpCode("ldc.i4.0", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x16);
- Ldc_I4_1 = new OpCode("ldc.i4.1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x17);
- Cpblk = new OpCode("cpblk", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0x17);
- Ldc_I4_2 = new OpCode("ldc.i4.2", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x18);
- Initblk = new OpCode("initblk", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0x18);
- Ldc_I4_3 = new OpCode("ldc.i4.3", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x19);
- Ldc_I4_4 = new OpCode("ldc.i4.4", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1A);
- Rethrow = new OpCode("rethrow", 2, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Throw, 0xFE, 0x1A);
- Ldc_I4_5 = new OpCode("ldc.i4.5", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1B);
- Ldc_I4_6 = new OpCode("ldc.i4.6", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1C);
- Sizeof = new OpCode("sizeof", 2, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x1C);
- Ldc_I4_7 = new OpCode("ldc.i4.7", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1D);
- Refanytype = new OpCode("refanytype", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x1D);
- Ldc_I4_8 = new OpCode("ldc.i4.8", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1E);
- Ldc_I4_S = new OpCode("ldc.i4.s", 1, OpCodeType.Macro, OperandType.ShortInlineI, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1F);
- Ldarg_0 = new OpCode("ldarg.0", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x2);
- Cgt = new OpCode("cgt", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x2);
- Ldc_I4 = new OpCode("ldc.i4", 1, OpCodeType.Primitive, OperandType.InlineI, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x20);
- Ldc_I8 = new OpCode("ldc.i8", 1, OpCodeType.Primitive, OperandType.InlineI8, StackBehaviour.Pop0, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x21);
- Ldc_R4 = new OpCode("ldc.r4", 1, OpCodeType.Primitive, OperandType.ShortInlineR, StackBehaviour.Pop0, StackBehaviour.Pushr4, FlowControl.Next, 0xFF, 0x22);
- Ldc_R8 = new OpCode("ldc.r8", 1, OpCodeType.Primitive, OperandType.InlineR, StackBehaviour.Pop0, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x23);
- Dup = new OpCode("dup", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push1_push1, FlowControl.Next, 0xFF, 0x25);
- Pop = new OpCode("pop", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x26);
- Jmp = new OpCode("jmp", 1, OpCodeType.Primitive, OperandType.InlineMethod, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Call, 0xFF, 0x27);
- Call = new OpCode("call", 1, OpCodeType.Primitive, OperandType.InlineMethod, StackBehaviour.Varpop, StackBehaviour.Varpush, FlowControl.Call, 0xFF, 0x28);
- Calli = new OpCode("calli", 1, OpCodeType.Primitive, OperandType.InlineSig, StackBehaviour.Varpop, StackBehaviour.Varpush, FlowControl.Call, 0xFF, 0x29);
- Ret = new OpCode("ret", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Varpop, StackBehaviour.Push0, FlowControl.Return, 0xFF, 0x2A);
- Br_S = new OpCode("br.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Branch, 0xFF, 0x2B);
- Brfalse_S = new OpCode("brfalse.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x2C);
- Brtrue_S = new OpCode("brtrue.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x2D);
- Beq_S = new OpCode("beq.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x2E);
- Bge_S = new OpCode("bge.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x2F);
- Ldarg_1 = new OpCode("ldarg.1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x3);
- Cgt_Un = new OpCode("cgt.un", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x3);
- Bgt_S = new OpCode("bgt.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x30);
- Ble_S = new OpCode("ble.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x31);
- Blt_S = new OpCode("blt.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x32);
- Bne_Un_S = new OpCode("bne.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x33);
- Bge_Un_S = new OpCode("bge.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x34);
- Bgt_Un_S = new OpCode("bgt.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x35);
- Ble_Un_S = new OpCode("ble.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x36);
- Blt_Un_S = new OpCode("blt.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x37);
- Br = new OpCode("br", 1, OpCodeType.Primitive, OperandType.InlineBrTarget, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Branch, 0xFF, 0x38);
- Brfalse = new OpCode("brfalse", 1, OpCodeType.Primitive, OperandType.InlineBrTarget, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x39);
- Brtrue = new OpCode("brtrue", 1, OpCodeType.Primitive, OperandType.InlineBrTarget, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3A);
- Beq = new OpCode("beq", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3B);
- Bge = new OpCode("bge", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3C);
- Bgt = new OpCode("bgt", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3D);
- Ble = new OpCode("ble", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3E);
- Blt = new OpCode("blt", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3F);
- Ldarg_2 = new OpCode("ldarg.2", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x4);
- Clt = new OpCode("clt", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x4);
- Bne_Un = new OpCode("bne.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x40);
- Bge_Un = new OpCode("bge.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x41);
- Bgt_Un = new OpCode("bgt.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x42);
- Ble_Un = new OpCode("ble.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x43);
- Blt_Un = new OpCode("blt.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x44);
- Switch = new OpCode("switch", 1, OpCodeType.Primitive, OperandType.InlineSwitch, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x45);
- Ldind_I1 = new OpCode("ldind.i1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x46);
- Ldind_U1 = new OpCode("ldind.u1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x47);
- Ldind_I2 = new OpCode("ldind.i2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x48);
- Ldind_U2 = new OpCode("ldind.u2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x49);
- Ldind_I4 = new OpCode("ldind.i4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x4A);
- Ldind_U4 = new OpCode("ldind.u4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x4B);
- Ldind_I8 = new OpCode("ldind.i8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x4C);
- Ldind_I = new OpCode("ldind.i", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x4D);
- Ldind_R4 = new OpCode("ldind.r4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushr4, FlowControl.Next, 0xFF, 0x4E);
- Ldind_R8 = new OpCode("ldind.r8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x4F);
- Ldarg_3 = new OpCode("ldarg.3", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5);
- Clt_Un = new OpCode("clt.un", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x5);
- Ldind_Ref = new OpCode("ldind.ref", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x50);
- Stind_Ref = new OpCode("stind.ref", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x51);
- Stind_I1 = new OpCode("stind.i1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x52);
- Stind_I2 = new OpCode("stind.i2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x53);
- Stind_I4 = new OpCode("stind.i4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x54);
- Stind_I8 = new OpCode("stind.i8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi8, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x55);
- Stind_R4 = new OpCode("stind.r4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popr4, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x56);
- Stind_R8 = new OpCode("stind.r8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popr8, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x57);
- Add = new OpCode("add", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x58);
- Sub = new OpCode("sub", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x59);
- Mul = new OpCode("mul", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5A);
- Div = new OpCode("div", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5B);
- Div_Un = new OpCode("div.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5C);
- Rem = new OpCode("rem", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5D);
- Rem_Un = new OpCode("rem.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5E);
- And = new OpCode("and", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5F);
- Ldloc_0 = new OpCode("ldloc.0", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x6);
- Ldftn = new OpCode("ldftn", 2, OpCodeType.Primitive, OperandType.InlineMethod, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x6);
- Or = new OpCode("or", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x60);
- Xor = new OpCode("xor", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x61);
- Shl = new OpCode("shl", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x62);
- Shr = new OpCode("shr", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x63);
- Shr_Un = new OpCode("shr.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x64);
- Neg = new OpCode("neg", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x65);
- Not = new OpCode("not", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x66);
- Conv_I1 = new OpCode("conv.i1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x67);
- Conv_I2 = new OpCode("conv.i2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x68);
- Conv_I4 = new OpCode("conv.i4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x69);
- Conv_I8 = new OpCode("conv.i8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x6A);
- Conv_R4 = new OpCode("conv.r4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushr4, FlowControl.Next, 0xFF, 0x6B);
- Conv_R8 = new OpCode("conv.r8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x6C);
- Conv_U4 = new OpCode("conv.u4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x6D);
- Conv_U8 = new OpCode("conv.u8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x6E);
- Callvirt = new OpCode("callvirt", 1, OpCodeType.Objmodel, OperandType.InlineMethod, StackBehaviour.Varpop, StackBehaviour.Varpush, FlowControl.Call, 0xFF, 0x6F);
- Ldloc_1 = new OpCode("ldloc.1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x7);
- Ldvirtftn = new OpCode("ldvirtftn", 2, OpCodeType.Primitive, OperandType.InlineMethod, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x7);
- Cpobj = new OpCode("cpobj", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x70);
- Ldobj = new OpCode("ldobj", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popi, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x71);
- Ldstr = new OpCode("ldstr", 1, OpCodeType.Objmodel, OperandType.InlineString, StackBehaviour.Pop0, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x72);
- Newobj = new OpCode("newobj", 1, OpCodeType.Objmodel, OperandType.InlineMethod, StackBehaviour.Varpop, StackBehaviour.Pushref, FlowControl.Call, 0xFF, 0x73);
- Castclass = new OpCode("castclass", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x74);
- Isinst = new OpCode("isinst", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x75);
- Conv_R_Un = new OpCode("conv.r.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x76);
- Unbox = new OpCode("unbox", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x79);
- Throw = new OpCode("throw", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref, StackBehaviour.Push0, FlowControl.Throw, 0xFF, 0x7A);
- Ldfld = new OpCode("ldfld", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Popref, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x7B);
- Ldflda = new OpCode("ldflda", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x7C);
- Stfld = new OpCode("stfld", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Popref_pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x7D);
- Ldsfld = new OpCode("ldsfld", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x7E);
- Ldsflda = new OpCode("ldsflda", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x7F);
- Ldloc_2 = new OpCode("ldloc.2", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x8);
- Stsfld = new OpCode("stsfld", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x80);
- Stobj = new OpCode("stobj", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Popi_pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x81);
- Conv_Ovf_I1_Un = new OpCode("conv.ovf.i1.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x82);
- Conv_Ovf_I2_Un = new OpCode("conv.ovf.i2.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x83);
- Conv_Ovf_I4_Un = new OpCode("conv.ovf.i4.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x84);
- Conv_Ovf_I8_Un = new OpCode("conv.ovf.i8.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x85);
- Conv_Ovf_U1_Un = new OpCode("conv.ovf.u1.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x86);
- Conv_Ovf_U2_Un = new OpCode("conv.ovf.u2.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x87);
- Conv_Ovf_U4_Un = new OpCode("conv.ovf.u4.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x88);
- Conv_Ovf_U8_Un = new OpCode("conv.ovf.u8.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x89);
- Conv_Ovf_I_Un = new OpCode("conv.ovf.i.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8A);
- Conv_Ovf_U_Un = new OpCode("conv.ovf.u.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8B);
- Boxval = new OpCode("boxval", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Pop1, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x8C);
- Box = new OpCode("box", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Pop1, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x8C);
- Newarr = new OpCode("newarr", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popi, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x8D);
- Ldlen = new OpCode("ldlen", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8E);
- Ldelema = new OpCode("ldelema", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8F);
- Ldloc_3 = new OpCode("ldloc.3", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x9);
- Ldarg = new OpCode("ldarg", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFE, 0x9);
- Ldelem_I1 = new OpCode("ldelem.i1", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x90);
- Ldelem_U1 = new OpCode("ldelem.u1", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x91);
- Ldelem_I2 = new OpCode("ldelem.i2", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x92);
- Ldelem_U2 = new OpCode("ldelem.u2", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x93);
- Ldelem_I4 = new OpCode("ldelem.i4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x94);
- Ldelem_U4 = new OpCode("ldelem.u4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x95);
- Ldelem_I8 = new OpCode("ldelem.i8", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x96);
- Ldelem_I = new OpCode("ldelem.i", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x97);
- Ldelem_R4 = new OpCode("ldelem.r4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushr4, FlowControl.Next, 0xFF, 0x98);
- Ldelem_R8 = new OpCode("ldelem.r8", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x99);
- Ldelem_Ref = new OpCode("ldelem.ref", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x9A);
- Stelem_I = new OpCode("stelem.i", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9B);
- Stelem_I1 = new OpCode("stelem.i1", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9C);
- Stelem_I2 = new OpCode("stelem.i2", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9D);
- Stelem_I4 = new OpCode("stelem.i4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9E);
- Stelem_I8 = new OpCode("stelem.i8", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi8, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9F);
- Stloc_0 = new OpCode("stloc.0", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA);
- Ldarga = new OpCode("ldarga", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0xA);
- Stelem_R4 = new OpCode("stelem.r4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popr4, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA0);
- Stelem_R8 = new OpCode("stelem.r8", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popr8, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA1);
- Stelem_Ref = new OpCode("stelem.ref", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popref, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA2);
- Stloc_1 = new OpCode("stloc.1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xB);
- Starg = new OpCode("starg", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0xB);
- Conv_Ovf_I1 = new OpCode("conv.ovf.i1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB3);
- Conv_Ovf_U1 = new OpCode("conv.ovf.u1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB4);
- Conv_Ovf_I2 = new OpCode("conv.ovf.i2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB5);
- Conv_Ovf_U2 = new OpCode("conv.ovf.u2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB6);
- Conv_Ovf_I4 = new OpCode("conv.ovf.i4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB7);
- Conv_Ovf_U4 = new OpCode("conv.ovf.u4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB8);
- Conv_Ovf_I8 = new OpCode("conv.ovf.i8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0xB9);
- Conv_Ovf_U8 = new OpCode("conv.ovf.u8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0xBA);
- Stloc_2 = new OpCode("stloc.2", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xC);
- Ldloc = new OpCode("ldloc", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFE, 0xC);
- Refanyval = new OpCode("refanyval", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xC2);
- Ckfinite = new OpCode("ckfinite", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0xC3);
- Mkrefany = new OpCode("mkrefany", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Popi, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xC6);
- Stloc_3 = new OpCode("stloc.3", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xD);
- Ldloca = new OpCode("ldloca", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0xD);
- Ldtoken = new OpCode("ldtoken", 1, OpCodeType.Primitive, OperandType.InlineTok, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD0);
- Conv_U2 = new OpCode("conv.u2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD1);
- Conv_U1 = new OpCode("conv.u1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD2);
- Conv_I = new OpCode("conv.i", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD3);
- Conv_Ovf_I = new OpCode("conv.ovf.i", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD4);
- Conv_Ovf_U = new OpCode("conv.ovf.u", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD5);
- Add_Ovf = new OpCode("add.ovf", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xD6);
- Add_Ovf_Un = new OpCode("add.ovf.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xD7);
- Mul_Ovf = new OpCode("mul.ovf", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xD8);
- Mul_Ovf_Un = new OpCode("mul.ovf.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xD9);
- Sub_Ovf = new OpCode("sub.ovf", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xDA);
- Sub_Ovf_Un = new OpCode("sub.ovf.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xDB);
- Endfinally = new OpCode("endfinally", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Return, 0xFF, 0xDC);
- Leave = new OpCode("leave", 1, OpCodeType.Primitive, OperandType.InlineBrTarget, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Branch, 0xFF, 0xDD);
- Leave_S = new OpCode("leave.s", 1, OpCodeType.Primitive, OperandType.ShortInlineBrTarget, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Branch, 0xFF, 0xDE);
- Stind_I = new OpCode("stind.i", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xDF);
- Ldarg_S = new OpCode("ldarg.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xE);
- Stloc = new OpCode("stloc", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0xE);
- Conv_U = new OpCode("conv.u", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xE0);
- Ldarga_S = new OpCode("ldarga.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xF);
- Localloc = new OpCode("localloc", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0xF);
- Prefix7 = new OpCode("prefix7", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xF8);
- Prefix6 = new OpCode("prefix6", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xF9);
- Prefix5 = new OpCode("prefix5", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFA);
- Prefix4 = new OpCode("prefix4", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFB);
- Prefix3 = new OpCode("prefix3", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFC);
- Prefix2 = new OpCode("prefix2", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFD);
- Prefix1 = new OpCode("prefix1", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFE);
- Prefixref = new OpCode("prefixref", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFF);
-
-
- }
-
- public static bool TakesSingleByteArgument (OpCode inst)
- {
- OperandType t = inst.OperandType;
-
- // check for short-inline instructions
- return ( t == OperandType.ShortInlineBrTarget
- || t == OperandType.ShortInlineI
- || t == OperandType.ShortInlineR
- || t == OperandType.ShortInlineVar
- );
- }
- }
-
-
-
-
-
-
-} // namespace System.Reflection.Emit
diff --git a/mcs/class/corlib/System.Reflection.Emit/OperandType.cs b/mcs/class/corlib/System.Reflection.Emit/OperandType.cs
deleted file mode 100644
index 669ca53277e..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/OperandType.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// OperandType.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Describes the operand types of MSIL instructions.
- /// </summary>
- public enum OperandType {
-
- /// <summary>
- /// </summary>
- InlineBrTarget = 0,
-
- /// <summary>
- /// </summary>
- InlineField = 1,
-
- /// <summary>
- /// </summary>
- InlineI = 2,
-
- /// <summary>
- /// </summary>
- InlineI8 = 3,
-
- /// <summary>
- /// </summary>
- InlineMethod = 4,
-
- /// <summary>
- /// </summary>
- InlineNone = 5,
-
- /// <summary>
- /// </summary>
- InlinePhi = 6,
-
- /// <summary>
- /// </summary>
- InlineR = 7,
-
- /// <summary>
- /// </summary>
- InlineSig = 9,
-
- /// <summary>
- /// </summary>
- InlineString = 0x0A,
-
- /// <summary>
- /// </summary>
- InlineSwitch = 0x0B,
-
- /// <summary>
- /// </summary>
- InlineTok = 0x0C,
-
- /// <summary>
- /// </summary>
- InlineType = 0x0D,
-
- /// <summary>
- /// </summary>
- InlineVar = 0x0E,
-
- /// <summary>
- /// </summary>
- ShortInlineBrTarget = 0x0F,
-
- /// <summary>
- /// </summary>
- ShortInlineI = 0x10,
-
- /// <summary>
- /// </summary>
- ShortInlineR = 0x11,
-
- /// <summary>
- /// </summary>
- ShortInlineVar = 0x12
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/PEFileKinds.cs b/mcs/class/corlib/System.Reflection.Emit/PEFileKinds.cs
deleted file mode 100644
index 0677897bc82..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/PEFileKinds.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace System.Reflection.Emit {
- public enum PEFileKinds {
- Dll = 1,
- ConsoleApplication = 2,
- WindowApplication = 3
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/PackingSize.cs b/mcs/class/corlib/System.Reflection.Emit/PackingSize.cs
deleted file mode 100644
index 82c74276386..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/PackingSize.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// PackingSize.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Specifies the packing size (data alignment) of a type.
- /// </summary>
- public enum PackingSize {
-
- /// <summary>
- /// The packing size is unspecified.
- /// </summary>
- Unspecified = 0,
-
- /// <summary>
- /// </summary>
- Size1 = 1,
-
- /// <summary>
- /// </summary>
- Size2 = 2,
-
- /// <summary>
- /// </summary>
- Size4 = 4,
-
- /// <summary>
- /// </summary>
- Size8 = 8,
-
- /// <summary>
- /// </summary>
- Size16 = 16
- }
-
-}
-
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs
deleted file mode 100755
index 84b029aca7b..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-//
-// System.Reflection.Emit/ParameterBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
- public class ParameterBuilder {
- private MethodBase methodb; /* MethodBuilder or ConstructorBuilder */
- private string name;
- private CustomAttributeBuilder[] cattrs;
- private ParameterAttributes attrs;
- private int position;
- private int table_idx;
-
- internal ParameterBuilder (MethodBase mb, int pos, ParameterAttributes attributes, string strParamName) {
- name = strParamName;
- position = pos;
- attrs = attributes;
- methodb = mb;
- table_idx = mb.get_next_table_index (0x08, true);
- }
-
- public virtual int Attributes {
- get {return (int)attrs;}
- }
- public bool IsIn {
- get {return ((int)attrs & (int)ParameterAttributes.In) != 0;}
- }
- public bool IsOut {
- get {return ((int)attrs & (int)ParameterAttributes.Out) != 0;}
- }
- public bool IsOptional {
- get {return ((int)attrs & (int)ParameterAttributes.Optional) != 0;}
- }
- public virtual string Name {
- get {return name;}
- }
- public virtual int Position {
- get {return position;}
- }
-
- public virtual ParameterToken GetToken() {
- return new ParameterToken (0x08 | table_idx);
- }
-
- [MonoTODO]
- public virtual void SetConstant( object defaultValue) {
- /* FIXME */
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- public virtual void SetMarshal( UnmanagedMarshal unmanagedMarshal) {
- }
-
-
-
-
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/ParameterToken.cs b/mcs/class/corlib/System.Reflection.Emit/ParameterToken.cs
deleted file mode 100644
index 460e08497cd..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ParameterToken.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// ParameterToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Parameter.
- /// </summary>
- public struct ParameterToken {
-
- internal int tokValue;
-
- public static readonly ParameterToken Empty;
-
-
- static ParameterToken ()
- {
- Empty = new ParameterToken ();
- }
-
-
- internal ParameterToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is ParameterToken;
-
- if (res) {
- ParameterToken that = (ParameterToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// ParameterToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Parameter.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/PropertyBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/PropertyBuilder.cs
deleted file mode 100755
index 57039b01c2c..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/PropertyBuilder.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-
-//
-// System.Reflection.Emit/PropertyBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
- public sealed class PropertyBuilder : PropertyInfo {
- private PropertyAttributes attrs;
- private string name;
- private Type type;
- private Type[] parameters;
- private CustomAttributeBuilder[] cattrs;
- private object def_value;
- private MethodBuilder set_method;
- private MethodBuilder get_method;
- private int table_idx = 0;
- internal TypeBuilder typeb;
-
- internal PropertyBuilder (TypeBuilder tb, string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes) {
- this.name = name;
- this.attrs = attributes;
- this.type = returnType;
- if (parameterTypes != null) {
- this.parameters = new Type [parameterTypes.Length];
- System.Array.Copy (parameterTypes, this.parameters, this.parameters.Length);
- }
- typeb = tb;
- table_idx = tb.get_next_table_index (0x17, true);
- }
-
- public override PropertyAttributes Attributes {
- get {return attrs;}
- }
- public override bool CanRead {
- get {return get_method != null;}
- }
- public override bool CanWrite {
- get {return set_method != null;}
- }
- public override Type DeclaringType {
- get {return null;}
- }
- public override string Name {
- get {return name;}
- }
- public PropertyToken PropertyToken {
- get {return new PropertyToken ();}
- }
- public override Type PropertyType {
- get {return type;}
- }
- public override Type ReflectedType {
- get {return null;}
- }
- public void AddOtherMethod( MethodBuilder mdBuilder) {
- }
- public override MethodInfo[] GetAccessors( bool nonPublic) {
- return null;
- }
- public override object[] GetCustomAttributes(bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return null;
- }
- public override MethodInfo GetGetMethod( bool nonPublic) {
- return get_method;
- }
- public override ParameterInfo[] GetIndexParameters() {
- return null;
- }
- public override MethodInfo GetSetMethod( bool nonPublic) {
- return set_method;
- }
- public override object GetValue(object obj, object[] index) {
- return null;
- }
- public override object GetValue( object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
- return null;
- }
- public override bool IsDefined( Type attributeType, bool inherit) {
- return false;
- }
- public void SetConstant( object defaultValue) {
- def_value = defaultValue;
- }
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- public void SetGetMethod( MethodBuilder mdBuilder) {
- get_method = mdBuilder;
- }
- public void SetSetMethod( MethodBuilder mdBuilder) {
- set_method = mdBuilder;
- }
- public override void SetValue( object obj, object value, object[] index) {
- }
- public override void SetValue( object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/PropertyToken.cs b/mcs/class/corlib/System.Reflection.Emit/PropertyToken.cs
deleted file mode 100644
index e883ec5a920..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/PropertyToken.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// PropertyToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Property.
- /// </summary>
- public struct PropertyToken {
-
- internal int tokValue;
-
- public static readonly PropertyToken Empty;
-
-
- static PropertyToken ()
- {
- Empty = new PropertyToken ();
- }
-
-
- internal PropertyToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is PropertyToken;
-
- if (res) {
- PropertyToken that = (PropertyToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// PropertyToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Property.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs b/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs
deleted file mode 100755
index 9838728d541..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-
-//
-// System.Reflection.Emit/SignatureHelper.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection.Emit {
- public sealed class SignatureHelper {
- public static SignatureHelper GetFieldSigHelper (Module mod) {
- return null;
- }
- public static SignatureHelper GetLocalVarSigHelper( Module mod) {
- return null;
- }
- public static SignatureHelper GetMethodSigHelper( Module mod, CallingConventions callingConvention, Type returnType) {
- return null;
- }
- public static SignatureHelper GetMethodSigHelper( Module mod, Type returnType, Type[] parameterTypes) {
- return null;
- }
- public static SignatureHelper GetPropertySigHelper( Module mod, Type returnType, Type[] parameterTypes) {
- return null;
- }
- public void AddArgument( Type clsArgument) {
- }
- public void AddSentinel() {
- }
- public override bool Equals( object obj) {
- return false;
- }
- public override int GetHashCode() {
- return 0;
- }
- public byte[] GetSignature() {
- return null;
- }
- public override string ToString() {
- return "SignatureHelper";
- }
-
-
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/SignatureToken.cs b/mcs/class/corlib/System.Reflection.Emit/SignatureToken.cs
deleted file mode 100644
index eebcba99363..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/SignatureToken.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// SignatureToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Signature.
- /// </summary>
- public struct SignatureToken {
-
- internal int tokValue;
-
- public static readonly SignatureToken Empty;
-
-
- static SignatureToken ()
- {
- Empty = new SignatureToken ();
- }
-
-
- internal SignatureToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is SignatureToken;
-
- if (res) {
- SignatureToken that = (SignatureToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// SignatureToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Signature.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/StackBehaviour.cs b/mcs/class/corlib/System.Reflection.Emit/StackBehaviour.cs
deleted file mode 100644
index 78cb915e7a6..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/StackBehaviour.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-// StackBehaviour.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Describes how values are pushed onto or popped off a stack.
- /// </summary>
- public enum StackBehaviour {
-
- /// <summary>
- /// </summary>
- Pop0 = 0,
-
- /// <summary>
- /// </summary>
- Pop1 = 1,
-
- /// <summary>
- /// </summary>
- Pop1_pop1 = 2,
-
- /// <summary>
- /// </summary>
- Popi = 3,
-
- /// <summary>
- /// </summary>
- Popi_pop1 = 4,
-
- /// <summary>
- /// </summary>
- Popi_popi = 5,
-
- /// <summary>
- /// </summary>
- Popi_popi8 = 6,
-
- /// <summary>
- /// </summary>
- Popi_popi_popi = 7,
-
- /// <summary>
- /// </summary>
- Popi_popr4 = 8,
-
- /// <summary>
- /// </summary>
- Popi_popr8 = 9,
-
- /// <summary>
- /// </summary>
- Popref = 0x0A,
-
- /// <summary>
- /// </summary>
- Popref_pop1 = 0x0B,
-
- /// <summary>
- /// </summary>
- Popref_popi = 0x0C,
-
- /// <summary>
- /// </summary>
- Popref_popi_popi = 0x0D,
-
- /// <summary>
- /// </summary>
- Popref_popi_popi8 = 0x0E,
-
- /// <summary>
- /// </summary>
- Popref_popi_popr4 = 0x0F,
-
- /// <summary>
- /// </summary>
- Popref_popi_popr8 = 0x10,
-
- /// <summary>
- /// </summary>
- Popref_popi_popref = 0x11,
-
- /// <summary>
- /// </summary>
- Push0 = 0x12,
-
- /// <summary>
- /// </summary>
- Push1 = 0x13,
-
- /// <summary>
- /// </summary>
- Push1_push1 = 0x14,
-
- /// <summary>
- /// </summary>
- Pushi = 0x15,
-
- /// <summary>
- /// </summary>
- Pushi8 = 0x16,
-
- /// <summary>
- /// </summary>
- Pushr4 = 0x17,
-
- /// <summary>
- /// </summary>
- Pushr8 = 0x18,
-
- /// <summary>
- /// </summary>
- Pushref = 0x19,
-
- /// <summary>
- /// </summary>
- Varpop = 0x1A,
-
- /// <summary>
- /// </summary>
- Varpush = 0x1B
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/StringToken.cs b/mcs/class/corlib/System.Reflection.Emit/StringToken.cs
deleted file mode 100644
index 8e9295d0cb7..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/StringToken.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// StringToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a String.
- /// </summary>
- public struct StringToken {
-
- internal int tokValue;
-
- public static readonly StringToken Empty;
-
-
- static StringToken ()
- {
- Empty = new StringToken ();
- }
-
-
- internal StringToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is StringToken;
-
- if (res) {
- StringToken that = (StringToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// StringToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this String.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
deleted file mode 100644
index 1fcde5543af..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
+++ /dev/null
@@ -1,415 +0,0 @@
-//
-// System.Reflection.Emit/TypeBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Globalization;
-
-namespace System.Reflection.Emit {
- public sealed class TypeBuilder : Type {
- private string tname;
- private string nspace;
- private Type parent;
- private Type[] interfaces;
- private MethodBuilder[] methods;
- private ConstructorBuilder[] ctors;
- private PropertyBuilder[] properties;
- private FieldBuilder[] fields;
- private CustomAttributeBuilder[] cattrs;
- internal TypeBuilder[] subtypes;
- private TypeAttributes attrs;
- private int table_idx;
- private ModuleBuilder pmodule;
- private int class_size;
- private PackingSize packing_size;
-
- public const int UnspecifiedTypeSize = -1;
-
- protected override TypeAttributes GetAttributeFlagsImpl () {
- return attrs;
- }
-
- internal TypeBuilder (ModuleBuilder mb, string name, TypeAttributes attr, Type parent, Type[] interfaces) {
- int sep_index;
- this.parent = parent;
- this.attrs = attr;
- packing_size = PackingSize.Unspecified;
- sep_index = name.LastIndexOf('.');
- if (sep_index != -1) {
- this.tname = name.Substring (sep_index + 1);
- this.nspace = name.Substring (0, sep_index);
- } else {
- this.tname = name;
- this.nspace = "";
- }
- if (interfaces != null) {
- this.interfaces = new Type[interfaces.Length];
- System.Array.Copy (interfaces, this.interfaces, interfaces.Length);
- }
- pmodule = mb;
- // skip .<Module> ?
- table_idx = mb.get_next_table_index (0x02, true);
- }
-
- public override Assembly Assembly {get {return null;}}
- public override string AssemblyQualifiedName {get {return null;}}
- public override Type BaseType {get {return parent;}}
- public override Type DeclaringType {get {return null;}}
- public override Type UnderlyingSystemType {
- get {return null;}
- }
-
- public override string FullName {
- get {
- if ((nspace != null) && (nspace.Length > 0))
- return String.Concat (nspace, ".", tname);
- return tname;
- }
- }
-
- public override Guid GUID {
- get {return Guid.Empty;}
- }
-
- public override Module Module {
- get {return pmodule;}
- }
- public override string Name {
- get {return tname;}
- }
- public override string Namespace {
- get {return nspace;}
- }
- public PackingSize PackingSize {
- get {return packing_size;}
- }
- public override Type ReflectedType {get {return parent;}}
- public override MemberTypes MemberType {
- get {return MemberTypes.TypeInfo;}
- }
-
- protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- }
-
- public override bool IsDefined( Type attributeType, bool inherit) {
- return false;
- }
- public override object[] GetCustomAttributes(bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return null;
- }
-
- [MonoTODO]
- public TypeBuilder DefineNestedType (string name) {
- // FIXME: LAMESPEC: what other attributes should we use here as default?
- return DefineNestedType (name, TypeAttributes.Public, typeof(object), null);
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr) {
- return DefineNestedType (name, attr, typeof(object), null);
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent) {
- return DefineNestedType (name, attr, parent, null);
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
- TypeBuilder res = new TypeBuilder (pmodule, name, attr, parent, interfaces);
- if (subtypes != null) {
- TypeBuilder[] new_types = new TypeBuilder [subtypes.Length + 1];
- System.Array.Copy (subtypes, new_types, subtypes.Length);
- new_types [subtypes.Length] = res;
- subtypes = new_types;
- } else {
- subtypes = new TypeBuilder [1];
- subtypes [0] = res;
- }
- return res;
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, int typesize) {
- return DefineNestedType (name, attr, parent, null);
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, PackingSize packsize) {
- return DefineNestedType (name, attr, parent, null);
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, PackingSize packsize, int typesize) {
- return DefineNestedType (name, attr, parent, null);
- }
-
- public ConstructorBuilder DefineConstructor( MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes) {
- ConstructorBuilder cb = new ConstructorBuilder (this, attributes, callingConvention, parameterTypes);
- if (ctors != null) {
- ConstructorBuilder[] new_ctors = new ConstructorBuilder [ctors.Length+1];
- System.Array.Copy (ctors, new_ctors, ctors.Length);
- new_ctors [ctors.Length] = cb;
- ctors = new_ctors;
- } else {
- ctors = new ConstructorBuilder [1];
- ctors [0] = cb;
- }
- return cb;
- }
-
- public ConstructorBuilder DefineDefaultConstructor( MethodAttributes attributes) {
- return DefineConstructor (attributes, CallingConventions.Standard, null);
- }
-
- public MethodBuilder DefineMethod( string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes) {
- return DefineMethod (name, attributes, CallingConventions.Standard, returnType, parameterTypes);
- }
-
- private void append_method (MethodBuilder mb) {
- if (methods != null) {
- MethodBuilder[] new_methods = new MethodBuilder [methods.Length+1];
- System.Array.Copy (methods, new_methods, methods.Length);
- new_methods [methods.Length] = mb;
- methods = new_methods;
- } else {
- methods = new MethodBuilder [1];
- methods [0] = mb;
- }
- }
-
- public MethodBuilder DefineMethod( string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
- MethodBuilder res = new MethodBuilder (this, name, attributes, callingConvention, returnType, parameterTypes);
- append_method (res);
- return res;
- }
-
- public MethodBuilder DefinePInvokeMethod (string name, string dllName, string entryName, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet) {
- MethodBuilder res = new MethodBuilder (this, name, attributes, callingConvention, returnType, parameterTypes,
- dllName, entryName, nativeCallConv, nativeCharSet);
- append_method (res);
- return res;
- }
-
- public MethodBuilder DefinePInvokeMethod (string name, string dllName, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet) {
- return DefinePInvokeMethod (name, dllName, name, attributes, callingConvention, returnType, parameterTypes,
- nativeCallConv, nativeCharSet);
- }
-
- public void DefineMethodOverride( MethodInfo methodInfoBody, MethodInfo methodInfoDeclaration) {
- if (methodInfoBody is MethodBuilder) {
- MethodBuilder mb = (MethodBuilder)methodInfoBody;
- mb.set_override (methodInfoDeclaration);
- }
- }
-
- public FieldBuilder DefineField( string fieldName, Type type, FieldAttributes attributes) {
- FieldBuilder res = new FieldBuilder (this, fieldName, type, attributes);
- if (fields != null) {
- FieldBuilder[] new_fields = new FieldBuilder [fields.Length+1];
- System.Array.Copy (fields, new_fields, fields.Length);
- new_fields [fields.Length] = res;
- fields = new_fields;
- } else {
- fields = new FieldBuilder [1];
- fields [0] = res;
- }
- return res;
- }
-
- public PropertyBuilder DefineProperty( string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes) {
- PropertyBuilder res = new PropertyBuilder (this, name, attributes, returnType, parameterTypes);
-
- if (properties != null) {
- PropertyBuilder[] new_properties = new PropertyBuilder [properties.Length+1];
- System.Array.Copy (properties, new_properties, properties.Length);
- new_properties [properties.Length] = res;
- properties = new_properties;
- } else {
- properties = new PropertyBuilder [1];
- properties [0] = res;
- }
- return res;
- }
-
- public Type CreateType() {
- if (methods != null) {
- foreach (MethodBuilder method in methods) {
- method.fixup ();
- }
- }
- if (ctors != null) {
- foreach (ConstructorBuilder ctor in ctors) {
- ctor.fixup ();
- }
- }
- return this;
- }
-
- public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr) {
- throw new NotImplementedException ();
- }
-
- public override Type GetElementType () { return null; }
-
- public override EventInfo GetEvent (string name, BindingFlags bindingAttr) {
- throw new NotImplementedException ();
- }
-
- public override EventInfo[] GetEvents (BindingFlags bindingAttr) {
- throw new NotImplementedException ();
- }
-
- public override FieldInfo GetField( string name, BindingFlags bindingAttr) {
- //FIXME
- throw new NotImplementedException ();
- }
-
- public override FieldInfo[] GetFields (BindingFlags bindingAttr) {
- //FIXME
- throw new NotImplementedException ();
- }
-
- public override Type GetInterface (string name, bool ignoreCase) {
- throw new NotImplementedException ();
- }
-
- public override Type[] GetInterfaces () {
- if (interfaces != null) {
- Type[] ret = new Type [interfaces.Length];
- System.Array.Copy (interfaces, ret, ret.Length);
- return ret;
- } else {
- return Type.EmptyTypes;
- }
- }
-
- public override MemberInfo[] GetMembers( BindingFlags bindingAttr) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public override MethodInfo[] GetMethods (BindingFlags bindingAttr) {
- /*MemberInfo[] m = FindMembers (MemberTypes.Method, bindingAttr, null, null);
- MethodInfo[] res = new MethodInfo [m.Length];
- int i;
- for (i = 0; i < m.Length; ++i)
- res [i] = (MethodInfo) m [i];
- return res;*/
- throw new NotImplementedException ();
- }
-
- protected override MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- return null;
- }
-
- public override Type GetNestedType( string name, BindingFlags bindingAttr) {
- // FIXME
- return null;
- }
-
- public override Type[] GetNestedTypes (BindingFlags bindingAttr) {
- // FIXME
- return null;
- }
-
- public override PropertyInfo[] GetProperties( BindingFlags bindingAttr) {
- // FIXME
- return null;
- }
-
- protected override PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- return null;
- }
-
- protected override bool HasElementTypeImpl () {
- return IsArrayImpl() || IsByRefImpl() || IsPointerImpl ();
- }
-
- public override object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
- // FIXME
- return null;
- }
-
- protected override bool IsArrayImpl () {
- // FIXME
- return false;
- }
- protected override bool IsByRefImpl () {
- // FIXME
- return false;
- }
- protected override bool IsCOMObjectImpl () {
- return false;
- }
- protected override bool IsPointerImpl () {
- // FIXME
- return false;
- }
- protected override bool IsPrimitiveImpl () {
- // FIXME
- return false;
- }
- protected override bool IsValueTypeImpl () {
- // test this one
- return type_is_subtype_of (this, typeof (System.ValueType), false);
- }
-
- public override RuntimeTypeHandle TypeHandle { get { return _impl; } }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
-
- public EventBuilder DefineEvent( string name, EventAttributes attributes, Type eventtype) {
- return null;
- }
-
- static int InitializedDataCount = 0;
-
- public FieldBuilder DefineInitializedData( string name, byte[] data, FieldAttributes attributes) {
- TypeBuilder datablobtype = pmodule.DefineType ("$ArrayType$"+InitializedDataCount.ToString(),
- TypeAttributes.Public|TypeAttributes.ExplicitLayout|TypeAttributes.Sealed,
- typeof (System.ValueType), PackingSize.Size1, data.Length);
- datablobtype.packing_size = PackingSize.Size1;
- datablobtype.class_size = data.Length;
- datablobtype.CreateType ();
- FieldBuilder res = DefineField (name, datablobtype, attributes|FieldAttributes.Assembly|FieldAttributes.Static|FieldAttributes.HasFieldRVA);
- res.SetRVAData (data);
- InitializedDataCount++;
- return res;
- }
-
- public FieldBuilder DefineUninitializedData( string name, int size, FieldAttributes attributes) {
- return null;
- }
-
- public void SetParent (Type parentType) {
- parent = parentType;
- }
- internal int get_next_table_index (int table, bool inc) {
- return pmodule.get_next_table_index (table, inc);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeToken.cs b/mcs/class/corlib/System.Reflection.Emit/TypeToken.cs
deleted file mode 100644
index 4ac7fe2678b..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/TypeToken.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// TypeToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Type.
- /// </summary>
- public struct TypeToken {
-
- internal int tokValue;
-
- public static readonly TypeToken Empty;
-
-
- static TypeToken ()
- {
- Empty = new TypeToken ();
- }
-
-
- internal TypeToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is TypeToken;
-
- if (res) {
- TypeToken that = (TypeToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// TypeToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Type.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/UnmanagedMarshal.cs b/mcs/class/corlib/System.Reflection.Emit/UnmanagedMarshal.cs
deleted file mode 100755
index ab033eb26e7..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/UnmanagedMarshal.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-
-using System.Reflection.Emit;
-using System.Runtime.InteropServices;
-using System;
-
-namespace System.Reflection.Emit {
-
- public sealed class UnmanagedMarshal {
- private int count;
- private UnmanagedType t;
-
- public UnmanagedType BaseType {
- get {return t;}
- }
-
- public int ElementCount {
- get {return count;}
- }
-
- public UnmanagedType GetUnmanagedType {
- get {return t;}
- }
-
- public Guid IIDGuid {
- get {return Guid.Empty;}
- }
-
- [MonoTODO]
- public static UnmanagedMarshal DefineByValArray( int elemCount) {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnmanagedMarshal DefineByValTStr( int elemCount) {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnmanagedMarshal DefineLPArray( UnmanagedType elemType) {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnmanagedMarshal DefineSafeArray( UnmanagedType elemType) {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static UnmanagedMarshal DefineUnmanagedMarshal( UnmanagedType unmanagedType) {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/common.src b/mcs/class/corlib/System.Reflection.Emit/common.src
deleted file mode 100755
index 569a9d60748..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/common.src
+++ /dev/null
@@ -1,23 +0,0 @@
-AssemblyBuilder.cs
-AssemblyBuilderAccess.cs
-ConstructorBuilder.cs
-EventToken.cs
-FieldToken.cs
-FlowControl.cs
-ILGenerator.cs
-Label.cs
-MethodToken.cs
-ModuleBuilder.cs
-OpCode.cs
-OpCodes.cs
-OpCodeType.cs
-OperandType.cs
-PackingSize.cs
-ParameterToken.cs
-PEFileKinds.cs
-PropertyToken.cs
-SignatureToken.cs
-StackBehaviour.cs
-StringToken.cs
-TypeBuilder.cs
-TypeToken.cs
diff --git a/mcs/class/corlib/System.Reflection/AmbiguousMatchException.cs b/mcs/class/corlib/System.Reflection/AmbiguousMatchException.cs
deleted file mode 100755
index eb51070d13b..00000000000
--- a/mcs/class/corlib/System.Reflection/AmbiguousMatchException.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AmbiguousMatchException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection {
-
- public sealed class AmbiguousMatchException : SystemException {
- // Constructors
- public AmbiguousMatchException ()
- : base ("Ambiguous matching in method resolution")
- {
- }
-
- public AmbiguousMatchException (string message)
- : base (message)
- {
- }
-
- public AmbiguousMatchException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/Assembly.cs b/mcs/class/corlib/System.Reflection/Assembly.cs
deleted file mode 100644
index 88c89dad0a8..00000000000
--- a/mcs/class/corlib/System.Reflection/Assembly.cs
+++ /dev/null
@@ -1,304 +0,0 @@
-//
-// System.Reflection/Assembly.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Policy;
-using System.Runtime.Serialization;
-using System.Reflection.Emit;
-using System.IO;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection {
-
- public class Assembly : System.Reflection.ICustomAttributeProvider,
- System.Security.IEvidenceFactory, System.Runtime.Serialization.ISerializable {
- private IntPtr _mono_assembly;
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern string get_code_base ();
-
- public virtual string CodeBase {
- get {
- return get_code_base ();
- }
- }
-
- public virtual string CopiedCodeBase {
- get {
- return null;
- }
- }
-
- public virtual string FullName {
- get {
- //
- // FIXME: This is wrong, but it gets us going
- // in the compiler for now
- //
- return CodeBase;
- }
- }
-
- public virtual MethodInfo EntryPoint {
- get {
- return null;
- }
- }
-
- public virtual Evidence Evidence {
- get {
- return null;
- }
- }
-
- public virtual String Location {
- get {
- return null;
- }
- }
-
- public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- }
-
- public virtual bool IsDefined (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public virtual object [] GetCustomAttributes (bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
-
- public virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public virtual void RemoveOnTypeResolve (ResolveEventHandler handler)
- {
- throw new NotImplementedException ();
- }
-
- public virtual void AddOnTypeResolve (ResolveEventHandler handler)
- {
- throw new NotImplementedException ();
- }
-
- public virtual void RemoveOnResourceResolve (ResolveEventHandler handler)
- {
- throw new NotImplementedException ();
- }
-
- public virtual void AddOnResourceResolve (ResolveEventHandler handler)
- {
- throw new NotImplementedException ();
- }
-
- public virtual ModuleBuilder DefineDynamicModule (String name, Boolean emitSymbolInfo)
- {
- throw new NotImplementedException ();
- }
-
- public virtual ModuleBuilder DefineDynamicModule (String name)
- {
- throw new NotImplementedException ();
- }
-
- public virtual FileStream[] GetFiles ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual FileStream GetFile (String name)
- {
- throw new NotImplementedException ();
- }
-
- public virtual Stream GetManifestResourceStream (String name)
- {
- throw new NotImplementedException ();
- }
-
- public virtual Stream GetManifestResourceStream (Type type, String name)
- {
- throw new NotImplementedException ();
- }
-
- public virtual Type[] GetTypes ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual Type[] GetExportedTypes ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual Type GetType (String name, Boolean throwOnError)
- {
- return GetType (name, throwOnError, false);
- }
-
- public virtual Type GetType (String name) {
- return GetType (name, false, false);
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern Type GetType (String name, Boolean throwOnError, Boolean ignoreCase);
-
- public virtual AssemblyName GetName (Boolean copiedName)
- {
- throw new NotImplementedException ();
- }
-
- public virtual AssemblyName GetName ()
- {
- throw new NotImplementedException ();
- }
-
- public override String ToString ()
- {
- return GetName ().Name;
- }
-
- [MonoTODO]
- public static String CreateQualifiedName (String assemblyName, String typeName)
- {
- return "FIXME: assembly";
- }
-
- [MonoTODO]
- public static String nCreateQualifiedName (String assemblyName, String typeName)
- {
- return "FIXME: assembly";
- }
-
- [MonoTODO]
- public static Assembly GetAssembly (Type type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Assembly GetSatelliteAssembly (CultureInfo culture)
- {
- throw new NotImplementedException ();
- }
-
- public static Assembly LoadFrom (String assemblyFile)
- {
- return AppDomain.CurrentDomain.Load (assemblyFile);
- }
-
- public static Assembly Load (String assemblyString)
- {
- return AppDomain.CurrentDomain.Load (assemblyString);
- }
-
- public static Assembly Load (String assemblyString, Evidence assemblySecurity)
- {
- return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
- }
-
- public static Assembly Load (AssemblyName assemblyRef)
- {
- return AppDomain.CurrentDomain.Load (assemblyRef);
- }
-
- public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
- {
- return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
- }
-
- public static Assembly Load (Byte[] rawAssembly)
- {
- return AppDomain.CurrentDomain.Load (rawAssembly);
- }
-
- public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore)
- {
- return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
- }
-
- public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
- Evidence securityEvidence)
- {
- return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
- }
-
- public Object CreateInstance (String typeName)
- {
- throw new NotImplementedException ();
- }
-
- public Object CreateInstance (String typeName, Boolean ignoreCase)
- {
- throw new NotImplementedException ();
- }
-
- public Object CreateInstance (String typeName, Boolean ignoreCase,
- BindingFlags bindingAttr, Binder binder,
- Object[] args, CultureInfo culture,
- Object[] activationAttributes)
- {
- throw new NotImplementedException ();
- }
-
- public Module[] GetLoadedModules ()
- {
- throw new NotImplementedException ();
- }
-
- public Module[] GetModules ()
- {
- throw new NotImplementedException ();
- }
-
- public Module GetModule (String name)
- {
- throw new NotImplementedException ();
- }
-
- public String[] GetManifestResourceNames ()
- {
- throw new NotImplementedException ();
- }
-
- public static Assembly GetExecutingAssembly ()
- {
- throw new NotImplementedException ();
- }
-
- public AssemblyName[] GetReferencedAssemblies ()
- {
- throw new NotImplementedException ();
- }
-
- public ManifestResourceInfo GetManifestResourceInfo (String resourceName)
- {
- throw new NotImplementedException ();
- }
-
- public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity,
- String callerLocation)
- {
- throw new NotImplementedException ();
- }
-
- public static Assembly Load (String assemblyString, Evidence assemblySecurity,
- String callerLocation)
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyAlgorithmIdAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyAlgorithmIdAttribute.cs
deleted file mode 100644
index d7ea89294ef..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyAlgorithmIdAttribute.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Reflection.AssemblyAlgorithmIdAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Configuration.Assemblies;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyAlgorithmIdAttribute : Attribute
- {
- // Field
- private uint id;
-
- // Constructor
- public AssemblyAlgorithmIdAttribute (AssemblyHashAlgorithm algorithmId)
- {
- id = (uint) algorithmId;
- }
-
- [CLSCompliant (false)]
- public AssemblyAlgorithmIdAttribute (uint algorithmId)
- {
- id = algorithmId;
- }
-
- // Property
- [CLSCompliant (false)]
- public uint Algorithmid
- {
- get { return id; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyCompanyAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyCompanyAttribute.cs
deleted file mode 100644
index b6dc24687a9..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyCompanyAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyCompanyAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyCompanyAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyCompanyAttribute (string company)
- {
- name = company;
- }
-
- // Properties
- public string Company
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyConfigurationAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyConfigurationAttribute.cs
deleted file mode 100644
index 8e48b485d2d..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyConfigurationAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyConfigurationAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyConfigurationAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyConfigurationAttribute (string configuration)
- {
- name = configuration;
- }
-
- // Properties
- public string Configuration
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyCopyrightAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyCopyrightAttribute.cs
deleted file mode 100644
index 264a905f0ef..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyCopyrightAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyCopyrightAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyCopyrightAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyCopyrightAttribute (string copyright)
- {
- name = copyright;
- }
-
- // Properties
- public string Copyright
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyCultureAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyCultureAttribute.cs
deleted file mode 100644
index 16ce1f96cc4..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyCultureAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyCultureAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyCultureAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyCultureAttribute (string culture)
- {
- name = culture;
- }
-
- // Properties
- public string Culture
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyDefaultAliasAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyDefaultAliasAttribute.cs
deleted file mode 100644
index f91c9314917..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyDefaultAliasAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyDefaultAliasAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyDefaultAliasAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyDefaultAliasAttribute (string defaultAlias)
- {
- name = defaultAlias;
- }
-
- // Properties
- public string DefaultAlias
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyDelaySignAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyDelaySignAttribute.cs
deleted file mode 100644
index 13d0e480149..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyDelaySignAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Reflection.AssemblyDelaySignAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyDelaySignAttribute : Attribute
- {
- // Field
- private bool delay;
-
- // Constructor
- public AssemblyDelaySignAttribute (bool delaySign)
- {
- delay = delaySign;
- }
-
- // Property
- public bool DelaySIgn
- {
- get { return delay; }
- }
- }
-}
-
-
diff --git a/mcs/class/corlib/System.Reflection/AssemblyDescriptionAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyDescriptionAttribute.cs
deleted file mode 100644
index 00beee47ec4..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyDescriptionAttribute.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Reflection.AssemblyDescriptionAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyDescriptionAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyDescriptionAttribute (string description)
- {
- name = description;
- }
-
- // Property
- public string Description
- {
- get { return name; }
- }
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyFileVersionAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyFileVersionAttribute.cs
deleted file mode 100644
index e562296f57e..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyFileVersionAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyFileVersionAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyFileVersionAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyFileVersionAttribute (string version)
- {
- name = version;
- }
-
- // Property
- public string FileVersion
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyFlagsAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyFlagsAttribute.cs
deleted file mode 100644
index 7a9589dde9f..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyFlagsAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyFlagsAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyFlagsAttribute : Attribute
- {
- // Field
- private uint flags;
-
- // Constructor
- [CLSCompliant (false)]
- public AssemblyFlagsAttribute (uint flags)
- {
- this.flags = flags;
- }
-
- // Property
- [CLSCompliant (false)]
- public uint Flags
- {
- get { return flags; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyInformationalVersionAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyInformationalVersionAttribute.cs
deleted file mode 100644
index e3a5742f539..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyInformationalVersionAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyInformationalVersionAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyInformationalVersionAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyInformationalVersionAttribute (string informationalVersion)
- {
- name = informationalVersion;
- }
-
- // Property
- public string InformationalVersion
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyKeyFileAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyKeyFileAttribute.cs
deleted file mode 100644
index 0e92688493e..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyKeyFileAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyKeyFileAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyKeyFileAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyKeyFileAttribute (string keyFile)
- {
- name = keyFile;
- }
-
- // Property
- public string KeyFile
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyKeyNameAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyKeyNameAttribute.cs
deleted file mode 100644
index 3323b14ed79..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyKeyNameAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyKeyNameAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyKeyNameAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyKeyNameAttribute (string keyName)
- {
- name = keyName;
- }
-
- // Property
- public string KeyName
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyName.cs b/mcs/class/corlib/System.Reflection/AssemblyName.cs
deleted file mode 100755
index 8a04d74df67..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyName.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-
-//
-// System.Reflection/AssemblyName.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Runtime.Serialization;
-
-namespace System.Reflection {
-
- public class AssemblyName : ISerializable // ICloneable, , IDeserializationCallback
- {
- string name;
- string codebase;
- Version version;
-
- public AssemblyName ()
- {
- name = null;
- }
-
- public AssemblyName (SerializationInfo si, StreamingContext sc)
- {
- name = si.GetString ("_Name");
- codebase = si.GetString ("_CodeBase");
- version = (Version)si.GetValue ("_Version", typeof (Version));
- }
-
- public virtual string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
-
- public virtual string CodeBase {
- get {
- return codebase;
- }
-
- set {
- codebase = value;
- }
- }
-
- public virtual Version Version {
- get {
- return version;
- }
-
- set {
- version = value;
- }
- }
-
- public override int GetHashCode ()
- {
- return name.GetHashCode ();
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Reflection.AssemblyName))
- return false;
-
- AssemblyName an = (AssemblyName)o;
-
- if (an.name == this.name)
- return true;
-
- return false;
- }
-
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("_Name", name);
- info.AddValue ("_CodeBase", codebase);
- info.AddValue ("_Version", version);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyNameFlags.cs b/mcs/class/corlib/System.Reflection/AssemblyNameFlags.cs
deleted file mode 100755
index daa3cd97148..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyNameFlags.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// AssemblyNameFlags.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:38:33 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- [Serializable]
- public enum AssemblyNameFlags {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// Not sure about the ECMA spec, but this is what is in mscorlib...
- /// Perhaps this has changed since the beta.
- /// </summary>
- PublicKey = 1,
- } // AssemblyNameFlags
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/AssemblyNameProxy.cs b/mcs/class/corlib/System.Reflection/AssemblyNameProxy.cs
deleted file mode 100644
index cc02533a741..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyNameProxy.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Reflection.AssemblyNameProxy.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- public class AssemblyNameProxy : MarshalByRefObject
- {
- // Constructor
- public AssemblyNameProxy ()
- {
- }
-
- // Method
- [MonoTODO]
- public AssemblyName GetAssemblyName (string assemblyFile)
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyProductAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyProductAttribute.cs
deleted file mode 100644
index 67c85f9421b..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyProductAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyProductAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyProductAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyProductAttribute (string product)
- {
- name = product;
- }
-
- // Property
- public string Product
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyTitleAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyTitleAttribute.cs
deleted file mode 100644
index f3ac196a789..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyTitleAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyTitleAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyTitleAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyTitleAttribute (string title)
- {
- name = title;
- }
-
- // Property
- public string Title
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyTradeMarkAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyTradeMarkAttribute.cs
deleted file mode 100644
index 7c2bcc8e712..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyTradeMarkAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyTrademarkAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyTrademarkAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyTrademarkAttribute (string trademark)
- {
- name = trademark;
- }
-
- // Property
- public string Trademark
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyVersionAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyVersionAttribute.cs
deleted file mode 100644
index d5f46894698..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyVersionAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyVersionAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyVersionAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyVersionAttribute (string version)
- {
- name = version;
- }
-
- // Property
- public string Version
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/Binder.cs b/mcs/class/corlib/System.Reflection/Binder.cs
deleted file mode 100644
index 16e9095238c..00000000000
--- a/mcs/class/corlib/System.Reflection/Binder.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// System.Reflection.Binder
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) Ximian, Inc. 2001
-
-namespace System.Reflection
-{
- public abstract class Binder
- {
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/BindingFlags.cs b/mcs/class/corlib/System.Reflection/BindingFlags.cs
deleted file mode 100644
index 35cd0edcf1a..00000000000
--- a/mcs/class/corlib/System.Reflection/BindingFlags.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// BindingFlags.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:33:54 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum BindingFlags {
-
- /// <summary>
- /// </summary>
- IgnoreCase = 0x00000001,
-
- /// <summary>
- /// </summary>
- DeclaredOnly = 0x00000002,
-
- /// <summary>
- /// </summary>
- Instance = 0x00000004,
-
- /// <summary>
- /// </summary>
- Static = 0x00000008,
-
- /// <summary>
- /// </summary>
- Public = 0x00000010,
-
- /// <summary>
- /// </summary>
- NonPublic = 0x00000020,
-
- /// <summary>
- /// </summary>
- InvokeMethod = 0x00000100,
-
- /// <summary>
- /// </summary>
- CreateInstance = 0x00000200,
-
- /// <summary>
- /// </summary>
- GetField = 0x00000400,
-
- /// <summary>
- /// </summary>
- SetField = 0x00000800,
-
- /// <summary>
- /// </summary>
- GetProperty = 0x00001000,
-
- /// <summary>
- /// </summary>
- SetProperty = 0x00002000,
-
- /// <summary>
- /// </summary>
- ExactBinding = 0x00010000,
-
- /// <summary>
- /// </summary>
- SuppressChangeType = 0x00020000,
-
- /// <summary>
- /// </summary>
- OptionalParamBinding = 0x00040000,
- } // BindingFlags
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/CallingConventions.cs b/mcs/class/corlib/System.Reflection/CallingConventions.cs
deleted file mode 100755
index c42c2471c9d..00000000000
--- a/mcs/class/corlib/System.Reflection/CallingConventions.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// CallingConventions.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:38:43 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum CallingConventions {
-
- /// <summary>
- /// </summary>
- Standard = 1,
-
- /// <summary>
- /// </summary>
- VarArgs = 2,
-
- /// <summary>
- /// </summary>
- Any = 3,
-
- /// <summary>
- /// </summary>
- HasThis = 32,
-
- /// <summary>
- /// </summary>
- ExplicitThis = 64,
- } // CallingConventions
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/ChangeLog b/mcs/class/corlib/System.Reflection/ChangeLog
deleted file mode 100644
index 228c7f61f1e..00000000000
--- a/mcs/class/corlib/System.Reflection/ChangeLog
+++ /dev/null
@@ -1,164 +0,0 @@
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * StrongNameKeyPair.cs: Committed for Kevin Winchester (kwin@ns.sympatico.ca>.
-
-2002-02-24 Nick Drochak <ndrochak@gol.com>
-
- * AssemblyNameFlags.cs: Use proper member name. Thanks corcompare!
-
-Fri Feb 22 18:54:13 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoField.cs: implement GetValue as an internalcall.
- Implemented ToString().
-
-Tue Feb 19 20:36:04 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs, Module.cs, MonoField.cs, MonoMethod.cs,
- MonoProperty.cs, ParameterInfo.cs: Implemented custom attributes
- related methods.
-
-Thu Feb 14 18:55:23 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * TypeAttributes.cs: update to latest spec.
-
-Mon Feb 11 19:50:27 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: handle throwOnError in GetType() call.
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * AssemblyName.cs: Implemented ISerializable interface for the
- fields that we have.
-
-2002-02-05 Duncan Mak <duncan@ximian.com>
-
- * Missing.cs:
- * TargetException.cs: Added in CVS.
-
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * ReflectionTypeLoadException.cs: Added missing bits.
-
-2002-01-23 Duncan Mak <duncan@ximian.com>
-
- * AssemblyAlgorithmIdAttribute.cs:
- * AssemblyCompanyAttribute.cs:
- * AssemblyConfigurationAttribute.cs:
- * AssemblyCopyrightAttribute.cs:
- * AssemblyCultureAttribute.cs:
- * AssemblyDefaultAliasAttribute.cs:
- * AssemblyDelaySignAttribute.cs:
- * AssemblyDescriptionAttribute.cs:
- * AssemblyFileVersionAttribute.cs:
- * AssemblyFlagsAttribute.cs:
- * AssemblyInformationalVersionAttribute.cs:
- * AssemblyKeyFileAttribute.cs:
- * AssemblyKeyNameAttribute.cs:
- * AssemblyNameProxy.cs:
- * AssemblyProductAttribute.cs:
- * AssemblyTitleAttribute.cs:
- * AssemblyTradeMarkAttribute.cs:
- * AssemblyVersionAttribute.cs:
- * CustomAttributeFormatException.cs:
- * InvalidFilterCriteriaException.cs:
- * TargetParameterCountException.cs: Added.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * Assembly.cs (Assembly.CodeBase): Implement.
- (Assembly.FullName): simplistic and broken implementation. Gets
- us where we were yesterday.
-
- Code style fix.
-
-Tue Jan 22 22:54:18 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * IReflect.cs: corrected GetMember() return type.
- * InterfaceMapping.cs, TypeDelegator.cs: implemented.
-
-Wed Jan 9 19:37:14 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoMethod.cs: ToString () implementation.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * Assembly.cs : Decorate missing bits with the MonoTODO
- attribute.
-
- * ConstructorInfo.cs, MonoMethod.cs, MonoProperty.cs, ParameterInfo.cs,
- ReflectionTypeLoadException.cs : Ditto.
-
- * FieldInfo.cs : Ditto.
-
-Thu Jan 3 23:25:34 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: trow unimplemented exceptions.
-
-Tue Dec 18 18:46:22 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * MonoMethod.cs: implemented GetParameters().
- * MonoProperty.cs: PropertyInfo implementation.
- * ParameterInfo.cs: implemented.
- * PropertyInfo.cs: fixes.
-
-Thu Dec 13 20:18:05 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * FieldInfo.cs: implemented some Is* propeties.
- * MethodBase.cs: fixed attribute accessors.
- * MonoField.cs: runtime object to represent a field.
- * MonoMethod.cs: runtime object to represent a method.
- * AssemblyBuilder.cs: GetToken() methods to get tokens for
- strings, fields, methods...
- * ILGenerator.cs: handle tokens for methods.
-
-Mon Nov 19 13:56:55 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * MethodBase.cs: add internal get_next_table_index() for use in
- Reflection.Emit.
-
-Wed Nov 14 16:53:28 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: implement some of the Load() methods.
- * ConstructorInfo.cs: some missing stubs and fields.
- * FieldInfo.cs: IsInitOnly property.
- * ParameterInfo.cs: stubs for missing properties.
- * ParameterModifier.cs: implemented class.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * Assembly.cs: Filled in some stub implementations
-
- * ConstructorInfo.cs: Added some stub functions for NUnit
-
-Fri Nov 2 18:29:36 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AmbiguousMatchException.cs,
- * Assembly.cs, Module.cs: updates.
- * FieldInfo.cs: better compliance to the spec.
- * MethodBase.cs: move call_conv out of the way.
- * AssemblyBuilder.cs: don't use internalcalls, more stuff supported.
- * FieldBuilder.cs: implemented.
- * ILGenerator.cs: implemented some opcode handling.
- * Label.cs: add constructor.
- * LocalBuilder.cs: implemented.
- * MethodBuilder.cs: don't use internalcalls, more implemented stuff.
- * ModuleBuilder.cs: don't use internalcalls, more meat here, too.
- * ParameterBuilder.cs: implemented.
- * PropertyBuilder.cs: implemented.
- * TypeBuilder.cs: don't use internalcalls, more stuff working.
-
-Tue Sep 25 16:48:50 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * ConstructorInfo.cs, MemberFilter.cs, Module.cs: added.
-
-Fri Sep 14 16:12:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * MethodBase.cs, MethodInfo.cs: added.
-
-Thu Sep 13 18:05:16 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: added stub code.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * BindingFlags.cs: Add.
diff --git a/mcs/class/corlib/System.Reflection/ConstructorInfo.cs b/mcs/class/corlib/System.Reflection/ConstructorInfo.cs
deleted file mode 100644
index 04fcc09b8f7..00000000000
--- a/mcs/class/corlib/System.Reflection/ConstructorInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Reflection/ConstructorInfo.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Globalization;
-
-namespace System.Reflection {
- public abstract class ConstructorInfo : MethodBase {
- public static readonly string ConstructorName = ".ctor";
- public static readonly string TypeConstructorName = ".cctor";
-
- protected ConstructorInfo() {
- }
-
- public override MemberTypes MemberType {
- get {return MemberTypes.Constructor;}
- }
-
- [MonoTODO]
- public object Invoke (object[] parameters)
- {
- //FIXME
- return null;
- }
-
- public abstract object Invoke (BindingFlags invokeAttr, Binder binder, object[] parameters,
- CultureInfo culture);
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/CustomAttributeFormatException.cs b/mcs/class/corlib/System.Reflection/CustomAttributeFormatException.cs
deleted file mode 100644
index 071072e551e..00000000000
--- a/mcs/class/corlib/System.Reflection/CustomAttributeFormatException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Reflection.CustomAttributeFormatException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Reflection
-{
- [Serializable]
- public class CustomAttributeFormatException : FormatException
- {
- // Constructors
- public CustomAttributeFormatException ()
- : base (Locale.GetText ("The Binary format of the custom attribute is invalid."))
- {
- }
- public CustomAttributeFormatException (string message)
- : base (message)
- {
- }
-
- public CustomAttributeFormatException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public CustomAttributeFormatException (SerializationInfo info,
- StreamingContext context)
- {
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection/DefaultMemberAttribute.cs b/mcs/class/corlib/System.Reflection/DefaultMemberAttribute.cs
deleted file mode 100644
index 166780e4eb2..00000000000
--- a/mcs/class/corlib/System.Reflection/DefaultMemberAttribute.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Reflection.DefaultMemberAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection {
-
- public sealed class DefaultMemberAttribute : Attribute {
- string member_name;
-
- public DefaultMemberAttribute (string member_name)
- {
- this.member_name = member_name;
- }
-
- public string MemberName {
- get {
- return member_name;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/EventAttributes.cs b/mcs/class/corlib/System.Reflection/EventAttributes.cs
deleted file mode 100755
index efb1154e21c..00000000000
--- a/mcs/class/corlib/System.Reflection/EventAttributes.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// EventAttributes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:39:03 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum EventAttributes {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- SpecialName = 512,
-
- /// <summary>
- /// </summary>
- ReservedMask = 1024,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 1024,
- } // EventAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/EventInfo.cs b/mcs/class/corlib/System.Reflection/EventInfo.cs
deleted file mode 100755
index 42ce11e2c40..00000000000
--- a/mcs/class/corlib/System.Reflection/EventInfo.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Reflection/EventInfo.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-
-namespace System.Reflection {
- public abstract class EventInfo : MemberInfo {
-
- public abstract EventAttributes Attributes {get;}
-
- public Type EventHandlerType {get {return null;}}
- public bool IsMulticast {get {return true;}}
- public bool IsSpecialName {get {return false;}}
- public override MemberTypes MemberType {
- get {return MemberTypes.Event;}
- }
-
- protected EventInfo() {
- }
-
- public void AddEventHandler( object target, Delegate handler) {
- }
- public MethodInfo GetAddMethod() {
- return null;
- }
- public abstract MethodInfo GetAddMethod(bool nonPublic);
- public MethodInfo GetRaiseMethod() {
- return null;
- }
- public abstract MethodInfo GetRaiseMethod( bool nonPublic);
- public MethodInfo GetRemoveMethod() {
- return null;
- }
- public abstract MethodInfo GetRemoveMethod( bool nonPublic);
- public void RemoveEventHandler( object target, Delegate handler) {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/FieldAttributes.cs b/mcs/class/corlib/System.Reflection/FieldAttributes.cs
deleted file mode 100755
index b65a622b8e8..00000000000
--- a/mcs/class/corlib/System.Reflection/FieldAttributes.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-// FieldAttributes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:39:12 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum FieldAttributes {
-
- /// <summary>
- /// </summary>
- FieldAccessMask = 7,
-
- /// <summary>
- /// </summary>
- PrivateScope = 0,
-
- /// <summary>
- /// </summary>
- Private = 1,
-
- /// <summary>
- /// </summary>
- FamANDAssem = 2,
-
- /// <summary>
- /// </summary>
- Assembly = 3,
-
- /// <summary>
- /// </summary>
- Family = 4,
-
- /// <summary>
- /// </summary>
- FamORAssem = 5,
-
- /// <summary>
- /// </summary>
- Public = 6,
-
- /// <summary>
- /// </summary>
- Static = 16,
-
- /// <summary>
- /// </summary>
- InitOnly = 32,
-
- /// <summary>
- /// </summary>
- Literal = 64,
-
- /// <summary>
- /// </summary>
- NotSerialized = 128,
-
- /// <summary>
- /// </summary>
- SpecialName = 512,
-
- /// <summary>
- /// </summary>
- PinvokeImpl = 8192,
-
- /// <summary>
- /// </summary>
- ReservedMask = 54528,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 1024,
-
- /// <summary>
- /// </summary>
- HasFieldMarshal = 4096,
-
- /// <summary>
- /// </summary>
- HasSecurity = 16384,
-
- /// <summary>
- /// </summary>
- HasDefault = 32768,
-
- /// <summary>
- /// </summary>
- HasFieldRVA = 256,
- } // FieldAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/FieldInfo.cs b/mcs/class/corlib/System.Reflection/FieldInfo.cs
deleted file mode 100755
index 6fe48cc16e6..00000000000
--- a/mcs/class/corlib/System.Reflection/FieldInfo.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Reflection.FieldInfo.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection {
-
- public abstract class FieldInfo : MemberInfo {
-
- public abstract FieldAttributes Attributes {get;}
- public abstract RuntimeFieldHandle FieldHandle {get;}
-
- public abstract Type FieldType { get; }
-
- public abstract object GetValue(object obj);
-
- public override MemberTypes MemberType {
- get { return MemberTypes.Field;}
- }
-
- public bool IsLiteral
- {
- get {return (Attributes & FieldAttributes.Literal) != 0;}
- }
-
- public bool IsStatic
- {
- get {return (Attributes & FieldAttributes.Static) != 0;}
- }
-
- public bool IsInitOnly
- {
- get {return (Attributes & FieldAttributes.InitOnly) != 0;}
- }
-
- [MonoTODO]
- public virtual void SetValue (object obj, object val, BindingFlags invokeAttr, Binder binder,
- CultureInfo culture) {
- }
-
- [MonoTODO]
- public void SetValue( object obj, object value) {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ICustomAttributeProvider.cs b/mcs/class/corlib/System.Reflection/ICustomAttributeProvider.cs
deleted file mode 100755
index c0c06c274ac..00000000000
--- a/mcs/class/corlib/System.Reflection/ICustomAttributeProvider.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Reflection.ICustomAttributeProvider.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-namespace System.Reflection {
-
- public interface ICustomAttributeProvider {
-
- object [] GetCustomAttributes (bool inherit);
- object [] GetCustomAttributes (Type attribute_type, bool inherit);
-
- /// <summary>
- /// Probes whether one or more `attribute_type' types are
- /// defined by this member
- /// </summary>
- bool IsDefined (Type attribute_type, bool inherit);
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/IReflect.cs b/mcs/class/corlib/System.Reflection/IReflect.cs
deleted file mode 100755
index e89c3298a69..00000000000
--- a/mcs/class/corlib/System.Reflection/IReflect.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Reflection.IReflect.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-using System.Globalization;
-
-namespace System.Reflection {
-
- public interface IReflect {
-
- Type UnderlyingSystemType {
- get;
- }
-
- FieldInfo GetField (string name, BindingFlags binding_attr);
- FieldInfo [] GetFields (BindingFlags binding_attr);
- MemberInfo[] GetMember (string name, BindingFlags binding_attr);
- MemberInfo[] GetMembers (BindingFlags binding_attr);
- MethodInfo GetMethod (string name, BindingFlags binding_attr);
- MethodInfo GetMethod (string name, BindingFlags binding_attr,
- Binder binder, Type [] types, ParameterModifier [] modifiers);
- MethodInfo[] GetMethods (BindingFlags binding_attr);
-
- PropertyInfo [] GetProperties (BindingFlags binding_attr);
- PropertyInfo GetProperty (string name, BindingFlags binding_attr);
- PropertyInfo GetProperty (string name, BindingFlags binding_attr,
- Binder binder, Type return_type, Type [] types,
- ParameterModifier [] modifiers);
-
- object InvokeMember (string name, BindingFlags invoke_attr,
- Binder binder, object target, object [] args,
- ParameterModifier [] modifiers,
- CultureInfo culture,
- string [] named_parameters);
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/InterfaceMapping.cs b/mcs/class/corlib/System.Reflection/InterfaceMapping.cs
deleted file mode 100755
index 8da05148398..00000000000
--- a/mcs/class/corlib/System.Reflection/InterfaceMapping.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-
-namespace System.Reflection {
-
- public struct InterfaceMapping {
- public MethodInfo[] InterfaceMethods;
- public Type InterfaceType;
- public MethodInfo[] TargetMethods;
- public Type TargetType;
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/InvalidFilterCriteriaException.cs b/mcs/class/corlib/System.Reflection/InvalidFilterCriteriaException.cs
deleted file mode 100644
index a59d7655589..00000000000
--- a/mcs/class/corlib/System.Reflection/InvalidFilterCriteriaException.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Reflection.InvalidFilterCriteriaException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Reflection
-{
- [Serializable]
- public class InvalidFilterCriteriaException : ApplicationException
- {
- public InvalidFilterCriteriaException ()
- : base (Locale.GetText ("Filter Criteria is not valid."))
- {
- }
- public InvalidFilterCriteriaException (string message)
- : base (message)
- {
- }
-
- public InvalidFilterCriteriaException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public InvalidFilterCriteriaException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ManifestResourceInfo.cs b/mcs/class/corlib/System.Reflection/ManifestResourceInfo.cs
deleted file mode 100644
index a23884d420a..00000000000
--- a/mcs/class/corlib/System.Reflection/ManifestResourceInfo.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// System.Reflection.ManifestResourceInfo
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) Ximian, Inc. 2001
-
-namespace System.Reflection
-{
- public class ManifestResourceInfo
- {
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MemberFilter.cs b/mcs/class/corlib/System.Reflection/MemberFilter.cs
deleted file mode 100644
index 74e73a69ce3..00000000000
--- a/mcs/class/corlib/System.Reflection/MemberFilter.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using System;
-using System.Reflection;
-
-namespace System.Reflection {
- public delegate bool MemberFilter( MemberInfo m, object filterCriteria);
-
-}
diff --git a/mcs/class/corlib/System.Reflection/MemberInfo.cs b/mcs/class/corlib/System.Reflection/MemberInfo.cs
deleted file mode 100755
index f0ad0ebc005..00000000000
--- a/mcs/class/corlib/System.Reflection/MemberInfo.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Reflection.MemberInfo.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-namespace System.Reflection {
-
- public abstract class MemberInfo : ICustomAttributeProvider {
-
- public abstract Type DeclaringType {
- get;
- }
-
- public abstract MemberTypes MemberType {
- get;
- }
-
- public abstract string Name {
- get;
- }
-
- public abstract Type ReflectedType {
- get;
- }
-
- public abstract bool IsDefined (Type attribute_type, bool inherit);
-
- public abstract object [] GetCustomAttributes (bool inherit);
-
- public abstract object [] GetCustomAttributes (Type attribute_type, bool inherit);
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MemberTypes.cs b/mcs/class/corlib/System.Reflection/MemberTypes.cs
deleted file mode 100755
index 00a1234ef36..00000000000
--- a/mcs/class/corlib/System.Reflection/MemberTypes.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// MemberTypes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:38:53 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum MemberTypes {
-
- /// <summary>
- /// </summary>
- Constructor = 1,
-
- /// <summary>
- /// </summary>
- Event = 2,
-
- /// <summary>
- /// </summary>
- Field = 4,
-
- /// <summary>
- /// </summary>
- Method = 8,
-
- /// <summary>
- /// </summary>
- Property = 16,
-
- /// <summary>
- /// </summary>
- TypeInfo = 32,
-
- /// <summary>
- /// </summary>
- Custom = 64,
-
- /// <summary>
- /// </summary>
- NestedType = 128,
-
- /// <summary>
- /// </summary>
- All = 191,
- } // MemberTypes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/MethodAttributes.cs b/mcs/class/corlib/System.Reflection/MethodAttributes.cs
deleted file mode 100755
index 51ac6f18a6a..00000000000
--- a/mcs/class/corlib/System.Reflection/MethodAttributes.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-// MethodAttributes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:39:32 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum MethodAttributes {
-
- /// <summary>
- /// </summary>
- MemberAccessMask = 7,
-
- /// <summary>
- /// </summary>
- PrivateScope = 0,
-
- /// <summary>
- /// </summary>
- Private = 1,
-
- /// <summary>
- /// </summary>
- FamANDAssem = 2,
-
- /// <summary>
- /// </summary>
- Assembly = 3,
-
- /// <summary>
- /// </summary>
- Family = 4,
-
- /// <summary>
- /// </summary>
- FamORAssem = 5,
-
- /// <summary>
- /// </summary>
- Public = 6,
-
- /// <summary>
- /// </summary>
- Static = 16,
-
- /// <summary>
- /// </summary>
- Final = 32,
-
- /// <summary>
- /// </summary>
- Virtual = 64,
-
- /// <summary>
- /// </summary>
- HideBySig = 128,
-
- /// <summary>
- /// </summary>
- VtableLayoutMask = 256,
-
- /// <summary>
- /// </summary>
- ReuseSlot = 0,
-
- /// <summary>
- /// </summary>
- NewSlot = 256,
-
- /// <summary>
- /// </summary>
- Abstract = 1024,
-
- /// <summary>
- /// </summary>
- SpecialName = 2048,
-
- /// <summary>
- /// </summary>
- PinvokeImpl = 8192,
-
- /// <summary>
- /// </summary>
- UnmanagedExport = 8,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 4096,
-
- /// <summary>
- /// </summary>
- ReservedMask = 53248,
-
- /// <summary>
- /// </summary>
- HasSecurity = 16384,
-
- /// <summary>
- /// </summary>
- RequireSecObject = 32768,
- } // MethodAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/MethodBase.cs b/mcs/class/corlib/System.Reflection/MethodBase.cs
deleted file mode 100644
index ae4f5eef8a7..00000000000
--- a/mcs/class/corlib/System.Reflection/MethodBase.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// System.Reflection/MethodBase.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Reflection.Emit;
-
-namespace System.Reflection {
-
- public abstract class MethodBase: MemberInfo {
-
- public static MethodBase GetCurrentMethod()
- {
- return null;
- }
-
- public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle)
- {
- return null;
- }
-
- public abstract MethodImplAttributes GetMethodImplementationFlags();
-
- public abstract ParameterInfo[] GetParameters();
-
- public Object Invoke(Object obj, Object[] parameters) {
- return null;
- }
-
- public abstract Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture);
-
- protected MethodBase()
- {
- }
-
- public abstract RuntimeMethodHandle MethodHandle { get; }
- public abstract MethodAttributes Attributes { get; }
- public virtual CallingConventions CallingConvention { get {return CallingConventions.Standard;} }
- public Boolean IsPublic {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Public;
- }
- }
- public Boolean IsPrivate {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Private;
- }
- }
- public Boolean IsFamily {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Family;
- }
- }
- public Boolean IsAssembly {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Assembly;
- }
- }
- public Boolean IsFamilyAndAssembly {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.FamANDAssem;
- }
- }
- public Boolean IsFamilyOrAssembly {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.FamORAssem;
- }
- }
- public Boolean IsStatic {
- get {
- return (Attributes & MethodAttributes.Static) != 0;
- }
- }
- public Boolean IsFinal {
- get {
- return (Attributes & MethodAttributes.Final) != 0;
- }
- }
- public Boolean IsVirtual {
- get {
- return (Attributes & MethodAttributes.Virtual) != 0;
- }
- }
- public Boolean IsHideBySig {
- get {
- return (Attributes & MethodAttributes.HideBySig) != 0;
- }
- }
- public Boolean IsAbstract {
- get {
- return (Attributes & MethodAttributes.Abstract) != 0;
- }
- }
- public Boolean IsSpecialName {
- get {
- int attr = (int)Attributes;
- return (attr & (int)MethodAttributes.SpecialName) != 0;
- }
- }
- public Boolean IsConstructor {
- get {
- int attr = (int)Attributes;
- return ((attr & (int)MethodAttributes.RTSpecialName) != 0
- && (Name == ".ctor"));
- }
- }
-
- internal virtual int get_next_table_index (int table, bool inc) {
- if (this is MethodBuilder) {
- MethodBuilder mb = (MethodBuilder)this;
- return mb.get_next_table_index (table, inc);
- }
- if (this is ConstructorBuilder) {
- ConstructorBuilder mb = (ConstructorBuilder)this;
- return mb.get_next_table_index (table, inc);
- }
- throw new Exception ("Method is not a builder method");
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MethodImplAttributes.cs b/mcs/class/corlib/System.Reflection/MethodImplAttributes.cs
deleted file mode 100755
index 6808b4c20f4..00000000000
--- a/mcs/class/corlib/System.Reflection/MethodImplAttributes.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-// MethodImplAttributes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:39:42 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum MethodImplAttributes {
-
- /// <summary>
- /// </summary>
- CodeTypeMask = 3,
-
- /// <summary>
- /// </summary>
- IL = 0,
-
- /// <summary>
- /// </summary>
- Native = 1,
-
- /// <summary>
- /// </summary>
- OPTIL = 2,
-
- /// <summary>
- /// </summary>
- Runtime = 3,
-
- /// <summary>
- /// </summary>
- ManagedMask = 4,
-
- /// <summary>
- /// </summary>
- Unmanaged = 4,
-
- /// <summary>
- /// </summary>
- Managed = 0,
-
- /// <summary>
- /// </summary>
- ForwardRef = 16,
-
- /// <summary>
- /// </summary>
- OLE = 128,
-
- /// <summary>
- /// </summary>
- InternalCall = 4096,
-
- /// <summary>
- /// </summary>
- Synchronized = 32,
-
- /// <summary>
- /// </summary>
- NoInlining = 8,
-
- /// <summary>
- /// </summary>
- OneWay = 64,
-
- /// <summary>
- /// </summary>
- MaxMethodImplVal = 65535,
- } // MethodImplAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/MethodInfo.cs b/mcs/class/corlib/System.Reflection/MethodInfo.cs
deleted file mode 100644
index 1cabefcf0c4..00000000000
--- a/mcs/class/corlib/System.Reflection/MethodInfo.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Reflection/MethodInfo.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection {
-
- public abstract class MethodInfo: MethodBase {
-
- public abstract MethodInfo GetBaseDefinition();
-
- protected MethodInfo() {
- }
- public override MemberTypes MemberType { get {return MemberTypes.Method;} }
- public abstract Type ReturnType { get; }
- public abstract ICustomAttributeProvider ReturnTypeCustomAttributes { get; }
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection/Missing.cs b/mcs/class/corlib/System.Reflection/Missing.cs
deleted file mode 100644
index f0a314a8a7c..00000000000
--- a/mcs/class/corlib/System.Reflection/Missing.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Reflection.Missing.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- public sealed class Missing
- {
- public static readonly Missing Value;
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/Module.cs b/mcs/class/corlib/System.Reflection/Module.cs
deleted file mode 100644
index f9a70832db0..00000000000
--- a/mcs/class/corlib/System.Reflection/Module.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.Reflection/Module.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Security.Cryptography.X509Certificates;
-
-namespace System.Reflection {
- public class Module : ISerializable, ICustomAttributeProvider {
-
- public static readonly TypeFilter FilterTypeName;
- public static readonly TypeFilter FilterTypeNameIgnoreCase;
-
- private IntPtr _impl; /* a pointer to a MonoImage */
- internal Assembly assembly;
- internal string fqname;
- internal string name;
- internal string scopename;
-
- public Assembly Assembly {get {return assembly;}}
- public virtual string FullyQualifiedName {get {return fqname;}}
- public string Name {get {return name;}}
- public string ScopeName {get {return scopename;}}
-
-
- public virtual Type[] FindTypes(TypeFilter filter, object filterCriteria) {
- return null;
- }
- public virtual object[] GetCustomAttributes(bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
- public FieldInfo GetField(string name) {
- return null;
- }
- public FieldInfo GetField(string name, BindingFlags flags) {
- return null;
- }
- public FieldInfo[] GetFields() {
- return null;
- }
-
- public MethodInfo GetMethod(string name) {
- return null;
- }
- public MethodInfo GetMethod(string name, Type[] types) {
- return null;
- }
- public MethodInfo GetMethod( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- return null;
- }
- protected virtual MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- return null;
- }
- public MethodInfo[] GetMethods() {
- return null;
- }
- public virtual void GetObjectData( SerializationInfo info, StreamingContext context) {}
- public X509Certificate GetSignerCertificate() {
- return null;
- }
- public virtual Type GetType(string className) {
- return null;
- }
- public virtual Type GetType(string className, bool ignoreCase) {
- return null;
- }
- public virtual Type GetType(string className, bool throwOnError, bool ignoreCase) {
- return null;
- }
- public virtual Type[] GetTypes() {
- return null;
- }
- public virtual bool IsDefined( Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
- public bool IsResource() {
- return false;
- }
- public override string ToString() {
- return "Reflection.Module: " + name;
- }
-
-
-
-
-
-
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection/MonoField.cs b/mcs/class/corlib/System.Reflection/MonoField.cs
deleted file mode 100755
index 109d9e00413..00000000000
--- a/mcs/class/corlib/System.Reflection/MonoField.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-
-//
-// System.Reflection/MonoField.cs
-// The class used to represent Fields from the mono runtime.
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection {
-
- internal struct MonoFieldInfo {
- public Type parent;
- public Type type;
- public String name;
- public FieldAttributes attrs;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void get_field_info (MonoField field, out MonoFieldInfo info);
- }
-
- internal class MonoField : FieldInfo {
- internal IntPtr klass;
- internal RuntimeFieldHandle fhandle;
-
- public override FieldAttributes Attributes {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.attrs;
- }
- }
- public override RuntimeFieldHandle FieldHandle {
- get {return fhandle;}
- }
-
- public override Type FieldType {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.type;
- }
- }
-
- public override Type ReflectedType {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.parent;
- }
- }
- public override Type DeclaringType {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.parent;
- }
- }
- public override string Name {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.name;
- }
- }
-
- public override bool IsDefined (Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes( bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override object GetValue(object obj);
-
- public override string ToString () {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return String.Format ("{0} {1}", info.type, info.name);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MonoMethod.cs b/mcs/class/corlib/System.Reflection/MonoMethod.cs
deleted file mode 100755
index 29a1c6a1170..00000000000
--- a/mcs/class/corlib/System.Reflection/MonoMethod.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-//
-// System.Reflection/MonoMethod.cs
-// The class used to represent methods from the mono runtime.
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection {
- internal struct MonoMethodInfo {
- internal Type parent;
- internal Type ret;
- internal string name;
- internal MethodAttributes attrs;
- internal MethodImplAttributes iattrs;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void get_method_info (RuntimeMethodHandle handle, out MonoMethodInfo info);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern ParameterInfo[] get_parameter_info (RuntimeMethodHandle handle);
- };
-
- /*
- * Note: most of this class needs to be duplicated for the contructor, since
- * the .NET reflection class hierarchy is so broken.
- */
- internal class MonoMethod : MethodInfo {
- internal RuntimeMethodHandle mhandle;
-
- [MonoTODO]
- public override MethodInfo GetBaseDefinition() {
- return this; /* FIXME */
- }
- public override Type ReturnType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.ret;
- }
- }
- public override ICustomAttributeProvider ReturnTypeCustomAttributes {
- get {return null;}
- }
-
- public override MethodImplAttributes GetMethodImplementationFlags() {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.iattrs;
- }
-
- public override ParameterInfo[] GetParameters() {
- return MonoMethodInfo.get_parameter_info (mhandle);
- }
-
- /*
- * InternalInvoke() receives the parameters corretcly converted by the binder
- * to match the types of the method signature.
- */
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern Object InternalInvoke (Object obj, Object[] parameters);
-
- [MonoTODO]
- public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- throw new NotImplementedException ();
- }
-
- public override RuntimeMethodHandle MethodHandle {
- get {return mhandle;}
- }
- public override MethodAttributes Attributes {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.attrs;
- }
- }
-
- public override Type ReflectedType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.parent;
- }
- }
- public override Type DeclaringType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.parent;
- }
- }
- public override string Name {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.name;
- }
- }
-
- public override bool IsDefined (Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes( bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public override string ToString () {
- string parms = "";
- ParameterInfo[] p = GetParameters ();
- for (int i = 0; i < p.Length; ++i) {
- if (i > 0)
- parms = parms + ", ";
- parms = parms + p [i].ParameterType.Name;
- }
- return Name+"("+parms+")";
- }
- }
-
- internal class MonoCMethod : ConstructorInfo {
- internal RuntimeMethodHandle mhandle;
-
- public override MethodImplAttributes GetMethodImplementationFlags() {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.iattrs;
- }
-
- public override ParameterInfo[] GetParameters() {
- return MonoMethodInfo.get_parameter_info (mhandle);
- }
-
- public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- throw new NotImplementedException ();
- }
-
- public override Object Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- throw new NotImplementedException ();
- }
-
- public override RuntimeMethodHandle MethodHandle {
- get {return mhandle;}
- }
- public override MethodAttributes Attributes {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.attrs;
- }
- }
-
- public override Type ReflectedType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.parent;
- }
- }
- public override Type DeclaringType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.parent;
- }
- }
- public override string Name {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.name;
- }
- }
-
- [MonoTODO]
- public override bool IsDefined (Type attribute_type, bool inherit) {
- return false;
- }
-
- [MonoTODO]
- public override object[] GetCustomAttributes (bool inherit) {
- return null;
- }
-
- [MonoTODO]
- public override object[] GetCustomAttributes (Type attributeType, bool inherit) {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MonoProperty.cs b/mcs/class/corlib/System.Reflection/MonoProperty.cs
deleted file mode 100755
index dd119e77578..00000000000
--- a/mcs/class/corlib/System.Reflection/MonoProperty.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-//
-// System.Reflection/MonoProperty.cs
-// The class used to represent Properties from the mono runtime.
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection {
-
- internal struct MonoPropertyInfo {
- public Type parent;
- public String name;
- public MethodInfo get_method;
- public MethodInfo set_method;
- public PropertyAttributes attrs;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void get_property_info (MonoProperty prop, out MonoPropertyInfo info);
- }
-
- internal class MonoProperty : PropertyInfo {
- internal IntPtr klass;
- internal IntPtr prop;
-
- public override PropertyAttributes Attributes {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.attrs;
- }
- }
- public override bool CanRead {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return (info.get_method != null);
- }
- }
- public override bool CanWrite {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return (info.set_method != null);
- }
- }
-
- [MonoTODO]
- public override Type PropertyType {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
-
- if (info.get_method != null) {
- return info.get_method.ReturnType;
- } else {
- // FIXME: take the last param to set_method
- return null;
- }
- }
- }
- public override Type ReflectedType {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.parent;
- }
- }
- public override Type DeclaringType {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.parent;
- }
- }
- public override string Name {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.name;
- }
- }
-
- [MonoTODO]
- public override MethodInfo[] GetAccessors( bool nonPublic) {
- // FIXME: check nonPublic
- MonoPropertyInfo info;
- int n = 0;
- MonoPropertyInfo.get_property_info (this, out info);
- if (info.set_method != null)
- n++;
- if (info.get_method != null)
- n++;
- MethodInfo[] res = new MethodInfo [n];
- n = 0;
- if (info.set_method != null)
- res [n++] = info.set_method;
- if (info.get_method != null)
- res [n++] = info.get_method;
- return res;
- }
-
- [MonoTODO]
- public override MethodInfo GetGetMethod( bool nonPublic) {
- // FIXME: check nonPublic
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.get_method;
- }
- public override ParameterInfo[] GetIndexParameters() {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- if (info.get_method != null)
- return info.get_method.GetParameters ();
- return new ParameterInfo [0];
- }
- public override MethodInfo GetSetMethod( bool nonPublic) {
- // FIXME: check nonPublic
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.set_method;
- }
- public override bool IsDefined (Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes( bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
- public override object GetValue( object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
- return null;
- }
- public override void SetValue( object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection/ParameterAttributes.cs b/mcs/class/corlib/System.Reflection/ParameterAttributes.cs
deleted file mode 100755
index eaf409d8b1c..00000000000
--- a/mcs/class/corlib/System.Reflection/ParameterAttributes.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// ParameterAttributes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:39:52 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ParameterAttributes {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- In = 1,
-
- /// <summary>
- /// </summary>
- Out = 2,
-
- /// <summary>
- /// </summary>
- Lcid = 4,
-
- /// <summary>
- /// </summary>
- Retval = 8,
-
- /// <summary>
- /// </summary>
- Optional = 16,
-
- /// <summary>
- /// </summary>
- ReservedMask = 61440,
-
- /// <summary>
- /// </summary>
- HasDefault = 4096,
-
- /// <summary>
- /// </summary>
- HasFieldMarshal = 8192,
-
- /// <summary>
- /// </summary>
- Reserved3 = 16384,
-
- /// <summary>
- /// </summary>
- Reserved4 = 32768,
- } // ParameterAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/ParameterInfo.cs b/mcs/class/corlib/System.Reflection/ParameterInfo.cs
deleted file mode 100644
index f29b623d6da..00000000000
--- a/mcs/class/corlib/System.Reflection/ParameterInfo.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// System.Reflection.ParameterInfo
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-namespace System.Reflection
-{
- public class ParameterInfo : ICustomAttributeProvider
- {
- protected Type ClassImpl;
- protected object DefaultValueImpl;
- protected MemberInfo MemberImpl;
- protected string NameImpl;
- protected int PositionImpl;
- protected ParameterAttributes AttrsImpl;
-
- protected ParameterInfo () {
- }
-
- public virtual Type ParameterType {
- get {return ClassImpl;}
- }
- public virtual ParameterAttributes Attributes {
- get {return AttrsImpl;}
- }
- public virtual object DefaultValue {
- get {return DefaultValueImpl;}
- }
-
- public bool IsIn {
- get {return (AttrsImpl & ParameterAttributes.In) != 0;}
- }
-
- public bool IsLcid {
- get {return (AttrsImpl & ParameterAttributes.Lcid) != 0;}
- }
-
- public bool IsOptional {
- get {return (AttrsImpl & ParameterAttributes.Optional) != 0;}
- }
-
- public bool IsOut {
- get {return (AttrsImpl & ParameterAttributes.Out) != 0;}
- }
-
- public bool IsRetval {
- get {return (AttrsImpl & ParameterAttributes.Retval) != 0;}
- }
-
- public virtual MemberInfo Member {
- get {return MemberImpl;}
- }
-
- public virtual string Name {
- get {return NameImpl;}
- }
-
- public virtual int Position {
- get {return PositionImpl;}
- }
-
- public virtual object[] GetCustomAttributes (bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
-
- public virtual object[] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public virtual bool IsDefined( Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ParameterModifier.cs b/mcs/class/corlib/System.Reflection/ParameterModifier.cs
deleted file mode 100755
index 4615e1931dd..00000000000
--- a/mcs/class/corlib/System.Reflection/ParameterModifier.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Reflection/ParameterModifier.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// Copyright (c) 2001 Ximian, Inc
-
-using System;
-
-namespace System.Reflection {
- public struct ParameterModifier {
- private bool[] data;
-
- public ParameterModifier (int paramaterCount) {
- data = new bool [paramaterCount];
- }
-
- public bool this [int index] {
- get {return data [index];}
- set {data [index] = value;}
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection/PropertyAttributes.cs b/mcs/class/corlib/System.Reflection/PropertyAttributes.cs
deleted file mode 100755
index 7cb7359dba0..00000000000
--- a/mcs/class/corlib/System.Reflection/PropertyAttributes.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-// PropertyAttributes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:40:02 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum PropertyAttributes {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- SpecialName = 512,
-
- /// <summary>
- /// </summary>
- ReservedMask = 62464,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 1024,
-
- /// <summary>
- /// </summary>
- HasDefault = 4096,
-
- /// <summary>
- /// </summary>
- Reserved2 = 8192,
-
- /// <summary>
- /// </summary>
- Reserved3 = 16384,
-
- /// <summary>
- /// </summary>
- Reserved4 = 32768,
- } // PropertyAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/PropertyInfo.cs b/mcs/class/corlib/System.Reflection/PropertyInfo.cs
deleted file mode 100755
index 5d8e9049ffb..00000000000
--- a/mcs/class/corlib/System.Reflection/PropertyInfo.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Reflection/PropertyInfo.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Globalization;
-
-namespace System.Reflection {
- public abstract class PropertyInfo : MemberInfo {
-
- public abstract PropertyAttributes Attributes {get;}
- public abstract bool CanRead {get;}
- public abstract bool CanWrite {get;}
-
- public bool IsSpecialName {
- get {return (Attributes & PropertyAttributes.SpecialName) != 0;}
- }
-
- public override MemberTypes MemberType {
- get {return MemberTypes.Property;}
- }
- public abstract Type PropertyType {get;}
-
- protected PropertyInfo() {
- }
-
- public MethodInfo[] GetAccessors() {
- return GetAccessors (false);
- }
- public abstract MethodInfo[] GetAccessors( bool nonPublic);
- public MethodInfo GetGetMethod() {
- return GetGetMethod (false);
- }
- public abstract MethodInfo GetGetMethod( bool nonPublic);
- public abstract ParameterInfo[] GetIndexParameters();
- public MethodInfo GetSetMethod() {
- return GetSetMethod (false);
- }
- public abstract MethodInfo GetSetMethod( bool nonPublic);
- public virtual object GetValue( object obj, object[] index) {
- return null;
- }
- public abstract object GetValue( object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
- public virtual void SetValue( object obj, object value, object[] index) {
- }
- public abstract void SetValue( object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ReflectionTypeLoadException.cs b/mcs/class/corlib/System.Reflection/ReflectionTypeLoadException.cs
deleted file mode 100644
index 7680b4c37b5..00000000000
--- a/mcs/class/corlib/System.Reflection/ReflectionTypeLoadException.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Reflection.ReflectionTypeLoadException
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Dunan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Reflection
-{
- [Serializable]
- public sealed class ReflectionTypeLoadException : SystemException
- {
- // Fields
- private Exception[] loaderExceptions;
- private Type[] types;
-
- // Constructors
- public ReflectionTypeLoadException (Type[] classes, Exception[] exceptions)
- : base (Locale.GetText ("The classes in the module cannot be loaded."))
- {
- loaderExceptions = exceptions;
- types = classes;
- }
-
- public ReflectionTypeLoadException (Type[] classes, Exception[] exceptions, string message)
- : base (message)
- {
- loaderExceptions = exceptions;
- types = classes;
- }
-
- // Properties
- public Type[] Types
- {
- get { return types; }
- }
-
- public Exception[] LoaderExceptions
- {
- get { return loaderExceptions; }
- }
-
- // Method
- [MonoTODO]
- //
- // This one is a bit tough because need to serialize two arrays.
- // The serialization output comes out as
- // <Types href="#ref-4" />
- // <Exceptions href="#ref-5" />
- // and then goes on and appends new SOAP-ENCs, etc...
- //
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ResourceAttributes.cs b/mcs/class/corlib/System.Reflection/ResourceAttributes.cs
deleted file mode 100755
index ab02d11805d..00000000000
--- a/mcs/class/corlib/System.Reflection/ResourceAttributes.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// ResourceAttributes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:40:12 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ResourceAttributes {
-
- /// <summary>
- /// </summary>
- Public = 1,
-
- /// <summary>
- /// </summary>
- Private = 2,
- } // ResourceAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/ResourceLocation.cs b/mcs/class/corlib/System.Reflection/ResourceLocation.cs
deleted file mode 100755
index 611c61828b5..00000000000
--- a/mcs/class/corlib/System.Reflection/ResourceLocation.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// ResourceLocation.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:39:22 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ResourceLocation {
-
- /// <summary>
- /// </summary>
- Embedded = 1,
-
- /// <summary>
- /// </summary>
- ContainedInAnotherAssembly = 2,
-
- /// <summary>
- /// </summary>
- ContainedInManifestFile = 4,
- } // ResourceLocation
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs b/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs
deleted file mode 100755
index cd16be2df68..00000000000
--- a/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Reflection.StrongNameKeyPair.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-using System.IO;
-
-namespace System.Reflection {
-
- [Serializable]
- public class StrongNameKeyPair
- {
- private byte[] keyPair;
-
- public StrongNameKeyPair (byte[] keyPairArray)
- {
- keyPair = keyPairArray;
- }
-
- public StrongNameKeyPair (FileStream keyPairFile)
- {
-
- }
-
- public StrongNameKeyPair (string keyPairContainer)
- {
-
- }
-
- public byte[] PublicKey
- {
- get { return keyPair; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetException.cs b/mcs/class/corlib/System.Reflection/TargetException.cs
deleted file mode 100644
index c98bb2f93e5..00000000000
--- a/mcs/class/corlib/System.Reflection/TargetException.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Reflection.TargetException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Reflection
-{
- [Serializable]
- public class TargetException : ApplicationException
- {
- public TargetException ()
- : base (Locale.GetText ("Unable to invoke and invalid target."))
- {
- }
-
- public TargetException (string message)
- : base (message)
- {
- }
-
- public TargetException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- public TargetException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetInvocationException.cs b/mcs/class/corlib/System.Reflection/TargetInvocationException.cs
deleted file mode 100644
index 4065a0aa4a3..00000000000
--- a/mcs/class/corlib/System.Reflection/TargetInvocationException.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// System.Reflection.TargetInvocationException
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-namespace System.Reflection
-{
- public class TargetInvocationException : ApplicationException
- {
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs b/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs
deleted file mode 100644
index 0dce9509d17..00000000000
--- a/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Reflection.TargetParameterCountException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System.Reflection
-{
- [Serializable]
- public class TargetParameterCountException : ApplicationException
- {
- public TargetParameterCountException ()
- : base (Locale.GetText ("Number of parameter does not match expected count."))
- {
- }
-
- public TargetParameterCountException (string message)
- : base (message)
- {
- }
-
- public TargetParameterCountException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public TargetParameterCountException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TypeAttributes.cs b/mcs/class/corlib/System.Reflection/TypeAttributes.cs
deleted file mode 100755
index 420532e8aa5..00000000000
--- a/mcs/class/corlib/System.Reflection/TypeAttributes.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-// TypeAttributes.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:40:22 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum TypeAttributes {
-
- /// <summary>
- /// </summary>
- VisibilityMask = 7,
-
- /// <summary>
- /// </summary>
- NotPublic = 0,
-
- /// <summary>
- /// </summary>
- Public = 1,
-
- /// <summary>
- /// </summary>
- NestedPublic = 2,
-
- /// <summary>
- /// </summary>
- NestedPrivate = 3,
-
- /// <summary>
- /// </summary>
- NestedFamily = 4,
-
- /// <summary>
- /// </summary>
- NestedAssembly = 5,
-
- /// <summary>
- /// </summary>
- NestedFamANDAssem = 6,
-
- /// <summary>
- /// </summary>
- NestedFamORAssem = 7,
-
- /// <summary>
- /// </summary>
- LayoutMask = 24,
-
- /// <summary>
- /// </summary>
- AutoLayout = 0,
-
- /// <summary>
- /// </summary>
- LayoutSequential = 8,
-
- /// <summary>
- /// </summary>
- ExplicitLayout = 16,
-
- /// <summary>
- /// </summary>
- ClassSemanticsMask = 32,
-
- /// <summary>
- /// </summary>
- Class = 0,
-
- /// <summary>
- /// </summary>
- Interface = 32,
-
- /// <summary>
- /// </summary>
- Abstract = 128,
-
- /// <summary>
- /// </summary>
- Sealed = 256,
-
- /// <summary>
- /// </summary>
- SpecialName = 1024,
-
- /// <summary>
- /// </summary>
- Import = 4096,
-
- /// <summary>
- /// </summary>
- Serializable = 8192,
-
- /// <summary>
- /// </summary>
- StringFormatMask = 196608,
-
- /// <summary>
- /// </summary>
- AnsiClass = 0,
-
- /// <summary>
- /// </summary>
- UnicodeClass = 65536,
-
- /// <summary>
- /// </summary>
- AutoClass = 131072,
-
- /// <summary>
- /// </summary>
- BeforeFieldInit = 1048576,
-
- /// <summary>
- /// </summary>
- ReservedMask = 264192,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 2048,
-
- /// <summary>
- /// </summary>
- HasSecurity = 262144,
- } // TypeAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/TypeDelegator.cs b/mcs/class/corlib/System.Reflection/TypeDelegator.cs
deleted file mode 100755
index fe18e659de8..00000000000
--- a/mcs/class/corlib/System.Reflection/TypeDelegator.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-// System.Reflection/TypeDelegator.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-using System.Reflection;
-using System.Globalization;
-
-namespace System.Reflection {
-
- public class TypeDelegator : Type {
- protected Type typeImpl;
-
- protected TypeDelegator () {
- }
-
- public TypeDelegator( Type delegatingType) {
- if (delegatingType == null)
- throw new ArgumentNullException ("delegatingType must be non-null");
- typeImpl = delegatingType;
- }
-
- public override Assembly Assembly {
- get {return typeImpl.Assembly;}
- }
-
- public override string AssemblyQualifiedName {
- get {return typeImpl.AssemblyQualifiedName;}
- }
-
- public override Type BaseType {
- get {return typeImpl.BaseType;}
- }
-
- public override string FullName {
- get {return typeImpl.FullName;}
- }
-
- public override Guid GUID {
- get {return typeImpl.GUID;}
- }
-
- public override Module Module {
- get {return typeImpl.Module;}
- }
-
- public override string Name {
- get {return typeImpl.Name;}
- }
-
- public override string Namespace {
- get {return typeImpl.Namespace;}
- }
-
- public override RuntimeTypeHandle TypeHandle {
- get {return typeImpl.TypeHandle;}
- }
-
- public override Type UnderlyingSystemType {
- get {return typeImpl.UnderlyingSystemType;}
- }
-
- protected override TypeAttributes GetAttributeFlagsImpl () {
- throw new NotImplementedException ();
- //return typeImpl.GetAttributeFlagsImpl ();
- }
-
- protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- //return typeImpl.GetConstructorImpl (bindingAttr, binder, callConvention, types, modifiers);
- }
-
- public override ConstructorInfo[] GetConstructors( BindingFlags bindingAttr) {
- return typeImpl.GetConstructors (bindingAttr);
- }
-
- public override object[] GetCustomAttributes (bool inherit)
- {
- return typeImpl.GetCustomAttributes (inherit);
- }
-
- public override object[] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return typeImpl.GetCustomAttributes (attributeType, inherit);
- }
-
- public override Type GetElementType() {
- return typeImpl.GetElementType ();
- }
-
- public override EventInfo GetEvent( string name, BindingFlags bindingAttr) {
- return typeImpl.GetEvent (name, bindingAttr);
- }
-
- public override EventInfo[] GetEvents() {
- return GetEvents (BindingFlags.Public);
- }
-
- public override EventInfo[] GetEvents( BindingFlags bindingAttr) {
- return typeImpl.GetEvents (bindingAttr);
- }
-
- public override FieldInfo GetField( string name, BindingFlags bindingAttr) {
- return typeImpl.GetField (name, bindingAttr);
- }
-
- public override FieldInfo[] GetFields( BindingFlags bindingAttr) {
- return typeImpl.GetFields (bindingAttr);
- }
-
- public override Type GetInterface( string name, bool ignoreCase) {
- return typeImpl.GetInterface (name, ignoreCase);
- }
-
- public override InterfaceMapping GetInterfaceMap( Type interfaceType) {
- return typeImpl.GetInterfaceMap (interfaceType);
- }
-
- public override Type[] GetInterfaces() {
- return typeImpl.GetInterfaces ();
- }
-
- public override MemberInfo[] GetMember( string name, MemberTypes type, BindingFlags bindingAttr) {
- return typeImpl.GetMember (name, type, bindingAttr);
- }
-
- public override MemberInfo[] GetMembers( BindingFlags bindingAttr) {
- return typeImpl.GetMembers (bindingAttr);
- }
-
- protected override MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- //return typeImpl.GetMethodImpl (name, bindingAttr, binder, callConvention, types, modifiers);
- }
-
- public override MethodInfo[] GetMethods( BindingFlags bindingAttr) {
- return typeImpl.GetMethods (bindingAttr);
- }
-
- public override Type GetNestedType( string name, BindingFlags bindingAttr) {
- return typeImpl.GetNestedType (name, bindingAttr);
- }
-
- public override Type[] GetNestedTypes( BindingFlags bindingAttr) {
- return typeImpl.GetNestedTypes (bindingAttr);
- }
-
- public override PropertyInfo[] GetProperties( BindingFlags bindingAttr) {
- return typeImpl.GetProperties (bindingAttr);
- }
-
- protected override PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- //return typeImpl.GetPropertyImpl (name, bindingAttr, bindingAttr, returnType, types, modifiers);
- }
-
- protected override bool HasElementTypeImpl() {
- throw new NotImplementedException ();
- //return typeImpl.HasElementTypeImpl ();
- }
-
- public override object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
- return typeImpl.InvokeMember (name, invokeAttr, binder, target, args, modifiers, culture, namedParameters);
- }
-
- protected override bool IsArrayImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsArrayImpl ();
- }
-
- protected override bool IsByRefImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsByRefImpl ();
- }
-
- protected override bool IsCOMObjectImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsCOMObjectImpl ();
- }
-
- public override bool IsDefined( Type attributeType, bool inherit) {
- return typeImpl.IsDefined (attributeType, inherit);
- }
-
- protected override bool IsPointerImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsPointerImpl ();
- }
-
- protected override bool IsPrimitiveImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsPrimitiveImpl ();
- }
-
- protected override bool IsValueTypeImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsValueTypeImpl ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TypeFilter.cs b/mcs/class/corlib/System.Reflection/TypeFilter.cs
deleted file mode 100644
index a7fb8baf957..00000000000
--- a/mcs/class/corlib/System.Reflection/TypeFilter.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// TypeAttributes.cs
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- public delegate bool TypeFilter (Type m, object filterCriteria);
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/common.src b/mcs/class/corlib/System.Reflection/common.src
deleted file mode 100644
index 022b6768fcc..00000000000
--- a/mcs/class/corlib/System.Reflection/common.src
+++ /dev/null
@@ -1,25 +0,0 @@
-Assembly.cs
-AssemblyNameFlags.cs
-BindingFlags.cs
-CallingConventions.cs
-ConstructorInfo.cs
-DefaultMemberAttribute.cs
-EventAttributes.cs
-EventInfo.cs
-FieldAttributes.cs
-FieldInfo.cs
-ICustomAttributeProvider.cs
-MemberFilter.cs
-MemberInfo.cs
-MemberTypes.cs
-MethodAttributes.cs
-MethodBase.cs
-MethodImplAttributes.cs
-MethodInfo.cs
-Module.cs
-ParameterAttributes.cs
-PropertyAttributes.cs
-PropertyInfo.cs
-ResourceAttributes.cs
-ResourceLocation.cs
-TypeAttributes.cs
diff --git a/mcs/class/corlib/System.Resources/ChangeLog b/mcs/class/corlib/System.Resources/ChangeLog
deleted file mode 100644
index bfdac8e288b..00000000000
--- a/mcs/class/corlib/System.Resources/ChangeLog
+++ /dev/null
@@ -1,123 +0,0 @@
-2002-01-26 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReader.cs: Finsished reading resource files with just strings
- in them. Need to figure out other types, and also resources with
- multiple types in the same file.
-
-2002-01-24 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReader.cs: Implemented constructors. Started on the
- GetEnumerator() method. Not done yet, but comitting for
- 'disaster recovery' purposes.
-
-2002-01-19 Duncan Mak <duncan@ximian.com>
-
- * *.cs: Fixed indentation. There was a stupid bug in my .emacs file.
-
-2002-1-17 Duncan Mak <duncan@duncan@ximian.com>
-
- * ResourceSet.cs: Implemented GetObject (string, bool) and GetString
- (string, bool). ResourceSet has no more MonoTODOs! Also added in the
- Serializable attribute.
-
- * *.cs: convert to Miguel's brace style.
-
-2002-01-17 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs: Fixed GetNeutralResourcesLanguage () and added
- new attributes documented in 1.0 SDK.
-
-2002-01-17 Duncan Mak <duncan@ximian.com>
-
- * ResourceWriter.cs: Added MonoTODO decorations.
-
- * SatelliteContractVersionAttribute.cs: added new attributes in 1.0 SDK.
-
- * NeutralResoucesLanguageAttribute.cs: added new attributes in 1.0 SDK
-
-2002-01-16 Duncan Mak <duncan@ximian.com>
-
- * ResourceReader.cs: Fixed some typos.
-
- * ResourceManager.cs: After reading the tutorial from the SDK,
- finished all the ResourceManager constructors and removed those
- MonoTODO tags.
-
- Removed MonoTODO from GetNeutralResourcesLanguage (Assembly)
- because Miguel just implemented the whole class, including the
- constructor that I needed (CultureInfo (string)).
-
- Updated fields after reading the new docs from the final SDK.
-
- * ResXFileRef.cs, ResXResourceReader.cs: Removed. They are part of
- Windows.Forms and require System.Xml, which we don't have access to.
-
-2002-01-13 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs: Added more MonoTODOs and cleaned up some
- indenting.
-
-2002-01-09 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs: Fixed the GetSatelliteContractVersion()
- method. It was missing a cast before. Removed MonoTODO
- attribute. ;-) It was tested by John Barnette, so this shouldn't break
- the build.
-
- * ResourceManager.cs: Removed MonoTODO attribute on GetString
- (string), as I believe it's correct. However, GetString
- (string, CultureInfo) is definitely broken, so I'm marking it with
- MonoTODO there. I also added MonoTODO to IntenalGetResourceSet().
-
-2002-01-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * Finalizing IResourceReader and IResourceWriter interfaces:
- Added "new"-modifier to IResourceReader.GetEnumerator
- * Fixed compilation issues in other *.cs, so that the
- System.Resources namespaces can be included in the corlib build.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ResourceManager.cs : MonoTODO attribute decoration.
-
-Tue Dec 18 13:18:32 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * *.cs: fixed some of the compilation issues: missing
- using directives, typos.
-
-2001-12-11 Duncan Mak <duncan@ximian.com>
-
- * Checked in to CVS.
-
-2001-12-10 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs (GetNeutralResourcesLanguage):
- (GetSatelliteContractVersion): Implemented.
-
-2001-12-09 Duncan Mak <duncan@ximian.com>
-
- * ResXResourceReader.cs: Initial attempt.
-
- * ResXFileRef.cs: Initial attempt.
-
- * ResourceWriter.cs: Initial attempt.
-
- * ResourceSet.cs (ReadResources): Implemented, with help from Radek Doulik.
-
-2001-11-28 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs: First attempt.
-
-2001-11-27 Duncan Mak <duncan@ximian.com>
-
- * ResourceSet.cs:
- First attempt, can't continue until ResourceReader and ResourceWriter are implemented.
-
- * SatelliteContractVersionAttribute.cs: First attempt. The spec is quite amibiguous here.
-
- * NeutralResoucesLanguageAttribute.cs: Complete.
-
- * MissingManifestResourceException.cs: Complete.
-
- * IResourceReader.cs: Complete.
-
- * IResourceWriter.cs: Complete.
diff --git a/mcs/class/corlib/System.Resources/IResourceReader.cs b/mcs/class/corlib/System.Resources/IResourceReader.cs
deleted file mode 100644
index 871f202cfff..00000000000
--- a/mcs/class/corlib/System.Resources/IResourceReader.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Resources.IResourceReader.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-
-namespace System.Resources
-{
- public interface IResourceReader : IEnumerable, IDisposable
- {
- void Close();
- new IDictionaryEnumerator GetEnumerator();
- }
-}
diff --git a/mcs/class/corlib/System.Resources/IResourceWriter.cs b/mcs/class/corlib/System.Resources/IResourceWriter.cs
deleted file mode 100644
index ec847784749..00000000000
--- a/mcs/class/corlib/System.Resources/IResourceWriter.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Resources.IResourceWriter.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Resources
-{
-
- public interface IResourceWriter : IDisposable
- {
- void AddResource (string name, byte[] value);
- void AddResource (string name, object value);
- void AddResource (string name, string value);
-
- void Close();
-
- void Generate();
- }
-}
diff --git a/mcs/class/corlib/System.Resources/MissingManifestResourceException.cs b/mcs/class/corlib/System.Resources/MissingManifestResourceException.cs
deleted file mode 100644
index f665c221b1c..00000000000
--- a/mcs/class/corlib/System.Resources/MissingManifestResourceException.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Resources.MissingManifestResourceException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Resources
-{
-
- public class MissingManifestResourceException: Exception
- {
- private string param;
-
- // Constructors
- public MissingManifestResourceException ()
- : base (Locale.GetText ("The assembly does not contain the resources for the required culture."))
- {
- }
-
- public MissingManifestResourceException (string message)
- :base (message)
- {
- }
-
- public MissingManifestResourceException (SerializationInfo info, StreamingContext context)
- :base (info, context)
- {
- }
-
- public MissingManifestResourceException (String message, Exception e)
- :base (message, e)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Resources/NeutralResoucesLanguageAttribute.cs b/mcs/class/corlib/System.Resources/NeutralResoucesLanguageAttribute.cs
deleted file mode 100644
index abff4ca7116..00000000000
--- a/mcs/class/corlib/System.Resources/NeutralResoucesLanguageAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Resources.NeutralResourcesLanguageAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Resources
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class NeutralResourcesLanguageAttribute : Attribute
- {
-
- string culture;
-
- // Constructors
- public NeutralResourcesLanguageAttribute (string cultureName)
- {
- culture = cultureName;
- }
- public string CultureName
- {
- get { return culture; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Resources/ResourceManager.cs b/mcs/class/corlib/System.Resources/ResourceManager.cs
deleted file mode 100644
index cd420d2cf36..00000000000
--- a/mcs/class/corlib/System.Resources/ResourceManager.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// System.Resources.ResourceManager.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2001 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-using System.Reflection;
-using System.Globalization;
-
-namespace System.Resources
-{
- [Serializable]
- public class ResourceManager
- {
- public static readonly int HeaderVersionNumber;
- // public static readonly int MagicNumber = 0xBEEFCACE;
-
- protected string BaseNameField;
- protected Assembly MainAssembly;
- protected Hashtable ResourceSets;
-
- private bool ignoreCase;
- private Type resourceSetType;
-
- // constructors
- public ResourceManager () {}
-
- public ResourceManager (Type resourceSource)
- {
- if (resourceSource == null)
- throw new ArgumentNullException ("resourceSource is null.");
-
- BaseNameField = resourceSource.FullName;
- MainAssembly = resourceSource.Assembly;
-
- ignoreCase = false;
- resourceSetType = resourceSource;
- }
-
- public ResourceManager (string baseName, Assembly assembly)
- {
- if (baseName == null || assembly == null)
- throw new ArgumentNullException ("The arguments are null.");
-
- BaseNameField = baseName;
- MainAssembly = assembly;
- ignoreCase = false;
- resourceSetType = typeof (ResourceSet);
- }
-
- public ResourceManager (string baseName, Assembly assembly, Type usingResourceSet)
- {
- if (baseName == null || assembly == null)
- throw new ArgumentNullException ("The arguments are null.");
-
- BaseNameField = baseName;
- MainAssembly = assembly;
-
- if (usingResourceSet == null) // defaults resourceSet type.
- resourceSetType = typeof (ResourceSet);
- else {
- if (!usingResourceSet.IsSubclassOf (typeof (ResourceSet)))
- throw new ArgumentException ("Type must be from ResourceSet.");
-
- }
- }
-
- [MonoTODO]
- public static ResourceManager CreateFileBasedResourceManager (string baseName,
- string resourceDir, Type usingResourceSet)
- {
- return null;
- }
-
- public virtual string BaseName
- {
- get { return BaseNameField; }
- }
-
- public virtual bool IgnoreCase
- {
- get { return ignoreCase; }
- set { ignoreCase = value; }
- }
-
- public virtual Type ResourceSetType
- {
- get { return resourceSetType; }
- }
-
- [MonoTODO]
- public virtual ResourceSet GetResourceSet (CultureInfo culture,
- bool createIfNotExists, bool tryParents)
-
- {
- if (culture == null)
- throw new ArgumentNullException ("CultureInfo is a null reference.");
- return null;
- }
-
- [MonoTODO]
- public virtual string GetString (string name)
- {
- if (name == null)
- throw new ArgumentNullException ("Name is null.");
- if (ResourceSets.Contains (name)) {
- if (!(ResourceSets[name] is string))
- throw new InvalidOperationException ("The resource is " +
- "not a string.");
- return ResourceSets[name].ToString();
- }
- return null;
- }
-
- [MonoTODO]
- public virtual string GetString (string name, CultureInfo culture)
- {
- if (name == null)
- throw new ArgumentNullException ("Name is null.");
- return null;
- }
-
- protected virtual string GetResourceFileName (CultureInfo culture)
- {
- return culture.Name + ".resources";
- }
-
- [MonoTODO]
- protected virtual ResourceSet InternalGetResourceSet (CultureInfo culture,
- bool Createifnotexists, bool tryParents)
- {
- return null;
- }
-
- public virtual void ReleaseAllResources ()
- {
- foreach (ResourceSet r in ResourceSets)
- r.Close();
- }
-
- protected static CultureInfo GetNeutralResourcesLanguage (Assembly a)
- {
- foreach (Attribute attribute in a.GetCustomAttributes (false)) {
- if (attribute is NeutralResourcesLanguageAttribute)
- return new CultureInfo ((attribute as NeutralResourcesLanguageAttribute).CultureName);
- }
- return null;
- }
-
- protected static Version GetSatelliteContractVersion (Assembly a)
- {
- foreach (Attribute attribute in a.GetCustomAttributes (false)) {
- if (attribute is SatelliteContractVersionAttribute)
- return new Version ((attribute as SatelliteContractVersionAttribute).Version);
- }
- return null; // return null if no version was found.
- }
- }
-}
diff --git a/mcs/class/corlib/System.Resources/ResourceReader.cs b/mcs/class/corlib/System.Resources/ResourceReader.cs
deleted file mode 100644
index 24c7561d97b..00000000000
--- a/mcs/class/corlib/System.Resources/ResourceReader.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-//
-// System.Resources.ResourceReader.cs
-//
-// Authors:
-// Duncan Mak <duncan@ximian.com>
-// Nick Drochak <ndrochak@gol.com>
-//
-// 2001 (C) Ximian Inc, http://www.ximian.com
-//
-// TODO: Finish this
-
-using System.Collections;
-using System.Resources;
-using System.IO;
-
-namespace System.Resources
-{
- class MonoTODO : Attribute {}
- public sealed class ResourceReader : IResourceReader, IDisposable
- {
- Stream stream;
- internal ArrayList resourceNames = null;
- internal ArrayList resourceValues = null;
- BinaryReader binaryReader;
- internal int resourceCount = 0;
- int typeCount = 0;
- ArrayList typeArray = new ArrayList();
- ArrayList hashes = new ArrayList();
- ArrayList positions = new ArrayList();
- int dataSectionOffset;
-
- // Constructors
- public ResourceReader (Stream stream)
- {
- if (stream == null)
- throw new ArgumentNullException ("Value cannot be null.");
-
- if (!stream.CanRead)
- throw new ArgumentException ("Stream was not readable.");
-
- this.stream = stream;
-
- if (!IsStreamValid()){
- throw new ArgumentException("Stream is not a valid .resources file! It was possibly truncated.");
- }
- }
-
- public ResourceReader (string fileName)
- {
- if (fileName == null)
- throw new ArgumentException ("Path cannot be null.");
-
- if (String.Empty == fileName)
- throw new ArgumentException("Empty path name is not legal.");
-
- if (!System.IO.File.Exists (fileName))
- throw new FileNotFoundException ("Could not find file " + Path.GetFullPath(fileName));
-
- stream = new FileStream (fileName, FileMode.Open);
-
- if (!IsStreamValid()){
- throw new ArgumentException("Stream is not a valid .resources file! It was possibly truncated.");
- }
- }
-
- [MonoTODO]
- private bool IsStreamValid() {
- // not sure how much to check to determine if it's valid,
- // but look at magic number, version numbers and class names
- string readerClass;
- string resourceSetClass;
- try {
- binaryReader = new BinaryReader(stream);
- int magicNumber = binaryReader.ReadInt32();
- if (-1091581234 != magicNumber) {
- return false;
- }
- int versionNumber = binaryReader.ReadInt32();
- if (1 != versionNumber){
- return false;
- }
- // Ignore next 32bits. they contain the length of the class name strings
- binaryReader.ReadInt32();
-
- readerClass = binaryReader.ReadString();
- if (!readerClass.StartsWith("System.Resources.ResourceReader")){
- return false;
- }
- resourceSetClass = binaryReader.ReadString();
- if (!resourceSetClass.StartsWith("System.Resources.RuntimeResourceSet")){
- return false;
- }
- int versionNumber2 = binaryReader.ReadInt32();
- if (1 != versionNumber2){
- return false;
- }
-
- resourceCount = binaryReader.ReadInt32();
- typeCount = binaryReader.ReadInt32();
-
- for (int i = 0; i < typeCount; i++) {
- typeArray.Add(binaryReader.ReadString());
- }
- for (int i = 0; i < resourceCount; i++) {
- hashes.Add(binaryReader.ReadInt32());
- }
- for (int i = 0; i < resourceCount; i++) {
- positions.Add(binaryReader.ReadInt32());
- }
-
- dataSectionOffset = binaryReader.ReadInt32();
-
- // LAMESPEC: what is the next Int32 here?
- binaryReader.ReadInt32();
- }
- catch{
- return false;
- }
- return true;
- }
-
- private string ReadString(BinaryReader br) {
- return br.ReadString();
- }
-
- public void Close ()
- {
- stream.Close ();
- stream = null;
- }
-
- public IDictionaryEnumerator GetEnumerator () {
- if (null == stream){
- throw new InvalidOperationException("ResourceReader is closed.");
- }
- else {
- // STRATEGY: if this is the first enumerator requested, fill the hash.
- // delaying in this way seems ok since there's not much you can do with just
- // a reader except close it. And if you close it, you cannot get the enumerator.
- // So, create the hash for the first enumerator, and re-use it for all others.
- if (null == resourceNames) {
- FillResources();
- }
- return new ResourceEnumerator (this);
- }
- }
-
- internal struct NameOffsetPair {
- public string name;
- public int offset;
- }
-
- [MonoTODO]
- private void FillResources(){
- NameOffsetPair pair;
- resourceNames = new ArrayList();
- resourceValues = new ArrayList();
- BinaryReader unicodeReader =
- new BinaryReader(binaryReader.BaseStream, System.Text.Encoding.Unicode);
- // TODO: need to put these in an array and work out when to get the values.
- // also need to figure out the hash and how/if to use it.
- for (int index=0; index < resourceCount; index++){
- pair = new NameOffsetPair();
- pair.name = unicodeReader.ReadString();
- pair.offset = binaryReader.ReadInt32();
- resourceNames.Add(pair);
- }
- for (int index=0; index < resourceCount; index++){
- // LAMESPEC: what the heck is this byte here? always 0? just a separator?
- binaryReader.ReadByte();
- resourceValues.Add(binaryReader.ReadString());
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return ((IResourceReader) this).GetEnumerator();
- }
-
- [MonoTODO]
- void IDisposable.Dispose ()
- {
- // FIXME: is this all we need to do?
- Close();
- }
-
- internal class ResourceEnumerator : IDictionaryEnumerator
- {
- protected ResourceReader reader;
- protected int index = -1;
-
-
- public ResourceEnumerator(ResourceReader readerToEnumerate){
- reader = readerToEnumerate;
- }
-
- public DictionaryEntry Entry
- {
- get {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (index < 0)
- throw new InvalidOperationException("Enumeration has not started. Call MoveNext.");
-
- DictionaryEntry entry = new DictionaryEntry();
- entry.Key = Key;
- entry.Value = Value;
- return entry;
- }
- }
-
- public object Key
- {
- get {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (index < 0)
- throw new InvalidOperationException("Enumeration has not started. Call MoveNext.");
- return ((NameOffsetPair)(reader.resourceNames[index])).name;
- }
- }
-
- public object Value
- {
- get {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (index < 0)
- throw new InvalidOperationException("Enumeration has not started. Call MoveNext.");
- return reader.resourceValues[index];
- }
- }
-
- public object Current
- {
- get {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (index < 0)
- throw new InvalidOperationException("Enumeration has not started. Call MoveNext.");
- return Entry;
- }
- }
-
- public bool MoveNext ()
- {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (++index < reader.resourceCount){
- return true;
- }
- else {
- --index;
- return false;
- }
- }
-
- public void Reset () {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- index = -1;
- }
- } // internal class ResourceEnumerator
- } // public sealed class ResourceReader
-} // namespace System.Resources
diff --git a/mcs/class/corlib/System.Resources/ResourceSet.cs b/mcs/class/corlib/System.Resources/ResourceSet.cs
deleted file mode 100644
index 03ed57f4894..00000000000
--- a/mcs/class/corlib/System.Resources/ResourceSet.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.Resources.ResourceSet.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-using System.IO;
-
-namespace System.Resources
-{
- [Serializable]
- public class ResourceSet : IDisposable
- {
-
- protected IResourceReader Reader;
- protected Hashtable Table;
-
- // Constructors
- protected ResourceSet () {}
- protected ResourceSet (IResourceReader reader)
- {
- if (reader == null)
- throw new ArgumentNullException ("The reader is null.");
- Reader = reader;
- }
-
- protected ResourceSet (Stream stream)
- {
- Reader = new ResourceReader (stream);
- }
-
- protected ResourceSet (String fileName)
- {
- Reader = new ResourceReader (fileName);
- }
-
- public virtual void Close ()
- {
- Dispose (true);
- }
-
- public void Dispose()
- {
- Dispose (true);
- }
-
- public void Dispose (bool disposing)
- {
- if (disposing) {
- Reader = null;
- Table = null;
- }
- }
-
- public virtual Type GetDefaultReader ()
- {
- return (typeof (ResourceReader));
- }
- public virtual Type GetDefaultWriter ()
- {
- return (typeof (ResourceWriter));
- }
-
- public virtual object GetObject (string name)
- {
- if (name == null)
- throw new ArgumentNullException ("The name parameter is null.");
- if (Reader == null)
- throw new InvalidOperationException ("The ResourceSet has been closed.");
- if (Table == null) {
- ReadResources ();
- return Table[name];
- } else
- return Table[name];
- }
- public virtual object GetObject (string name, bool ignoreCase)
- {
- if (name == null)
- throw new ArgumentNullException ("The name parameter is null.");
- if (Reader == null)
- throw new InvalidOperationException ("ResourceSet has been closed.");
- if (Table == null)
- ReadResources ();
- if (ignoreCase) {
- foreach (DictionaryEntry de in Table) {
- string key = (string) de.Key;
- if (String.Compare (key, name, true) == 0)
- return de.Value;
- }
- return null;
- } else
- return Table[name];
- }
-
- public virtual string GetString (string name)
- {
- Object o = GetObject (name);
- if (o is string)
- return (string) o;
- return null;
- }
-
- public virtual string GetString (string name, bool ignoreCase)
- {
- Object o = GetObject (name, ignoreCase);
- if (o is string)
- return (string) o;
- return null;
- }
-
- public virtual void ReadResources ()
- {
- IDictionaryEnumerator i = Reader.GetEnumerator();
-
- if (Table == null)
- Table = new Hashtable ();
- i.Reset ();
-
- while (i.MoveNext ())
- Table.Add (i.Key, i.Value);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Resources/ResourceWriter.cs b/mcs/class/corlib/System.Resources/ResourceWriter.cs
deleted file mode 100644
index d815ac76b3d..00000000000
--- a/mcs/class/corlib/System.Resources/ResourceWriter.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Resources.ResourceWriter.cs
-//
-// Author:
-// Duncan Mak <duncan@ximian.com>
-//
-// 2001 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.IO;
-
-namespace System.Resources
-{
- public sealed class ResourceWriter : IResourceWriter
- {
- [MonoTODO]
- public ResourceWriter (Stream stream)
- {
- if (stream == null)
- throw new ArgumentNullException ("stream is null");
- if (stream.CanWrite == false)
- throw new ArgumentException ("stream is not writable.");
- }
-
- [MonoTODO]
- public ResourceWriter (String fileName)
- {
- if (fileName == null)
- throw new ArgumentNullException ("fileName is null.");
- }
-
- [MonoTODO]
- public void AddResource (string name, byte[] value)
- {
- if (name == null || value == null)
- throw new ArgumentNullException ("Parameter is a null reference.");
- }
-
- [MonoTODO]
- public void AddResource (string name, object value)
- {
- if (name == null || value == null)
- throw new ArgumentNullException ("Parameter is a null reference.");
- }
-
- [MonoTODO]
- public void AddResource (string name, string value)
- {
- if (name == null || value == null)
- throw new ArgumentNullException ("Parameter is a null reference.");
- }
-
- [MonoTODO]
- public void Close () {}
-
- public void Dispose ()
- {
- Close();
- }
-
- [MonoTODO]
- public void Generate () {}
- }
-}
diff --git a/mcs/class/corlib/System.Resources/SatelliteContractVersionAttribute.cs b/mcs/class/corlib/System.Resources/SatelliteContractVersionAttribute.cs
deleted file mode 100644
index a0bf1bd0614..00000000000
--- a/mcs/class/corlib/System.Resources/SatelliteContractVersionAttribute.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Resources.SatelliteContractVersionAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Resources
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class SatelliteContractVersionAttribute : Attribute
- {
- private Version ver;
-
- // Constructor
- public SatelliteContractVersionAttribute (string version)
- {
- ver = new Version(version);
- }
- public string Version
- {
- get { return ver.ToString(); }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog b/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog
deleted file mode 100644
index 0ea5e1305ae..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog
+++ /dev/null
@@ -1,12 +0,0 @@
-
-Fri Feb 22 15:36:19 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * RuntimeHelpers.cs: added OffsetToStringData() property.
-
-Mon Nov 5 19:50:11 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * RuntimeHelpers.cs: make InitializeArray an internalcall.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * MethodCodeType.cs, MethodImplOptions.cs: Add.
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/IndexerNameAttribute.cs b/mcs/class/corlib/System.Runtime.CompilerServices/IndexerNameAttribute.cs
deleted file mode 100755
index 8594700ed21..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/IndexerNameAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.CompilerServices.IndexerNameAttributecs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.CompilerServices {
-
- [AttributeUsage(AttributeTargets.Property, Inherited=false)]
- public class IndexerNameAttribute : Attribute {
- public IndexerNameAttribute (string indexer_name)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/MethodCodeType.cs b/mcs/class/corlib/System.Runtime.CompilerServices/MethodCodeType.cs
deleted file mode 100644
index 3608120e516..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/MethodCodeType.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Runtime.CompilerServices.MethodCodeType.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Thu 07/18/2001
-//
-//------------------------------------------------------------------------------
-
-namespace System.Runtime.CompilerServices
-{
-
-public enum MethodCodeType
-{
- IL,
- Native,
- OPTIL,
- Runtime,
-}
-
-} // Namespace
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplAttribute.cs b/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplAttribute.cs
deleted file mode 100644
index 18ba12881ab..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Runtime.CompilerServices.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Runtime.CompilerServices {
-
- [AttributeUsage(AttributeTargets.Method, Inherited=false)]
- public class MethodImplAttribute : Attribute {
- MethodImplOptions impl_options;
-
- public MethodImplAttribute ()
- {
- }
-
- public MethodImplAttribute (short options)
- {
- impl_options = (MethodImplOptions) options;
- }
-
- public MethodImplAttribute (MethodImplOptions options)
- {
- impl_options = options;
- }
-
- public MethodCodeType MethodCodeType;
-
- public MethodImplOptions Value {
- get {
- return impl_options;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplOptions.cs b/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplOptions.cs
deleted file mode 100644
index 347c38569a4..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplOptions.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// MethodImplOptions.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:33:23 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.CompilerServices {
-
-
- /// <summary>
- /// </summary>
- public enum MethodImplOptions {
-
- /// <summary>
- /// </summary>
- Unmanaged = 4,
-
- /// <summary>
- /// </summary>
- ForwardRef = 16,
-
- /// <summary>
- /// </summary>
- InternalCall = 4096,
-
- /// <summary>
- /// </summary>
- Synchronized = 32,
-
- /// <summary>
- /// </summary>
- NoInlining = 8,
- } // MethodImplOptions
-
-} // System.Runtime.CompilerServices
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs
deleted file mode 100644
index a2c644ee847..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// System.Runtime.CompilerServices.RuntimeHelpers
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) Ximian, Inc. 2001
-
-namespace System.Runtime.CompilerServices
-{
- public sealed class RuntimeHelpers
- {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern void InitializeArray (Array array, RuntimeFieldHandle fldHandle);
-
- public static int OffsetToStringData {
- get {
- // FIXME: this requires the reimplementation of String
- // as of my mail a few months ago, dum de dum
- throw new NotImplementedException ();
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/AssemblyRegistrationFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/AssemblyRegistrationFlags.cs
deleted file mode 100755
index 0360d868163..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/AssemblyRegistrationFlags.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.InteropServices.AssemblyRegistrationFlags.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices
-{
- [Flags]
- [Serializable]
- public enum AssemblyRegistrationFlags {
- None = 0,
- SetCodeBase = 0,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/CallingConvention.cs b/mcs/class/corlib/System.Runtime.InteropServices/CallingConvention.cs
deleted file mode 100644
index 7f2c24d2b0c..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/CallingConvention.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// CallingConvention.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:33:29 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum CallingConvention {
-
- /// <summary>
- /// </summary>
- Winapi = 1,
-
- /// <summary>
- /// </summary>
- Cdecl = 2,
-
- /// <summary>
- /// </summary>
- StdCall = 3,
-
- /// <summary>
- /// </summary>
- ThisCall = 4,
-
- /// <summary>
- /// </summary>
- FastCall = 5,
- } // CallingConvention
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog b/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
deleted file mode 100644
index 3f3335e26be..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
+++ /dev/null
@@ -1,71 +0,0 @@
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * ComInterfaceType.cs: Added to CVS.
-
- * AssemblyRegistrationFlags.cs:
- * GuidAttribute.cs:
- * ICustomAdapter.cs:
- * ICustomFactory.cs:
- * ICustomMarshaler.cs:
- * IRegistrationServices.cs:
- * ITypeLibExporterNameProvider.cs:
- * ITypeLibImporterNotifySink.cs:
- * InterfaceTypeAttribute.cs:
- * TypeLibExporterFlags.cs: Committed for Kevin Winchester <kwin@ns.sympatico.ca>.
-
- * GCHandle.cs: Added to CVS. Patch from Ajay kumar Dwivedi.
-
- * GCHandleType.cs: Committed patch from Ajay.
-
- * ImporterEventKind.cs: Added to CVS.
-
-2002-01-24 Miguel de Icaza <miguel@ximian.com>
-
- * StructLayoutAttribute.cs: Flag attribute as targetting structs
- or classes.
-
- * InAttribute.cs: Flag attribute as targettting a paramter
-
- * OutAttribute.cs: ditto.
-
- * DllImportAttribute.cs: Flag attribute as targetting methods.
-
- * MarshalAsAttribute.cs: Flag attribute as targetting fields,
- parameters and returnvalues.
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * Marshal.cs: Added GetLastWin32Error()
-
- * ExternalException.cs: Implemented
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * ExternalException.cs: Add ExternalException.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * OutAttribute.cs : Decorate with MonoTODO.
-
-Thu Dec 20 15:46:31 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * FieldOffsetAttribute.cs, InAttribute.cs, MarshalAsAttribute.cs,
- OptionalAttribute.cs, StructLayoutAttribute.cs, VarEnum.cs:
- more stuff needed by the compiler.
-
-Thu Dec 13 20:22:18 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * DllImportAttribute.cs: added.
- * MethodImplOptions.cs: removed: this is already in CompilerServices.
-
-Wed Nov 14 17:02:57 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * CallingConvention.cs: add missing Winapi.
-
-2001-07-20 Miguel de Icaza <miguel@ximian.com>
-
- * OutAttribute.cs: New file.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * CallingConvention.cs.cs, CharSet.cs, GCHandleType.cs, LayoutKind.cs: Add.
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/CharSet.cs b/mcs/class/corlib/System.Runtime.InteropServices/CharSet.cs
deleted file mode 100644
index df1443f63ee..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/CharSet.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// CharSet.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:33:35 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum CharSet {
-
- /// <summary>
- /// </summary>
- Ansi = 2,
-
- /// <summary>
- /// </summary>
- Unicode = 3,
-
- /// <summary>
- /// </summary>
- Auto = 4,
- } // CharSet
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs
deleted file mode 100755
index 8d7c7a6b669..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Runtime.InteropServices.ComInterfaceType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.InteropServices
-{
- [Serializable] public enum ComInterfaceType
- {
- InterfaceIsDual = 0,
- InterfaceIsIUnknown = 1,
- InterfaceIsIDispatch = 2,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs
deleted file mode 100755
index 9d6466527ea..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Runtime.InteropServices/DllImportAttribute.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class DllImportAttribute: Attribute {
- public CallingConvention CallingConvention;
- public CharSet CharSet;
- public string EntryPoint;
- public bool ExactSpelling;
- public bool PreserveSig;
- public bool SetLastError;
- private string Dll;
-
- public string Value {
- get {return Dll;}
- }
-
- public DllImportAttribute (string dllName) {
- Dll = dllName;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ExternalException.cs b/mcs/class/corlib/System.Runtime.InteropServices/ExternalException.cs
deleted file mode 100755
index 014074cef21..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ExternalException.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Runtime.InteropServices.ExternalException.cs
-//
-// Author:
-// Miguel De Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System.Runtime.InteropServices {
- [Serializable]
- public class ExternalException : SystemException {
- private int error_code;
-
- // Constructors
- public ExternalException ()
- : base (Locale.GetText ("External exception"))
- {
- }
-
- public ExternalException (string message)
- : base (message)
- {
- }
-
- protected ExternalException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public ExternalException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public ExternalException (string message, int errorCode)
- : base (message)
- {
- error_code = errorCode;
- }
-
- public virtual int ErrorCode {
- get {
- return error_code;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs
deleted file mode 100755
index a5deebb0675..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Field)]
- public sealed class FieldOffsetAttribute : Attribute {
- private int val;
-
- public FieldOffsetAttribute( int offset) {
- val = offset;
- }
- public int Value {
- get {return val;}
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs b/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs
deleted file mode 100755
index 4eafe919d9e..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-namespace System.Runtime.InteropServices
-{
- /// <summary>
- /// Summary description for GCHandle.
- /// </summary>
- public struct GCHandle
- {
- // fields
- private IntPtr handle;
- private GCHandleType handleType;
-
- // Constructors
- private GCHandle(object obj)
- : this(obj, GCHandleType.Normal)
- {}
-
- private GCHandle(object value, GCHandleType type)
- {
- handle = IntPtr.Zero;
- handleType = type;
- }
-
- // Properties
-
- public bool IsAllocated
- {
- get
- {
- return (handle != IntPtr.Zero);
- }
- }
-
- public object Target
- {
- get
- {
- return GetTarget(handle);
- }
- set
- {
- SetTarget(handle,value);
- }
- }
-
- // Methods
- public IntPtr AddrOfPinnedObject()
- {
- if(this.handleType == System.Runtime.InteropServices.GCHandleType.Pinned)
- {
- throw new InvalidOperationException("The handle is not of Pinned type");
- }
- return GetAddrOfPinnedObject();
- }
-
- public static System.Runtime.InteropServices.GCHandle Alloc(object value)
- {
- return new GCHandle(value);
- }
-
- public static System.Runtime.InteropServices.GCHandle Alloc(object value, GCHandleType type)
- {
- return new GCHandle(value,type);
- }
-
- public void Free()
- {
- FreeHandle(handle);
- handle = IntPtr.Zero;
- }
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static explicit operator IntPtr(GCHandle value);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static explicit operator GCHandle(IntPtr value);
-
- //TODO: Private Native Functions
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern object GetTarget(IntPtr pointer);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void SetTarget(IntPtr pointer,object obj);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void FreeHandle(IntPtr pointer);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern IntPtr GetAddrOfPinnedObject();
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/GCHandleType.cs b/mcs/class/corlib/System.Runtime.InteropServices/GCHandleType.cs
deleted file mode 100644
index bee7c8b8436..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/GCHandleType.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// GCHandleType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:33:42 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum GCHandleType {
-
-
- /// <summary>
- /// </summary>
- Weak = 0,
-
- /// <summary>
- /// </summary>
- WeakTrackResurrection = 1,
-
- /// <summary>
- /// </summary>
- Normal = 2,
-
- /// <summary>
- /// </summary>
- Pinned = 3,
- } // GCHandleType
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs
deleted file mode 100755
index 1fd1a44f85e..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Runtime.InteropServices.InAttribute.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate)]
- public sealed class GuidAttribute : Attribute {
-
- private string guidValue;
-
- public GuidAttribute (string guid) {
- guidValue = guid;
- }
-
- public string Value {
- get {return guidValue;}
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ICustomAdapter.cs b/mcs/class/corlib/System.Runtime.InteropServices/ICustomAdapter.cs
deleted file mode 100755
index edde7b22cc0..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ICustomAdapter.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Runtime.InteropServices.ICustomAdapter.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- public interface ICustomAdapter {
- object GetUnderlyingObject ();
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ICustomFactory.cs b/mcs/class/corlib/System.Runtime.InteropServices/ICustomFactory.cs
deleted file mode 100755
index c5f1cb23eea..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ICustomFactory.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Runtime.InteropServices.ICustomFactory.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- public interface ICustomFactory {
- MarshalByRefObject CreateInstance (Type serverType);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ICustomMarshaler.cs b/mcs/class/corlib/System.Runtime.InteropServices/ICustomMarshaler.cs
deleted file mode 100755
index 90a2b29b619..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ICustomMarshaler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Runtime.InteropServices.ICustomMarshaler.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- public interface ICustomMarshaler {
- void CleanUpManagedData (object ManagedObj);
- void CleanUpNativeData (IntPtr pNativeData);
- int GetNativeDataSize ();
- IntPtr MarshalManagedToNative (object ManagedObj);
- object MarshalNativeToManaged (IntPtr pNativeData);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/IRegistrationServices.cs b/mcs/class/corlib/System.Runtime.InteropServices/IRegistrationServices.cs
deleted file mode 100755
index a42e935895c..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/IRegistrationServices.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Runtime.InteropServices.IRegistrationServices.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-using System.Reflection;
-
-namespace System.Runtime.InteropServices {
-
- //[Guid("")]
- public interface IRegistrationServices {
- Guid GetManagedCategoryGuid ();
- string GetProgIdForType (Type type);
- Type[] GetRegistrableTypesInAssembly (Assembly assembly);
- bool RegisterAssembly (Assembly assembly, AssemblyRegistrationFlags flags);
- void RegisterTypeForComClients (Type type, ref Guid g);
- bool TypeRepresentsComType (Type type);
- bool TypeRequiresRegistration (Type type);
- bool UnregisterAssembly (Assembly assembly);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs b/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs
deleted file mode 100755
index 3e937ae4b22..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.InteropServices.ITypeLibExporterNameProvider.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- //[Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeLibExporterNameProvider {
- string[] GetNames ();
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs b/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs
deleted file mode 100755
index 3c9199e4063..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.InteropServices.ITypeLibImporterNotifySink.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-using System.Reflection;
-
-namespace System.Runtime.InteropServices {
-
- //[Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeLibImporterNotifySink {
- void ReportEvent(ImporterEventKind eventKind, int eventCode, string eventMsg);
- Assembly ResolveRef(object typeLib);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ImporterEventKind.cs b/mcs/class/corlib/System.Runtime.InteropServices/ImporterEventKind.cs
deleted file mode 100755
index a7888769482..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ImporterEventKind.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Runtime.InteropServices.ImporterEventKind.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.InteropServices
-{
- [Serializable] public enum ImporterEventKind
- {
- NOTIF_TYPECONVERED = 0,
- NOTIF_CONVERTWARNING = 1,
- ERROR_REFTOINVALIDTYPELID = 2,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs
deleted file mode 100755
index b141d9dbc49..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.InteropServices.InAttribute.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Parameter)]
- public sealed class InAttribute : Attribute {
- public InAttribute () {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs
deleted file mode 100755
index e8cbd5ae9b7..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Runtime.InteropServices.InterfaceTypeAttribute.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage(AttributeTargets.Interface)]
- public sealed class InterfaceTypeAttribute : Attribute {
-
- private ComInterfaceType intType;
-
- public InterfaceTypeAttribute (ComInterfaceType interfaceType){
- intType = interfaceType;
- }
-
- public InterfaceTypeAttribute (short interfaceType) {
- intType = (ComInterfaceType)interfaceType;
- }
-
- public ComInterfaceType Value {
- get {return intType;}
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/LayoutKind.cs b/mcs/class/corlib/System.Runtime.InteropServices/LayoutKind.cs
deleted file mode 100644
index 960cc3d551e..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/LayoutKind.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// LayoutKind.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:33:48 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum LayoutKind {
-
- /// <summary>
- /// </summary>
- Sequential = 0,
-
- /// <summary>
- /// </summary>
- Explicit = 2,
-
- /// <summary>
- /// </summary>
- Auto = 3,
- } // LayoutKind
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
deleted file mode 100644
index 6bead740127..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// System.Runtime.InteropServices.Marshal
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices
-{
- class Marshal
- {
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern string PtrToStringAuto (IntPtr ptr);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern IntPtr ReadIntPtr (IntPtr ptr);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern int GetLastWin32Error();
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs
deleted file mode 100755
index 48e9f523d07..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public sealed class MarshalAsAttribute : Attribute {
- private UnmanagedType utype;
- public UnmanagedType ArraySubType;
- public string MarshalCookie;
- public string MarshalType;
- public Type MarshalTypeRef;
- public VarEnum SafeArraySubType;
- public int SizeConst;
- public short SizeParamIndex;
-
- public MarshalAsAttribute (short unmanagedType) {
- utype = (UnmanagedType)unmanagedType;
- }
- public MarshalAsAttribute( UnmanagedType unmanagedType) {
- utype = unmanagedType;
- }
- public UnmanagedType Value {
- get {return utype;}
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs
deleted file mode 100755
index d53f5291fa0..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Parameter)]
- public sealed class OptionalAttribute : Attribute {
- public OptionalAttribute () {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs
deleted file mode 100644
index 868bc61468b..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Runtime.InteropServices.OutAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Parameter)]
- public sealed class OutAttribute : Attribute {
-
- public OutAttribute ()
- {
- }
-
- public override object TypeId {
- get {
- // TODO: Implement me
- return null;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/PInvokeMap.cs b/mcs/class/corlib/System.Runtime.InteropServices/PInvokeMap.cs
deleted file mode 100755
index c35bac6bdf1..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/PInvokeMap.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-// PInvokeMap.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- /// <remarks>
- /// </remarks>
- public enum PInvokeMap {
-
- /// <summary>
- /// </summary>
- NoMangle = 1,
-
- /// <summary>
- /// </summary>
- CharSetMask = 6,
-
- /// <summary>
- /// </summary>
- CharSetNotSpec = 0,
-
- /// <summary>
- /// </summary>
- CharSetAnsi = 2,
-
- /// <summary>
- /// </summary>
- CharSetUnicode = 4,
-
- /// <summary>
- /// </summary>
- CharSetAuto = 6,
-
- /// <summary>
- /// </summary>
- PinvokeOLE = 32,
-
- /// <summary>
- /// </summary>
- SupportsLastError = 64,
-
- /// <summary>
- /// </summary>
- CallConvMask = 1792,
-
- /// <summary>
- /// </summary>
- CallConvWinapi = 256,
-
- /// <summary>
- /// </summary>
- CallConvCdecl = 512,
-
- /// <summary>
- /// </summary>
- CallConvStdcall = 768,
-
- /// <summary>
- /// </summary>
- CallConvThiscall = 1024,
-
- /// <summary>
- /// </summary>
- CallConvFastcall = 1280,
- } // PInvokeMap
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs
deleted file mode 100755
index 420e70efa0c..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct)]
- public sealed class StructLayoutAttribute : Attribute {
- public CharSet CharSet = CharSet.Auto;
- public int Pack = 8;
- public int Size = 0;
- private LayoutKind lkind;
-
- public StructLayoutAttribute( short layoutKind) {
- lkind = (LayoutKind)layoutKind;
- }
- public StructLayoutAttribute( LayoutKind layoutKind) {
- lkind = layoutKind;
- }
- public LayoutKind Value {
- get {return lkind;}
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibExporterFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibExporterFlags.cs
deleted file mode 100755
index 7f7c7695412..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibExporterFlags.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibExporterFlags.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices
-{
- [Flags] [Serializable]
- public enum TypeLibExporterFlags {
- OnlyReferenceRegistered = 1,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs b/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs
deleted file mode 100755
index a4062929834..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-// UnmanagedType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum UnmanagedType {
-
- /// <summary>
- /// </summary>
- Bool = 2,
-
- /// <summary>
- /// </summary>
- I1 = 3,
-
- /// <summary>
- /// </summary>
- U1 = 4,
-
- /// <summary>
- /// </summary>
- I2 = 5,
-
- /// <summary>
- /// </summary>
- U2 = 6,
-
- /// <summary>
- /// </summary>
- I4 = 7,
-
- /// <summary>
- /// </summary>
- U4 = 8,
-
- /// <summary>
- /// </summary>
- I8 = 9,
-
- /// <summary>
- /// </summary>
- U8 = 10,
-
- /// <summary>
- /// </summary>
- R4 = 11,
-
- /// <summary>
- /// </summary>
- R8 = 12,
-
- /// <summary>
- /// </summary>
- BStr = 19,
-
- /// <summary>
- /// </summary>
- LPStr = 20,
-
- /// <summary>
- /// </summary>
- LPWStr = 21,
-
- /// <summary>
- /// </summary>
- LPTStr = 22,
-
- /// <summary>
- /// </summary>
- ByValTStr = 23,
-
- /// <summary>
- /// </summary>
- IUnknown = 25,
-
- /// <summary>
- /// </summary>
- IDispatch = 26,
-
- /// <summary>
- /// </summary>
- Struct = 27,
-
- /// <summary>
- /// </summary>
- Interface = 28,
-
- /// <summary>
- /// </summary>
- SafeArray = 29,
-
- /// <summary>
- /// </summary>
- ByValArray = 30,
-
- /// <summary>
- /// </summary>
- SysInt = 31,
-
- /// <summary>
- /// </summary>
- SysUInt = 32,
-
- /// <summary>
- /// </summary>
- VBByRefStr = 34,
-
- /// <summary>
- /// </summary>
- AnsiBStr = 35,
-
- /// <summary>
- /// </summary>
- TBStr = 36,
-
- /// <summary>
- /// </summary>
- VariantBool = 37,
-
- /// <summary>
- /// </summary>
- FunctionPtr = 38,
-
- /// <summary>
- /// </summary>
- LPVoid = 39,
-
- /// <summary>
- /// </summary>
- AsAny = 40,
-
- /// <summary>
- /// </summary>
- RPrecise = 41,
-
- /// <summary>
- /// </summary>
- LPArray = 42,
-
- /// <summary>
- /// </summary>
- LPStruct = 43,
-
- /// <summary>
- /// </summary>
- CustomMarshaler = 44,
-
- /// <summary>
- /// </summary>
- Error = 45,
-
- /// <summary>
- /// </summary>
- NativeTypeMax = 80,
- } // UnmanagedType
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs b/mcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs
deleted file mode 100755
index 4a8dc4168c1..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
- public enum VarEnum {
- VT_EMPTY = 0,
- VT_NULL = 1,
- VT_I2 = 2,
- VT_I4 = 3,
- VT_R4 = 4,
- VT_R8 = 5,
- VT_CY = 6,
- VT_DATE = 7,
- VT_BSTR = 8,
- VT_DISPATCH = 9,
- VT_ERROR = 10,
- VT_BOOL = 11,
- VT_VARIANT = 12,
- VT_UNKNOWN = 13,
- VT_DECIMAL = 14,
- VT_I1 = 16,
- VT_UI1 = 17,
- VT_UI2 = 18,
- VT_UI4 = 19,
- VT_I8 = 20,
- VT_UI8 = 21,
- VT_INT = 22,
- VT_UINT = 23,
- VT_VOID = 24,
- VT_HRESULT = 25,
- VT_PTR = 26,
- VT_SAFEARRAY = 27,
- VT_CARRAY = 28,
- VT_USERDEFINED = 29,
- VT_LPSTR = 30,
- VT_LPWSTR = 31,
- VT_RECORD = 36,
- VT_FILETIME = 64,
- VT_BLOB = 65,
- VT_STREAM = 66,
- VT_STORAGE = 67,
- VT_STREAMED_OBJECT = 68,
- VT_STORED_OBJECT = 69,
- VT_BLOB_OBJECT = 70,
- VT_CF = 71,
- VT_CLSID = 72,
- VT_VECTOR = 4096,
- VT_ARRAY = 8192,
- VT_BYREF = 16384
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivatorLevel.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivatorLevel.cs
deleted file mode 100644
index 574f2de52bf..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivatorLevel.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.ActivatorLevel..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Remoting.Activation {
-
- public enum ActivatorLevel {
- Construction = 4,
- Context = 8,
- AppDomain = 12,
- Process = 16,
- Machine = 20,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/IActivator.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/IActivator.cs
deleted file mode 100644
index 60bf6be961c..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/IActivator.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IActivator..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Remoting.Activation {
-
- public interface IActivator {
- ActivatorLevel Level {
- get;
- }
-
- IActivator NextActivator {
- get; set;
- }
-
- IConstructionReturnMessage Activate (IConstructionCallMessage msg);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionCallMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionCallMessage.cs
deleted file mode 100644
index 6bbb601e467..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionCallMessage.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Runtime.Remoting.Activation.IConstructionCallMessage.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Runtime.Remoting.Activation {
-
- public interface IConstructionCallMessage {
- Type ActivationType {
- get;
- }
-
- string ActivationTypeName {
- get;
- }
-
- IActivator Activator {
- get;
- set;
- }
-
- object [] CallSiteActivationAttributes {
- get;
- }
-
- IList ContextProperties {
- get;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs
deleted file mode 100644
index 495736f8c44..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IConstructionReturnMessage..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Messaging;
-
-namespace System.Runtime.Remoting.Activation {
-
- public interface IConstructionReturnMessage :IMethodReturnMessage, IMethodMessage, IMessage {
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs
deleted file mode 100644
index 3f2a0f327ab..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.Context..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Runtime.Remoting.Contexts {
-
- public class Context {
- static Context default_context;
- ArrayList context_properties;
- int context_id;
- bool frozen;
- static int global_count;
-
- static Context ()
- {
- default_context = new Context ();
- default_context.frozen = true;
- }
-
- public Context ()
- {
- context_id = global_count++;
- }
-
- public static Context DefaultContext {
- get {
- return default_context;
- }
- }
-
- public virtual int ContextID {
- get {
- return context_id;
- }
- }
-
- public IContextProperty GetProperty (string name)
- {
- if (context_properties == null)
- return null;
-
- foreach (IContextProperty p in context_properties)
- if (p.Name == name)
- return p;
-
- return null;
- }
-
- public void SetProperty (IContextProperty prop)
- {
- if (prop == null)
- throw new ArgumentNullException ("IContextProperty");
- if (this == default_context)
- throw new InvalidOperationException ("Can not add properties to " +
- "default context");
- if (frozen)
- throw new InvalidOperationException ("Context is Frozen");
-
- if (context_properties == null)
- context_properties = new ArrayList ();
-
- context_properties.Add (prop);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/ContextAttribute.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/ContextAttribute.cs
deleted file mode 100644
index a1e7b34ee0e..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/ContextAttribute.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.ContextAttribute..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Activation;
-using System.Collections;
-
-namespace System.Runtime.Remoting.Contexts {
-
- [AttributeUsage (AttributeTargets.Class)]
- public class ContextAttribute : Attribute, IContextAttribute, IContextProperty {
- protected string AttributeName;
-
- public virtual string Name {
- get {
- return AttributeName;
- }
- }
-
- public override bool Equals (object o)
- {
- if (o == null)
- return false;
-
- if (!(o is ContextAttribute))
- return false;
-
- ContextAttribute ca = (ContextAttribute) o;
-
- if (ca.AttributeName != AttributeName)
- return false;
-
- return true;
- }
-
- public virtual void Freeze (Context ctx)
- {
- }
-
- public override int GetHashCode ()
- {
- if (AttributeName == null)
- return 0;
-
- return AttributeName.GetHashCode ();
- }
-
- /// <summary>
- /// Adds the current context property to the IConstructionCallMessage
- /// </summary>
- public void GetPropertiesForNewContext (IConstructionCallMessage msg)
- {
- if (msg == null)
- throw new ArgumentNullException ("IConstructionCallMessage");
-
- IList list = msg.ContextProperties;
-
- list.Add (this);
- }
-
- // <summary>
- // True whether the context arguments satisfies the requirements
- // of the current context.
- // </summary>
- public bool IsContextOK (Context ctx, IConstructionCallMessage msg)
- {
- if (msg == null)
- throw new ArgumentNullException ("IConstructionCallMessage");
- if (ctx == null)
- throw new ArgumentNullException ("Context");
-
- if (!msg.ActivationType.IsContextful)
- return true;
-
- IContextProperty p = ctx.GetProperty (AttributeName);
- if (p == null)
- return false;
-
- if (this != p)
- return false;
-
- return true;
- }
-
- public bool IsNewContextOK (Context ctx)
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextAttribute.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextAttribute.cs
deleted file mode 100644
index b998062642c..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IContextAttribute..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Activation;
-
-namespace System.Runtime.Remoting.Contexts {
-
- public interface IContextAttribute {
-
- void GetPropertiesForNewContext (IConstructionCallMessage msg);
-
- bool IsContextOK (Context ctx, IConstructionCallMessage msg);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextProperty.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextProperty.cs
deleted file mode 100644
index 7230c19b029..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextProperty.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IContextProperty..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Runtime.Remoting.Contexts {
-
- public interface IContextProperty {
-
- string Name {
- get;
- }
-
- void Freeze (Context ctx);
-
- bool IsNewContextOK (Context ctx);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs
deleted file mode 100644
index daf169559d8..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IDynamicMessageSink..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Messaging;
-
-namespace System.Runtime.Remoting.Contexts {
-
- public interface IDynamicMessageSink {
-
- void ProcessMessageFinish (IMessage reply_msg, bool client_site, bool async);
-
- void ProcessMessageStart (IMessage req_msg, bool client_site, bool async);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicProperty.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicProperty.cs
deleted file mode 100644
index e469e24b6f1..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicProperty.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IDynamicProperty..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Runtime.Remoting.Contexts {
-
- public interface IDynamicProperty {
-
- string Name {
- get;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs
deleted file mode 100644
index 0efe8959ff2..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.SynchronizationAttribute..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-using System.Runtime.Remoting.Messaging;
-
-namespace System.Runtime.Remoting.Contexts {
-
- public interface SynchronizationAttribute {
-
- void ProcessMessageFinish (IMessage reply_msg, bool client_site, bool async);
-
- void ProcessMessageStart (IMessage req_msg, bool client_site, bool async);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/Header.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/Header.cs
deleted file mode 100644
index ef932273ba7..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/Header.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.Header.cs
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-using System.Collections;
-
-namespace System.Runtime.Remoting.Messaging {
-
- public class Header {
- public Header (string name, object value) :
- this (name, value, true)
- {
- }
-
- public Header (string name, object value, bool must_understand) :
- this (name, value, must_understand, null)
- {
- }
-
- public Header (string name, object value, bool must_understand, string header_namespace) {
- this.name = name;
- this.value = value;
- this.must_understand = must_understand;
- this.header_namespace = header_namespace;
- }
-
- // properties
-
- public string HeaderNamespace {
- get { return header_namespace; }
- }
-
- public bool MustUnderstand {
- get { return must_understand; }
- }
-
- public string Name {
- get { return name; }
- }
-
- public object Value {
- get { return value; }
- }
-
- // private
-
- private string name;
- private object value;
- private bool must_understand;
- private string header_namespace;
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessage.cs
deleted file mode 100644
index d1a5c0c1207..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessage.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.IMessage.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Runtime.Remoting.Messaging {
-
- public interface IMessage {
-
- IDictionary Properties {
- get;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodMessage.cs
deleted file mode 100644
index cc21de7f287..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodMessage.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.IMethodMessage..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Reflection;
-
-namespace System.Runtime.Remoting.Messaging {
-
- public interface IMethodMessage {
- int ArgCount {
- get;
- }
-
- object [] Args {
- get;
- }
-
- bool HasVarArgs {
- get;
- }
-
- LogicalCallContext LogicalCalLContext {
- get;
- }
-
- MethodBase MethodBase {
- get;
- }
-
- string MethodName {
- get;
- }
-
- object MethodSignature {
- get;
- }
-
- string TypeName {
- get;
- }
-
- string Uri {
- get;
- }
-
- object GetArg (int arg_num);
- string GetArgName (int arg_num);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs
deleted file mode 100644
index 613de9f756a..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.IMethodReturnMessage..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Remoting.Messaging {
-
- public interface IMethodReturnMessage {
-
- Exception Exception { get; }
- int OutArgCount { get; }
- object [] OutArgs { get; }
- object ReturnValue { get; }
-
- object GetOutArg (int arg_num);
- string GetOutArgName (int arg_num);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs
deleted file mode 100644
index 32ec35848af..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.LogicalCallContext.cs
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Remoting.Messaging {
-
- [MonoTODO]
- public class LogicalCallContext : ISerializable, ICloneable {
- public bool HasInfo {
- get { return false; }
- }
-
- public void FreeNamedDataSlot (string name) {
- }
-
- public object GetData (string name) {
- return null;
- }
-
- public void GetObjectData (SerializationInfo info, StreamingContext context) {
- }
-
- public void SetData (string name, object data) {
- }
-
- public object Clone () {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting/ChangeLog
deleted file mode 100755
index 1d7c354a86b..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/ChangeLog
+++ /dev/null
@@ -1,8 +0,0 @@
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ObjRef.cs : Strew the MonoTODO attribute.
-
-2001-09-02 Miguel de Icaza <miguel@ximian.com>
-
- * ObjRef.cs: Include System.Runtime.Serialization
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting/LeaseState.cs b/mcs/class/corlib/System.Runtime.Remoting/LeaseState.cs
deleted file mode 100755
index 825e6130e0d..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/LeaseState.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// LeaseState.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:40:41 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Remoting {
-
-
- /// <summary>
- /// </summary>
- public enum LeaseState {
-
- /// <summary>
- /// </summary>
- Null = 0,
-
- /// <summary>
- /// </summary>
- Initial = 1,
-
- /// <summary>
- /// </summary>
- Active = 2,
-
- /// <summary>
- /// </summary>
- Renewing = 3,
-
- /// <summary>
- /// </summary>
- Expired = 4,
- } // LeaseState
-
-} // System.Runtime.Remoting
diff --git a/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs b/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs
deleted file mode 100644
index 48a7f551feb..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// System.Runtime.Remoting.ObjRef.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-// FIXME: This is just a skeleton for practical purposes.
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Remoting {
-
- public class ObjRef : IObjectReference, ISerializable {
- MarshalByRefObject mbr;
- SerializationInfo si;
- Type type;
-
- public ObjRef ()
- {
- }
-
- public ObjRef (MarshalByRefObject mbr, Type type)
- {
- this.mbr = mbr;
- this.type = type;
- }
-
- [MonoTODO]
- public ObjRef (SerializationInfo si, StreamingContext sc)
- {
- // FIXME: Implement.
- //
- // This encarnates the object from serialized data.
- }
-
- [MonoTODO]
- public virtual void GetObjectData (SerializationInfo si, StreamingContext sc)
- {
- // FIXME:
- }
-
- [MonoTODO]
- public virtual object GetRealObject (StreamingContext sc)
- {
- // FIXME:
-
- return null;
- }
-
- [MonoTODO]
- public bool IsFromThisAppDomain ()
- {
- // FIXME:
-
- return true;
- }
-
- [MonoTODO]
- public bool IsFromThisProcess ()
- {
- // FIXME:
-
- return true;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting/ObjectHandle.cs b/mcs/class/corlib/System.Runtime.Remoting/ObjectHandle.cs
deleted file mode 100644
index cea43624356..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/ObjectHandle.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Runtime.Remoting.ObjectHandle.cs
-//
-// Author:
-// Dietmar Maurer (dietmr@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Remoting {
-
- public class ObjectHandle : MarshalByRefObject, IObjectReference {
-
- [MonoTODO]
- public ObjectHandle (object o)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override object InitializeLifeTimeService ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public object Unwrap ()
- {
- throw new NotImplementedException ();
- }
-
- public object GetRealObject (StreamingContext context)
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting/SoapMethodOption.cs b/mcs/class/corlib/System.Runtime.Remoting/SoapMethodOption.cs
deleted file mode 100755
index 1a1919e2a9d..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/SoapMethodOption.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// SoapMethodOption.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:41:01 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Remoting {
-
-
- /// <summary>
- /// </summary>
- public enum SoapMethodOption {
-
- /// <summary>
- /// </summary>
- SoapAction = 0,
-
- /// <summary>
- /// </summary>
- MethodURI = 1,
-
- /// <summary>
- /// </summary>
- ResponseName = 2,
-
- /// <summary>
- /// </summary>
- ReturnElement = 3,
- } // SoapMethodOption
-
-} // System.Runtime.Remoting
diff --git a/mcs/class/corlib/System.Runtime.Remoting/SoapOption.cs b/mcs/class/corlib/System.Runtime.Remoting/SoapOption.cs
deleted file mode 100755
index e334e53c239..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/SoapOption.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// SoapOption.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:41:11 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Remoting {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum SoapOption {
-
- /// <summary>
- /// </summary>
- AlwaysIncludeTypes = 1,
-
- /// <summary>
- /// </summary>
- XsdString = 2,
- } // SoapOption
-
-} // System.Runtime.Remoting
diff --git a/mcs/class/corlib/System.Runtime.Remoting/WellKnownObjectMode.cs b/mcs/class/corlib/System.Runtime.Remoting/WellKnownObjectMode.cs
deleted file mode 100755
index 24898ead85e..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/WellKnownObjectMode.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// WellKnownObjectMode.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:40:51 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Remoting {
-
-
- /// <summary>
- /// </summary>
- public enum WellKnownObjectMode {
-
- /// <summary>
- /// </summary>
- Singleton = 1,
-
- /// <summary>
- /// </summary>
- SingleCall = 2,
- } // WellKnownObjectMode
-
-} // System.Runtime.Remoting
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs
deleted file mode 100755
index c73656e838a..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// BinaryArrayTypeEnum.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:42:50 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters.Binary {
-
-
- /// <summary>
- /// </summary>
- public enum BinaryArrayTypeEnum {
-
- /// <summary>
- /// </summary>
- Single = 0,
-
- /// <summary>
- /// </summary>
- Jagged = 1,
-
- /// <summary>
- /// </summary>
- Rectangular = 2,
-
- /// <summary>
- /// </summary>
- SingleOffset = 3,
-
- /// <summary>
- /// </summary>
- JaggedOffset = 4,
-
- /// <summary>
- /// </summary>
- RectangularOffset = 5,
- } // BinaryArrayTypeEnum
-
-} // System.Runtime.Serialization.Formatters.Binary
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/ChangeLog b/mcs/class/corlib/System.Runtime.Serialization.Formatters/ChangeLog
deleted file mode 100644
index 97f1def7827..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/ChangeLog
+++ /dev/null
@@ -1,5 +0,0 @@
-2002-01-21 David Dawkins <david@dawkins.st>
-
- * IFieldInfo.cs : New file
- * ISoapMessage.cs : New file
-
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs
deleted file mode 100755
index 944f8a68d2f..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// FormatterAssemblyStyle.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:43:19 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum FormatterAssemblyStyle {
-
- /// <summary>
- /// </summary>
- Simple = 0,
-
- /// <summary>
- /// </summary>
- Full = 1,
- } // FormatterAssemblyStyle
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs
deleted file mode 100755
index 2bba90aaafa..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// FormatterTopObjectStyle.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:42:59 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum FormatterTopObjectStyle {
-
- /// <summary>
- /// </summary>
- Object = 0,
-
- /// <summary>
- /// </summary>
- SoapMessage = 1,
- } // FormatterTopObjectStyle
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs
deleted file mode 100755
index c719b3eea56..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// FormatterTypeStyle.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:43:09 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum FormatterTypeStyle {
-
- /// <summary>
- /// </summary>
- TypesWhenNeeded = 0,
-
- /// <summary>
- /// </summary>
- TypesAlways = 1,
-
- /// <summary>
- /// </summary>
- XsdString = 2,
- } // FormatterTypeStyle
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/IFieldInfo.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/IFieldInfo.cs
deleted file mode 100644
index 1aba9e2cd14..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/IFieldInfo.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Runtime.Serialization.Formatters.IFieldInfo
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-namespace System.Runtime.Serialization.Formatters {
-
- /// <summary>
- /// Interface for querying field information on serialized objects.</summary>
- public interface IFieldInfo {
-
- /// <summary>
- /// Get or set the field names for serialized objects.</summary>
- string[] FieldNames {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the field types for serialized objects.</summary>
- Type[] FieldTypes {
- get;
- set;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/ISoapMessage.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/ISoapMessage.cs
deleted file mode 100644
index f43d55a6a73..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/ISoapMessage.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Runtime.Serialization.Formatters.ISoapMessage
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-using System.Runtime.Remoting.Messaging;
-
-namespace System.Runtime.Serialization.Formatters {
-
- /// <summary>
- /// Interface for making SOAP method calls</summary>
- public interface ISoapMessage {
-
- /// <summary>
- /// Get or set the headers ("out-of-band" data) for the method call</summary>
- Header[] Headers {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the method name</summary>
- string MethodName {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the method parameter names</summary
- string[] ParamNames {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the method parameter types</summary
- Type[] ParamTypes {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the method parameter values</summary
- object[] ParamValues {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the XML namespace for the location of the called object</summary
- string XmlNameSpace {
- get;
- set;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs
deleted file mode 100755
index 5c8f704520e..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// InternalArrayTypeE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:43:29 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalArrayTypeE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Single = 1,
-
- /// <summary>
- /// </summary>
- Jagged = 2,
-
- /// <summary>
- /// </summary>
- Rectangular = 3,
-
- /// <summary>
- /// </summary>
- Base64 = 4,
- } // InternalArrayTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalElementTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalElementTypeE.cs
deleted file mode 100755
index 2112390e67d..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalElementTypeE.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// InternalElementTypeE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:43:49 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalElementTypeE {
-
- /// <summary>
- /// </summary>
- ObjectBegin = 0,
-
- /// <summary>
- /// </summary>
- ObjectEnd = 1,
-
- /// <summary>
- /// </summary>
- Member = 2,
- } // InternalElementTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs
deleted file mode 100755
index 4854703471e..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// InternalMemberTypeE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:44:09 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalMemberTypeE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Header = 1,
-
- /// <summary>
- /// </summary>
- Field = 2,
-
- /// <summary>
- /// </summary>
- Item = 3,
- } // InternalMemberTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberValueE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberValueE.cs
deleted file mode 100755
index 3459d9e43b5..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberValueE.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// InternalMemberValueE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:44:18 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalMemberValueE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- InlineValue = 1,
-
- /// <summary>
- /// </summary>
- Nested = 2,
-
- /// <summary>
- /// </summary>
- Reference = 3,
-
- /// <summary>
- /// </summary>
- Null = 4,
- } // InternalMemberValueE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs
deleted file mode 100755
index 6074981b751..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// InternalNameSpaceE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:44:28 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalNameSpaceE {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- Soap = 1,
-
- /// <summary>
- /// </summary>
- XdrPrimitive = 2,
-
- /// <summary>
- /// </summary>
- XdrString = 3,
-
- /// <summary>
- /// </summary>
- UrtSystem = 4,
-
- /// <summary>
- /// </summary>
- UrtUser = 5,
-
- /// <summary>
- /// </summary>
- UserNameSpace = 6,
-
- /// <summary>
- /// </summary>
- MemberName = 7,
-
- /// <summary>
- /// </summary>
- Interop = 8,
-
- /// <summary>
- /// </summary>
- CallElement = 9,
- } // InternalNameSpaceE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs
deleted file mode 100755
index 9229202af82..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// InternalObjectPositionE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:44:38 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalObjectPositionE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Top = 1,
-
- /// <summary>
- /// </summary>
- Child = 2,
-
- /// <summary>
- /// </summary>
- Headers = 3,
- } // InternalObjectPositionE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs
deleted file mode 100755
index 986b6bd4bc1..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// InternalObjectTypeE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:44:48 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalObjectTypeE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Object = 1,
-
- /// <summary>
- /// </summary>
- Array = 2,
- } // InternalObjectTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseStateE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseStateE.cs
deleted file mode 100755
index 87627fcc2bb..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseStateE.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// InternalParseStateE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:44:58 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalParseStateE {
-
- /// <summary>
- /// </summary>
- Initial = 0,
-
- /// <summary>
- /// </summary>
- Object = 1,
-
- /// <summary>
- /// </summary>
- Member = 2,
-
- /// <summary>
- /// </summary>
- MemberChild = 3,
- } // InternalParseStateE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseTypeE.cs
deleted file mode 100755
index 9747bffcbe8..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseTypeE.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-// InternalParseTypeE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:45:08 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalParseTypeE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- SerializedStreamHeader = 1,
-
- /// <summary>
- /// </summary>
- Object = 2,
-
- /// <summary>
- /// </summary>
- Member = 3,
-
- /// <summary>
- /// </summary>
- ObjectEnd = 4,
-
- /// <summary>
- /// </summary>
- MemberEnd = 5,
-
- /// <summary>
- /// </summary>
- Headers = 6,
-
- /// <summary>
- /// </summary>
- HeadersEnd = 7,
-
- /// <summary>
- /// </summary>
- SerializedStreamHeaderEnd = 8,
-
- /// <summary>
- /// </summary>
- Envelope = 9,
-
- /// <summary>
- /// </summary>
- EnvelopeEnd = 10,
-
- /// <summary>
- /// </summary>
- Body = 11,
-
- /// <summary>
- /// </summary>
- BodyEnd = 12,
- } // InternalParseTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs
deleted file mode 100755
index 09adef22214..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-// InternalPrimitiveTypeE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:43:39 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalPrimitiveTypeE {
-
- /// <summary>
- /// </summary>
- Invalid = 0,
-
- /// <summary>
- /// </summary>
- Boolean = 1,
-
- /// <summary>
- /// </summary>
- Byte = 2,
-
- /// <summary>
- /// </summary>
- Char = 3,
-
- /// <summary>
- /// </summary>
- Currency = 4,
-
- /// <summary>
- /// </summary>
- Decimal = 5,
-
- /// <summary>
- /// </summary>
- Double = 6,
-
- /// <summary>
- /// </summary>
- Int16 = 7,
-
- /// <summary>
- /// </summary>
- Int32 = 8,
-
- /// <summary>
- /// </summary>
- Int64 = 9,
-
- /// <summary>
- /// </summary>
- SByte = 10,
-
- /// <summary>
- /// </summary>
- Single = 11,
-
- /// <summary>
- /// </summary>
- TimeSpan = 12,
-
- /// <summary>
- /// </summary>
- DateTime = 13,
-
- /// <summary>
- /// </summary>
- UInt16 = 14,
-
- /// <summary>
- /// </summary>
- UInt32 = 15,
-
- /// <summary>
- /// </summary>
- UInt64 = 16,
- } // InternalPrimitiveTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs
deleted file mode 100755
index 51f70341f93..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// InternalSerializerTypeE.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:43:59 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalSerializerTypeE {
-
- /// <summary>
- /// </summary>
- Soap = 1,
-
- /// <summary>
- /// </summary>
- Binary = 2,
- } // InternalSerializerTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ChangeLog b/mcs/class/corlib/System.Runtime.Serialization/ChangeLog
deleted file mode 100644
index b1e339b0581..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/ChangeLog
+++ /dev/null
@@ -1,73 +0,0 @@
-2002-02-19 Duncan Mak <duncan@ximian.com>
-
- * SurrogateSelector.cs: Implemented.
-
- * SerializationInfoEnumerator.cs: oh, and simplified the Current
- property too.
-
- * SerializationInfo.cs: Forgot to finish up GetEnumerator ().
-
-2002-02-18 Duncan Mak <duncan@ximian.com>
-
- * SerializationInfo.cs: Converted Type.GetType calls to the faster
- typeof operator.
-
-2002-02-16 Duncan Mak <duncan@ximian.com>
-
- * SurrogateSelector.cs: Stubbed out. Gonna be working on this
- tomorrow.
-
-2002-02-15 Duncan Mak <duncan@ximian.com>
-
- * SerializationEntry.cs: Added internal constructor for writing
- bits in SerializationInfoEnumerator.
- * SerializationInfo.cs: Completed.
- * SerializationInfoEnumerator.cs: Implemented. Piggybacking on
- Hashtable's GetEnumerator method.
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * SerializationInfoEnumerator.cs: New file (stub)
-
-2002-02-12 Duncan Mak <duncan@ximian.com>
-
- * SerializationBinder.cs: Implemented.
- * SerializationEntry.cs: Implemented.
- * SerializationInfo.cs: Fixed the get portion of the AssemblyName
- property. Implemented the FullTypename property.
-
-2002-01-06 David Dawkins <david@dawkins.st>
-
- * IFormatter.cs : New file
- * ISerializationSurrogate.cs : New file
- * ISurrogateSelector.cs : New file
-
-2002-05-01 Ravi Pratap <ravi@ximian.com>
-
- * SerializationInfo.cs : Insert MonoTODO attribute.
-
-2001-08-24 Nick Drochak <ndrochak@gol.com>
-
- * IDeserializationCallback.cs: New File
-
-Wed Nov 14 17:03:30 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * IFormatterConverter.cs, SerializationInfo.cs: CLSCompliant updates.
-
-Fri Nov 2 18:40:12 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * SerializationException.cs: implemented.
-
-2001-08-24 Nick Drochak <ndrochak@gol.com>
-
- * SerializationInfo.cs: Added all the public methods so that the compile would not break
-
-2001-07-20 Miguel de Icaza <miguel@ximian.com>
-
- * SerializationInfo.cs: New file.
-
- * IFormatterConverter.cs: New file.
-
- * ISerializable.cs: New file.
-
-
diff --git a/mcs/class/corlib/System.Runtime.Serialization/IDeserializationCallback.cs b/mcs/class/corlib/System.Runtime.Serialization/IDeserializationCallback.cs
deleted file mode 100644
index a889303f51b..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/IDeserializationCallback.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Runtime.Serialization.IDeserializationCallback.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Runtime.Serialization {
- public interface IDeserializationCallback {
- void OnDeserialization(object sender);
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Runtime.Serialization/IFormatter.cs b/mcs/class/corlib/System.Runtime.Serialization/IFormatter.cs
deleted file mode 100644
index d31199a151b..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/IFormatter.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Runtime.Serialization.IFormatter
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-using System.IO;
-
-namespace System.Runtime.Serialization {
-
- /// <summary>
- /// Formatting for serialized objects</summary>
- public interface IFormatter {
-
- //
- // Properties
- //
-
- /// <summary>
- /// Get or set the SerializationBinder used
- /// for looking up types during deserialization</summary>
- SerializationBinder Binder
- {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the StreamingContext used for serialization
- /// and deserialization</summary>
- StreamingContext Context
- {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the SurrogateSelector used by the current
- /// formatter</summary>
- ISurrogateSelector SurrogateSelector
- {
- get;
- set;
- }
-
- /// <summary>
- /// Deserialize data from the specified stream, rebuilding
- /// the object hierarchy</summary>
- object Deserialize(
- Stream serializationStream
- );
-
- /// <summary>
- /// Serialize the specified object to the specified stream.
- /// Object may be the root of a graph of objects to be
- /// serialized</summary>
- object Serialize(
- Stream serializationStream,
- object graph
- );
- }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/IFormatterConverter.cs b/mcs/class/corlib/System.Runtime.Serialization/IFormatterConverter.cs
deleted file mode 100644
index b902ec339a5..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/IFormatterConverter.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Runtime.Serialization.IFormatterConverter.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.Runtime.Serialization {
- [CLSCompliant(false)]
- public interface IFormatterConverter {
- object Convert (object o, Type t);
- object Convert (object o, TypeCode tc);
-
- bool ToBoolean (object o);
- byte ToByte (object o);
- char ToChar (object o);
- DateTime ToDateTime (object o);
- Decimal ToDecimal (object o);
- double ToDouble (object o);
- Int16 ToInt16 (object o);
- Int32 ToInt32 (object o);
- Int64 ToInt64 (object o);
- sbyte ToSByte (object o);
- float ToSingle (object o);
- string ToString (object o);
- UInt16 ToUInt16 (object o);
- UInt32 ToUInt32 (object o);
- UInt64 ToUInt64 (object o);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/IObjectReference.cs b/mcs/class/corlib/System.Runtime.Serialization/IObjectReference.cs
deleted file mode 100644
index 59f5a0200b4..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/IObjectReference.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Runtime.Serialization.IObjectReference.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Serialization {
-
- public interface IObjectReference {
- object GetRealObject (StreamingContext context);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ISerializable.cs b/mcs/class/corlib/System.Runtime.Serialization/ISerializable.cs
deleted file mode 100644
index 64773514eba..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/ISerializable.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Runtime.Serialization.ISerializable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.Runtime.Serialization {
- public interface ISerializable {
- void GetObjectData (SerializationInfo info, StreamingContext context);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ISerializationSurrogate.cs b/mcs/class/corlib/System.Runtime.Serialization/ISerializationSurrogate.cs
deleted file mode 100644
index 21b4ecbb7dd..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/ISerializationSurrogate.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Runtime.Serialization.ISerializationSurrogate
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-namespace System.Runtime.Serialization {
-
- /// <summary>
- /// Interface for serialization surrogates</summary>
- public interface ISerializationSurrogate {
-
- /// <summary>
- /// Get the SerializationInfo necessary to serialize
- /// the specified object </summary>
- /// <param name="obj">Object to be serialized</param>
- /// <param name="info">SerializationInfo to be populated</param>
- /// <param name="context">Destination for serialization</param>
- void GetObjectData(
- object obj,
- SerializationInfo info,
- StreamingContext context
- );
-
- /// <summary>
- /// Populate an object using the specified SerializationInfo </summary>
- /// <param name="obj">Object to be populated</param>
- /// <param name="info">Data used for populating object</param>
- /// <param name="context">Source for deserialization of object</param>
- /// <param name="selector>Starting point for searching for compatible surrogates</param>
- /// <returns>The deserialized object</returns>
- object SetObjectData(
- object obj,
- SerializationInfo info,
- StreamingContext context,
- ISurrogateSelector selector
- );
- }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ISurrogateSelector.cs b/mcs/class/corlib/System.Runtime.Serialization/ISurrogateSelector.cs
deleted file mode 100644
index 442b01789ed..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/ISurrogateSelector.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Runtime.Serialization.ISurrogateSelector
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-namespace System.Runtime.Serialization {
-
- /// <summary>
- /// Creation of serialization surrogate selectors</summary>
- public interface ISurrogateSelector {
-
- /// <summary>
- /// Insert specified selector into available surrogates</summary>
- void ChainSelector( ISurrogateSelector selector );
-
- /// <summary>
- /// Return next surrogate in the surrogate chain</summary>
- ISurrogateSelector GetNextSelector();
-
- /// <summary>
- /// Fetch the surrogate according the specified type, starting
- /// the search from the surrogate selector for the specified
- /// StreamingContext</summary>
- /// <param name="type">Type of the object to be serialized</param>
- /// <param name="context">Context for the serialization/deserialization</para,>
- /// <param name="selector">Upon return, contains a reference to the selector where the returned surrogate was found</param>
- /// <returns>The surrogate for the specified type and context</returns>
- ISerializationSurrogate GetSurrogate(
- Type type,
- StreamingContext context,
- out ISurrogateSelector selector
- );
-
- }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationBinder.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationBinder.cs
deleted file mode 100644
index 30eef514b4d..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationBinder.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Runtime.Serialization.SerializationBinder.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.Serialization
-{
- [Serializable]
- public abstract class SerializationBinder
- {
- // Constructor
- protected SerializationBinder ()
- : base ()
- {
- }
-
- public abstract Type BindToType (string assemblyName, string typeName);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationEntry.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationEntry.cs
deleted file mode 100644
index 8221509892f..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationEntry.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Runtime.Serialization.SerializationEntry.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Serialization
-{
- public struct SerializationEntry
- {
- string name;
- Type objectType;
- object value;
-
- // Properties
- public string Name
- {
- get { return name; }
- }
-
- public Type ObjectType
- {
- get { return objectType; }
- }
-
- public object Value
- {
- get { return value; }
- }
-
- internal SerializationEntry (string name, Type type, object value)
- {
- this.name = name;
- this.objectType = type;
- this.value = value;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationException.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationException.cs
deleted file mode 100755
index 50a0b4df691..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationException.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Runtime.Serialization/SerializationException.cd
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Runtime.Serialization {
-
- public sealed class SerializationException : SystemException {
- // Constructors
- public SerializationException ()
- : base ("An error occurred during (de)serialization")
- {
- }
-
- public SerializationException (string message)
- : base (message)
- {
- }
-
- public SerializationException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationInfo.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationInfo.cs
deleted file mode 100644
index 2cfd4073b7b..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationInfo.cs
+++ /dev/null
@@ -1,262 +0,0 @@
-//
-// System.Runtime.Serialization.SerializationInfo.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-using System;
-using System.Collections;
-
-namespace System.Runtime.Serialization
-{
- public sealed class SerializationInfo
- {
- Hashtable serialized = new Hashtable ();
- string assemblyName; // the assembly being serialized
- string fullTypeName; // the type being serialized.
-
- [CLSCompliant (false)] IFormatterConverter converter;
-
- // Constructor
- [CLSCompliant (false)]
- public SerializationInfo (Type type, IFormatterConverter converter)
- {
- if (type == null && converter == null)
- throw new ArgumentNullException ("Null arguments.");
-
- this.converter = converter;
- assemblyName = type.Assembly.FullName;
- fullTypeName = type.FullName;
- }
-
- // Properties
- public string AssemblyName
- {
- get { return assemblyName; }
-
- set {
- if (value == null)
- throw new ArgumentNullException ("Argument is null.");
- assemblyName = value;
- }
- }
-
- public string FullTypeName
- {
- get { return fullTypeName; }
-
- set {
- if ( value == null)
- throw new ArgumentNullException ("Argument is null.");
- fullTypeName = value;
- }
- }
-
- public int MemberCount
- {
- get { return serialized.Count; }
- }
-
- // Methods
- public void AddValue (string name, object value, Type type)
- {
- if (serialized.ContainsKey (name))
- throw new SerializationException ("Value has been serialized already.");
-
- SerializationEntry values = new SerializationEntry (name, type, value);
- serialized.Add (name, values);
- }
-
- public object GetValue (string name, Type type)
- {
- if (name == null)
- throw new ArgumentNullException ("name is null.");
- if (!serialized.ContainsKey (name))
- throw new SerializationException ("No element named " + name + " could be found.");
-
- SerializationEntry values = (SerializationEntry) serialized [name];
-
- if (values.ObjectType != type)
- throw new InvalidCastException ("Invalid Type casting.");
-
- return values.Value;
- }
-
- public void SetType (Type type)
- {
- if (type == null)
- throw new ArgumentNullException ("type is null.");
-
- fullTypeName = type.FullName;
- assemblyName = type.Assembly.FullName;
- }
-
- public SerializationInfoEnumerator GetEnumerator ()
- {
- return new SerializationInfoEnumerator (serialized);
- }
-
- [CLSCompliant(false)]
- public void AddValue (string name, short value)
- {
- AddValue (name, value, typeof (System.Int16));
- }
-
- [CLSCompliant(false)]
- public void AddValue (string name, UInt16 value)
- {
- AddValue (name, value, typeof (System.UInt16));
- }
-
- public void AddValue (string name, int value)
- {
- AddValue (name, value, typeof (System.Int32));
- }
-
- public void AddValue (string name, byte value)
- {
- AddValue (name, value, typeof (System.Byte));
- }
-
- public void AddValue (string name, bool value)
- {
- AddValue (name, value, typeof (System.Boolean));
- }
-
- public void AddValue (string name, char value)
- {
- AddValue (name, value, typeof (System.Char));
- }
-
- [CLSCompliant(false)]
- public void AddValue (string name, SByte value)
- {
- AddValue (name, value, typeof (System.SByte));
- }
-
- public void AddValue (string name, double value)
- {
- AddValue (name, value, typeof (System.Double));
- }
-
- public void AddValue (string name, Decimal value)
- {
- AddValue (name, value, typeof (System.Decimal));
- }
-
- public void AddValue (string name, DateTime value)
- {
- AddValue (name, value, typeof (System.DateTime));
- }
-
- public void AddValue (string name, float value)
- {
- AddValue (name, value, typeof (System.Single));
- }
-
- [CLSCompliant(false)]
- public void AddValue (string name, UInt32 value)
- {
- AddValue (name, value, typeof (System.UInt32));
- }
-
- public void AddValue (string name, long value)
- {
- AddValue (name, value, typeof (System.Int64));
- }
-
- [CLSCompliant(false)]
- public void AddValue (string name, UInt64 value)
- {
- AddValue (name, value, typeof (System.UInt64));
- }
-
- public void AddValue (string name, object value)
- {
- AddValue (name, value, value.GetType ());
- }
-
- public bool GetBoolean (string name)
- {
- return (bool) GetValue (name, typeof (System.Boolean));
- }
-
- public byte GetByte (string name)
- {
- return (byte) GetValue (name, typeof (System.Byte));
- }
-
- public char GetChar (string name)
- {
- return (char) GetValue (name, typeof (System.Char));
- }
-
- public DateTime GetDateTime (string name)
- {
- return (DateTime) GetValue (name, typeof (System.DateTime));
- }
-
- public Decimal GetDecimal (string name)
- {
- return (Decimal) GetValue (name, typeof (System.Decimal));
- }
-
- public double GetDouble (string name)
- {
- return (double) GetValue (name, typeof (System.Double));
- }
-
- public short GetInt16 (string name)
- {
- return (short) GetValue (name, typeof (System.Int16));
- }
-
- public int GetInt32 (string name)
- {
- return (int) GetValue (name, typeof (System.Int32));
- }
-
- public long GetInt64 (string name)
- {
- return (long) GetValue (name, typeof (System.Int64));
- }
-
- [CLSCompliant(false)]
- public SByte GetSByte (string name)
- {
- return (sbyte) GetValue (name, typeof (System.SByte));
- }
-
- public float GetSingle (string name)
- {
- return (float) GetValue (name, typeof (System.Single));
- }
-
- public string GetString (string name)
- {
- return (string) GetValue (name, typeof (System.String));
- }
-
- [CLSCompliant(false)]
- public UInt16 GetUInt16 (string name)
- {
- return (UInt16) GetValue (name, typeof (System.UInt16));
- }
-
- [CLSCompliant(false)]
- public UInt32 GetUInt32 (string name)
- {
- return (UInt32) GetValue (name, typeof (System.UInt32));
- }
- [CLSCompliant(false)]
- public UInt64 GetUInt64 (string name)
- {
- return (UInt64) GetValue (name, typeof (System.UInt64));
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationInfoEnumerator.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationInfoEnumerator.cs
deleted file mode 100644
index a4d50af1d70..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationInfoEnumerator.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Runtime.Serialization.SerializationInfoEnumerator.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Serialization
-{
- public sealed class SerializationInfoEnumerator : IEnumerator
- {
- IDictionaryEnumerator ide;
-
- // Constructor
- internal SerializationInfoEnumerator (Hashtable collection)
- {
- ide = collection.GetEnumerator ();
- }
-
- // Properties
- public SerializationEntry Current
- {
- get { return (SerializationEntry) ide.Value; }
- }
-
- object IEnumerator.Current
- {
- get { return ide.Value; }
- }
-
- public string Name
- {
- get { return this.Current.Name; }
- }
-
- public Type ObjectType
- {
- get { return this.Current.ObjectType; }
- }
-
- public object Value
- {
- get { return this.Current.Value; }
- }
-
- // Methods
- public bool MoveNext ()
- {
- return ide.MoveNext ();
- }
-
- public void Reset ()
- {
- ide.Reset ();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/StreamingContext.cs b/mcs/class/corlib/System.Runtime.Serialization/StreamingContext.cs
deleted file mode 100644
index c91bfe84858..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/StreamingContext.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Runtime.Serialization.StreamingContext.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Serialization {
-
- public struct StreamingContext {
- StreamingContextStates state;
- object additional;
-
- public StreamingContext (StreamingContextStates state)
- {
- this.state = state;
- additional = null;
- }
-
- public StreamingContext (StreamingContextStates state, object additional)
- {
- this.state = state;
- this.additional = additional;
- }
-
- public object Context {
- get {
- return additional;
- }
- }
-
- public StreamingContextStates State {
- get {
- return state;
- }
- }
-
- override public bool Equals (Object o)
- {
- StreamingContext other;
-
- if (!(o is StreamingContext))
- return false;
-
- other = (StreamingContext) o;
-
- return (other.state == this.state) && (other.additional == this.additional);
- }
-
- override public int GetHashCode ()
- {
- return (int) state;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/StreamingContextStates.cs b/mcs/class/corlib/System.Runtime.Serialization/StreamingContextStates.cs
deleted file mode 100644
index c9a29d85387..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/StreamingContextStates.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// StreamingContextStates.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:45:18 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization {
-
-
- /// <summary>
- /// </summary>
- public enum StreamingContextStates {
-
- /// <summary>
- /// </summary>
- CrossProcess = 1,
-
- /// <summary>
- /// </summary>
- CrossMachine = 2,
-
- /// <summary>
- /// </summary>
- File = 4,
-
- /// <summary>
- /// </summary>
- Persistence = 8,
-
- /// <summary>
- /// </summary>
- Remoting = 16,
-
- /// <summary>
- /// </summary>
- Other = 32,
-
- /// <summary>
- /// </summary>
- Clone = 64,
-
- /// <summary>
- /// </summary>
- All = 127,
- } // StreamingContextStates
-
-} // System.Runtime.Serialization
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SurrogateSelector.cs b/mcs/class/corlib/System.Runtime.Serialization/SurrogateSelector.cs
deleted file mode 100644
index ec01dfe4d20..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SurrogateSelector.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Runtime.Serialization.SurrogateSelector.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Runtime.Serialization
-{
- public class SurrogateSelector : ISurrogateSelector
- {
- // Fields
- Hashtable Surrogates = new Hashtable ();
- string currentKey = null; // current key of Surrogates
-
- internal struct Bundle
- {
- public ISerializationSurrogate surrogate;
- public ArrayList selectors;
-
- public Bundle (ISerializationSurrogate surrogate)
- {
- this.surrogate = surrogate;
- selectors = new ArrayList ();
- }
- }
-
- // Constructor
- public SurrogateSelector()
- : base ()
- {
- }
-
- // Methods
- public virtual void AddSurrogate (Type type,
- StreamingContext context, ISerializationSurrogate surrogate)
- {
- if (type == null || surrogate == null)
- throw new ArgumentNullException ("Null reference.");
-
- currentKey = type.FullName + "#" + context.ToString ();
-
- if (Surrogates.ContainsKey (currentKey))
- throw new ArgumentException ("A surrogate for " + type.FullName + " already exists.");
-
- Bundle values = new Bundle (surrogate);
-
- Surrogates.Add (currentKey, values);
- }
-
- public virtual void ChainSelector (ISurrogateSelector selector)
- {
- if (selector == null)
- throw new ArgumentNullException ("Selector is null.");
-
- Bundle current = (Bundle) Surrogates [currentKey];
- current.selectors.Add (selector);
- }
-
- public virtual ISurrogateSelector GetNextSelector ()
- {
- Bundle current = (Bundle) Surrogates [currentKey];
- return (ISurrogateSelector) current.selectors [current.selectors.Count];
- }
-
- public virtual ISerializationSurrogate GetSurrogate (Type type,
- StreamingContext context, out ISurrogateSelector selector)
- {
- if (type == null)
- throw new ArgumentNullException ("type is null.");
-
- string key = type.FullName + "#" + context.ToString ();
- Bundle current = (Bundle) Surrogates [key];
- selector = (ISurrogateSelector) current.selectors [current.selectors.Count - 1];
-
- return (ISerializationSurrogate) current.surrogate;
- }
-
- public virtual void RemoveSurrogate (Type type, StreamingContext context)
- {
- if (type == null)
- throw new ArgumentNullException ("type is null.");
-
- string key = type.FullName + "#" + context.ToString ();
- Surrogates.Remove (key);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricAlgorithm.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricAlgorithm.cs
deleted file mode 100755
index e0f57333bab..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricAlgorithm.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricAlgorithm Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all cryptographic asymmetric algorithms.
- /// Available algorithms include:
- /// RSA, DSA
- /// </summary>
- public abstract class AsymmetricAlgorithm {
- protected int KeySizeValue; // The size of the secret key used by the symmetric algorithm in bits.
- protected KeySizes[] LegalKeySizesValue; // Specifies the key sizes that are supported by the symmetric algorithm.
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected AsymmetricAlgorithm () {
- throw new CryptographicException();
- }
-
- /// <summary>
- /// Gets the key exchange algorithm
- /// </summary>
- public abstract string KeyExchangeAlgorithm {get;}
-
- /// <summary>
- /// Gets or sets the actual key size
- /// </summary>
- public virtual int KeySize {
- get {
- return this.KeySizeValue;
- }
- set {
- if (!IsLegalKeySize(this.LegalKeySizesValue, value))
- throw new CryptographicException("key size not supported by algorithm");
-
- this.KeySizeValue = value;
- }
- }
-
- /// <summary>
- /// Gets all legal key sizes
- /// </summary>
- public virtual KeySizes[] LegalKeySizes {
- get {
- return this.LegalKeySizesValue;
- }
- }
-
- /// <summary>
- /// Gets the signature algorithm
- /// </summary>
- public abstract string SignatureAlgorithm {get;}
-
- /// <summary>
- /// Reconstructs the AsymmetricAlgorithm Object from an XML-string
- /// </summary>
- public abstract void FromXmlString(string xmlString);
-
- /// <summary>
- /// Returns an XML string representation the current AsymmetricAlgorithm object
- /// </summary>
- public abstract string ToXmlString(bool includePrivateParameters);
-
- private bool IsLegalKeySize(KeySizes[] LegalKeys, int Size) {
- foreach (KeySizes LegalKeySize in LegalKeys) {
- for (int i=LegalKeySize.MinSize; i<=LegalKeySize.MaxSize; i+=LegalKeySize.SkipSize) {
- if (i == Size)
- return true;
- }
- }
- return false;
- }
-
- /// <summary>
- /// Checks wether the given keyLength is valid for the current algorithm
- /// </summary>
- /// <param name="bitLength">the given keyLength</param>
- public bool ValidKeySize(int bitLength) {
- return IsLegalKeySize(LegalKeySizesValue, bitLength);
- }
-
- /// <summary>
- /// Creates the default implementation of the default asymmetric algorithm (RSA).
- /// </summary>
- public static AsymmetricAlgorithm Create () {
- return RSA.Create();;
- }
-
- /// <summary>
- /// Creates a specific implementation of the given asymmetric algorithm.
- /// </summary>
- /// <param name="algName">the given algorithm</param>
- [MonoTODO]
- public static AsymmetricAlgorithm Create (string algName) {
- // TODO: use reflection to create a new instance of the given algorithm
- return null;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs
deleted file mode 100755
index 78ee4ce669c..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricKeyExchangeDeformatter Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all asymmetric key exchange deformatter.
- /// Available derived classes:
- /// RSAOAEPKeyExchangeDeformatter, RSAPKCS1KeyExchangeDeformatter
- /// </summary>
- public abstract class AsymmetricKeyExchangeDeformatter {
-
- /// <summary>
- /// constructor, no idea why it is here (abstract class) :-)
- /// just for compatibility with MS
- /// </summary>
- public AsymmetricKeyExchangeDeformatter() {
- }
-
- /// <summary>
- /// XML string containing the parameters of an asymmetric key exchange operation
- /// </summary>
- public abstract string Parameters {get; set;}
-
- /// <summary>
- /// get secret data
- /// </summary>
- public abstract byte[] DecryptKeyExchange(byte[] rgb);
-
- /// <summary>
- /// set the private key
- /// </summary>
- public abstract void SetKey(AsymmetricAlgorithm key);
-
- } // AsymmetricKeyExchangeDeformatter
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs
deleted file mode 100755
index e1b5c0f16de..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricKeyExchangeFormatter Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all asymmetric key exchange formatter.
- /// Available derived classes:
- /// RSAOAEPKeyExchangeFormatter, RSAPKCS1KeyExchangeFormatter
- /// </summary>
- public abstract class AsymmetricKeyExchangeFormatter {
-
- /// <summary>
- /// constructor, no idea why it is here (abstract class) :-)
- /// just for compatibility with MS
- /// </summary>
- public AsymmetricKeyExchangeFormatter() {
- }
-
- /// <summary>
- /// XML string containing the parameters of an asymmetric key exchange operation
- /// </summary>
- public abstract string Parameters {get;}
-
- /// <summary>
- /// create encrypted key exchange data
- /// </summary>
- public abstract byte[] CreateKeyExchange(byte[] data);
-
- /// <summary>
- /// create encrypted key exchange data
- /// </summary>
- public abstract byte[] CreateKeyExchange(byte[] data, Type symAlgType);
-
- /// <summary>
- /// set the private key
- /// </summary>
- public abstract void SetKey(AsymmetricAlgorithm key);
-
- } // AsymmetricKeyExchangeFormatter
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureDeformatter.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureDeformatter.cs
deleted file mode 100755
index 55abce71c5c..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureDeformatter.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricSignatureDeformatter Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all asymmetric signature deformatter.
- /// Available derived classes:
- /// DSASignatureDeformatter, RSAPKCS1SignatureDeformatter
- /// </summary>
- public abstract class AsymmetricSignatureDeformatter {
-
- /// <summary>
- /// constructor, no idea why it is here (abstract class) :-)
- /// just for compatibility with MS
- /// </summary>
- public AsymmetricSignatureDeformatter() {
- }
-
- /// <summary>
- /// Sets the hash algorithm used for verifying a signature
- /// </summary>
- public abstract void SetHashAlgorithm(string strName);
-
- /// <summary>
- /// set the private key
- /// </summary>
- public abstract void SetKey(AsymmetricAlgorithm key);
-
- /// <summary>
- /// Verifies the given Signature
- /// </summary>
- public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature);
-
- /// <summary>
- /// Verifies the given Signature with the given hash algorithm
- /// </summary>
- public virtual bool VerifySignature(HashAlgorithm hash, byte[] rgbSignature) {
- return VerifySignature(hash.Hash, rgbSignature);
- }
-
- } // AsymmetricSignatureDeformatter
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureFormatter.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureFormatter.cs
deleted file mode 100755
index 541b8a4faa3..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureFormatter.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricSignatureFormatter Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all asymmetric signature formatter.
- /// Available derived classes:
- /// DSASignatureFormatter, RSAPKCS1SignatureFormatter
- /// </summary>
- public abstract class AsymmetricSignatureFormatter {
-
- /// <summary>
- /// constructor, no idea why it is here (abstract class) :-)
- /// just for compatibility with MS
- /// </summary>
- public AsymmetricSignatureFormatter() {
- }
-
- /// <summary>
- /// Sets the hash algorithm used for verifying a signature
- /// </summary>
- public abstract void SetHashAlgorithm(string strName);
-
- /// <summary>
- /// set the private key
- /// </summary>
- public abstract void SetKey(AsymmetricAlgorithm key);
-
- /// <summary>
- /// Create a signature from the given data
- /// </summary>
- public abstract byte[] CreateSignature(byte[] rgbHash);
-
- /// <summary>
- /// Create a signature from data with the specified hash algorithm
- /// </summary>
- public virtual byte[] CreateSignature(HashAlgorithm hash) {
- return CreateSignature(hash.Hash);
- }
-
- } // AsymmetricSignatureFormatter
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/ChangeLog b/mcs/class/corlib/System.Security.Cryptography/ChangeLog
deleted file mode 100644
index 674c5ea2b81..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/ChangeLog
+++ /dev/null
@@ -1,90 +0,0 @@
-2002-02-21 Mark Crichton <crichton@gimp.org>
-
- * RNGCryptoServiceProvider.cs: New file.
- * RandomNumberGenerator.cs: Constructor is now marked public.
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * DSACryptoServiceProvider.cs, SHA384Managed.cs, SHA512Managed.cs,
- Rijndael.cs, RSA.cs, RSAParameters.cs : New files (stubs)
-
-Mon Feb 11 13:26:17 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * X509Certificates: dummy class.
-
-2002-01-10 Duco Fijma <duco@lorentz.xs4all.nl>
- * Create (trivial) implementation of RandomNumberGenerator
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * CryptoAPITransform.cs, DESCryptoProvider.cs : MonoTODO attribute
- decoration.
-
- * HashAlgorithm.cs, MD5.cs, SHA1.cs, SHA256.cs, SHA384.cs : Ditto.
-
- * SHA512.cs, SymmetricAlgorithm.cs, ToBase64Transform.cs,
- AsymmetricAlgorithm.cs, CryptoStream.cs, DSA.cs, DSASignatureDeformatter.cs,
- DSASignatureFormatter.cs, SignatureDescription.cs : Ditto.
-
-Wed Nov 14 17:04:30 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * MD5CryptoServiceProvider.cs, SHA1CryptoServiceProvider.cs,
- SHA256Managed.cs: CLSCompliant updates.
-
-2001-10-11 Thomas Neidhart <tome@sbox.tugraz.at>
-
- * CryptoAPITransform.cs: Initial version
- * CryptoStream.cs: Initial version
- * CspParameter.cs: Initial version
- * CspProviderFlags.cs: Initial version
- * DSA.cs: Initial version
- * DSAParameters.cs: Initial version
- * DSASignatureDeformatter.cs: Initial version
- * DSASignatureFormatter.cs: Initial version
- * DeriveBytes.cs: Initial version
-
-2001-10-06 Thomas Neidhart <tome@sbox.tugraz.at>
-
- * AsymmetricAlgorithm.cs: Inital version
- * AsymmetricKeyExchangeDeformatter.cs: Initial version
- * AsymmetricKeyExchangeFormatter.cs: Initial version
- * AsymmetricSignatureDeformatter.cs: Initial version
- * AsymmetricSignatureFormatter.cs: Initial version
- * PaddingMode.cs: Added PaddingMode.None
- * SignatureDescription.cs: Initial version
- * CryptographicException.cs: Initial version
- * CryptographicUnknownOperationException.cs: Initial version
- * SymmetricAlgorithm.cs: Implemented CreateDecryptor, CreateEncryptor
- and Create() methods.
-
-2001-08-20 Sergey Chaban <serge@wildwestsoftware.com>
-
- * DES.cs encryption core is about 30% faster than previous version.
- * DESCryptoServiceProvider.cs added PKCS-5 padding.
-
-2001-08-09 Sergey Chaban <serge@wildwestsoftware.com>
-
- * ToBase64Transform.cs: Base64Table now supports both encoding
- and decoding tables. As a result Table was renamed to EncodeTable
- and DecodeTable was added.
- * FromBase64Transform.cs: Initial check-in.
- * DES.cs: Initial check-in.
- * DESCryptoServiceProvider.cs: Initial check-in.
-
-2001-08-01 Matthew S. Ford <Matthew.S.Ford@Rose-Hulman.Edu>
-
- * CipherMode.cs: Initial version.
- * CryptoStreamMode.cs: Initial version.
- * HashAlgorithm.cs: Initial version.
- * ICryptoTransform.cs: Initial version.
- * KeySizes.cs: Initial version.
- * MD5.cs: Initial version.
- * MD5CryptoServiceProvider.cs: Initial version.
- * PaddingMode.cs: Initial version.
- * SHA1.cs: Initial version.
- * SHA1CryptoServiceProvider.cs: Initial version.
- * SHA256.cs: Initial version.
- * SHA256Managed.cs: Initial version.
- * SHA384.cs: Initial version.
- * SHA512.cs: Initial version.
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/CipherMode.cs b/mcs/class/corlib/System.Security.Cryptography/CipherMode.cs
deleted file mode 100644
index e2cab26df53..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CipherMode.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Security.Cryptography CipherMode enumeration
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Block cipher modes of operation.
- /// </summary>
- public enum CipherMode {
- CBC, // Cipher Block Chaining
- CFB, // Cipher Feedback
- CTS, // Cipher Text Stealing
- ECB, // Electronic Codebook
- OFB // Output Feedback
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoAPITransform.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoAPITransform.cs
deleted file mode 100755
index ea16089740e..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptoAPITransform.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Security.Cryptography CryptoAPITransform.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.IO;
-
-namespace System.Security.Cryptography
-{
-
- public sealed class CryptoAPITransform : ICryptoTransform
- {
- public CryptoAPITransform()
- {
- }
-
- /// <summary>
- /// Indicates if the Transform object can transform multiple blocks
- /// </summary>
- [MonoTODO]
- public bool CanTransformMultipleBlocks
- {
- get
- {
- // FIXME: should not be always true
- return true;
- }
- }
-
- [MonoTODO]
- public int InputBlockSize
- {
- get {
- // TODO: implement
- return 0;
- }
- }
-
- [MonoTODO]
- public IntPtr KeyHandle
- {
- get {
- // TODO: implement
- return IntPtr.Zero;
- }
- }
-
- [MonoTODO]
- public int OutputBlockSize
- {
- get {
- // TODO: implement
- return 0;
- }
- }
-
- [MonoTODO]
- public int TransformBlock(byte[] inputBuffer, int inputOffset,
- int inputCount, byte[] outputBuffer, int outputOffset)
- {
- // TODO: implement
- return 0;
- }
-
- [MonoTODO]
- public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
- {
- // TODO: implement
- return null;
- }
-
- } // CryptoAPITransform
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
deleted file mode 100755
index 6dad1ca628d..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// System.Security.Cryptography CryptoStream.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.IO;
-
-namespace System.Security.Cryptography
-{
-
- public class CryptoStream : Stream
- {
- private CryptoStreamMode _mode;
-
- public CryptoStream(Stream stream, ICryptoTransform transform, CryptoStreamMode mode)
- {
- _mode = mode;
- }
-
- public override bool CanRead
- {
- get {
- switch (_mode) {
- case CryptoStreamMode.Read:
- return true;
-
- case CryptoStreamMode.Write:
- return false;
-
- default:
- return false;
- }
- }
- }
-
- public override bool CanSeek
- {
- get {
- return false;
- }
- }
-
- public override bool CanWrite
- {
- get {
- switch (_mode) {
- case CryptoStreamMode.Read:
- return false;
-
- case CryptoStreamMode.Write:
- return true;
-
- default:
- return false;
- }
- }
- }
-
- public override long Length
- {
- get {
- throw new NotSupportedException("Length property not supported by CryptoStream");
- }
- }
-
- public override long Position
- {
- get {
- throw new NotSupportedException("Position property not supported by CryptoStream");
- }
- set {
- throw new NotSupportedException("Position property not supported by CryptoStream");
- }
- }
-
- [MonoTODO]
- public override int Read(byte[] buffer, int offset, int count)
- {
- // TODO: implement
- return 0;
- }
-
- [MonoTODO]
- public override void Write(byte[] buffer, int offset, int count)
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public override void Flush()
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public void FlushFinalBlock()
- {
- if (_mode != CryptoStreamMode.Write)
- throw new NotSupportedException("cannot flush a non-writeable CryptoStream");
-
- // TODO: implement
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotSupportedException("cannot seek a CryptoStream");
- }
-
- public override void SetLength(long value)
- {
- // LAMESPEC: should throw NotSupportedException like Seek??
- return;
- }
-
- } // CryptoStream
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoStreamMode.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoStreamMode.cs
deleted file mode 100644
index 6e08107b7d2..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptoStreamMode.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Security.Cryptography CryptoStreamMode enumeration
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by authors.
-//
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// FIXME (the comment): Whether the crypto-stream is in read mode or write mode?
- /// </summary>
- public enum CryptoStreamMode {
- Read,
- Write
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptographicException.cs b/mcs/class/corlib/System.Security.Cryptography/CryptographicException.cs
deleted file mode 100755
index 693dcc98fd9..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptographicException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Security.Cryptography.CryptographicException.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- public class CryptographicException : SystemException {
- // Constructors
- public CryptographicException ()
- : base ("Error occured during a cryptographic operation.")
- {
- }
-
- public CryptographicException (int hr)
- {
- HResult = hr;
- }
-
- public CryptographicException (string message)
- : base (message)
- {
- }
-
- public CryptographicException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public CryptographicException (string format, string insert)
- : base (String.Format(format, insert))
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs b/mcs/class/corlib/System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs
deleted file mode 100755
index 904dfb030b9..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Security.Cryptography.CryptographicUnexpectedOperationException.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- public class CryptographicUnexpectedOperationException : SystemException {
- // Constructors
- public CryptographicUnexpectedOperationException ()
- : base ("Error occured during a cryptographic operation.")
- {
- }
-
- public CryptographicUnexpectedOperationException (string message)
- : base (message)
- {
- }
-
- public CryptographicUnexpectedOperationException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public CryptographicUnexpectedOperationException (string format, string insert)
- : base (String.Format(format, insert))
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs b/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs
deleted file mode 100755
index 7c84eaff8af..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Security.Cryptography CspParameters.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// Contains information passed to Crypto Service Providers (CSP)
- /// </summary>
- public sealed class CspParameters
- {
- private CspProviderFlags _Flags;
-
- public CspParameters() : this(1) {}
-
- public CspParameters(int dwTypeIn) : this(dwTypeIn, null) {}
-
- public CspParameters(int dwTypeIn, string strProviderNameIn) : this(dwTypeIn, null, null) {}
-
- public CspParameters(int dwTypeIn, string strProviderNameIn, string strContainerNameIn)
- {
- ProviderType = dwTypeIn;
- ProviderName = strProviderNameIn;
- KeyContainerName = strContainerNameIn;
-
- // not defined in specs, only tested from M$ impl
- KeyNumber = -1;
- }
-
- public string KeyContainerName;
-
- public int KeyNumber;
-
- public string ProviderName;
-
- public int ProviderType;
-
- public CspProviderFlags Flags
- {
- get {
- return _Flags;
- }
-
- set {
- _Flags = value;
- }
- }
-
- } // CspParameters
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/CspProviderFlags.cs b/mcs/class/corlib/System.Security.Cryptography/CspProviderFlags.cs
deleted file mode 100755
index 11857f3eb6c..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CspProviderFlags.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Security.Cryptography CspProviderFlags enumeration
-//
-// Authors:
-// Thomas Neidhart <tome@sbox.tugraz.at>
-//
-
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// CSP Provider Flags
- /// </summary>
- public enum CspProviderFlags {
- UseDefaultKeyContainer,
- UseMachineKeyStore
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/DES.cs b/mcs/class/corlib/System.Security.Cryptography/DES.cs
deleted file mode 100644
index f2d344f21c2..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DES.cs
+++ /dev/null
@@ -1,587 +0,0 @@
-//
-// System.Security.Cryptography.DES
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.Security.Cryptography;
-
-// References: FIPS PUB 46-3
-
-namespace System.Security.Cryptography {
-
- internal sealed class DESCore {
-
- internal static readonly int KEY_BIT_SIZE = 64;
- internal static readonly int KEY_BYTE_SIZE = KEY_BIT_SIZE / 8;
- internal static readonly int BLOCK_BIT_SIZE = 64;
- internal static readonly int BLOCK_BYTE_SIZE = BLOCK_BIT_SIZE / 8;
-
- private byte [] keySchedule;
- private byte [] byteBuff;
- private uint [] dwordBuff;
-
- internal delegate void DESCall (byte [] block, byte [] output);
-
-
- // Ek(Ek(m)) = m
- internal static ulong [] weakKeys = {
- 0x0101010101010101, /* 0000000 0000000 */
- 0xFEFEFEFEFEFEFEFE, /* FFFFFFF FFFFFFF */
- 0x1F1F1F1FE0E0E0E0, /* 0000000 FFFFFFF */
- 0xE0E0E0E01F1F1F1F /* FFFFFFF 0000000 */
- };
-
- // Ek1(Ek2(m)) = m
- internal static ulong [] semiweakKeys = {
- 0x01FE01FE01FE01FE, 0xFE01FE01FE01FE01,
- 0x1FE01FE00EF10EF1, 0xE01FE01FF10EF10E,
- 0x01E001E001F101F1, 0xE001E001F101F101,
- 0x1FFE1FFE0EFE0EFE, 0xFE1FFE1FFE0EFE0E,
- 0x011F011F010E010E, 0x1F011F010E010E01,
- 0xE0FEE0FEF1FEF1FE, 0xFEE0FEE0FEF1FEF1
- };
-
-
-
- // S-boxes from FIPS 46-3, Appendix 1, page 17
- private static byte [] sBoxes = {
- /* S1 */
- 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
- 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
- 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0,
- 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13,
-
- /* S2 */
- 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
- 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5,
- 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15,
- 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9,
-
- /* S3 */
- 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
- 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1,
- 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7,
- 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12,
-
- /* S4 */
- 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
- 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9,
- 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4,
- 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14,
-
- /* S5 */
- 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
- 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6,
- 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14,
- 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3,
-
- /* S6 */
- 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
- 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8,
- 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6,
- 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13,
-
- /* S7 */
- 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1,
- 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6,
- 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2,
- 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12,
-
- /* S8 */
- 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7,
- 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2,
- 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8,
- 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11
- };
-
-
- // P table from page 15, also in Appendix 1, page 18
- private static byte [] pTab = {
- 16-1, 7-1, 20-1, 21-1,
- 29-1, 12-1, 28-1, 17-1,
- 1-1, 15-1, 23-1, 26-1,
- 5-1, 18-1, 31-1, 10-1,
- 2-1, 8-1, 24-1, 14-1,
- 32-1, 27-1, 3-1, 9-1,
- 19-1, 13-1, 30-1, 6-1,
- 22-1, 11-1, 4-1, 25-1
- };
-
-
- // Permuted choice 1 table, PC-1, page 19
- // Translated to zero-based format.
- private static byte [] PC1 = {
- 57-1, 49-1, 41-1, 33-1, 25-1, 17-1, 9-1,
- 1-1, 58-1, 50-1, 42-1, 34-1, 26-1, 18-1,
- 10-1, 2-1, 59-1, 51-1, 43-1, 35-1, 27-1,
- 19-1, 11-1, 3-1, 60-1, 52-1, 44-1, 36-1,
-
- 63-1, 55-1, 47-1, 39-1, 31-1, 23-1, 15-1,
- 7-1, 62-1, 54-1, 46-1, 38-1, 30-1, 22-1,
- 14-1, 6-1, 61-1, 53-1, 45-1, 37-1, 29-1,
- 21-1, 13-1, 5-1, 28-1, 20-1, 12-1, 4-1
- };
-
-
- private static byte [] leftRot = {
- 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1
- };
-
- private static byte [] leftRotTotal;
-
-
-
- // Permuted choice 2 table, PC-2, page 21
- // Translated to zero-based format.
- private static byte [] PC2 = {
- 14-1, 17-1, 11-1, 24-1, 1-1, 5-1,
- 3-1, 28-1, 15-1, 6-1, 21-1, 10-1,
- 23-1, 19-1, 12-1, 4-1, 26-1, 8-1,
- 16-1, 7-1, 27-1, 20-1, 13-1, 2-1,
- 41-1, 52-1, 31-1, 37-1, 47-1, 55-1,
- 30-1, 40-1, 51-1, 45-1, 33-1, 48-1,
- 44-1, 49-1, 39-1, 56-1, 34-1, 53-1,
- 46-1, 42-1, 50-1, 36-1, 29-1, 32-1
- };
-
-
- // Initial permutation IP, page 10.
- // Transposed to 0-based format.
- private static byte [] ipBits = {
- 58-1, 50-1, 42-1, 34-1, 26-1, 18-1, 10-1, 2-1,
- 60-1, 52-1, 44-1, 36-1, 28-1, 20-1, 12-1, 4-1,
- 62-1, 54-1, 46-1, 38-1, 30-1, 22-1, 14-1, 6-1,
- 64-1, 56-1, 48-1, 40-1, 32-1, 24-1, 16-1, 8-1,
- 57-1, 49-1, 41-1, 33-1, 25-1, 17-1, 9-1, 1-1,
- 59-1, 51-1, 43-1, 35-1, 27-1, 19-1, 11-1, 3-1,
- 61-1, 53-1, 45-1, 37-1, 29-1, 21-1, 13-1, 5-1,
- 63-1, 55-1, 47-1, 39-1, 31-1, 23-1, 15-1, 7-1
- };
-
-
- // Final permutation FP = IP^(-1), page 10.
- // Transposed to 0-based format.
- private static byte [] fpBits = {
- 40-1, 8-1, 48-1, 16-1, 56-1, 24-1, 64-1, 32-1,
- 39-1, 7-1, 47-1, 15-1, 55-1, 23-1, 63-1, 31-1,
- 38-1, 6-1, 46-1, 14-1, 54-1, 22-1, 62-1, 30-1,
- 37-1, 5-1, 45-1, 13-1, 53-1, 21-1, 61-1, 29-1,
- 36-1, 4-1, 44-1, 12-1, 52-1, 20-1, 60-1, 28-1,
- 35-1, 3-1, 43-1, 11-1, 51-1, 19-1, 59-1, 27-1,
- 34-1, 2-1, 42-1, 10-1, 50-1, 18-1, 58-1, 26-1,
- 33-1, 1-1, 41-1, 9-1, 49-1, 17-1, 57-1, 25-1
- };
-
-
-
- private static uint [] spBoxes;
- private static int [] ipTab;
- private static int [] fpTab;
-
-
- static DESCore ()
- {
- spBoxes = new uint [64 * 8];
-
- int [] pBox = new int [32];
-
- for (int p = 0; p < 32; p++) {
- for (int i = 0; i < 32; i++) {
- if (p == pTab [i]) {
- pBox [p] = i;
- break;
- }
- }
- }
-
-
- for (int s = 0; s < 8; s++) { // for each S-box
- int sOff = s << 6;
-
- for (int i = 0; i < 64; i++) { // inputs
- uint sp=0;
-
- int indx = (i & 0x20) | ((i & 1) << 4) | ((i >> 1) & 0xF);
-
- for (int j = 0; j < 4; j++) { // for each bit in the output
- if ((sBoxes [sOff + indx] & (8 >> j)) != 0) {
- sp |= (uint) (1 << (31 - pBox [(s << 2) + j]));
- }
- }
-
- spBoxes [sOff + i] = sp;
- }
- }
-
-
- leftRotTotal = new byte [leftRot.Length];
-
-
- for (int i = 0; i < leftRot.Length; i++) {
- int r = 0;
- for (int j = 0; j <= i; r += leftRot [j++]);
- leftRotTotal [i] = (byte) r;
- }
-
-
- InitPermutationTable (ipBits, out ipTab);
- InitPermutationTable (fpBits, out fpTab);
-
- } // class constructor
-
-
-
- // Default constructor.
- internal DESCore ()
- {
- keySchedule = new byte [KEY_BYTE_SIZE * 16];
- byteBuff = new byte [BLOCK_BYTE_SIZE];
- dwordBuff = new uint [BLOCK_BYTE_SIZE / 4];
- }
-
-
-
-
- private static void InitPermutationTable (byte [] pBits, out int [] permTab)
- {
- permTab = new int [8*2 * 8*2 * (64/32)];
-
- for (int i = 0; i < 16; i++) {
- for (int j = 0; j < 16; j++) {
- int offs = (i << 5) + (j << 1);
- for (int n = 0; n < 64; n++) {
- int bitNum = (int) pBits [n];
- if ((bitNum >> 2 == i) &&
- 0 != (j & (8 >> (bitNum & 3)))) {
- permTab [offs + (n >> (3+2))] |= (int) ((0x80808080 & (0xFF << (n & (3 << 3)))) >> (n & 7));
- }
- }
- }
- }
- }
-
-
-
- internal static ulong PackKey (byte [] key)
- {
- ulong res = 0;
- for (int i = 0, sh = 8*KEY_BYTE_SIZE; (sh = sh - 8) >= 0; i++) {
- res |= (ulong) key [i] << sh;
- }
- return res;
- }
-
-
-
- internal static byte [] UnpackKey (ulong key)
- {
- byte [] res = new byte [KEY_BYTE_SIZE];
- for (int i = 0, sh = 8*KEY_BYTE_SIZE; (sh = sh - 8) >= 0; i++) {
- res [i] = (byte) (key >> sh);
- }
- return res;
- }
-
-
-
- internal static bool IsValidKeySize (byte [] key)
- {
- return (key.Length == KEY_BYTE_SIZE);
- }
-
-
-
- private uint CipherFunct(uint r, int n)
- {
- uint res = 0;
- byte [] subkey = keySchedule;
- int i = n << 3;
-
- uint rt = (r >> 1) | (r << 31); // ROR32(r)
- res |= spBoxes [0*64 + (((rt >> 26) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [1*64 + (((rt >> 22) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [2*64 + (((rt >> 18) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [3*64 + (((rt >> 14) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [4*64 + (((rt >> 10) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [5*64 + (((rt >> 6) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [6*64 + (((rt >> 2) ^ subkey [i++]) & 0x3F)];
- rt = (r << 1) | (r >> 31); // ROL32(r)
- res |= spBoxes [7*64 + ((rt ^ subkey [i]) & 0x3F)];
-
- return res;
- }
-
-
- private static void Permutation (byte [] input, byte [] _output, int [] permTab, bool preSwap)
- {
-
- if (preSwap) BSwap (input);
-
- byte [] output = _output;
-
- int offs1 = (((int)(input [0]) >> 4)) << 1;
- int offs2 = (1 << 5) + ((((int)input [0]) & 0xF) << 1);
-
- int d1 = permTab [offs1++] | permTab [offs2++];
- int d2 = permTab [offs1] | permTab [offs2];
-
-
- int max = BLOCK_BYTE_SIZE << 1;
- for (int i = 2, indx = 1; i < max; i += 2, indx++) {
- int ii = (int) input [indx];
- offs1 = (i << 5) + ((ii >> 4) << 1);
- offs2 = ((i + 1) << 5) + ((ii & 0xF) << 1);
-
- d1 |= permTab [offs1++] | permTab [offs2++];
- d2 |= permTab [offs1] | permTab [offs2];
- }
-
- if (preSwap) {
- output [0] = (byte) (d1);
- output [1] = (byte) (d1 >> 8);
- output [2] = (byte) (d1 >> 16);
- output [3] = (byte) (d1 >> 24);
- output [4] = (byte) (d2);
- output [5] = (byte) (d2 >> 8);
- output [6] = (byte) (d2 >> 16);
- output [7] = (byte) (d2 >> 24);
- } else {
- output [0] = (byte) (d1 >> 24);
- output [1] = (byte) (d1 >> 16);
- output [2] = (byte) (d1 >> 8);
- output [3] = (byte) (d1);
- output [4] = (byte) (d2 >> 24);
- output [5] = (byte) (d2 >> 16);
- output [6] = (byte) (d2 >> 8);
- output [7] = (byte) (d2);
- }
- }
-
-
-
-
- private static void BSwap (byte [] byteBuff)
- {
- byte t;
-
- t = byteBuff [0];
- byteBuff [0] = byteBuff [3];
- byteBuff [3] = t;
-
- t = byteBuff [1];
- byteBuff [1] = byteBuff [2];
- byteBuff [2] = t;
-
- t = byteBuff [4];
- byteBuff [4] = byteBuff [7];
- byteBuff [7] = t;
-
- t = byteBuff [5];
- byteBuff [5] = byteBuff [6];
- byteBuff [6] = t;
- }
-
-
-
- internal void SetKey (byte [] key)
- {
- // NOTE: see Fig. 3, Key schedule calculation, at page 20.
-
- Array.Clear (keySchedule, 0, keySchedule.Length);
-
- int keyBitSize = PC1.Length;
-
- byte [] keyPC1 = new byte [keyBitSize]; // PC1-permuted key
- byte [] keyRot = new byte [keyBitSize]; // PC1 & rotated
-
- int indx = 0;
-
- foreach (byte bitPos in PC1) {
- keyPC1 [indx++] = (byte)((key [(int)bitPos >> 3] >> (7 ^ (bitPos & 7))) & 1);
- }
-
-
-
-
- int j;
- for (int i = 0; i < KEY_BYTE_SIZE*2; i++) {
- int b = keyBitSize >> 1;
-
- for (j = 0; j < b; j++) {
- int s = j + (int) leftRotTotal [i];
- keyRot [j] = keyPC1 [s < b ? s : s - b];
- }
-
- for (j = b; j < keyBitSize; j++) {
- int s = j + (int) leftRotTotal [i];
- keyRot [j] = keyPC1 [s < keyBitSize ? s : s - b];
- }
-
- int keyOffs = i * KEY_BYTE_SIZE;
-
- j = 0;
- foreach (byte bitPos in PC2) {
- if (keyRot [(int)bitPos] != 0) {
- keySchedule [keyOffs + (j/6)] |= (byte) (0x80 >> ((j % 6) + 2));
- }
- j++;
- }
- }
-
- }
-
-
-
- internal void Encrypt (byte [] block, byte [] output)
- {
- byte [] dest = (output == null ? block : output);
-
- byte [] byteBuff = this.byteBuff;
- uint [] dwordBuff = this.dwordBuff;
-
- Permutation (block, byteBuff, ipTab, false);
-
- Buffer.BlockCopy (byteBuff, 0, dwordBuff, 0, BLOCK_BYTE_SIZE);
-
- uint d0 = dwordBuff[0];
- uint d1 = dwordBuff[1];
-
- // 16 rounds
- d0 ^= CipherFunct (d1, 0);
- d1 ^= CipherFunct (d0, 1);
- d0 ^= CipherFunct (d1, 2);
- d1 ^= CipherFunct (d0, 3);
- d0 ^= CipherFunct (d1, 4);
- d1 ^= CipherFunct (d0, 5);
- d0 ^= CipherFunct (d1, 6);
- d1 ^= CipherFunct (d0, 7);
- d0 ^= CipherFunct (d1, 8);
- d1 ^= CipherFunct (d0, 9);
- d0 ^= CipherFunct (d1, 10);
- d1 ^= CipherFunct (d0, 11);
- d0 ^= CipherFunct (d1, 12);
- d1 ^= CipherFunct (d0, 13);
- d0 ^= CipherFunct (d1, 14);
- d1 ^= CipherFunct (d0, 15);
-
-
- dwordBuff [0] = d1;
- dwordBuff [1] = d0;
- Buffer.BlockCopy (dwordBuff, 0, byteBuff, 0, BLOCK_BYTE_SIZE);
-
- Permutation (byteBuff, dest, fpTab, true);
- }
-
-
- internal void Decrypt (byte [] block, byte [] output)
- {
- byte [] dest = (output == null ? block : output);
-
- byte [] byteBuff = this.byteBuff;
- uint [] dwordBuff = this.dwordBuff;
-
- Permutation (block, byteBuff, ipTab, false);
-
- Buffer.BlockCopy (byteBuff, 0, dwordBuff, 0, BLOCK_BYTE_SIZE);
-
- uint d1 = dwordBuff [0];
- uint d0 = dwordBuff [1];
-
- // 16 rounds in reverse order
- d1 ^= CipherFunct (d0, 15);
- d0 ^= CipherFunct (d1, 14);
- d1 ^= CipherFunct (d0, 13);
- d0 ^= CipherFunct (d1, 12);
- d1 ^= CipherFunct (d0, 11);
- d0 ^= CipherFunct (d1, 10);
- d1 ^= CipherFunct (d0, 9);
- d0 ^= CipherFunct (d1, 8);
- d1 ^= CipherFunct (d0, 7);
- d0 ^= CipherFunct (d1, 6);
- d1 ^= CipherFunct (d0, 5);
- d0 ^= CipherFunct (d1, 4);
- d1 ^= CipherFunct (d0, 3);
- d0 ^= CipherFunct (d1, 2);
- d1 ^= CipherFunct (d0, 1);
- d0 ^= CipherFunct (d1, 0);
-
- dwordBuff [0] = d0;
- dwordBuff [1] = d1;
-
-
- Buffer.BlockCopy (dwordBuff, 0, byteBuff, 0, BLOCK_BYTE_SIZE);
-
- Permutation (byteBuff, dest, fpTab, true);
- }
-
-
- } // DESCore
-
-
-
-
- public abstract class DES : SymmetricAlgorithm {
- private byte [] key;
-
- public DES ()
- {
- }
-
- [MonoTODO]
- public static new DES Create()
- {
- // TODO: implement
- return null;
- }
-
- [MonoTODO]
- public static new DES Create(string name)
- {
- // TODO: implement
- return null;
- }
-
-
- public static bool IsWeakKey (byte [] rgbKey)
- {
- if (!DESCore.IsValidKeySize (rgbKey)) {
- throw new CryptographicException ();
- }
-
- ulong lk = DESCore.PackKey (rgbKey);
- foreach (ulong wk in DESCore.weakKeys) {
- if (lk == wk) return true;
- }
- return false;
- }
-
-
- public static bool IsSemiWeakKey (byte [] rgbKey)
- {
- if (!DESCore.IsValidKeySize (rgbKey)) {
- throw new CryptographicException ();
- }
-
- ulong lk = DESCore.PackKey (rgbKey);
- foreach (ulong swk in DESCore.semiweakKeys) {
- if (lk == swk) return true;
- }
- return false;
- }
-
- public override byte[] Key {
- get {
- return this.key;
- }
- set {
- this.key = new byte [DESCore.KEY_BYTE_SIZE];
- Array.Copy (value, 0, this.key, 0, DESCore.KEY_BYTE_SIZE);
- }
- }
-
- } // DES
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs
deleted file mode 100644
index 963506e4278..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-//
-// System.Security.Cryptography.DESCryptoServiceProvider
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-
-using System;
-using System.Security.Cryptography;
-
-
-namespace System.Security.Cryptography {
-
-
- internal class DESTransformBase : ICryptoTransform {
-
- internal enum Mode : int {
- ENCRYPTOR = 0,
- DECRYPTOR = 1
- }
-
- protected delegate void Filter (byte [] workBuff);
-
- private DESCore core;
-
- private DESCore.DESCall cryptFn;
- private Filter preprocess;
- private Filter postprocess;
-
- private byte [] iv;
- private byte [] tmpBlock;
-
- protected DESTransformBase (Mode mode, byte [] key, byte [] iv)
- {
- core = new DESCore ();
-
- if (mode == Mode.ENCRYPTOR) {
- cryptFn = new DESCore.DESCall (core.Encrypt);
- preprocess = new Filter (this.EncPreprocess);
- postprocess = new Filter (this.EncPostprocess);
- } else {
- cryptFn = new DESCore.DESCall (core.Decrypt);
- preprocess = new Filter (this.DecPreprocess);
- postprocess = new Filter (this.DecPostprocess);
- }
-
- core.SetKey (key);
- this.iv = new byte [DESCore.BLOCK_BYTE_SIZE];
- Array.Copy (iv, 0, this.iv, 0, DESCore.BLOCK_BYTE_SIZE);
-
- tmpBlock = new byte [DESCore.BLOCK_BYTE_SIZE];
- }
-
-
- public virtual bool CanTransformMultipleBlocks {
- get {
- return true;
- }
- }
-
-
- public virtual int InputBlockSize {
- get {
- return DESCore.BLOCK_BYTE_SIZE;
- }
- }
-
- public virtual int OutputBlockSize {
- get {
- return DESCore.BLOCK_BYTE_SIZE;
- }
- }
-
- private void EncPreprocess (byte [] workBuff)
- {
- byte [] iv = this.iv;
- for (int i = 0; i < DESCore.BLOCK_BYTE_SIZE; i++) {
- workBuff [i] ^= iv [i];
- }
- }
-
- private void EncPostprocess (byte [] workBuff)
- {
- Array.Copy (workBuff, 0, iv, 0, DESCore.BLOCK_BYTE_SIZE);
- }
-
-
- private void DecPreprocess (byte [] workBuff)
- {
- Array.Copy (workBuff, 0, tmpBlock, 0, DESCore.BLOCK_BYTE_SIZE);
- }
-
- private void DecPostprocess (byte [] workBuff)
- {
- EncPreprocess (workBuff);
- Array.Copy (tmpBlock, 0, iv, 0, DESCore.BLOCK_BYTE_SIZE);
- }
-
-
-
- private void Transform (byte [] workBuff)
- {
- preprocess (workBuff);
- cryptFn (workBuff, null);
- postprocess (workBuff);
- }
-
-
- public virtual int TransformBlock (byte [] inputBuffer, int inputOffset, int inputCount, byte [] outputBuffer, int outputOffset)
- {
- if ((inputCount & (DESCore.BLOCK_BYTE_SIZE-1)) != 0)
- throw new CryptographicException ("Invalid input block size.");
-
- if (outputOffset + inputCount > outputBuffer.Length)
- throw new CryptographicException ("Insufficient output buffer size.");
-
- int step = InputBlockSize;
- int offs = inputOffset;
- int full = inputCount / step;
-
- byte [] workBuff = new byte [step];
-
- for (int i = 0; i < full; i++) {
- Array.Copy (inputBuffer, offs, workBuff, 0, step);
- Transform (workBuff);
- Array.Copy (workBuff, 0, outputBuffer, outputOffset, step);
- offs += step;
- outputOffset += step;
- }
-
- return (full * step);
- }
-
-
- [MonoTODO]
- public virtual byte [] TransformFinalBlock (byte [] inputBuffer, int inputOffset, int inputCount)
- {
- // TODO: add decryption support
-
- int num = (inputCount + DESCore.BLOCK_BYTE_SIZE) & (~(DESCore.BLOCK_BYTE_SIZE-1));
- byte [] res = new byte [num];
- int full = num - DESCore.BLOCK_BYTE_SIZE;
-
- TransformBlock (inputBuffer, inputOffset, full, res, 0);
-
- int rem = inputCount & (DESCore.BLOCK_BYTE_SIZE-1);
-
- // PKCS-5 padding
- for (int i = num; --i >= (num - rem);) {
- res [i] = (byte) rem;
- }
-
- Array.Copy (inputBuffer, inputOffset + full, res, full, rem);
-
- // the last padded block will be transformed in-place
- TransformBlock (res, full, DESCore.BLOCK_BYTE_SIZE, res, full);
-
- /*
- byte [] workBuff = new byte [DESCore.BLOCK_BYTE_SIZE];
- Array.Copy (res, full, workBuff, 0, DESCore.BLOCK_BYTE_SIZE);
- preprocess (workBuff);
- cryptFn (workBuff, null);
- Array.Copy (workBuff, 0, res, full, DESCore.BLOCK_BYTE_SIZE);
- */
-
- return res;
- }
-
-
- } // DESTransformBase
-
-
- internal sealed class DESEncryptor : DESTransformBase {
- internal DESEncryptor (byte [] key, byte [] iv)
- : base (DESTransformBase.Mode.ENCRYPTOR, key, iv)
- {
- }
- } // DESEncryptor
-
-
- internal sealed class DESDecryptor : DESTransformBase {
- internal DESDecryptor (byte [] key, byte [] iv)
- : base (DESTransformBase.Mode.DECRYPTOR, key, iv)
- {
- }
- } // DESDecryptor
-
-
- public class DESCryptoServiceProvider {
- private byte [] iv;
- private byte [] key;
-
- public DESCryptoServiceProvider ()
- {
- }
-
-
- //
- // Factories
- //
-
- public virtual ICryptoTransform CreateEncryptor()
- {
- return new DESEncryptor (key, iv);
- }
-
- public virtual ICryptoTransform CreateDecryptor()
- {
- return new DESDecryptor (key, iv);
- }
-
-
-
- // FIXME: Ought to be in DES.cs
-
- [MonoTODO ("Ought to be in DES.cs")]
- public /*override*/ byte[] Key {
- get {
- return this.key;
- }
- set {
- this.key = new byte [DESCore.KEY_BYTE_SIZE];
- Array.Copy (value, 0, this.key, 0, DESCore.KEY_BYTE_SIZE);
- }
- }
-
- public virtual byte[] IV {
- get {
- return this.iv;
- }
- set {
- this.iv = new byte [DESCore.KEY_BYTE_SIZE];
- Array.Copy (value, 0, this.iv, 0, DESCore.KEY_BYTE_SIZE);
- }
- }
-
-
-
-
-
- public override string ToString ()
- {
- return "mono::System.Security.Cryptography.DESCryptoServiceProvider";
- }
-
- } // DESCryptoServiceProvider
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSA.cs b/mcs/class/corlib/System.Security.Cryptography/DSA.cs
deleted file mode 100755
index 35b1aa6796b..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSA.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.Security.Cryptography DSA.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Text;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// Abstract base class for all implementations of the DSA algorithm
- /// </summary>
- public abstract class DSA : AsymmetricAlgorithm
- {
-
- public static new DSA Create()
- {
- return new DSACryptoServiceProvider();
- }
-
- [MonoTODO]
- public static new DSA Create(string algName)
- {
- // TODO: implement
- return null;
- }
-
- public abstract byte[] CreateSignature(byte[] rgbHash);
-
- public abstract DSAParameters ExportParameters(bool includePrivateParameters);
-
- [MonoTODO]
- public override void FromXmlString(string xmlString)
- {
- if (xmlString == null)
- throw new ArgumentNullException();
-
- // TODO: implement
- }
-
- public abstract void ImportParameters(DSAParameters parameters);
-
- public override string ToXmlString(bool includePrivateParameters)
- {
- DSAParameters dsaParams = ExportParameters(includePrivateParameters);
-
- StringBuilder sb = new StringBuilder();
-
- sb.Append("<DSAKeyValue>");
-
- sb.Append("<P>");
- sb.Append(Convert.ToBase64String(dsaParams.P));
- sb.Append("</P>");
-
- sb.Append("<Q>");
- sb.Append(Convert.ToBase64String(dsaParams.Q));
- sb.Append("</Q>");
-
- sb.Append("<G>");
- sb.Append(Convert.ToBase64String(dsaParams.G));
- sb.Append("</G>");
-
- sb.Append("<Y>");
- sb.Append(Convert.ToBase64String(dsaParams.Y));
- sb.Append("</Y>");
-
- sb.Append("<J>");
- sb.Append(Convert.ToBase64String(dsaParams.J));
- sb.Append("</J>");
-
- sb.Append("<Seed>");
- sb.Append(Convert.ToBase64String(dsaParams.Seed));
- sb.Append("</Seed>");
-
- sb.Append("<PgenCounter>");
- string cnt = Convert.ToString(dsaParams.Counter);
- byte[] inArr = new ASCIIEncoding().GetBytes(cnt);
- sb.Append(Convert.ToBase64String(inArr));
- sb.Append("</PgenCounter>");
-
- if (dsaParams.X != null) {
- sb.Append("<X>");
- sb.Append(Convert.ToBase64String(dsaParams.X));
- sb.Append("</X>");
- }
-
- sb.Append("</DSAKeyValue>");
-
- return sb.ToString();
- }
-
- public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature);
-
- } // DSA
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs
deleted file mode 100644
index c7c7158fb67..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// System.Security.Cryptography.DSACryptoServiceProvider.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-using System.IO;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public class DSACryptoServiceProvider : DSA {
- public DSACryptoServiceProvider () { }
- public DSACryptoServiceProvider (CspParameters parameters) { }
- public DSACryptoServiceProvider (int key_size) { }
- public DSACryptoServiceProvider (int key_size, CspParameters parameters) { }
-
- public override string KeyExchangeAlgorithm {
- get { return null; }
- }
-
- public override int KeySize {
- get { return 0; }
- }
-
- public override KeySizes[] LegalKeySizes {
- get { return null; }
- }
-
- public override string SignatureAlgorithm {
- get { return null; }
- }
-
- public bool PersistKeyInCsp {
- get { return false; }
- set { }
- }
-
- public override byte[] CreateSignature (byte[] rgb) {
- return null;
- }
-
- public override bool VerifySignature(byte[] hash, byte[] sig) {
- return false;
- }
-
- public byte[] SignData (byte[] data) {
- return SignData (data, 0, data.Length);
- }
-
- public byte[] SignData (byte[] data, int offset, int count) {
- return null;
- }
-
- public byte[] SignData (Stream data) {
- return null;
- }
-
- public byte[] SignHash (byte[] hash, string str) {
- return null;
- }
-
- public bool VerifyData (byte[] data, byte[] sig) {
- return false;
- }
-
- public override DSAParameters ExportParameters (bool include) {
- return new DSAParameters ();
- }
-
- public override void ImportParameters (DSAParameters parameters) {
- }
-
- public override void FromXmlString(string xmlString) {
- }
-
- public override string ToXmlString(bool includePrivateParameters) {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSAParameters.cs b/mcs/class/corlib/System.Security.Cryptography/DSAParameters.cs
deleted file mode 100755
index 6c98a7c9b50..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSAParameters.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Security.Cryptography DSAParameters.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// DSA Parameters
- /// </summary>
- public struct DSAParameters
- {
- public int Counter;
-
- public byte[] G;
-
- public byte[] J;
-
- public byte[] P;
-
- public byte[] Q;
-
- public byte[] Seed;
-
- [NonSerialized]
- public byte[] X;
-
- public byte[] Y;
-
- } // DSAParameters
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSASignatureDeformatter.cs b/mcs/class/corlib/System.Security.Cryptography/DSASignatureDeformatter.cs
deleted file mode 100755
index 999381a9afe..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSASignatureDeformatter.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Security.Cryptography DSASignatureDeformatter.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// DSA Signature Deformatter
- /// </summary>
- public class DSASignatureDeformatter : AsymmetricSignatureDeformatter
- {
- [MonoTODO]
- public DSASignatureDeformatter()
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public DSASignatureDeformatter(AsymmetricAlgorithm key)
- {
- // TODO: implement
- }
-
-
- public override void SetHashAlgorithm(string strName)
- {
- throw new CryptographicException("This method is not used");
- }
-
- [MonoTODO]
- public override void SetKey(AsymmetricAlgorithm key)
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
- {
- // TODO: implement
- return false;
- }
-
- } // DSASignatureDeformatter
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSASignatureFormatter.cs b/mcs/class/corlib/System.Security.Cryptography/DSASignatureFormatter.cs
deleted file mode 100755
index 2d1a241a8f7..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSASignatureFormatter.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Security.Cryptography DSASignatureFormatter.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// DSA Signature Formatter
- /// </summary>
- public class DSASignatureFormatter : AsymmetricSignatureFormatter
- {
-
- [MonoTODO]
- public DSASignatureFormatter()
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public DSASignatureFormatter(AsymmetricAlgorithm key)
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public override byte[] CreateSignature(byte[] rgbHash)
- {
- // TODO: implement
- return null;
- }
-
- [MonoTODO]
- public override void SetHashAlgorithm(string strName)
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public override void SetKey(AsymmetricAlgorithm key)
- {
- // TODO: implement
- }
-
- } // DSASignatureFormatter
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DeriveBytes.cs b/mcs/class/corlib/System.Security.Cryptography/DeriveBytes.cs
deleted file mode 100755
index 048c4182cd7..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DeriveBytes.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Security.Cryptography DeriveBytes.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// Abstract base class for all classes that derive byte information from an integer
- /// </summary>
- public abstract class DeriveBytes
- {
-
- protected DeriveBytes() {}
-
- public abstract byte[] GetBytes(int cb);
-
- public abstract void Reset();
-
- } // DeriveBytes
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/FromBase64Transform.cs b/mcs/class/corlib/System.Security.Cryptography/FromBase64Transform.cs
deleted file mode 100644
index 16a2f597a8f..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/FromBase64Transform.cs
+++ /dev/null
@@ -1,264 +0,0 @@
-//
-// System.Security.Cryptography.FromBase64Transform
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.Security.Cryptography;
-
-
-namespace System.Security.Cryptography {
-
- public enum FromBase64TransformMode : int {
- IgnoreWhiteSpaces,
- DoNotIgnoreWhiteSpaces
- }
-
- public class FromBase64Transform : ICryptoTransform {
-
- private FromBase64TransformMode mode;
- private byte [] accumulator;
- private byte [] filterBuffer;
- private int accPtr;
-
-
- /// <summary>
- /// Creates a new instance of the decoder
- /// with the default transformation mode (IgnoreWhiteSpaces).
- /// </summary>
- public FromBase64Transform ()
- : this (FromBase64TransformMode.IgnoreWhiteSpaces)
- {
- }
-
-
- /// <summary>
- /// Creates a new instance of the decoder
- /// with the specified transformation mode.
- /// </summary>
- public FromBase64Transform (FromBase64TransformMode mode)
- {
- this.mode = mode;
- accumulator = new byte [4];
- filterBuffer = new byte [4];
- accPtr = 0;
- }
-
-
- /// <summary>
- /// </summary>
- public virtual bool CanTransformMultipleBlocks {
- get {
- return false;
- }
- }
-
-
- /// <summary>
- /// Returns the input block size for the Base64 decoder.
- /// </summary>
- /// <remarks>
- /// The input block size for Base64 decoder is always 1 byte.
- /// </remarks>
- public virtual int InputBlockSize {
- get {
- return 1;
- }
- }
-
-
- /// <summary>
- /// Returns the output block size for the Base64 decoder.
- /// </summary>
- /// <remarks>
- /// The value returned by this property is always 3.
- /// </remarks>
- public virtual int OutputBlockSize {
- get {
- return 3;
- }
- }
-
-
-
- private int Filter (byte [] buffer, int offset, int count)
- {
- int end = offset + count;
- int len = filterBuffer.Length;
- int ptr = 0;
- byte [] filter = this.filterBuffer;
-
- for (int i = offset; i < end; i++) {
- byte b = buffer [i];
- if (!Char.IsWhiteSpace ((char) b)) {
- if (ptr >= len) {
- len <<= 1;
- this.filterBuffer = new byte [len];
- Array.Copy(filter, 0, this.filterBuffer, 0, len >> 1);
- filter = this.filterBuffer;
- }
- filter [ptr++] = b;
- }
- }
-
- return ptr;
- }
-
-
-
-
- private int DoTransform (byte [] inputBuffer,
- int inputOffset,
- int inputCount,
- byte [] outputBuffer,
- int outputOffset)
- {
- int full = inputCount >> 2;
- if (full == 0) return 0;
-
- int rem = 0;
-
- if (inputBuffer[inputCount - 1] == (byte)'=') {
- ++rem;
- --full;
- }
-
- if (inputBuffer[inputCount - 2] == (byte)'=') ++rem;
-
- byte [] lookup = Base64Table.DecodeTable;
- int b0,b1,b2,b3;
-
- for (int i = 0; i < full; i++) {
- b0 = lookup [inputBuffer [inputOffset++]];
- b1 = lookup [inputBuffer [inputOffset++]];
- b2 = lookup [inputBuffer [inputOffset++]];
- b3 = lookup [inputBuffer [inputOffset++]];
-
- outputBuffer [outputOffset++] = (byte) ((b0 << 2) | (b1 >> 4));
- outputBuffer [outputOffset++] = (byte) ((b1 << 4) | (b2 >> 2));
- outputBuffer [outputOffset++] = (byte) ((b2 << 6) | b3);
- }
-
- int res = full * 3;
-
- switch (rem) {
- case 0:
- break;
- case 1:
- b0 = lookup [inputBuffer [inputOffset++]];
- b1 = lookup [inputBuffer [inputOffset++]];
- b2 = lookup [inputBuffer [inputOffset++]];
- outputBuffer [outputOffset++] = (byte) ((b0 << 2) | (b1 >> 4));
- outputBuffer [outputOffset++] = (byte) ((b1 << 4) | (b2 >> 2));
- res += 2;
- break;
- case 2:
- b0 = lookup [inputBuffer [inputOffset++]];
- b1 = lookup [inputBuffer [inputOffset++]];
- outputBuffer [outputOffset++] = (byte) ((b0 << 2) | (b1 >> 4));
- ++res;
- break;
- default:
- break;
- }
-
- return res;
- }
-
-
- /// <summary>
- /// </summary>
- public virtual int TransformBlock (byte [] inputBuffer,
- int inputOffset,
- int inputCount,
- byte [] outputBuffer,
- int outputOffset)
- {
- int n;
- byte [] src;
- int srcOff;
- int res = 0;
-
- if (mode == FromBase64TransformMode.IgnoreWhiteSpaces) {
- n = Filter (inputBuffer, inputOffset, inputCount);
- src = filterBuffer;
- srcOff = 0;
- } else {
- n = inputCount;
- src = inputBuffer;
- srcOff = inputOffset;
- }
-
-
- int count = accPtr + n;
-
- if (count < 4) {
- Array.Copy (src, srcOff, accumulator, accPtr, n);
- accPtr = count;
- } else {
- byte [] tmpBuff = new byte [count];
- Array.Copy (accumulator, 0, tmpBuff, 0, accPtr);
- Array.Copy (src, srcOff, tmpBuff, accPtr, n);
- accPtr = count & 3;
- Array.Copy (src, srcOff + (n - accPtr), accumulator, 0, accPtr);
- res = DoTransform (tmpBuff, 0, count & (~3), outputBuffer, outputOffset);
- }
-
-
- return res;
- }
-
-
-
-
-
- /// <summary>
- /// </summary>
- public virtual byte [] TransformFinalBlock (byte [] inputBuffer,
- int inputOffset,
- int inputCount)
- {
- byte [] src;
- int srcOff;
- int n;
-
- if (mode == FromBase64TransformMode.IgnoreWhiteSpaces) {
- n = Filter (inputBuffer, inputOffset, inputCount);
- src = filterBuffer;
- srcOff = 0;
- } else {
- n = inputCount;
- src = inputBuffer;
- srcOff = inputOffset;
- }
-
-
- int dataLen = accPtr + n;
- byte [] tmpBuf = new byte [dataLen];
-
- int resLen = ((dataLen) >> 2) * 3;
- byte [] res = new byte [resLen];
-
- Array.Copy (accumulator, 0, tmpBuf, 0, accPtr);
- Array.Copy (src, srcOff, tmpBuf, accPtr, n);
-
- DoTransform (tmpBuf, 0, dataLen, res, 0);
-
- accPtr = 0;
- return res;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override string ToString ()
- {
- return "mono::System.Security.Cryptography.FromBase64Transform";
- }
-
- } // FromBase64Transform
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/HashAlgorithm.cs b/mcs/class/corlib/System.Security.Cryptography/HashAlgorithm.cs
deleted file mode 100644
index 96166c7d734..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/HashAlgorithm.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// System.Security.Cryptography HashAlgorithm Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
- public abstract class HashAlgorithm : ICryptoTransform {
- protected byte[] HashValue; // Caches the hash after it is calculated. Accessed through the Hash property.
- protected int HashSizeValue; // The size of the hash in bits.
- protected int State; // nonzero when in use; zero when not in use
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected HashAlgorithm () {
-
- }
-
-
- /// <summary>
- /// FIXME: Always true for hashes?
- /// Get whether or not the hash can transform multiple blocks at a time.
- /// </summary>
- [MonoTODO]
- public virtual bool CanTransformMultipleBlocks {
- get {
- return true;
- }
- }
-
- /// <summary>
- /// Computes the entire hash of all the bytes in the byte array.
- /// </summary>
- public virtual byte[] ComputeHash (byte[] input) {
- // inputData = input.Clone();
- HashCore (input, 0, input.Length);
- HashValue = HashFinal ();
- Initialize ();
-
- return HashValue;
- }
-
- /// <summary>
- /// Creates the default implementation of the default hash algorithm (SHA1).
- /// </summary>
- public static HashAlgorithm Create () {
- return SHA1.Create ();
- }
-
- /// <summary>
- /// Creates a specific implementation of the general hash idea.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create.</param>
- [MonoTODO]
- public static HashAlgorithm Create (string st) {
- return Create ();
- }
-
- /// <summary>
- /// Gets the previously computed hash.
- /// </summary>
- public virtual byte[] Hash {
- get {
- return HashValue;
- }
- }
-
- /// <summary>
- /// When overridden in a derived class, drives the hashing function.
- /// </summary>
- /// <param name="rgb"></param>
- /// <param name="start"></param>
- /// <param name="size"></param>
- protected abstract void HashCore (byte[] rgb, int start, int size);
-
- /// <summary>
- /// When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created.
- /// </summary>
- protected abstract byte[] HashFinal ();
-
- /// <summary>
- /// Returns the size in bits of the hash.
- /// </summary>
- public virtual int HashSize {
- get {
- return HashSizeValue;
- }
- }
-
- /// <summary>
- /// When overridden in a derived class, initializes the object to prepare for hashing.
- /// </summary>
- public abstract void Initialize ();
-
- /// <summary>
- /// FIXME: Not quire valid for the hashes? Returns 1?
- /// </summary>
- [MonoTODO]
- public virtual int InputBlockSize {
- get {
- return 1;
- }
- }
-
- /// <summary>
- /// FIXME: Not quire valid for the hashes? Returns 1?
- /// </summary>
- [MonoTODO]
- public virtual int OutputBlockSize {
- get {
- return 1;
- }
- }
-
- /// <summary>
- /// Used for stream chaining. Computes hash as data passes through it.
- /// </summary>
- /// <param name="inputBuffer">The buffer from which to grab the data to be copied.</param>
- /// <param name="inputOffset">The offset into the input buffer to start reading at.</param>
- /// <param name="inputCount">The number of bytes to be copied.</param>
- /// <param name="outputBuffer">The buffer to write the copied data to.</param>
- /// <param name="outputOffset">At what point in the outputBuffer to write the data at.</param>
- public int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) {
-
- Buffer.BlockCopy (inputBuffer, inputOffset, outputBuffer, outputOffset, inputCount);
- HashCore (inputBuffer, inputOffset, inputCount);
-
- return inputCount;
- }
-
- /// <summary>
- /// Used for stream chaining. Computes hash as data passes through it. Finishes off the hash.
- /// </summary>
- /// <param name="inputBuffer">The buffer from which to grab the data to be copied.</param>
- /// <param name="inputOffset">The offset into the input buffer to start reading at.</param>
- /// <param name="inputCount">The number of bytes to be copied.</param>
- public byte[] TransformFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount) {
- byte[] outputBuffer = new byte[inputCount];
-
- Buffer.BlockCopy (inputBuffer, inputOffset, outputBuffer, 0, inputCount);
-
- HashCore (inputBuffer, inputOffset, inputCount);
- HashValue = HashFinal ();
- Initialize ();
-
- return outputBuffer;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/ICryptoTransform.cs b/mcs/class/corlib/System.Security.Cryptography/ICryptoTransform.cs
deleted file mode 100644
index f3d1f0e0df8..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/ICryptoTransform.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Security.Cryptography ICryptoTransform interface
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Crytographic functions that can process a stream of bytes implement this interface.
- /// This works by stringing together one or more ICryptoTransform classes with a stream.
- /// Data is passed from one to the next without the need of outside buffering/intervention.
- /// </summary>
- public interface ICryptoTransform {
-
- /// <summary>
- /// Whether the function can transform multiple blocks at a time.
- /// </summary>
- bool CanTransformMultipleBlocks {get;}
-
- /// <summary>
- /// Size of input blocks for the function.
- /// </summary>
- int InputBlockSize {get;}
-
- /// <summary>
- /// Size of the output blocks of the function.
- /// </summary>
- int OutputBlockSize {get;}
-
- /// <summary>
- /// FIXME: Process some data. A block at a time? Less than a block at a time?
- /// </summary>
- int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
-
- /// <summary>
- /// Processes the final part of the data. Also finalizes the function if needed.
- /// </summary>
- byte[] TransformFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount);
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/KeySizes.cs b/mcs/class/corlib/System.Security.Cryptography/KeySizes.cs
deleted file mode 100644
index 5fef7ec0908..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/KeySizes.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Security.Cryptography KeySizes Class implementation
-//
-// Author:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// This class represents valid ranges of key sizes for ciphers. It is also used to represent block sizes in the same fashion for block ciphers.
- /// </summary>
- public class KeySizes {
- private int _maxSize;
- private int _minSize;
- private int _skipSize;
-
- /// <summary>
- /// Creates a new KeySizes object.
- /// </summary>
- /// <param name="minSize">The minimum size key allowed for this cipher.</param>
- /// <param name="maxSize">The maximum size key allowed for this cipher.</param>
- /// <param name="skipSize">The jump/skip between the valid key sizes.</param>
- public KeySizes (int minSize, int maxSize, int skipSize) {
- _maxSize = maxSize;
- _minSize = minSize;
- _skipSize = skipSize;
- }
-
- /// <summary>
- /// Returns the maximum valid key size;
- /// </summary>
- public int MaxSize {
- get {
- return _maxSize;
- }
- }
-
- /// <summary>
- /// Returns the minimum valid key size;
- /// </summary>
- public int MinSize {
- get {
- return _minSize;
- }
- }
-
- /// <summary>
- /// Returns the skip between valid key sizes;
- /// </summary>
- public int SkipSize {
- get {
- return _skipSize;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/MD5.cs b/mcs/class/corlib/System.Security.Cryptography/MD5.cs
deleted file mode 100644
index 039a3f4bb1d..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/MD5.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Security.Cryptography MD5 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived MD5 iplementations.
- /// </summary>
- public abstract class MD5 : HashAlgorithm {
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected MD5 () {
-
- }
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new MD5 Create () {
- return new MD5CryptoServiceProvider();
- }
-
- /// <summary>
- /// Creates a new derived implementation.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new MD5 Create (string st) {
- return Create();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/MD5CryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/MD5CryptoServiceProvider.cs
deleted file mode 100644
index 6a9dca05e25..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/MD5CryptoServiceProvider.cs
+++ /dev/null
@@ -1,482 +0,0 @@
-//
-// System.Security.Cryptography MD5CryptoServiceProvider Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// C# implementation of the MD5 cryptographic hash function.
- /// </summary>
- public class MD5CryptoServiceProvider : MD5 {
- private const int BLOCK_SIZE_BYTES = 64;
- private const int HASH_SIZE_BYTES = 16;
- private const int HASH_SIZE_BITS = 128;
- [CLSCompliant(false)] protected uint[] _H;
- [CLSCompliant(false)] protected uint count;
- private byte[] _ProcessingBuffer; // Used to start data when passed less than a block worth.
- private int _ProcessingBufferCount; // Counts how much data we have stored that still needs processed.
-
- /// <summary>
- /// Creates a new MD5CryptoServiceProvider.
- /// </summary>
- public MD5CryptoServiceProvider () {
- _H = new uint[4];
- HashSizeValue = HASH_SIZE_BITS;
- _ProcessingBuffer = new byte[BLOCK_SIZE_BYTES];
-
- Initialize();
- }
-
- /// <summary>
- /// Drives the hashing function.
- /// </summary>
- /// <param name="rgb">Byte array containing the data to hash.</param>
- /// <param name="start">Where in the input buffer to start.</param>
- /// <param name="size">Size in bytes of the data in the buffer to hash.</param>
- protected override void HashCore (byte[] rgb, int start, int size) {
- int i;
- State = 1;
-
- if (_ProcessingBufferCount != 0) {
- if (size < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) {
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, size);
- _ProcessingBufferCount += size;
- return;
- }
- else {
- i = (BLOCK_SIZE_BYTES - _ProcessingBufferCount);
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, i);
- ProcessBlock (_ProcessingBuffer, 0);
- _ProcessingBufferCount = 0;
- start += i;
- size -= i;
- }
- }
-
- for (i=0; i<size-size%BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) {
- ProcessBlock (rgb, start+i);
- }
-
- if (size%BLOCK_SIZE_BYTES != 0) {
- System.Buffer.BlockCopy (rgb, size-size%BLOCK_SIZE_BYTES+start, _ProcessingBuffer, 0, size%BLOCK_SIZE_BYTES);
- _ProcessingBufferCount = size%BLOCK_SIZE_BYTES;
- }
- }
-
- /// <summary>
- /// This finalizes the hash. Takes the data from the chaining variables and returns it.
- /// </summary>
- protected override byte[] HashFinal () {
- byte[] hash = new byte[16];
- int i, j;
-
- ProcessFinalBlock(_ProcessingBuffer, 0, _ProcessingBufferCount);
-
- for (i=0; i<4; i++) {
- for (j=0; j<4; j++) {
- hash[i*4+j] = (byte)(_H[i] >> j*8);
- }
- }
-
- return hash;
- }
-
- /// <summary>
- /// Resets the class after use. Called automatically after hashing is done.
- /// </summary>
- public override void Initialize () {
- count = 0;
- _ProcessingBufferCount = 0;
-
- _H[0] = 0x67452301;
- _H[1] = 0xefcdab89;
- _H[2] = 0x98badcfe;
- _H[3] = 0x10325476;
- }
-
- /// <summary>
- /// This is the meat of the hash function. It is what processes each block one at a time.
- /// </summary>
- /// <param name="inputBuffer">Byte array to process data from.</param>
- /// <param name="inputOffset">Where in the byte array to start processing.</param>
- private void ProcessBlock(byte[] inputBuffer, int inputOffset) {
- uint[] buff = new uint[16];
- uint a, b, c, d;
- int i;
-
- count += BLOCK_SIZE_BYTES;
-
- for (i=0; i<16; i++) {
- buff[i] = (uint)(inputBuffer[inputOffset+4*i])
- | (((uint)(inputBuffer[inputOffset+4*i+1])) << 8)
- | (((uint)(inputBuffer[inputOffset+4*i+2])) << 16)
- | (((uint)(inputBuffer[inputOffset+4*i+3])) << 24);
- }
-
- a = _H[0];
- b = _H[1];
- c = _H[2];
- d = _H[3];
-
- // This function was unrolled because it seems to be doubling our performance with current compiler/VM.
- // Possibly roll up if this changes.
-
-
- // ---- Round 1 --------
-
- a += (((c ^ d) & b) ^ d) + (uint) Constants.C0 + buff [0];
- a = (a << 7) | (a >> 25);
- a += b;
-
- d += (((b ^ c) & a) ^ c) + (uint) Constants.C1 + buff [1];
- d = (d << 12) | (d >> 20);
- d += a;
-
- c += (((a ^ b) & d) ^ b) + (uint) Constants.C2 + buff [2];
- c = (c << 17) | (c >> 15);
- c += d;
-
- b += (((d ^ a) & c) ^ a) + (uint) Constants.C3 + buff [3];
- b = (b << 22) | (b >> 10);
- b += c;
-
- a += (((c ^ d) & b) ^ d) + (uint) Constants.C4 + buff [4];
- a = (a << 7) | (a >> 25);
- a += b;
-
- d += (((b ^ c) & a) ^ c) + (uint) Constants.C5 + buff [5];
- d = (d << 12) | (d >> 20);
- d += a;
-
- c += (((a ^ b) & d) ^ b) + (uint) Constants.C6 + buff [6];
- c = (c << 17) | (c >> 15);
- c += d;
-
- b += (((d ^ a) & c) ^ a) + (uint) Constants.C7 + buff [7];
- b = (b << 22) | (b >> 10);
- b += c;
-
- a += (((c ^ d) & b) ^ d) + (uint) Constants.C8 + buff [8];
- a = (a << 7) | (a >> 25);
- a += b;
-
- d += (((b ^ c) & a) ^ c) + (uint) Constants.C9 + buff [9];
- d = (d << 12) | (d >> 20);
- d += a;
-
- c += (((a ^ b) & d) ^ b) + (uint) Constants.C10 + buff [10];
- c = (c << 17) | (c >> 15);
- c += d;
-
- b += (((d ^ a) & c) ^ a) + (uint) Constants.C11 + buff [11];
- b = (b << 22) | (b >> 10);
- b += c;
-
- a += (((c ^ d) & b) ^ d) + (uint) Constants.C12 + buff [12];
- a = (a << 7) | (a >> 25);
- a += b;
-
- d += (((b ^ c) & a) ^ c) + (uint) Constants.C13 + buff [13];
- d = (d << 12) | (d >> 20);
- d += a;
-
- c += (((a ^ b) & d) ^ b) + (uint) Constants.C14 + buff [14];
- c = (c << 17) | (c >> 15);
- c += d;
-
- b += (((d ^ a) & c) ^ a) + (uint) Constants.C15 + buff [15];
- b = (b << 22) | (b >> 10);
- b += c;
-
-
- // ---- Round 2 --------
-
- a += (((b ^ c) & d) ^ c) + (uint) Constants.C16 + buff [1];
- a = (a << 5) | (a >> 27);
- a += b;
-
- d += (((a ^ b) & c) ^ b) + (uint) Constants.C17 + buff [6];
- d = (d << 9) | (d >> 23);
- d += a;
-
- c += (((d ^ a) & b) ^ a) + (uint) Constants.C18 + buff [11];
- c = (c << 14) | (c >> 18);
- c += d;
-
- b += (((c ^ d) & a) ^ d) + (uint) Constants.C19 + buff [0];
- b = (b << 20) | (b >> 12);
- b += c;
-
- a += (((b ^ c) & d) ^ c) + (uint) Constants.C20 + buff [5];
- a = (a << 5) | (a >> 27);
- a += b;
-
- d += (((a ^ b) & c) ^ b) + (uint) Constants.C21 + buff [10];
- d = (d << 9) | (d >> 23);
- d += a;
-
- c += (((d ^ a) & b) ^ a) + (uint) Constants.C22 + buff [15];
- c = (c << 14) | (c >> 18);
- c += d;
-
- b += (((c ^ d) & a) ^ d) + (uint) Constants.C23 + buff [4];
- b = (b << 20) | (b >> 12);
- b += c;
-
- a += (((b ^ c) & d) ^ c) + (uint) Constants.C24 + buff [9];
- a = (a << 5) | (a >> 27);
- a += b;
-
- d += (((a ^ b) & c) ^ b) + (uint) Constants.C25 + buff [14];
- d = (d << 9) | (d >> 23);
- d += a;
-
- c += (((d ^ a) & b) ^ a) + (uint) Constants.C26 + buff [3];
- c = (c << 14) | (c >> 18);
- c += d;
-
- b += (((c ^ d) & a) ^ d) + (uint) Constants.C27 + buff [8];
- b = (b << 20) | (b >> 12);
- b += c;
-
- a += (((b ^ c) & d) ^ c) + (uint) Constants.C28 + buff [13];
- a = (a << 5) | (a >> 27);
- a += b;
-
- d += (((a ^ b) & c) ^ b) + (uint) Constants.C29 + buff [2];
- d = (d << 9) | (d >> 23);
- d += a;
-
- c += (((d ^ a) & b) ^ a) + (uint) Constants.C30 + buff [7];
- c = (c << 14) | (c >> 18);
- c += d;
-
- b += (((c ^ d) & a) ^ d) + (uint) Constants.C31 + buff [12];
- b = (b << 20) | (b >> 12);
- b += c;
-
-
- // ---- Round 3 --------
-
- a += (b ^ c ^ d) + (uint) Constants.C32 + buff [5];
- a = (a << 4) | (a >> 28);
- a += b;
-
- d += (a ^ b ^ c) + (uint) Constants.C33 + buff [8];
- d = (d << 11) | (d >> 21);
- d += a;
-
- c += (d ^ a ^ b) + (uint) Constants.C34 + buff [11];
- c = (c << 16) | (c >> 16);
- c += d;
-
- b += (c ^ d ^ a) + (uint) Constants.C35 + buff [14];
- b = (b << 23) | (b >> 9);
- b += c;
-
- a += (b ^ c ^ d) + (uint) Constants.C36 + buff [1];
- a = (a << 4) | (a >> 28);
- a += b;
-
- d += (a ^ b ^ c) + (uint) Constants.C37 + buff [4];
- d = (d << 11) | (d >> 21);
- d += a;
-
- c += (d ^ a ^ b) + (uint) Constants.C38 + buff [7];
- c = (c << 16) | (c >> 16);
- c += d;
-
- b += (c ^ d ^ a) + (uint) Constants.C39 + buff [10];
- b = (b << 23) | (b >> 9);
- b += c;
-
- a += (b ^ c ^ d) + (uint) Constants.C40 + buff [13];
- a = (a << 4) | (a >> 28);
- a += b;
-
- d += (a ^ b ^ c) + (uint) Constants.C41 + buff [0];
- d = (d << 11) | (d >> 21);
- d += a;
-
- c += (d ^ a ^ b) + (uint) Constants.C42 + buff [3];
- c = (c << 16) | (c >> 16);
- c += d;
-
- b += (c ^ d ^ a) + (uint) Constants.C43 + buff [6];
- b = (b << 23) | (b >> 9);
- b += c;
-
- a += (b ^ c ^ d) + (uint) Constants.C44 + buff [9];
- a = (a << 4) | (a >> 28);
- a += b;
-
- d += (a ^ b ^ c) + (uint) Constants.C45 + buff [12];
- d = (d << 11) | (d >> 21);
- d += a;
-
- c += (d ^ a ^ b) + (uint) Constants.C46 + buff [15];
- c = (c << 16) | (c >> 16);
- c += d;
-
- b += (c ^ d ^ a) + (uint) Constants.C47 + buff [2];
- b = (b << 23) | (b >> 9);
- b += c;
-
-
- // ---- Round 4 --------
-
- a += (((~d) | b) ^ c) + (uint) Constants.C48 + buff [0];
- a = (a << 6) | (a >> 26);
- a += b;
-
- d += (((~c) | a) ^ b) + (uint) Constants.C49 + buff [7];
- d = (d << 10) | (d >> 22);
- d += a;
-
- c += (((~b) | d) ^ a) + (uint) Constants.C50 + buff [14];
- c = (c << 15) | (c >> 17);
- c += d;
-
- b += (((~a) | c) ^ d) + (uint) Constants.C51 + buff [5];
- b = (b << 21) | (b >> 11);
- b += c;
-
- a += (((~d) | b) ^ c) + (uint) Constants.C52 + buff [12];
- a = (a << 6) | (a >> 26);
- a += b;
-
- d += (((~c) | a) ^ b) + (uint) Constants.C53 + buff [3];
- d = (d << 10) | (d >> 22);
- d += a;
-
- c += (((~b) | d) ^ a) + (uint) Constants.C54 + buff [10];
- c = (c << 15) | (c >> 17);
- c += d;
-
- b += (((~a) | c) ^ d) + (uint) Constants.C55 + buff [1];
- b = (b << 21) | (b >> 11);
- b += c;
-
- a += (((~d) | b) ^ c) + (uint) Constants.C56 + buff [8];
- a = (a << 6) | (a >> 26);
- a += b;
-
- d += (((~c) | a) ^ b) + (uint) Constants.C57 + buff [15];
- d = (d << 10) | (d >> 22);
- d += a;
-
- c += (((~b) | d) ^ a) + (uint) Constants.C58 + buff [6];
- c = (c << 15) | (c >> 17);
- c += d;
-
- b += (((~a) | c) ^ d) + (uint) Constants.C59 + buff [13];
- b = (b << 21) | (b >> 11);
- b += c;
-
- a += (((~d) | b) ^ c) + (uint) Constants.C60 + buff [4];
- a = (a << 6) | (a >> 26);
- a += b;
-
- d += (((~c) | a) ^ b) + (uint) Constants.C61 + buff [11];
- d = (d << 10) | (d >> 22);
- d += a;
-
- c += (((~b) | d) ^ a) + (uint) Constants.C62 + buff [2];
- c = (c << 15) | (c >> 17);
- c += d;
-
- b += (((~a) | c) ^ d) + (uint) Constants.C63 + buff [9];
- b = (b << 21) | (b >> 11);
- b += c;
-
-
- _H[0] += a;
- _H[1] += b;
- _H[2] += c;
- _H[3] += d;
- }
-
- /// <summary>
- /// Pads and then processes the final block.
- /// </summary>
- /// <param name="inputBuffer">Buffer to grab data from.</param>
- /// <param name="inputOffset">Position in buffer in bytes to get data from.</param>
- /// <param name="inputCount">How much data in bytes in the buffer to use.</param>
- private void ProcessFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) {
- byte[] fooBuffer;
- int paddingSize;
- int i;
- uint size;
-
- paddingSize = (int)(56 - (inputCount + count) % BLOCK_SIZE_BYTES);
-
- if (paddingSize < 1)
- paddingSize += BLOCK_SIZE_BYTES;
-
-
- fooBuffer = new byte[inputCount+paddingSize+8];
-
- for (i=0; i<inputCount; i++) {
- fooBuffer[i] = inputBuffer[i+inputOffset];
- }
-
- fooBuffer[inputCount] = 0x80;
- for (i=inputCount+1; i<inputCount+paddingSize; i++) {
- fooBuffer[i] = 0x00;
- }
-
- size = (uint)(count+inputCount);
- size *= 8;
- fooBuffer[inputCount+paddingSize] = (byte)((size) >> 0);
- fooBuffer[inputCount+paddingSize+1] = (byte)((size) >> 8);
- fooBuffer[inputCount+paddingSize+2] = (byte)((size) >> 16);
- fooBuffer[inputCount+paddingSize+3] = (byte)((size) >> 24);
-
- fooBuffer[inputCount+paddingSize+4] = 0x00;
- fooBuffer[inputCount+paddingSize+5] = 0x00;
- fooBuffer[inputCount+paddingSize+6] = 0x00;
- fooBuffer[inputCount+paddingSize+7] = 0x00;
-
- ProcessBlock(fooBuffer, 0);
-
- if (inputCount+paddingSize+8 == 128) {
- ProcessBlock(fooBuffer, 64);
- }
- }
-
- private enum Constants : uint {
- C0 = 0xd76aa478, C1 = 0xe8c7b756, C2 = 0x242070db,
- C3 = 0xc1bdceee, C4 = 0xf57c0faf, C5 = 0x4787c62a,
- C6 = 0xa8304613, C7 = 0xfd469501, C8 = 0x698098d8,
- C9 = 0x8b44f7af,C10 = 0xffff5bb1,C11 = 0x895cd7be,
- C12 = 0x6b901122,C13 = 0xfd987193,C14 = 0xa679438e,
- C15 = 0x49b40821,C16 = 0xf61e2562,C17 = 0xc040b340,
- C18 = 0x265e5a51,C19 = 0xe9b6c7aa,C20 = 0xd62f105d,
- C21 = 0x02441453,C22 = 0xd8a1e681,C23 = 0xe7d3fbc8,
- C24 = 0x21e1cde6,C25 = 0xc33707d6,C26 = 0xf4d50d87,
- C27 = 0x455a14ed,C28 = 0xa9e3e905,C29 = 0xfcefa3f8,
- C30 = 0x676f02d9,C31 = 0x8d2a4c8a,C32 = 0xfffa3942,
- C33 = 0x8771f681,C34 = 0x6d9d6122,C35 = 0xfde5380c,
- C36 = 0xa4beea44,C37 = 0x4bdecfa9,C38 = 0xf6bb4b60,
- C39 = 0xbebfbc70,C40 = 0x289b7ec6,C41 = 0xeaa127fa,
- C42 = 0xd4ef3085,C43 = 0x04881d05,C44 = 0xd9d4d039,
- C45 = 0xe6db99e5,C46 = 0x1fa27cf8,C47 = 0xc4ac5665,
- C48 = 0xf4292244,C49 = 0x432aff97,C50 = 0xab9423a7,
- C51 = 0xfc93a039,C52 = 0x655b59c3,C53 = 0x8f0ccc92,
- C54 = 0xffeff47d,C55 = 0x85845dd1,C56 = 0x6fa87e4f,
- C57 = 0xfe2ce6e0,C58 = 0xa3014314,C59 = 0x4e0811a1,
- C60 = 0xf7537e82,C61 = 0xbd3af235,C62 = 0x2ad7d2bb,
- C63 = 0xeb86d391
- }
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/PaddingMode.cs b/mcs/class/corlib/System.Security.Cryptography/PaddingMode.cs
deleted file mode 100644
index 891911e2218..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/PaddingMode.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Security.Cryptography PaddingMode enumeration
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// How to pad the message processed by block ciphers when they don't come out to the being the size of the block.
- /// </summary>
- public enum PaddingMode {
- None,
- PKCS7, // Each byte contains the value of the number of padding bytes.
- Zeros // Append zeros to the message.
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs
deleted file mode 100644
index bf71a10bb17..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Security.Cryptography.RNGCryptoServiceProvider
-//
-// Author: Mark Crichton (crichton@gimp.org)
-//
-// (C) 2002
-//
-
-// "In the beginning there was Chaos,
-// and within this Chaos was Power,
-// Great Power without form."
-// -- The Verrah Rubicon of Verena, Book One
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Security.Cryptography {
-
- public class RNGCryptoServiceProvider : RandomNumberGenerator {
-
- [MonoTODO]
- public RNGCryptoServiceProvider () {
- // This will get some meaning when I figure out what the other
- // three constructors do.
- }
-
- [MonoTODO]
- public RNGCryptoServiceProvider (byte[] rgb) {
- // Ok, not called by app code... someone must call it, though.
- }
-
- [MonoTODO]
- public RNGCryptoServiceProvider (CspParameters cspParams) {
- // Why do I have this feeling this is the MS CryptAPI...
- }
-
- [MonoTODO]
- public RNGCryptoServiceProvider (string str) {
- // More !application code. Interesting...
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override void GetBytes (byte[] data);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override void GetNonZeroBytes (byte[] data);
-
- ~RNGCryptoServiceProvider () {
- // FIN?
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/RSA.cs b/mcs/class/corlib/System.Security.Cryptography/RSA.cs
deleted file mode 100644
index a02dd19cc2b..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RSA.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Security.Cryptography.RSA.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public abstract class RSA : AsymmetricAlgorithm {
- public static new RSA Create () { return null; }
- public static new RSA Create (string alg) { return Create (); }
-
- public RSA () { }
-
- public abstract byte[] EncryptValue (byte[] rgb);
- public abstract byte[] DecryptValue (byte[] rgb);
-
- public abstract RSAParameters ExportParameters (bool include);
- public abstract void ImportParameters (RSAParameters parameters);
-
- public override void FromXmlString (string xml) {
- }
-
- public override string ToXmlString (bool include) {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/RSAParameters.cs b/mcs/class/corlib/System.Security.Cryptography/RSAParameters.cs
deleted file mode 100644
index cf7e61f695d..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RSAParameters.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Security.Cryptography.RSAParameters.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public struct RSAParameters {
- [NonSerialized]
- public byte[] P;
- [NonSerialized]
- public byte[] Q;
- [NonSerialized]
- public byte[] D;
- [NonSerialized]
- public byte[] DP;
- [NonSerialized]
- public byte[] DQ;
- [NonSerialized]
- public byte[] InverseQ;
- [NonSerialized]
-
- public byte[] Modulus;
- public byte[] Exponent;
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs b/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs
deleted file mode 100755
index f6bc1c51608..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Security.Cryptography.RandomNumberGenerator
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using System.Globalization;
-
-namespace System.Security.Cryptography {
-
-public abstract class RandomNumberGenerator {
-
- public RandomNumberGenerator () {
- }
-
- public static RandomNumberGenerator Create () {
- // create the default random number generator
- return Create ("System.Security.Cryptography.RandomNumberGenerator");
- }
-
- [MonoTODO]
- public static RandomNumberGenerator Create (string rngName) {
- return null;
- // return (RandomNumberGenerator) (CryptoConfig.CreateFromName (rngName));
- }
-
- public abstract void GetBytes (byte[] data);
-
- public abstract void GetNonZeroBytes (byte[] data);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs b/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs
deleted file mode 100644
index e4412164e82..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Security.Cryptography.Rijndael.cs
-//
-// Authors: Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public abstract class Rijndael : SymmetricAlgorithm {
- public static new Rijndael Create () { return null; }
- public static new Rijndael Create (string alg) { return Create (); }
-
- public Rijndael () {
- KeySizeValue = 256;
- BlockSizeValue = 128;
- FeedbackSizeValue = 128;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs b/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs
deleted file mode 100644
index 205a00cfa63..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs
+++ /dev/null
@@ -1,744 +0,0 @@
-//
-// System.Security.Cryptography.RijndaelManaged.cs
-//
-// Authors: Mark Crichton (crichton@gimp.org)
-//
-// (C) 2002
-//
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-
-/// <summary>
-/// TODO - Add class summary
-/// </summary>
-/// <remarks>
-/// created by - crichton
-/// created on - 2/23/2002 6:21:44 PM
-/// </remarks>
-namespace System.Security.Cryptography {
- public class RijndaelManaged : Rijndael {
-
- /// <summary>
- /// RijndaelManaged constructor.
- /// </summary>
- public RijndaelManaged() {
- }
-
- /// <summary>
- /// Generates a random IV for block feedback modes
- /// </summary>
- /// <remarks>
- /// Method is inherited from SymmetricAlgorithm
- ///
- /// </remarks>
- [MonoTODO]
- public override void GenerateIV() {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// Generates a random key for Rijndael. Uses the current KeySize.
- /// </summary>
- /// <remarks>
- /// Inherited method from base class SymmetricAlgorithm
- ///
- /// </remarks>
- [MonoTODO]
- public override void GenerateKey() {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// Creates a symmetric Rijndael decryptor object
- /// </summary>
- /// <remarks>
- /// Inherited method from base class SymmetricAlgorithm
- ///
- /// </remarks>
- /// <param name='rgbKey'>Key for Rijndael</param>
- /// <param name='rgbIV'>IV for chaining mode</param>
- [MonoTODO]
- public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// Creates a symmetric Rijndael encryptor object
- /// </summary>
- /// <remarks>
- /// Inherited method from base class SymmetricAlgorithm
- ///
- /// </remarks>
- /// <param name='rgbKey'>Key for Rijndael</param>
- /// <param name='rgbIV'>IV for chaining mode</param>
- [MonoTODO]
- public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) {
- throw new System.NotImplementedException();
- }
-
-
- // Note, the following tables are autogenerated.
- // DO NOT EDIT.
- // These are the 5 T boxes needed for Rijndael
-
-
-
- internal static uint [,] ft_tab = {{
- 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d,
- 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554,
- 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d,
- 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a,
- 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87,
- 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b,
- 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea,
- 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b,
- 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a,
- 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f,
- 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108,
- 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f,
- 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e,
- 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5,
- 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d,
- 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f,
- 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e,
- 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb,
- 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce,
- 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497,
- 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c,
- 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed,
- 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b,
- 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a,
- 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16,
- 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594,
- 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81,
- 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3,
- 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a,
- 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504,
- 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163,
- 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d,
- 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f,
- 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739,
- 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47,
- 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395,
- 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f,
- 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883,
- 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c,
- 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76,
- 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e,
- 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4,
- 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6,
- 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b,
- 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7,
- 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0,
- 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25,
- 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818,
- 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72,
- 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651,
- 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21,
- 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85,
- 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa,
- 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12,
- 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0,
- 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9,
- 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133,
- 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7,
- 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920,
- 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a,
- 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17,
- 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8,
- 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11,
- 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a,
- },{
- 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b,
- 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5,
- 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b,
- 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676,
- 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d,
- 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0,
- 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf,
- 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0,
- 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626,
- 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc,
- 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1,
- 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515,
- 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3,
- 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a,
- 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2,
- 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575,
- 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a,
- 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0,
- 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3,
- 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484,
- 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded,
- 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b,
- 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939,
- 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf,
- 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb,
- 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585,
- 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f,
- 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8,
- 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f,
- 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5,
- 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121,
- 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2,
- 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec,
- 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717,
- 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d,
- 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373,
- 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc,
- 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888,
- 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414,
- 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb,
- 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a,
- 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c,
- 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262,
- 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979,
- 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d,
- 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9,
- 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea,
- 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808,
- 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e,
- 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6,
- 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f,
- 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a,
- 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666,
- 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e,
- 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9,
- 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e,
- 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111,
- 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494,
- 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9,
- 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf,
- 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d,
- 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868,
- 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f,
- 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616,
- },{
- 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b,
- 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5,
- 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b,
- 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76,
- 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d,
- 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0,
- 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af,
- 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0,
- 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26,
- 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc,
- 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1,
- 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15,
- 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3,
- 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a,
- 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2,
- 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75,
- 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a,
- 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0,
- 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3,
- 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384,
- 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed,
- 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b,
- 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239,
- 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf,
- 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb,
- 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185,
- 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f,
- 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8,
- 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f,
- 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5,
- 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221,
- 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2,
- 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec,
- 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17,
- 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d,
- 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673,
- 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc,
- 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88,
- 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814,
- 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb,
- 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a,
- 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c,
- 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462,
- 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279,
- 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d,
- 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9,
- 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea,
- 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008,
- 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e,
- 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6,
- 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f,
- 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a,
- 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66,
- 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e,
- 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9,
- 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e,
- 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211,
- 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394,
- 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9,
- 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df,
- 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d,
- 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068,
- 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f,
- 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16,
- },{
- 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6,
- 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491,
- 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56,
- 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec,
- 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa,
- 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb,
- 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45,
- 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b,
- 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c,
- 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83,
- 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9,
- 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a,
- 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d,
- 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f,
- 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf,
- 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea,
- 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34,
- 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b,
- 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d,
- 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713,
- 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1,
- 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6,
- 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72,
- 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85,
- 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed,
- 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411,
- 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe,
- 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b,
- 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05,
- 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1,
- 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342,
- 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf,
- 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3,
- 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e,
- 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a,
- 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6,
- 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3,
- 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b,
- 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28,
- 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad,
- 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14,
- 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8,
- 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4,
- 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2,
- 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da,
- 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049,
- 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf,
- 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810,
- 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c,
- 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197,
- 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e,
- 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f,
- 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc,
- 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c,
- 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069,
- 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927,
- 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322,
- 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733,
- 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9,
- 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5,
- 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a,
- 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0,
- 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e,
- 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c,
- },{
- 0x63636363, 0x7c7c7c7c, 0x77777777, 0x7b7b7b7b,
- 0xf2f2f2f2, 0x6b6b6b6b, 0x6f6f6f6f, 0xc5c5c5c5,
- 0x30303030, 0x01010101, 0x67676767, 0x2b2b2b2b,
- 0xfefefefe, 0xd7d7d7d7, 0xabababab, 0x76767676,
- 0xcacacaca, 0x82828282, 0xc9c9c9c9, 0x7d7d7d7d,
- 0xfafafafa, 0x59595959, 0x47474747, 0xf0f0f0f0,
- 0xadadadad, 0xd4d4d4d4, 0xa2a2a2a2, 0xafafafaf,
- 0x9c9c9c9c, 0xa4a4a4a4, 0x72727272, 0xc0c0c0c0,
- 0xb7b7b7b7, 0xfdfdfdfd, 0x93939393, 0x26262626,
- 0x36363636, 0x3f3f3f3f, 0xf7f7f7f7, 0xcccccccc,
- 0x34343434, 0xa5a5a5a5, 0xe5e5e5e5, 0xf1f1f1f1,
- 0x71717171, 0xd8d8d8d8, 0x31313131, 0x15151515,
- 0x04040404, 0xc7c7c7c7, 0x23232323, 0xc3c3c3c3,
- 0x18181818, 0x96969696, 0x05050505, 0x9a9a9a9a,
- 0x07070707, 0x12121212, 0x80808080, 0xe2e2e2e2,
- 0xebebebeb, 0x27272727, 0xb2b2b2b2, 0x75757575,
- 0x09090909, 0x83838383, 0x2c2c2c2c, 0x1a1a1a1a,
- 0x1b1b1b1b, 0x6e6e6e6e, 0x5a5a5a5a, 0xa0a0a0a0,
- 0x52525252, 0x3b3b3b3b, 0xd6d6d6d6, 0xb3b3b3b3,
- 0x29292929, 0xe3e3e3e3, 0x2f2f2f2f, 0x84848484,
- 0x53535353, 0xd1d1d1d1, 0x00000000, 0xedededed,
- 0x20202020, 0xfcfcfcfc, 0xb1b1b1b1, 0x5b5b5b5b,
- 0x6a6a6a6a, 0xcbcbcbcb, 0xbebebebe, 0x39393939,
- 0x4a4a4a4a, 0x4c4c4c4c, 0x58585858, 0xcfcfcfcf,
- 0xd0d0d0d0, 0xefefefef, 0xaaaaaaaa, 0xfbfbfbfb,
- 0x43434343, 0x4d4d4d4d, 0x33333333, 0x85858585,
- 0x45454545, 0xf9f9f9f9, 0x02020202, 0x7f7f7f7f,
- 0x50505050, 0x3c3c3c3c, 0x9f9f9f9f, 0xa8a8a8a8,
- 0x51515151, 0xa3a3a3a3, 0x40404040, 0x8f8f8f8f,
- 0x92929292, 0x9d9d9d9d, 0x38383838, 0xf5f5f5f5,
- 0xbcbcbcbc, 0xb6b6b6b6, 0xdadadada, 0x21212121,
- 0x10101010, 0xffffffff, 0xf3f3f3f3, 0xd2d2d2d2,
- 0xcdcdcdcd, 0x0c0c0c0c, 0x13131313, 0xecececec,
- 0x5f5f5f5f, 0x97979797, 0x44444444, 0x17171717,
- 0xc4c4c4c4, 0xa7a7a7a7, 0x7e7e7e7e, 0x3d3d3d3d,
- 0x64646464, 0x5d5d5d5d, 0x19191919, 0x73737373,
- 0x60606060, 0x81818181, 0x4f4f4f4f, 0xdcdcdcdc,
- 0x22222222, 0x2a2a2a2a, 0x90909090, 0x88888888,
- 0x46464646, 0xeeeeeeee, 0xb8b8b8b8, 0x14141414,
- 0xdededede, 0x5e5e5e5e, 0x0b0b0b0b, 0xdbdbdbdb,
- 0xe0e0e0e0, 0x32323232, 0x3a3a3a3a, 0x0a0a0a0a,
- 0x49494949, 0x06060606, 0x24242424, 0x5c5c5c5c,
- 0xc2c2c2c2, 0xd3d3d3d3, 0xacacacac, 0x62626262,
- 0x91919191, 0x95959595, 0xe4e4e4e4, 0x79797979,
- 0xe7e7e7e7, 0xc8c8c8c8, 0x37373737, 0x6d6d6d6d,
- 0x8d8d8d8d, 0xd5d5d5d5, 0x4e4e4e4e, 0xa9a9a9a9,
- 0x6c6c6c6c, 0x56565656, 0xf4f4f4f4, 0xeaeaeaea,
- 0x65656565, 0x7a7a7a7a, 0xaeaeaeae, 0x08080808,
- 0xbabababa, 0x78787878, 0x25252525, 0x2e2e2e2e,
- 0x1c1c1c1c, 0xa6a6a6a6, 0xb4b4b4b4, 0xc6c6c6c6,
- 0xe8e8e8e8, 0xdddddddd, 0x74747474, 0x1f1f1f1f,
- 0x4b4b4b4b, 0xbdbdbdbd, 0x8b8b8b8b, 0x8a8a8a8a,
- 0x70707070, 0x3e3e3e3e, 0xb5b5b5b5, 0x66666666,
- 0x48484848, 0x03030303, 0xf6f6f6f6, 0x0e0e0e0e,
- 0x61616161, 0x35353535, 0x57575757, 0xb9b9b9b9,
- 0x86868686, 0xc1c1c1c1, 0x1d1d1d1d, 0x9e9e9e9e,
- 0xe1e1e1e1, 0xf8f8f8f8, 0x98989898, 0x11111111,
- 0x69696969, 0xd9d9d9d9, 0x8e8e8e8e, 0x94949494,
- 0x9b9b9b9b, 0x1e1e1e1e, 0x87878787, 0xe9e9e9e9,
- 0xcececece, 0x55555555, 0x28282828, 0xdfdfdfdf,
- 0x8c8c8c8c, 0xa1a1a1a1, 0x89898989, 0x0d0d0d0d,
- 0xbfbfbfbf, 0xe6e6e6e6, 0x42424242, 0x68686868,
- 0x41414141, 0x99999999, 0x2d2d2d2d, 0x0f0f0f0f,
- 0xb0b0b0b0, 0x54545454, 0xbbbbbbbb, 0x16161616,
- }};
-
- internal static uint [,] it_tab = {{
- 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96,
- 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393,
- 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25,
- 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f,
- 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1,
- 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6,
- 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da,
- 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844,
- 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd,
- 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4,
- 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45,
- 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94,
- 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7,
- 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a,
- 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5,
- 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c,
- 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1,
- 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a,
- 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75,
- 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051,
- 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46,
- 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff,
- 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77,
- 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb,
- 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000,
- 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e,
- 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927,
- 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a,
- 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e,
- 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16,
- 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d,
- 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8,
- 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd,
- 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34,
- 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163,
- 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120,
- 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d,
- 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0,
- 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422,
- 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef,
- 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36,
- 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4,
- 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662,
- 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5,
- 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3,
- 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b,
- 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8,
- 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6,
- 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6,
- 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0,
- 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815,
- 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f,
- 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df,
- 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f,
- 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e,
- 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713,
- 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89,
- 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c,
- 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf,
- 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86,
- 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f,
- 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541,
- 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190,
- 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742,
- },{
- 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e,
- 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303,
- 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c,
- 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3,
- 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0,
- 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9,
- 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259,
- 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8,
- 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971,
- 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a,
- 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f,
- 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b,
- 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8,
- 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab,
- 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708,
- 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682,
- 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2,
- 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe,
- 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb,
- 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10,
- 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd,
- 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015,
- 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e,
- 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee,
- 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000,
- 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72,
- 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39,
- 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e,
- 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91,
- 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a,
- 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17,
- 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9,
- 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60,
- 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e,
- 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1,
- 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611,
- 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1,
- 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3,
- 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964,
- 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390,
- 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b,
- 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf,
- 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46,
- 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af,
- 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512,
- 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb,
- 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a,
- 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8,
- 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c,
- 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266,
- 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8,
- 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6,
- 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604,
- 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551,
- 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41,
- 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647,
- 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c,
- 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1,
- 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737,
- 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db,
- 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340,
- 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95,
- 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1,
- 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857,
- },{
- 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27,
- 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3,
- 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502,
- 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562,
- 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe,
- 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3,
- 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552,
- 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9,
- 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9,
- 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce,
- 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253,
- 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908,
- 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b,
- 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655,
- 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337,
- 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16,
- 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69,
- 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6,
- 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6,
- 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e,
- 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6,
- 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050,
- 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9,
- 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8,
- 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000,
- 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a,
- 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d,
- 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436,
- 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b,
- 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12,
- 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b,
- 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e,
- 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f,
- 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb,
- 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4,
- 0xdccad731, 0x85104263, 0x22401397, 0x112084c6,
- 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729,
- 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1,
- 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9,
- 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233,
- 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4,
- 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad,
- 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e,
- 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3,
- 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25,
- 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b,
- 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f,
- 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15,
- 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0,
- 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2,
- 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7,
- 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791,
- 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496,
- 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665,
- 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b,
- 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6,
- 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13,
- 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47,
- 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7,
- 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844,
- 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3,
- 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d,
- 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456,
- 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8,
- },{
- 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a,
- 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b,
- 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5,
- 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5,
- 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d,
- 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b,
- 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95,
- 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e,
- 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27,
- 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d,
- 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562,
- 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9,
- 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752,
- 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66,
- 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3,
- 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced,
- 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e,
- 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4,
- 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4,
- 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd,
- 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d,
- 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60,
- 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767,
- 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79,
- 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000,
- 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c,
- 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736,
- 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24,
- 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b,
- 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c,
- 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12,
- 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814,
- 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3,
- 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b,
- 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8,
- 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084,
- 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7,
- 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077,
- 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247,
- 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22,
- 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698,
- 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f,
- 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254,
- 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582,
- 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf,
- 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb,
- 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883,
- 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef,
- 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629,
- 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035,
- 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533,
- 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17,
- 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4,
- 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46,
- 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb,
- 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d,
- 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb,
- 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a,
- 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73,
- 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678,
- 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2,
- 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff,
- 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064,
- 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0,
- },{
- 0x52525252, 0x09090909, 0x6a6a6a6a, 0xd5d5d5d5,
- 0x30303030, 0x36363636, 0xa5a5a5a5, 0x38383838,
- 0xbfbfbfbf, 0x40404040, 0xa3a3a3a3, 0x9e9e9e9e,
- 0x81818181, 0xf3f3f3f3, 0xd7d7d7d7, 0xfbfbfbfb,
- 0x7c7c7c7c, 0xe3e3e3e3, 0x39393939, 0x82828282,
- 0x9b9b9b9b, 0x2f2f2f2f, 0xffffffff, 0x87878787,
- 0x34343434, 0x8e8e8e8e, 0x43434343, 0x44444444,
- 0xc4c4c4c4, 0xdededede, 0xe9e9e9e9, 0xcbcbcbcb,
- 0x54545454, 0x7b7b7b7b, 0x94949494, 0x32323232,
- 0xa6a6a6a6, 0xc2c2c2c2, 0x23232323, 0x3d3d3d3d,
- 0xeeeeeeee, 0x4c4c4c4c, 0x95959595, 0x0b0b0b0b,
- 0x42424242, 0xfafafafa, 0xc3c3c3c3, 0x4e4e4e4e,
- 0x08080808, 0x2e2e2e2e, 0xa1a1a1a1, 0x66666666,
- 0x28282828, 0xd9d9d9d9, 0x24242424, 0xb2b2b2b2,
- 0x76767676, 0x5b5b5b5b, 0xa2a2a2a2, 0x49494949,
- 0x6d6d6d6d, 0x8b8b8b8b, 0xd1d1d1d1, 0x25252525,
- 0x72727272, 0xf8f8f8f8, 0xf6f6f6f6, 0x64646464,
- 0x86868686, 0x68686868, 0x98989898, 0x16161616,
- 0xd4d4d4d4, 0xa4a4a4a4, 0x5c5c5c5c, 0xcccccccc,
- 0x5d5d5d5d, 0x65656565, 0xb6b6b6b6, 0x92929292,
- 0x6c6c6c6c, 0x70707070, 0x48484848, 0x50505050,
- 0xfdfdfdfd, 0xedededed, 0xb9b9b9b9, 0xdadadada,
- 0x5e5e5e5e, 0x15151515, 0x46464646, 0x57575757,
- 0xa7a7a7a7, 0x8d8d8d8d, 0x9d9d9d9d, 0x84848484,
- 0x90909090, 0xd8d8d8d8, 0xabababab, 0x00000000,
- 0x8c8c8c8c, 0xbcbcbcbc, 0xd3d3d3d3, 0x0a0a0a0a,
- 0xf7f7f7f7, 0xe4e4e4e4, 0x58585858, 0x05050505,
- 0xb8b8b8b8, 0xb3b3b3b3, 0x45454545, 0x06060606,
- 0xd0d0d0d0, 0x2c2c2c2c, 0x1e1e1e1e, 0x8f8f8f8f,
- 0xcacacaca, 0x3f3f3f3f, 0x0f0f0f0f, 0x02020202,
- 0xc1c1c1c1, 0xafafafaf, 0xbdbdbdbd, 0x03030303,
- 0x01010101, 0x13131313, 0x8a8a8a8a, 0x6b6b6b6b,
- 0x3a3a3a3a, 0x91919191, 0x11111111, 0x41414141,
- 0x4f4f4f4f, 0x67676767, 0xdcdcdcdc, 0xeaeaeaea,
- 0x97979797, 0xf2f2f2f2, 0xcfcfcfcf, 0xcececece,
- 0xf0f0f0f0, 0xb4b4b4b4, 0xe6e6e6e6, 0x73737373,
- 0x96969696, 0xacacacac, 0x74747474, 0x22222222,
- 0xe7e7e7e7, 0xadadadad, 0x35353535, 0x85858585,
- 0xe2e2e2e2, 0xf9f9f9f9, 0x37373737, 0xe8e8e8e8,
- 0x1c1c1c1c, 0x75757575, 0xdfdfdfdf, 0x6e6e6e6e,
- 0x47474747, 0xf1f1f1f1, 0x1a1a1a1a, 0x71717171,
- 0x1d1d1d1d, 0x29292929, 0xc5c5c5c5, 0x89898989,
- 0x6f6f6f6f, 0xb7b7b7b7, 0x62626262, 0x0e0e0e0e,
- 0xaaaaaaaa, 0x18181818, 0xbebebebe, 0x1b1b1b1b,
- 0xfcfcfcfc, 0x56565656, 0x3e3e3e3e, 0x4b4b4b4b,
- 0xc6c6c6c6, 0xd2d2d2d2, 0x79797979, 0x20202020,
- 0x9a9a9a9a, 0xdbdbdbdb, 0xc0c0c0c0, 0xfefefefe,
- 0x78787878, 0xcdcdcdcd, 0x5a5a5a5a, 0xf4f4f4f4,
- 0x1f1f1f1f, 0xdddddddd, 0xa8a8a8a8, 0x33333333,
- 0x88888888, 0x07070707, 0xc7c7c7c7, 0x31313131,
- 0xb1b1b1b1, 0x12121212, 0x10101010, 0x59595959,
- 0x27272727, 0x80808080, 0xecececec, 0x5f5f5f5f,
- 0x60606060, 0x51515151, 0x7f7f7f7f, 0xa9a9a9a9,
- 0x19191919, 0xb5b5b5b5, 0x4a4a4a4a, 0x0d0d0d0d,
- 0x2d2d2d2d, 0xe5e5e5e5, 0x7a7a7a7a, 0x9f9f9f9f,
- 0x93939393, 0xc9c9c9c9, 0x9c9c9c9c, 0xefefefef,
- 0xa0a0a0a0, 0xe0e0e0e0, 0x3b3b3b3b, 0x4d4d4d4d,
- 0xaeaeaeae, 0x2a2a2a2a, 0xf5f5f5f5, 0xb0b0b0b0,
- 0xc8c8c8c8, 0xebebebeb, 0xbbbbbbbb, 0x3c3c3c3c,
- 0x83838383, 0x53535353, 0x99999999, 0x61616161,
- 0x17171717, 0x2b2b2b2b, 0x04040404, 0x7e7e7e7e,
- 0xbabababa, 0x77777777, 0xd6d6d6d6, 0x26262626,
- 0xe1e1e1e1, 0x69696969, 0x14141414, 0x63636363,
- 0x55555555, 0x21212121, 0x0c0c0c0c, 0x7d7d7d7d,
- }};
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA1.cs b/mcs/class/corlib/System.Security.Cryptography/SHA1.cs
deleted file mode 100644
index 605c4d9baa9..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA1.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Security.Cryptography SHA1 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived SHA1 iplementations.
- /// </summary>
- public abstract class SHA1 : HashAlgorithm {
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected SHA1 () {
-
- }
-
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new SHA1 Create () {
- return new SHA1CryptoServiceProvider();
- }
-
- /// <summary>
- /// Creates a new derived class.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new SHA1 Create (string st) {
- return Create();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs
deleted file mode 100644
index fe84262080f..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs
+++ /dev/null
@@ -1,455 +0,0 @@
-//
-// System.Security.Cryptography SHA1CryptoServiceProvider Class implementation
-//
-// Author:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// C# implementation of the SHA1 cryptographic hash function.
- /// LAMESPEC?: Basically the same thing as SHA1Managed except for how its implemented.
- /// </summary>
- public class SHA1CryptoServiceProvider : SHA1 {
- private const int BLOCK_SIZE_BYTES = 64;
- private const int HASH_SIZE_BYTES = 20;
- private const int HASH_SIZE_BITS = 160;
- [CLSCompliant(false)] protected uint[] _H; // these are my chaining variables
- [CLSCompliant(false)] protected uint count;
- private byte[] _ProcessingBuffer; // Used to start data when passed less than a block worth.
- private int _ProcessingBufferCount; // Counts how much data we have stored that still needs processed.
-
- /// <summary>
- /// Creates a new SHA1CryptoServiceProvider.
- /// </summary>
- public SHA1CryptoServiceProvider () {
- _H = new uint[5];
- HashSizeValue = HASH_SIZE_BITS;
- _ProcessingBuffer = new byte[BLOCK_SIZE_BYTES];
-
- Initialize();
- }
-
- /// <summary>
- /// Drives the hashing function.
- /// </summary>
- /// <param name="rgb">Byte array containing the data to hash.</param>
- /// <param name="start">Where in the input buffer to start.</param>
- /// <param name="size">Size in bytes of the data in the buffer to hash.</param>
- protected override void HashCore (byte[] rgb, int start, int size) {
- int i;
- State = 1;
-
- if (_ProcessingBufferCount != 0) {
- if (size < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) {
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, size);
- _ProcessingBufferCount += size;
- return;
- }
- else {
- i = (BLOCK_SIZE_BYTES - _ProcessingBufferCount);
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, i);
- ProcessBlock (_ProcessingBuffer, 0);
- _ProcessingBufferCount = 0;
- start += i;
- size -= i;
- }
- }
-
- for (i=0; i<size-size%BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) {
- ProcessBlock (rgb, start+i);
- }
-
- if (size%BLOCK_SIZE_BYTES != 0) {
- System.Buffer.BlockCopy (rgb, size-size%BLOCK_SIZE_BYTES+start, _ProcessingBuffer, 0, size%BLOCK_SIZE_BYTES);
- _ProcessingBufferCount = size%BLOCK_SIZE_BYTES;
- }
- }
-
- /// <summary>
- /// This finalizes the hash. Takes the data from the chaining variables and returns it.
- /// </summary>
- protected override byte[] HashFinal () {
- byte[] hash = new byte[20];
- int i, j;
-
- ProcessFinalBlock(_ProcessingBuffer, 0, _ProcessingBufferCount);
-
- for (i=0; i<5; i++) {
- for (j=0; j<4; j++) {
- hash[i*4+j] = (byte)(_H[i] >> (8*(3-j)));
- }
- }
-
- State = 0;
- return hash;
- }
-
-
- /// <summary>
- /// Resets the class after use. Called automatically after hashing is done.
- /// </summary>
- public override void Initialize () {
- count = 0;
- _ProcessingBufferCount = 0;
-
- _H[0] = 0x67452301;
- _H[1] = 0xefcdab89;
- _H[2] = 0x98badcfe;
- _H[3] = 0x10325476;
- _H[4] = 0xC3D2E1F0;
- }
-
- /// <summary>
- /// This is the meat of the hash function. It is what processes each block one at a time.
- /// </summary>
- /// <param name="inputBuffer">Byte array to process data from.</param>
- /// <param name="inputOffset">Where in the byte array to start processing.</param>
- private void ProcessBlock(byte[] inputBuffer, int inputOffset) {
- uint[] buff = new uint[80];
- uint a, b, c, d, e;
- int i;
-
- count += BLOCK_SIZE_BYTES;
-
- for (i=0; i<16; i++) {
- buff[i] = ((uint)(inputBuffer[inputOffset+4*i]) << 24)
- | ((uint)(inputBuffer[inputOffset+4*i+1]) << 16)
- | ((uint)(inputBuffer[inputOffset+4*i+2]) << 8)
- | ((uint)(inputBuffer[inputOffset+4*i+3]));
- }
-
- for (i=16; i<80; i++) {
- buff[i] = ((buff[i-3] ^ buff[i-8] ^ buff[i-14] ^ buff[i-16]) << 1)
- | ((buff[i-3] ^ buff[i-8] ^ buff[i-14] ^ buff[i-16]) >> 31);
- }
-
- a = _H[0];
- b = _H[1];
- c = _H[2];
- d = _H[3];
- e = _H[4];
-
-
- // This function was unrolled because it seems to be doubling our performance with current compiler/VM.
- // Possibly roll up if this changes.
-
- // ---- Round 1 --------
-
- e += ((a << 5) | (a >> 27)) + (((c ^ d) & b) ^ d) + 0x5A827999 + buff[0];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (((b ^ c) & a) ^ c) + 0x5A827999 + buff[1];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (((a ^ b) & e) ^ b) + 0x5A827999 + buff[2];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (((e ^ a) & d) ^ a) + 0x5A827999 + buff[3];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (((d ^ e) & c) ^ e) + 0x5A827999 + buff[4];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (((c ^ d) & b) ^ d) + 0x5A827999 + buff[5];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (((b ^ c) & a) ^ c) + 0x5A827999 + buff[6];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (((a ^ b) & e) ^ b) + 0x5A827999 + buff[7];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (((e ^ a) & d) ^ a) + 0x5A827999 + buff[8];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (((d ^ e) & c) ^ e) + 0x5A827999 + buff[9];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (((c ^ d) & b) ^ d) + 0x5A827999 + buff[10];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (((b ^ c) & a) ^ c) + 0x5A827999 + buff[11];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (((a ^ b) & e) ^ b) + 0x5A827999 + buff[12];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (((e ^ a) & d) ^ a) + 0x5A827999 + buff[13];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (((d ^ e) & c) ^ e) + 0x5A827999 + buff[14];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (((c ^ d) & b) ^ d) + 0x5A827999 + buff[15];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (((b ^ c) & a) ^ c) + 0x5A827999 + buff[16];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (((a ^ b) & e) ^ b) + 0x5A827999 + buff[17];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (((e ^ a) & d) ^ a) + 0x5A827999 + buff[18];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (((d ^ e) & c) ^ e) + 0x5A827999 + buff[19];
- c = (c << 30) | (c >> 2);
-
-
-
- // ---- Round 2 --------
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0x6ED9EBA1 + buff[20];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0x6ED9EBA1 + buff[21];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0x6ED9EBA1 + buff[22];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0x6ED9EBA1 + buff[23];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0x6ED9EBA1 + buff[24];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0x6ED9EBA1 + buff[25];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0x6ED9EBA1 + buff[26];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0x6ED9EBA1 + buff[27];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0x6ED9EBA1 + buff[28];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0x6ED9EBA1 + buff[29];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0x6ED9EBA1 + buff[30];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0x6ED9EBA1 + buff[31];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0x6ED9EBA1 + buff[32];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0x6ED9EBA1 + buff[33];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0x6ED9EBA1 + buff[34];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0x6ED9EBA1 + buff[35];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0x6ED9EBA1 + buff[36];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0x6ED9EBA1 + buff[37];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0x6ED9EBA1 + buff[38];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0x6ED9EBA1 + buff[39];
- c = (c << 30) | (c >> 2);
-
-
-
- // ---- Round 3 --------
-
- e += ((a << 5) | (a >> 27)) + ((b&c) | (b&d) | (c&d)) + 0x8F1BBCDC + buff[40];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + ((a&b) | (a&c) | (b&c)) + 0x8F1BBCDC + buff[41];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + ((e&a) | (e&b) | (a&b)) + 0x8F1BBCDC + buff[42];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + ((d&e) | (d&a) | (e&a)) + 0x8F1BBCDC + buff[43];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + ((c&d) | (c&e) | (d&e)) + 0x8F1BBCDC + buff[44];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + ((b&c) | (b&d) | (c&d)) + 0x8F1BBCDC + buff[45];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + ((a&b) | (a&c) | (b&c)) + 0x8F1BBCDC + buff[46];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + ((e&a) | (e&b) | (a&b)) + 0x8F1BBCDC + buff[47];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + ((d&e) | (d&a) | (e&a)) + 0x8F1BBCDC + buff[48];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + ((c&d) | (c&e) | (d&e)) + 0x8F1BBCDC + buff[49];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + ((b&c) | (b&d) | (c&d)) + 0x8F1BBCDC + buff[50];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + ((a&b) | (a&c) | (b&c)) + 0x8F1BBCDC + buff[51];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + ((e&a) | (e&b) | (a&b)) + 0x8F1BBCDC + buff[52];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + ((d&e) | (d&a) | (e&a)) + 0x8F1BBCDC + buff[53];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + ((c&d) | (c&e) | (d&e)) + 0x8F1BBCDC + buff[54];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + ((b&c) | (b&d) | (c&d)) + 0x8F1BBCDC + buff[55];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + ((a&b) | (a&c) | (b&c)) + 0x8F1BBCDC + buff[56];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + ((e&a) | (e&b) | (a&b)) + 0x8F1BBCDC + buff[57];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + ((d&e) | (d&a) | (e&a)) + 0x8F1BBCDC + buff[58];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + ((c&d) | (c&e) | (d&e)) + 0x8F1BBCDC + buff[59];
- c = (c << 30) | (c >> 2);
-
-
-
- // ---- Round 4 --------
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0xCA62C1D6 + buff[60];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0xCA62C1D6 + buff[61];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0xCA62C1D6 + buff[62];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0xCA62C1D6 + buff[63];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0xCA62C1D6 + buff[64];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0xCA62C1D6 + buff[65];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0xCA62C1D6 + buff[66];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0xCA62C1D6 + buff[67];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0xCA62C1D6 + buff[68];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0xCA62C1D6 + buff[69];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0xCA62C1D6 + buff[70];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0xCA62C1D6 + buff[71];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0xCA62C1D6 + buff[72];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0xCA62C1D6 + buff[73];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0xCA62C1D6 + buff[74];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0xCA62C1D6 + buff[75];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0xCA62C1D6 + buff[76];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0xCA62C1D6 + buff[77];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0xCA62C1D6 + buff[78];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0xCA62C1D6 + buff[79];
- c = (c << 30) | (c >> 2);
-
-
- _H[0] += a;
- _H[1] += b;
- _H[2] += c;
- _H[3] += d;
- _H[4] += e;
- }
-
- /// <summary>
- /// Pads and then processes the final block.
- /// Non-standard.
- /// </summary>
- /// <param name="inputBuffer">Buffer to grab data from.</param>
- /// <param name="inputOffset">Position in buffer in bytes to get data from.</param>
- /// <param name="inputCount">How much data in bytes in the buffer to use.</param>
- private void ProcessFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) {
- byte[] fooBuffer;
- int paddingSize;
- int i;
- uint size;
-
- paddingSize = (int)(56 - (inputCount + count) % BLOCK_SIZE_BYTES);
-
- if (paddingSize < 1)
- paddingSize += BLOCK_SIZE_BYTES;
-
- fooBuffer = new byte[inputCount+paddingSize+8];
-
- for (i=0; i<inputCount; i++) {
- fooBuffer[i] = inputBuffer[i+inputOffset];
- }
-
- fooBuffer[inputCount] = 0x80;
- for (i=inputCount+1; i<inputCount+paddingSize; i++) {
- fooBuffer[i] = 0x00;
- }
-
- size = (uint)(count+inputCount);
- size *= 8; // I deal in bytes. They algorythm deals in bits.
-
- fooBuffer[inputCount+paddingSize] = 0x00;
- fooBuffer[inputCount+paddingSize+1] = 0x00;
- fooBuffer[inputCount+paddingSize+2] = 0x00;
- fooBuffer[inputCount+paddingSize+3] = 0x00;
-
- fooBuffer[inputCount+paddingSize+4] = (byte)((size) >> 24);
- fooBuffer[inputCount+paddingSize+5] = (byte)((size) >> 16);
- fooBuffer[inputCount+paddingSize+6] = (byte)((size) >> 8);
- fooBuffer[inputCount+paddingSize+7] = (byte)((size) >> 0);
-
- ProcessBlock(fooBuffer, 0);
-
- if (inputCount+paddingSize+8 == 128) {
- ProcessBlock(fooBuffer, 64);
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA256.cs b/mcs/class/corlib/System.Security.Cryptography/SHA256.cs
deleted file mode 100644
index 0054d0e9027..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA256.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.Cryptography SHA256 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived SHA256 iplementations.
- /// Abstract.
- /// </summary>
- public abstract class SHA256 : HashAlgorithm {
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected SHA256 () {
-
- }
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new SHA256 Create () {
- return new SHA256Managed ();
- }
-
- /// <summary>
- /// Creates a new derived class.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new SHA256 Create (string st) {
- return Create ();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA256Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA256Managed.cs
deleted file mode 100644
index bcfd16b3479..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA256Managed.cs
+++ /dev/null
@@ -1,290 +0,0 @@
-//
-// System.Security.Cryptography SHA256Managed Class implementation
-//
-// Author:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// (C) 2001
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// C# implementation of the SHA1 cryptographic hash function.
- /// LAMESPEC?: Basically the same thing as SHA1Managed except for how its implemented.
- /// </summary>
- public class SHA256Managed : SHA256 {
- private const int BLOCK_SIZE_BYTES = 64;
- private const int HASH_SIZE_BYTES = 32;
- private const int HASH_SIZE_BITS = 256;
- [CLSCompliant(false)] protected uint[] _H;
- [CLSCompliant(false)] private uint[] K;
- [CLSCompliant(false)] protected uint count;
- private byte[] _ProcessingBuffer; // Used to start data when passed less than a block worth.
- private int _ProcessingBufferCount; // Counts how much data we have stored that still needs processed.
-
- /// <summary>
- /// Creates a new SHA256Managed class.
- /// </summary>
- public SHA256Managed () {
- _H = new uint[8];
- HashSizeValue = HASH_SIZE_BITS;
- _ProcessingBuffer = new byte[BLOCK_SIZE_BYTES];
-
- K = new uint[64];
- K[0] = 0x428A2F98; K[1] = 0x71374491; K[2] = 0xB5C0FBCF; K[3] = 0xE9B5DBA5;
- K[4] = 0x3956C25B; K[5] = 0x59F111F1; K[6] = 0x923F82A4; K[7] = 0xAB1C5ED5;
- K[8] = 0xD807AA98; K[9] = 0x12835B01; K[10] = 0x243185BE; K[11] = 0x550C7DC3;
- K[12] = 0x72BE5D74; K[13] = 0x80DEB1FE; K[14] = 0x9BDC06A7; K[15] = 0xC19BF174;
- K[16] = 0xE49B69C1; K[17] = 0xEFBE4786; K[18] = 0x0FC19DC6; K[19] = 0x240CA1CC;
- K[20] = 0x2DE92C6F; K[21] = 0x4A7484AA; K[22] = 0x5CB0A9DC; K[23] = 0x76F988DA;
- K[24] = 0x983E5152; K[25] = 0xA831C66D; K[26] = 0xB00327C8; K[27] = 0xBF597FC7;
- K[28] = 0xC6E00BF3; K[29] = 0xD5A79147; K[30] = 0x06CA6351; K[31] = 0x14292967;
- K[32] = 0x27B70A85; K[33] = 0x2E1B2138; K[34] = 0x4D2C6DFC; K[35] = 0x53380D13;
- K[36] = 0x650A7354; K[37] = 0x766A0ABB; K[38] = 0x81C2C92E; K[39] = 0x92722C85;
- K[40] = 0xA2BFE8A1; K[41] = 0xA81A664B; K[42] = 0xC24B8B70; K[43] = 0xC76C51A3;
- K[44] = 0xD192E819; K[45] = 0xD6990624; K[46] = 0xF40E3585; K[47] = 0x106AA070;
- K[48] = 0x19A4C116; K[49] = 0x1E376C08; K[50] = 0x2748774C; K[51] = 0x34B0BCB5;
- K[52] = 0x391C0CB3; K[53] = 0x4ED8AA4A; K[54] = 0x5B9CCA4F; K[55] = 0x682E6FF3;
- K[56] = 0x748F82EE; K[57] = 0x78A5636F; K[58] = 0x84C87814; K[59] = 0x8CC70208;
- K[60] = 0x90BEFFFA; K[61] = 0xA4506CEB; K[62] = 0xBEF9A3F7; K[63] = 0xC67178F2;
-
- Initialize();
- }
-
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Ch (uint u, uint v, uint w) {
- return (u&v) ^ (~u&w);
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Maj (uint u, uint v, uint w) {
- return (u&v) ^ (u&w) ^ (v&w);
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Ro0 (uint x) {
- return ((x >> 7) | (x << 25))
- ^ ((x >> 18) | (x << 14))
- ^ (x >> 3);
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Ro1 (uint x) {
- return ((x >> 17) | (x << 15))
- ^ ((x >> 19) | (x << 13))
- ^ (x >> 10);
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Sig0 (uint x) {
- return ((x >> 2) | (x << 30))
- ^ ((x >> 13) | (x << 19))
- ^ ((x >> 22) | (x << 10));
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Sig1 (uint x) {
- return ((x >> 6) | (x << 26))
- ^ ((x >> 11) | (x << 21))
- ^ ((x >> 25) | (x << 7));
- }
-
- /// <summary>
- /// Drives the hashing function.
- /// </summary>
- /// <param name="rgb">Byte array containing the data to hash.</param>
- /// <param name="start">Where in the input buffer to start.</param>
- /// <param name="size">Size in bytes of the data in the buffer to hash.</param>
- protected override void HashCore (byte[] rgb, int start, int size) {
- int i;
- State = 1;
-
- if (_ProcessingBufferCount != 0) {
- if (size < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) {
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, size);
- _ProcessingBufferCount += size;
- return;
- }
- else {
- i = (BLOCK_SIZE_BYTES - _ProcessingBufferCount);
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, i);
- ProcessBlock (_ProcessingBuffer, 0);
- _ProcessingBufferCount = 0;
- start += i;
- size -= i;
- }
- }
-
- for (i=0; i<size-size%BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) {
- ProcessBlock (rgb, start+i);
- }
-
- if (size%BLOCK_SIZE_BYTES != 0) {
- System.Buffer.BlockCopy (rgb, size-size%BLOCK_SIZE_BYTES+start, _ProcessingBuffer, 0, size%BLOCK_SIZE_BYTES);
- _ProcessingBufferCount = size%BLOCK_SIZE_BYTES;
- }
- }
-
- /// <summary>
- /// This finalizes the hash. Takes the data from the chaining variables and returns it.
- /// </summary>
- protected override byte[] HashFinal () {
- byte[] hash = new byte[32];
- int i, j;
-
- ProcessFinalBlock(_ProcessingBuffer, 0, _ProcessingBufferCount);
-
- for (i=0; i<8; i++) {
- for (j=0; j<4; j++) {
- hash[i*4+j] = (byte)(_H[i] >> (24-j*8));
- }
- }
-
- State = 0;
- return hash;
- }
-
- /// <summary>
- /// Resets the class after use. Called automatically after hashing is done.
- /// </summary>
- public override void Initialize () {
- count = 0;
- _ProcessingBufferCount = 0;
-
- _H[0] = 0x6A09E667;
- _H[1] = 0xBB67AE85;
- _H[2] = 0x3C6EF372;
- _H[3] = 0xA54FF53A;
- _H[4] = 0x510E527F;
- _H[5] = 0x9B05688C;
- _H[6] = 0x1F83D9AB;
- _H[7] = 0x5BE0CD19;
- }
-
- /// <summary>
- /// This is the meat of the hash function. It is what processes each block one at a time.
- /// </summary>
- /// <param name="inputBuffer">Byte array to process data from.</param>
- /// <param name="inputOffset">Where in the byte array to start processing.</param>
- public void ProcessBlock(byte[] inputBuffer, int inputOffset) {
- uint a, b, c, d, e, f, g, h;
- uint t1, t2;
- int i;
- uint[] buff;
-
- count += BLOCK_SIZE_BYTES;
-
- buff = new uint[64];
-
- for (i=0; i<16; i++) {
- buff[i] = ((uint)(inputBuffer[inputOffset+4*i]) << 24)
- | ((uint)(inputBuffer[inputOffset+4*i+1]) << 16)
- | ((uint)(inputBuffer[inputOffset+4*i+2]) << 8)
- | ((uint)(inputBuffer[inputOffset+4*i+3]));
- }
-
-
- for (i=16; i<64; i++) {
- buff[i] = Ro1(buff[i-2]) + buff[i-7] + Ro0(buff[i-15]) + buff[i-16];
- }
-
- a = _H[0];
- b = _H[1];
- c = _H[2];
- d = _H[3];
- e = _H[4];
- f = _H[5];
- g = _H[6];
- h = _H[7];
-
- for (i=0; i<64; i++) {
- t1 = h + Sig1(e) + Ch(e,f,g) + K[i] + buff[i];
- t2 = Sig0(a) + Maj(a,b,c);
- h = g;
- g = f;
- f = e;
- e = d + t1;
- d = c;
- c = b;
- b = a;
- a = t1 + t2;
- }
-
- _H[0] += a;
- _H[1] += b;
- _H[2] += c;
- _H[3] += d;
- _H[4] += e;
- _H[5] += f;
- _H[6] += g;
- _H[7] += h;
- }
-
- /// <summary>
- /// Pads and then processes the final block.
- /// Non-standard.
- /// </summary>
- /// <param name="inputBuffer">Buffer to grab data from.</param>
- /// <param name="inputOffset">Position in buffer in bytes to get data from.</param>
- /// <param name="inputCount">How much data in bytes in the buffer to use.</param>
- public void ProcessFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) {
- byte[] fooBuffer;
- int paddingSize;
- int i;
- uint size;
-
- paddingSize = (int)(56 - (inputCount + count) % BLOCK_SIZE_BYTES);
-
- if (paddingSize < 1)
- paddingSize += BLOCK_SIZE_BYTES;
-
- fooBuffer = new byte[inputCount+paddingSize+8];
-
- for (i=0; i<inputCount; i++) {
- fooBuffer[i] = inputBuffer[i+inputOffset];
- }
-
- fooBuffer[inputCount] = 0x80;
- for (i=inputCount+1; i<inputCount+paddingSize; i++) {
- fooBuffer[i] = 0x00;
- }
-
- size = (uint)(count+inputCount);
- size *= 8;
-
- fooBuffer[inputCount+paddingSize] = 0x00;
- fooBuffer[inputCount+paddingSize+1] = 0x00;
- fooBuffer[inputCount+paddingSize+2] = 0x00;
- fooBuffer[inputCount+paddingSize+3] = 0x00;
-
- fooBuffer[inputCount+paddingSize+4] = (byte)((size) >> 24);
- fooBuffer[inputCount+paddingSize+5] = (byte)((size) >> 16);
- fooBuffer[inputCount+paddingSize+6] = (byte)((size) >> 8);
- fooBuffer[inputCount+paddingSize+7] = (byte)((size) >> 0);
-
- ProcessBlock(fooBuffer, 0);
-
- if (inputCount+paddingSize+8 == 128) {
- ProcessBlock(fooBuffer, 64);
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA384.cs b/mcs/class/corlib/System.Security.Cryptography/SHA384.cs
deleted file mode 100644
index cb1cb7fd7d7..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA384.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.Cryptography SHA384 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived SHA384 iplementations.
- /// </summary>
- public abstract class SHA384 : HashAlgorithm {
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected SHA384 () {
-
- }
-
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new SHA384 Create () {
- return new SHA384Managed();
- }
-
- /// <summary>
- /// Creates a new derived class.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new SHA384 Create (string st) {
- return Create();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs
deleted file mode 100644
index d5679038c80..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Security.Cryptography.SHA384Managed.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public class SHA384Managed : SHA384 {
- public SHA384Managed () {
- }
-
- public override void Initialize () {
- }
-
- // protected
-
- protected override void HashCore (byte[] rgb, int start, int count) {
- }
-
- protected override byte[] HashFinal () {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA512.cs b/mcs/class/corlib/System.Security.Cryptography/SHA512.cs
deleted file mode 100644
index 1e76e556636..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA512.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.Cryptography SHA512 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived SHA512 iplementations.
- /// </summary>
- public abstract class SHA512 : HashAlgorithm {
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected SHA512 () {
-
- }
-
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new SHA512 Create () {
- return new SHA512Managed();
- }
-
- /// <summary>
- /// Creates a new derived class.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new SHA512 Create (string st) {
- return Create();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs
deleted file mode 100644
index 3b3a010a2fe..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Security.Cryptography.SHA512Managed.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public class SHA512Managed : SHA512 {
- public SHA512Managed () {
- }
-
- public override void Initialize () {
- }
-
- // protected
-
- protected override void HashCore (byte[] rgb, int start, int count) {
- }
-
- protected override byte[] HashFinal () {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/SignatureDescription.cs b/mcs/class/corlib/System.Security.Cryptography/SignatureDescription.cs
deleted file mode 100755
index f867f763316..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SignatureDescription.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.Security.Cryptography SignatureDescription Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-// LAMESPEC: documentation of this class is completely missing in the sdk doc
-// TODO: Implement AsymmetricSignatureFormatter & AsymmetricSignatureDeformatter methods
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// LAMESPEC: no sdk doc available for this class by the time of beta 2
- /// </summary>
- [MonoTODO]
- public class SignatureDescription {
- private string _DeformatterAlgorithm;
- private string _DigestAlgorithm;
- private string _FormatterAlgorithm;
- private string _KeyAlgorithm;
-
- /// <summary>
- /// LAMESPEC: no idea what param el should do??
- /// </summary>
- public SignatureDescription (SecurityElement el) {
- if (el == null)
- throw new CryptographicException();
- }
-
-
- /// <summary>
- /// LAMESPEC: what to do if setting null values?
- /// </summary>
- public string DeformatterAlgorithm {
- get {
- return _DeformatterAlgorithm;
- }
- set {
- _DeformatterAlgorithm = value;
- }
- }
-
- /// <summary>
- /// LAMESPEC: what to do if setting null values?
- /// </summary>
- public string DigestAlgorithm {
- get {
- return _DigestAlgorithm;
- }
- set {
- _DigestAlgorithm = value;
- }
- }
-
- /// <summary>
- /// LAMESPEC: what to do if setting null values?
- /// </summary>
- public string FormatterAlgorithm {
- get {
- return _FormatterAlgorithm;
- }
- set {
- _FormatterAlgorithm = value;
- }
- }
-
- /// <summary>
- /// LAMESPEC: what to do if setting null values?
- /// </summary>
- public string KeyAlgorithm {
- get {
- return _KeyAlgorithm;
- }
- set {
- _KeyAlgorithm = value;
- }
- }
-
- [MonoTODO]
- public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
- {
- // TODO: Implement
- return null;
- }
-
- /// <summary>
- /// Create the hash algorithm assigned with this object
- /// </summary>
- public virtual HashAlgorithm CreateDigest()
- {
- return HashAlgorithm.Create(_DigestAlgorithm);
- }
-
- [MonoTODO]
- public virtual AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key)
- {
- // TODO: Implement
- return null;
- }
-
- } // SignatureDescription
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs b/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
deleted file mode 100755
index 508c25d5810..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
+++ /dev/null
@@ -1,256 +0,0 @@
-//
-// System.Security.Cryptography SymmetricAlgorithm Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all cryptographic symmetric algorithms.
- /// Available algorithms include:
- /// DES, RC2, Rijndael, TripleDES
- /// </summary>
- public abstract class SymmetricAlgorithm {
- protected int BlockSizeValue; // The block size of the cryptographic operation in bits.
- protected int FeedbackSizeValue; // The feedback size of the cryptographic operation in bits.
- protected byte[] IVValue; // The initialization vector ( IV) for the symmetric algorithm.
- protected int KeySizeValue; // The size of the secret key used by the symmetric algorithm in bits.
- protected byte[] KeyValue; // The secret key for the symmetric algorithm.
- protected KeySizes[] LegalBlockSizesValue; // Specifies the block sizes that are supported by the symmetric algorithm.
- protected KeySizes[] LegalKeySizesValue; // Specifies the key sizes that are supported by the symmetric algorithm.
- protected CipherMode ModeValue; // Represents the cipher mode used in the symmetric algorithm.
- protected PaddingMode PaddingValue; // Represents the padding mode used in the symmetric algorithm.
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- public SymmetricAlgorithm () {
- throw new CryptographicException();
- }
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- ~SymmetricAlgorithm () {
- if (KeyValue != null) {
- Array.Clear(KeyValue, 0, KeyValue.Length);
- KeyValue = null;
- }
- }
-
- /// <summary>
- /// Gets or sets the actual BlockSize
- /// </summary>
- public virtual int BlockSize {
- get {
- return this.BlockSizeValue;
- }
- set {
- if (IsLegalKeySize(this.LegalBlockSizesValue, value))
- this.BlockSizeValue = value;
- else
- throw new CryptographicException("block size not supported by algorithm");
- }
- }
-
- /// <summary>
- /// Gets or sets the actual FeedbackSize
- /// </summary>
- public virtual int FeedbackSize {
- get {
- return this.FeedbackSizeValue;
- }
- set {
- if (value > this.BlockSizeValue)
- throw new CryptographicException("feedback size larger than block size");
- else
- this.FeedbackSizeValue = value;
- }
- }
-
- /// <summary>
- /// Gets or sets the actual Initial Vector
- /// </summary>
- [MonoTODO]
- public virtual byte[] IV {
- get {
- if (this.IVValue == null)
- GenerateIV();
-
- return this.IVValue;
- }
- set {
- if (value == null)
- throw new ArgumentNullException("tried setting initial vector to null");
-
- // FIXME: dont know if to compare with block or key size
- if (value.Length != this.KeySizeValue)
- throw new CryptographicException("tried setting initial vector with illegal size");
-
- this.IVValue = new byte [value.Length];
- System.Array.Copy (value, 0, this.IVValue, 0, value.Length);
- }
- }
-
- /// <summary>
- /// Gets or sets the actual key
- /// </summary>
- public virtual byte[] Key {
- get {
- if (this.KeyValue == null)
- GenerateKey();
-
- return this.KeyValue;
- }
- set {
- if (value == null)
- throw new ArgumentNullException("tried setting key to null");
-
- if (!IsLegalKeySize(this.LegalKeySizesValue, value.Length))
- throw new CryptographicException("key size not supported by algorithm");
-
- this.KeySizeValue = value.Length;
- this.KeyValue = new byte [this.KeySizeValue];
- System.Array.Copy (value, 0, this.KeyValue, 0, this.KeySizeValue);
- }
- }
-
- /// <summary>
- /// Gets or sets the actual key size
- /// </summary>
- public virtual int KeySize {
- get {
- return this.KeySizeValue;
- }
- set {
- if (!IsLegalKeySize(this.LegalKeySizesValue, value))
- throw new CryptographicException("key size not supported by algorithm");
-
- this.KeyValue = null;
- this.KeySizeValue = value;
- }
- }
-
- /// <summary>
- /// Gets all legal block sizes
- /// </summary>
- public virtual KeySizes[] LegalBlockSizes {
- get {
- return this.LegalBlockSizesValue;
- }
- }
-
- /// <summary>
- /// Gets all legal key sizes
- /// </summary>
- public virtual KeySizes[] LegalKeySizes {
- get {
- return this.LegalKeySizesValue;
- }
- }
-
- /// <summary>
- /// Gets or sets the actual cipher mode
- /// </summary>
- public virtual CipherMode Mode {
- get {
- return this.ModeValue;
- }
- set {
- if (Enum.IsDefined(ModeValue.GetType(), value))
- this.ModeValue = value;
- else
- throw new CryptographicException("padding mode not available");
- }
- }
-
- /// <summary>
- /// Gets or sets the actual padding
- /// </summary>
- public virtual PaddingMode Padding {
- get {
- return this.PaddingValue;
- }
- set {
- if (Enum.IsDefined(PaddingValue.GetType(), value))
- this.PaddingValue = value;
- else
- throw new CryptographicException("padding mode not available");
- }
- }
-
- /// <summary>
- /// Gets an Decryptor transform object to work with a CryptoStream
- /// </summary>
- public virtual ICryptoTransform CreateDecryptor() {
- return CreateDecryptor(Key, IV);
- }
-
- /// <summary>
- /// Gets an Decryptor transform object to work with a CryptoStream
- /// </summary>
- public abstract ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV);
-
- /// <summary>
- /// Gets an Encryptor transform object to work with a CryptoStream
- /// </summary>
- public virtual ICryptoTransform CreateEncryptor() {
- return CreateEncryptor(Key, IV);
- }
-
- /// <summary>
- /// Gets an Encryptor transform object to work with a CryptoStream
- /// </summary>
- public abstract ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV);
-
- /// <summary>
- /// used to generate an inital vector if none is specified
- /// </summary>
- public abstract void GenerateIV();
-
- /// </summary>
- /// used to generate a random key if none is specified
- /// </summary>
- public abstract void GenerateKey();
-
- internal bool IsLegalKeySize(KeySizes[] LegalKeys, int Size) {
- foreach (KeySizes LegalKeySize in LegalKeys) {
- for (int i=LegalKeySize.MinSize; i<=LegalKeySize.MaxSize; i+=LegalKeySize.SkipSize) {
- if (i == Size)
- return true;
- }
- }
- return false;
- }
-
- /// <summary>
- /// Checks wether the given keyLength is valid for the current algorithm
- /// </summary>
- /// <param name="bitLength">the given keyLength</param>
- public bool ValidKeySize(int bitLength) {
- return IsLegalKeySize(LegalKeySizesValue, bitLength);
- }
-
- /// <summary>
- /// Creates the default implementation of the default symmetric algorithm (RC2).
- /// </summary>
- public static SymmetricAlgorithm Create () {
- return Rijndael.Create();
- }
-
- /// <summary>
- /// Creates a specific implementation of the given symmetric algorithm.
- /// </summary>
- /// <param name="algName">the given algorithm</param>
- [MonoTODO]
- public static SymmetricAlgorithm Create (string algName) {
- // TODO: Use Reflection to create a new algorithm instance
- return null;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/ToBase64Transform.cs b/mcs/class/corlib/System.Security.Cryptography/ToBase64Transform.cs
deleted file mode 100644
index 702c450a19f..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/ToBase64Transform.cs
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// System.Security.Cryptography.ToBase64Transform
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.Security.Cryptography;
-
-
-namespace System.Security.Cryptography {
-
- public class ToBase64Transform : ICryptoTransform {
-
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public ToBase64Transform ()
- {
- }
-
-
- /// <summary>
- /// </summary>
- public virtual bool CanTransformMultipleBlocks {
- get {
- return false;
- }
- }
-
-
- /// <summary>
- /// Returns the input block size for the Base64 encoder.
- /// </summary>
- /// <remarks>
- /// The returned value is always 3.
- /// </remarks>
- public virtual int InputBlockSize {
- get {
- return 3;
- }
- }
-
-
- /// <summary>
- /// Returns the output block size for the Base64 encoder.
- /// </summary>
- /// <remarks>
- /// The value returned by this property is always 4.
- /// </remarks>
- public virtual int OutputBlockSize {
- get {
- return 4;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public virtual int TransformBlock (byte [] inputBuffer,
- int inputOffset,
- int inputCount,
- byte [] outputBuffer,
- int outputOffset)
- {
- if (inputCount != this.InputBlockSize)
- throw new CryptographicException();
-
- byte [] lookup = Base64Table.EncodeTable;
-
- int b1 = inputBuffer [inputOffset];
- int b2 = inputBuffer [inputOffset + 1];
- int b3 = inputBuffer [inputOffset + 2];
-
- outputBuffer [outputOffset] = lookup [b1 >> 2];
- outputBuffer [outputOffset+1] = lookup [((b1 << 4) & 0x30) | (b2 >> 4)];
- outputBuffer [outputOffset+2] = lookup [((b2 << 2) & 0x3c) | (b3 >> 6)];
- outputBuffer [outputOffset+3] = lookup [b3 & 0x3f];
-
- return this.OutputBlockSize;
- }
-
-
-
-
- // LAMESPEC: It's not clear from Beta2 docs what should be
- // happening here if inputCount > InputBlockSize.
- // It just "Converts the specified region of the specified
- // byte array" and that's all.
- // Beta2 implementation throws some strange (and undocumented)
- // exception in such case. The exception is thrown by
- // System.Convert and not the method itself.
- // Anyhow, this implementation just encodes blocks of any size,
- // like any usual Base64 encoder.
-
- /// <summary>
- /// </summary>
- public virtual byte [] TransformFinalBlock (byte [] inputBuffer,
- int inputOffset,
- int inputCount)
- {
- int blockLen = this.InputBlockSize;
- int outLen = this.OutputBlockSize;
- int fullBlocks = inputCount / blockLen;
- int tail = inputCount % blockLen;
-
- byte [] res = new byte [(inputCount != 0)
- ? ((inputCount + 2) / blockLen) * outLen
- : 0];
-
- int outputOffset = 0;
-
- for (int i = 0; i < fullBlocks; i++) {
-
- TransformBlock (inputBuffer, inputOffset,
- blockLen, res, outputOffset);
-
- inputOffset += blockLen;
- outputOffset += outLen;
- }
-
-
- byte [] lookup = Base64Table.EncodeTable;
- int b1,b2;
-
-
- // When fewer than 24 input bits are available
- // in an input group, zero bits are added
- // (on the right) to form an integral number of
- // 6-bit groups.
- switch (tail) {
- case 0:
- break;
- case 1:
- b1 = inputBuffer [inputOffset];
- res [outputOffset] = lookup [b1 >> 2];
- res [outputOffset+1] = lookup [(b1 << 4) & 0x30];
-
- // padding
- res [outputOffset+2] = (byte)'=';
- res [outputOffset+3] = (byte)'=';
- break;
-
- case 2:
- b1 = inputBuffer [inputOffset];
- b2 = inputBuffer [inputOffset + 1];
- res [outputOffset] = lookup [b1 >> 2];
- res [outputOffset+1] = lookup [((b1 << 4) & 0x30) | (b2 >> 4)];
- res [outputOffset+2] = lookup [(b2 << 2) & 0x3c];
-
- // one-byte padding
- res [outputOffset+3] = (byte)'=';
- break;
-
- default:
- break;
- }
-
- return res;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override string ToString ()
- {
- return "mono::System.Security.Cryptography.ToBase64Transform";
- }
-
- } // ToBase64Transform
-
-
-
-
- [MonoTODO ("Put me in a separate file")]
- internal sealed class Base64Table {
-
- // This is the Base64 alphabet as described in RFC 2045
- // (Table 1, page 25).
- private static string ALPHABET =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
- private static byte[] encodeTable;
- private static byte[] decodeTable;
-
-
- static Base64Table ()
- {
- int len = ALPHABET.Length;
-
- encodeTable = new byte [len];
-
- for (int i=0; i < len; i++) {
- encodeTable [i] = (byte) ALPHABET [i];
- }
-
-
- decodeTable = new byte [1 + (int)'z'];
-
- for (int i=0; i < decodeTable.Length; i++) {
- decodeTable [i] = Byte.MaxValue;
- }
-
- for (int i=0; i < len; i++) {
- char ch = ALPHABET [i];
- decodeTable [(int)ch] = (byte) i;
- }
- }
-
-
- private Base64Table ()
- {
- // Never instantiated.
- }
-
-
- internal static byte [] EncodeTable {
- get {
- return encodeTable;
- }
- }
-
- internal static byte [] DecodeTable {
- get {
- return decodeTable;
- }
- }
-
- } // Base64Table
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/X509Certificates.cs b/mcs/class/corlib/System.Security.Cryptography/X509Certificates.cs
deleted file mode 100755
index 35ab02c76df..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/X509Certificates.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography.X509Certificates {
-
- public class X509Certificate {
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Permissions/ChangeLog b/mcs/class/corlib/System.Security.Permissions/ChangeLog
deleted file mode 100644
index 06e58631ff1..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/ChangeLog
+++ /dev/null
@@ -1,62 +0,0 @@
-2002-02-17 Duncan Mak <duncan@ximian.com>
-
- * FileDialogPermissionAccess.cs: Add in namespace declaration, so
- that this one little unique enum wouldn't show up in the System
- namespace when we ildasm corlib.dll ;-) Oops, my bad.
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * SecurityPermission.cs,
- IsolatedStoragePermissionAttribute.cs: New files
-
-2002-01-23 Duncan Mak <duncan@ximian.com>
-
- * FileDialogPermissionAccess.cs: Add to CVS.
-
-2002-01-20 Duncan Mak <duncan@ximian.com>
-
- * *Attribute.cs: Implemented all the properties in the attributes
- and removed the relevent MonoTODO attributes.
-
- * *Attribute.cs: Fixed indentation.
-
-2002-01-18 Duncan Mak <duncan@ximian.com>
-
- * EnvironmentPermissionAttribute.cs:
- * FileDialogPermissionAttribute.cs:
- * FileIOPermissionAttribute.cs:
- * IsolatedStorageAttribute.cs:
- * IsolatedStorageFilePermissionAttribute.cs:
- * PermissionSetAttribute.cs:
- * PrinciplePermissionAttribute.cs:
- * ReflectionPermissionAttribute.cs:
- * RegistryPermissionAttribute.cs:
- * SiteIdentityPermissionAttribute.cs:
- * StrongNamePermissionAttribute.cs:
- * UIPermissionAttribute.cs:
- * UrlIdentityPermissionAttribute.cs:
- * ZoneIdentityPermissionAttribute.cs: New files. Stubbed out with MonoTODOs
-
- * Note: These are all the Attributes in the
- System.Security.Permissions namespace. The only missing one is
- PublishIdentityPermissionAttribute.cs because we don't have
- anything for the X509Certificate class.
-
-2002-01-14 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermission.cs: New file. Implemented.
-
-2002-01-08 Nick Drochak <ndrochak@gol.com>
-
- * CodeAccessSecurityAttribute.cs, SecurityAttribute.cs,
- SecurityPermissionAttribute.cs: New Files
-
- * SecurityPermissionFlag.cs: Add missing enum values
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * IUnrestrictedPermission.cs: Added missing interface class
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * EnvironmentPermissionAccess.cs, FileIOPermissionAccess.cs, ReflectionPermissionFlag.cs: Add.
diff --git a/mcs/class/corlib/System.Security.Permissions/CodeAccessSecurityAttribute.cs b/mcs/class/corlib/System.Security.Permissions/CodeAccessSecurityAttribute.cs
deleted file mode 100644
index 389813681da..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/CodeAccessSecurityAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Security.Permissions.SecurityPermissionAttribute.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-06
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [System.AttributeUsage(
- System.AttributeTargets.Assembly
- | System.AttributeTargets.Class
- | System.AttributeTargets.Struct
- | System.AttributeTargets.Constructor
- | System.AttributeTargets.Method,
- AllowMultiple=true,
- Inherited=false)
- ]
- public abstract class CodeAccessSecurityAttribute : SecurityAttribute {
-
- protected CodeAccessSecurityAttribute(SecurityAction action) : base(action) {}
-
- } // public abstract class CodeAccessSecurityAttribute
-} // namespace System.Security.Permissions \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAccess.cs b/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAccess.cs
deleted file mode 100644
index 06517ebc7c6..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAccess.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// EnvironmentPermissionAccess.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:29:59 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum EnvironmentPermissionAccess {
-
- /// <summary>
- /// </summary>
- NoAccess = 0x00000000,
-
- /// <summary>
- /// </summary>
- Read = 0x00000001,
-
- /// <summary>
- /// </summary>
- Write = 0x00000002,
-
- /// <summary>
- /// </summary>
- AllAccess = Read | Write,
- } // EnvironmentPermissionAccess
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs
deleted file mode 100644
index 3b16e90eb16..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.Security.Permissions.EnvironmentPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class EnvironmentPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string all;
- private string read;
- private string write;
-
- // Constructor
- public EnvironmentPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string All
- {
- set { all = value; }
- }
-
- public string Read
- {
- get { return read; }
- set { read = value; }
- }
-
- public string Write
- {
- get { return write; }
- set { write = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAccess.cs b/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAccess.cs
deleted file mode 100644
index d2196cba0b3..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAccess.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Security.Permissions.FileDialogPermissionAccess
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Security.Permissions
-{
- [Flags] [Serializable]
- public enum FileDialogPermissionAccess
- {
- None = 0,
- Open = 1,
- Save = 2,
- OpenSave = 3,
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAttribute.cs
deleted file mode 100644
index 58ee4a5fe0a..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAttribute.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Security.Permissions.FileDialogPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class FileDialogPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private bool canOpen;
- private bool canSave;
-
- // Constructor
- public FileDialogPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public bool Open
- {
- get { return canOpen; }
- set { canOpen = value; }
- }
-
- public bool Save
- {
- get { return canSave; }
- set { canSave = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs b/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs
deleted file mode 100644
index 9c0de94f196..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs
+++ /dev/null
@@ -1,411 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Security.Permissions.FileIOPermission.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-09
-//
-//------------------------------------------------------------------------------
-
-using System.Collections;
-using System.Text;
-using System.Security.Permissions;
-using System.IO;
-
-namespace System.Security.Permissions {
-
- [SerializableAttribute()]
- public sealed class FileIOPermission : CodeAccessPermission, IUnrestrictedPermission {
-
- private static char[] m_badCharacters = {'\"','<', '>', '|', '*', '?'};
- private bool m_Unrestricted = false;
- private Hashtable m_PathList = new Hashtable();
- private FileIOPermissionAccess m_AllFilesAccess = FileIOPermissionAccess.NoAccess;
- private FileIOPermissionAccess m_AllLocalFilesAccess = FileIOPermissionAccess.NoAccess;
-
- public FileIOPermission(PermissionState state) {
- if (!Enum.IsDefined(typeof(PermissionState), state)){
- throw new ArgumentException("Invalid permission state.", "state");
- }
- m_Unrestricted = (PermissionState.Unrestricted == state);
- if (m_Unrestricted) {
- m_AllFilesAccess = FileIOPermissionAccess.AllAccess;
- m_AllLocalFilesAccess = FileIOPermissionAccess.AllAccess;
- }
- }
-
- public FileIOPermission(FileIOPermissionAccess access, string path){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
-
- if (path.LastIndexOfAny(m_badCharacters) >= 0){
- throw new ArgumentException("Illegal characters found in input. Security checks can not contain wild card characters.", "path");
- }
-
- AddPathList(access, path);
- }
-
- public FileIOPermission(FileIOPermissionAccess access, string[] pathList){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
-
- AddPathList(access, pathList);
- }
-
- public FileIOPermissionAccess AllFiles {
- get {
- return m_AllFilesAccess;
- }
- set {
- // if we are already set to unrestricted, don't change this property
- if (!m_Unrestricted){
- m_AllFilesAccess = value;
- }
- }
- }
-
- public FileIOPermissionAccess AllLocalFiles {
- get {
- return m_AllLocalFilesAccess;
- }
- set {
- // if we are already set to unrestricted, don't change this property
- if (!m_Unrestricted){
- m_AllLocalFilesAccess = value;
- }
- }
- }
-
- public void AddPathList(FileIOPermissionAccess access, string path){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: {0}.",access.ToString());
- }
-
- if (path.LastIndexOfAny(m_badCharacters) >= 0){
- throw new ArgumentException("Invalid characters in path: '{0}'", path);
- }
-
- // LAMESPEC: docs don't say it must be a rooted path, but the MS implementation enforces it, so we will too.
- if(!Path.IsPathRooted(path)) {
- throw new ArgumentException("Absolute path information is required.");
- }
-
- // don't add the same path twice, instead overwrite access entry for that path
- if (m_PathList.ContainsKey(path)) {
- FileIOPermissionAccess currentPermission = (FileIOPermissionAccess)m_PathList[path];
- currentPermission |= access;
- m_PathList[path] = currentPermission;
- }
- else {
- m_PathList.Add(path, access);
- }
- }
-
- public void AddPathList(FileIOPermissionAccess access, string[] pathList ){
- foreach(string path in pathList){
- AddPathList(access, path);
- }
-
- }
-
- // private constructor used by Copy() method
- private FileIOPermission(Hashtable pathList, FileIOPermissionAccess allFiles,
- FileIOPermissionAccess allLocalFiles, bool unrestricted){
- m_PathList = pathList;
- m_AllFilesAccess = allFiles;
- m_AllLocalFilesAccess = allLocalFiles;
- m_Unrestricted = unrestricted;
- }
-
- public override IPermission Copy(){
- if (m_Unrestricted) {
- return new FileIOPermission(PermissionState.Unrestricted);
- }
- else{
- FileIOPermission retVal = new FileIOPermission(m_PathList, m_AllFilesAccess, m_AllLocalFilesAccess, m_Unrestricted);
- return retVal;
- }
- }
-
- /* XML Schema for FileIOPermission
- <IPermission class=”FileIOPermission”
- version=”1”
- (
- Read=”[list of files or folders]” |
- Write=”[list of files or folders]” |
- Append=”[list of files or folders]”
- ) v Unrestricted=”true”
- />
- */
- public override void FromXml(SecurityElement esd){
- if (null == esd) {
- throw new ArgumentNullException();
- }
- if (esd.Tag != "IPermission" || (string)esd.Attributes["class"] != "FileIOPermission"
- || (string)esd.Attributes["version"] != "1"){
- throw new ArgumentException("Not a valid permission element");
- }
- m_PathList.Clear();
- if ("true" == (string)esd.Attributes["Unrestricted"]){
- m_Unrestricted = true;
- }
- else{
- m_Unrestricted = false;
- string fileList;
- fileList = (string)esd.Attributes["Read"];
- string[] files;
- if (fileList != null){
- files = fileList.Split(';');
- AddPathList(FileIOPermissionAccess.Read, files);
- }
- fileList = (string)esd.Attributes["Write"];
- if (fileList != null){
- files = fileList.Split(';');
- AddPathList(FileIOPermissionAccess.Write, files);
- }
- fileList = (string)esd.Attributes["Append"];
- if (fileList != null){
- files = fileList.Split(';');
- AddPathList(FileIOPermissionAccess.Append, files);
- }
- }
- }
-
- public string[] GetPathList(FileIOPermissionAccess access){
- //LAMESPEC: docs says it returns (semicolon separated) list, but return
- //type is array. I think docs are wrong and it just returns an array
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
-
- ArrayList matchingPaths = new ArrayList();
- System.Collections.IDictionaryEnumerator pathListIterator = m_PathList.GetEnumerator();
- while (pathListIterator.MoveNext()) {
- if (((FileIOPermissionAccess)pathListIterator.Value & access) != 0) {
- matchingPaths.Add((string)pathListIterator.Key);
- }
- }
- if (matchingPaths.Count == 0) {
- return null;
- }
- else {
- return (string[])matchingPaths.ToArray(typeof(string));
- }
- }
-
- public override IPermission Intersect(IPermission target){
- if (null == target){
- return null;
- }
- else {
- if (target.GetType() != typeof(FileIOPermission)){
- throw new ArgumentException();
- }
- }
- FileIOPermission FIOPTarget = (FileIOPermission)target;
- if (FIOPTarget.IsUnrestricted() && m_Unrestricted){
- return new FileIOPermission(PermissionState.Unrestricted);
- }
- else if (FIOPTarget.IsUnrestricted()){
- return Copy();
- }
- else if (m_Unrestricted){
- return FIOPTarget.Copy();
- }
- else{
- FileIOPermission retVal = new FileIOPermission(PermissionState.None);
- retVal.AllFiles = m_AllFilesAccess & FIOPTarget.AllFiles;
- retVal.AllLocalFiles = m_AllLocalFilesAccess & FIOPTarget.AllLocalFiles;
-
- string[] paths;
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Append);
- if (null != paths) {
- foreach (string path in paths){
- if (m_PathList.ContainsKey(path)
- && ((FileIOPermissionAccess)m_PathList[path] & FileIOPermissionAccess.Append) != 0){
- retVal.AddPathList(FileIOPermissionAccess.Append, path);
- }
- }
- }
-
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Read);
- if (null != paths) {
- foreach (string path in paths){
- if (m_PathList.ContainsKey(path)
- && ((FileIOPermissionAccess)m_PathList[path] & FileIOPermissionAccess.Read) != 0){
- retVal.AddPathList(FileIOPermissionAccess.Read, path);
- }
- }
- }
-
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Write);
- if (null != paths) {
- foreach (string path in paths){
- if (m_PathList.ContainsKey(path)
- && ((FileIOPermissionAccess)m_PathList[path] & FileIOPermissionAccess.Write) != 0){
- retVal.AddPathList(FileIOPermissionAccess.Write, path);
- }
- }
- }
-
- return retVal;
- }
- }
-
-
- public override bool IsSubsetOf(IPermission target){
- // X.IsSubsetOf(Y) is true if permission Y includes everything allowed by X.
- if (target != null && target.GetType() != typeof(FileIOPermission)){
- throw new ArgumentException();
- }
- FileIOPermission FIOPTarget = (FileIOPermission)target;
- if (FIOPTarget.IsUnrestricted()){
- return true;
- }
- else if (m_Unrestricted){
- return false;
- }
- else if ((m_AllFilesAccess & FIOPTarget.AllFiles) != m_AllFilesAccess) {
- return false;
- }
- else if ((m_AllLocalFilesAccess & FIOPTarget.AllLocalFiles) != m_AllLocalFilesAccess) {
- return false;
- }
- else{
- string[] pathsNeeded;
- string[] pathsInTarget;
-
- pathsNeeded = GetPathList(FileIOPermissionAccess.Append);
- if (null != pathsNeeded) {
- pathsInTarget = FIOPTarget.GetPathList(FileIOPermissionAccess.Append);
- foreach (string path in pathsNeeded){
- if (Array.IndexOf(pathsInTarget, path) <0) {
- return false;
- }
- }
- }
-
- pathsNeeded = GetPathList(FileIOPermissionAccess.Read);
- if (null != pathsNeeded) {
- pathsInTarget = FIOPTarget.GetPathList(FileIOPermissionAccess.Read);
- foreach (string path in pathsNeeded){
- if (Array.IndexOf(pathsInTarget, path) <0) {
- return false;
- }
- }
- }
-
- pathsNeeded = GetPathList(FileIOPermissionAccess.Write);
- if (null != pathsNeeded) {
- pathsInTarget = FIOPTarget.GetPathList(FileIOPermissionAccess.Write);
- foreach (string path in pathsNeeded){
- if (Array.IndexOf(pathsInTarget, path) <0) {
- return false;
- }
- }
- }
-
- return true;
- }
- }
-
- public bool IsUnrestricted(){
- return m_Unrestricted;
- }
-
- public void SetPathList(FileIOPermissionAccess access, string path){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
- if (path.LastIndexOfAny(m_badCharacters) >= 0){
- throw new ArgumentException("Invalid characters in path: '{0}'", path);
- }
-
- m_PathList.Clear();
- AddPathList(access, path);
- }
-
- public void SetPathList(FileIOPermissionAccess access, string[] pathList){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
- foreach(string path in pathList){
- if (path.LastIndexOfAny(m_badCharacters) >= 0){
- throw new ArgumentException("Invalid characters in path entry: '{0}'", path);
- }
- }
-
- m_PathList.Clear();
- AddPathList(access, pathList);
- }
-
- public override SecurityElement ToXml(){
- //Encode the the current permission to XML using the
- //security element class.
- SecurityElement element = new SecurityElement("IPermission");
- Type type = this.GetType();
- StringBuilder AsmName = new StringBuilder(type.Assembly.ToString());
- AsmName.Replace('\"', '\'');
- element.AddAttribute("class", type.FullName + ", " + AsmName);
- element.AddAttribute("version", "1");
- if(m_Unrestricted){
- element.AddAttribute("Unrestricted", "true");
- }
- else {
- string[] paths;
- paths = GetPathList(FileIOPermissionAccess.Append);
- if (null != paths && paths.Length >0){
- element.AddAttribute("Append", String.Join(";",paths));
- }
- paths = GetPathList(FileIOPermissionAccess.Read);
- if (null != paths && paths.Length >0){
- element.AddAttribute("Read", String.Join(";",paths));
- }
- paths = GetPathList(FileIOPermissionAccess.Write);
- if (null != paths && paths.Length >0){
- element.AddAttribute("Write", String.Join(";",paths));
- }
- }
- return element;
- }
-
- public override IPermission Union(IPermission other){
- if (null == other){
- return null;
- }
- else {
- if (other.GetType() != typeof(FileIOPermission)){
- throw new ArgumentException();
- }
- }
- FileIOPermission FIOPTarget = (FileIOPermission)other;
- if (FIOPTarget.IsUnrestricted() || m_Unrestricted){
- return new FileIOPermission(PermissionState.Unrestricted);
- }
- else{
- FileIOPermission retVal = (FileIOPermission)Copy();
- retVal.AllFiles |= FIOPTarget.AllFiles;
- retVal.AllLocalFiles |= FIOPTarget.AllLocalFiles;
- string[] paths;
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Append);
- if (null != paths){
- retVal.AddPathList(FileIOPermissionAccess.Append, paths);
- }
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Read);
- if (null != paths){
- retVal.AddPathList(FileIOPermissionAccess.Read, paths);
- }
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Write);
- if (null != paths){
- retVal.AddPathList(FileIOPermissionAccess.Write, paths);
- }
- return retVal;
- }
- }
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAccess.cs b/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAccess.cs
deleted file mode 100644
index dd255cd3b1c..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAccess.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// FileIOPermissionAccess.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:30:11 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum FileIOPermissionAccess {
-
- /// <summary>
- /// </summary>
- NoAccess = 0x00000000,
-
- /// <summary>
- /// </summary>
- Read = 0x00000001,
-
- /// <summary>
- /// </summary>
- Write = 0x00000002,
-
- /// <summary>
- /// </summary>
- Append = 0x00000004,
-
- /// <summary>
- /// </summary>
- PathDiscovery = 0x00000008,
-
- /// <summary>
- /// </summary>
- AllAccess = Read | Write | Append | PathDiscovery,
- } // FileIOPermissionAccess
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAttribute.cs
deleted file mode 100644
index 64540caf30a..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAttribute.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.Security.Permissions.FileIOPermissionAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class FileIOPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string all;
- private string append;
- private string path;
- private string read;
- private string write;
-
- // Constructor
- public FileIOPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string All
- {
- set { all = value; }
- }
-
- public string Append
- {
- get { return append; }
- set { append = value; }
- }
-
- public string PathDiscovery
- {
- get { return path; }
- set { path = value; }
- }
-
- public string Read
- {
- get { return read; }
- set { read = value; }
- }
-
- public string Write
- {
- get { return write; }
- set { write = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/IUnrestrictedPermission.cs b/mcs/class/corlib/System.Security.Permissions/IUnrestrictedPermission.cs
deleted file mode 100644
index f9b6b9eae0e..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IUnrestrictedPermission.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Security.Permissions.IUnrestrictedPermission.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security.Permissions {
-
- public interface IUnrestrictedPermission {
- bool IsUnrestricted();
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/IsolatedStorageContainment.cs b/mcs/class/corlib/System.Security.Permissions/IsolatedStorageContainment.cs
deleted file mode 100755
index 0004b520a3f..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IsolatedStorageContainment.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// IsolatedStorageContainment.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:41:57 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum IsolatedStorageContainment {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- DomainIsolationByUser = 1,
-
- /// <summary>
- /// </summary>
- AssemblyIsolationByUser = 2,
-
- /// <summary>
- /// </summary>
- AdministerIsolatedStorageByUser = 5,
-
- /// <summary>
- /// </summary>
- UnrestrictedIsolatedStorage = 7,
- } // IsolatedStorageContainment
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs
deleted file mode 100644
index a9a879f06fc..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Security.Permissions.IsolatedStorageFilePermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
-
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class IsolatedStorageFilePermissionAttribute : IsolatedStoragePermissionAttribute
- {
- // Constructor
- public IsolatedStorageFilePermissionAttribute (SecurityAction action)
- : base (action)
- {
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs b/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs
deleted file mode 100644
index 35683f71296..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Security.Permissions.IsolatedStoragePermission.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public abstract class IsolatedStoragePermission : CodeAccessSecurityAttribute
- {
- // Fields
- private IsolatedStorageContainment containment;
- private long quota;
-
- // Constructor
- public IsolatedStoragePermission (SecurityAction action)
- : base (action)
- {
- }
-
- // Properties
- public IsolatedStorageContainment UsageAllowed
- {
- get { return containment; }
- set { containment = value; }
- }
-
- public long UserQuota
- {
- get { return quota; }
- set { quota = value; }
- }
- }
-}
-
-
-
-
-
diff --git a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermissionAttribute.cs
deleted file mode 100644
index ce44c66edc5..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermissionAttribute.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Security.Permissions.IsolatedStoragePermissionAttributes.cs
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions {
-
- [AttributeUsage ( AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public class IsolatedStoragePermissionAttribute : CodeAccessSecurityAttribute {
-
- public IsolatedStoragePermissionAttribute (SecurityAction action) : base (action) {
- }
-
- public IsolatedStorageContainment UsageAllowed {
- get { return usage_allowed; }
- set { usage_allowed = value; }
- }
-
- public long UserQuota {
- get { return user_quota; }
- set { user_quota = value; }
- }
-
- [MonoTODO]
- public override IPermission CreatePermission () {
- return null;
- }
-
- // private
-
- private IsolatedStorageContainment usage_allowed;
- private long user_quota;
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/PermissionSetAttribute.cs b/mcs/class/corlib/System.Security.Permissions/PermissionSetAttribute.cs
deleted file mode 100644
index ee654f7e00b..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/PermissionSetAttribute.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.Security.Permissions.PermissionSetAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class PermissionSetAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string file;
- private string name;
- private bool isUnicodeEncoded;
- private string xml;
-
- // Constructor
- public PermissionSetAttribute (SecurityAction action)
- : base (action)
- {
- }
-
- // Properties
- public string File
- {
- get { return file; }
- set { file = value; }
- }
-
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
-
- public bool UnicodeEncoded
- {
- get { return isUnicodeEncoded; }
- set { isUnicodeEncoded = value; }
- }
-
- public string XML
- {
- get { return xml; }
- set { xml = value; }
- }
-
- // Methods
- public override IPermission CreatePermission ()
- {
- return null; // Not used, used for inheritance from SecurityAttribute
- }
-
- [MonoTODO]
- public PermissionSet CreatePermissionSet ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/PermissionState.cs b/mcs/class/corlib/System.Security.Permissions/PermissionState.cs
deleted file mode 100755
index 66c3d03eb6f..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/PermissionState.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// PermissionState.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:30:05 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum PermissionState {
-
- /// <summary>
- /// </summary>
- Unrestricted = 1,
-
- /// <summary>
- /// </summary>
- None = 0,
- } // PermissionState
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/PrincipalPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/PrincipalPermissionAttribute.cs
deleted file mode 100644
index 2e417f3d13e..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/PrincipalPermissionAttribute.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Security.Permissions.PrinciplePermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class PrinciplePermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private bool authenticated;
- private string name;
- private string role;
-
- // Constructor
- public PrinciplePermissionAttribute (SecurityAction action)
- : base (action)
- {
- }
-
- // Properties
- [MonoTODO]
- public bool Authenticated
- {
- get { return authenticated; }
- set { authenticated = value; }
- }
-
- [MonoTODO]
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
-
- [MonoTODO]
- public string Role
- {
- get { return role; }
- set { role = value; }
- }
-
- // Method
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/PrinciplePermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/PrinciplePermissionAttribute.cs
deleted file mode 100644
index 2e417f3d13e..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/PrinciplePermissionAttribute.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Security.Permissions.PrinciplePermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class PrinciplePermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private bool authenticated;
- private string name;
- private string role;
-
- // Constructor
- public PrinciplePermissionAttribute (SecurityAction action)
- : base (action)
- {
- }
-
- // Properties
- [MonoTODO]
- public bool Authenticated
- {
- get { return authenticated; }
- set { authenticated = value; }
- }
-
- [MonoTODO]
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
-
- [MonoTODO]
- public string Role
- {
- get { return role; }
- set { role = value; }
- }
-
- // Method
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs
deleted file mode 100644
index b7a94b4c29d..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Security.Permissions.ReflectionPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class ReflectionPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private ReflectionPermissionFlag flags;
- private bool memberAccess;
- private bool reflectionEmit;
- private bool typeInfo;
-
- //Constructor
- public ReflectionPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public ReflectionPermissionFlag Flags
- {
- get { return flags; }
- set { flags = value; }
- }
-
- public bool MemberAccess
- {
- get { return memberAccess; }
- set { memberAccess = value; }
- }
-
- public bool ReflectionEmit
- {
- get { return reflectionEmit; }
- set { reflectionEmit = value; }
- }
-
- public bool TypeInformation
- {
- get { return typeInfo; }
- set { typeInfo = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionFlag.cs b/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionFlag.cs
deleted file mode 100644
index bb0414a22d9..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionFlag.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// ReflectionPermissionFlag.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:31:14 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ReflectionPermissionFlag {
-
- /// <summary>
- /// </summary>
- NoFlags = 0x00000000,
-
- /// <summary>
- /// </summary>
- TypeInformation = 0x00000001,
-
- /// <summary>
- /// </summary>
- MemberAccess = 0x00000002,
-
- /// <summary>
- /// </summary>
- AllFlags = TypeInformation | MemberAccess,
- } // ReflectionPermissionFlag
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAccess.cs b/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAccess.cs
deleted file mode 100755
index 20051045886..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAccess.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// RegistryPermissionAccess.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:42:13 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum RegistryPermissionAccess {
-
- /// <summary>
- /// </summary>
- NoAccess = 0,
-
- /// <summary>
- /// </summary>
- Read = 1,
-
- /// <summary>
- /// </summary>
- Write = 2,
-
- /// <summary>
- /// </summary>
- Create = 4,
-
- /// <summary>
- /// </summary>
- AllAccess = 7,
- } // RegistryPermissionAccess
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAttribute.cs
deleted file mode 100644
index 9e0a79fe833..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAttribute.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Security.Permissions.RegistryPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class RegistryPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string all;
- private string create;
- private string read;
- private string write;
-
- // Constructor
- public RegistryPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- string All
- {
- set { all = value; }
- }
-
- public string Create
- {
- get { return create; }
- set { create = value; }
- }
-
- public string Read
- {
- get { return read; }
- set { read = value; }
- }
-
- public string Write
- {
- get { return write; }
- set { write = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs b/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs
deleted file mode 100755
index 7cd81e1c500..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// SecurityAction.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:29:52 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum SecurityAction {
-
- /// <summary>
- /// </summary>
- Demand = 2,
-
- /// <summary>
- /// </summary>
- Assert = 3,
-
- /// <summary>
- /// </summary>
- Deny = 4,
-
- /// <summary>
- /// </summary>
- PermitOnly = 5,
-
- /// <summary>
- /// </summary>
- LinkDemand = 6,
-
- /// <summary>
- /// </summary>
- InheritanceDemand = 7,
-
- /// <summary>
- /// </summary>
- RequestMinimum = 8,
-
- /// <summary>
- /// </summary>
- RequestOptional = 9,
-
- /// <summary>
- /// </summary>
- RequestRefuse = 10,
- } // SecurityAction
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityAttribute.cs b/mcs/class/corlib/System.Security.Permissions/SecurityAttribute.cs
deleted file mode 100644
index b3591229ebd..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityAttribute.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Security.Permissions.SecurityPermissionAttribute.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-06
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions {
- [System.AttributeUsage(
- System.AttributeTargets.Assembly
- | System.AttributeTargets.Class
- | System.AttributeTargets.Struct
- | System.AttributeTargets.Constructor
- | System.AttributeTargets.Method,
- AllowMultiple=true,
- Inherited=false)
- ]
-
- public abstract class SecurityAttribute : Attribute {
-
- private SecurityAction m_Action;
- private bool m_Unrestricted;
-
- public SecurityAttribute(SecurityAction action) {
- if (!SecurityAction.IsDefined(typeof(SecurityAction), action)) {
- throw new System.ArgumentException();
- }
- }
-
- public abstract IPermission CreatePermission();
-
- public bool Unrestricted {
- get {
- return m_Unrestricted;
- }
- set {
- m_Unrestricted = value;
- }
- }
-
- public SecurityAction Action {
- get {
- return m_Action;
- }
- set {
- m_Action = value;
- }
- }
- } // public abstract class SecurityAttribute
-} // namespace System.Security.Permissions \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityPermission.cs b/mcs/class/corlib/System.Security.Permissions/SecurityPermission.cs
deleted file mode 100644
index 47eee269b2b..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityPermission.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Security.Permissions.SecurityPermission.cs
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions {
-
- [MonoTODO]
- public sealed class SecurityPermission :
- CodeAccessPermission, IUnrestrictedPermission
- {
- public SecurityPermission (PermissionState state) {
- this.flags = SecurityPermissionFlag.NoFlags;
- }
-
- public SecurityPermission (SecurityPermissionFlag flags) {
- this.flags = flags;
- }
-
- public SecurityPermissionFlag Flags {
- get { return flags; }
- set { flags = value; }
- }
-
- public bool IsUnrestricted () {
- return false;
- }
-
- public override IPermission Copy () {
- return null;
- }
-
- public override IPermission Intersect (IPermission target) {
- return null;
- }
-
- public override IPermission Union (IPermission target) {
- return null;
- }
-
- public override bool IsSubsetOf (IPermission target) {
- return false;
- }
-
- public override void FromXml (SecurityElement e) {
- }
-
- public override SecurityElement ToXml () {
- return null;
- }
-
- // private
-
- private SecurityPermissionFlag flags;
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/SecurityPermissionAttribute.cs
deleted file mode 100644
index 868b199f267..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionAttribute.cs
+++ /dev/null
@@ -1,216 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Security.Permissions.SecurityPermissionAttribute.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-06
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions {
- [System.AttributeUsage(
- System.AttributeTargets.Assembly
- | System.AttributeTargets.Class
- | System.AttributeTargets.Struct
- | System.AttributeTargets.Constructor
- | System.AttributeTargets.Method,
- AllowMultiple=true,
- Inherited=false)
- ]
- public sealed class SecurityPermissionAttribute : CodeAccessSecurityAttribute {
- private SecurityPermissionFlag m_Flags = SecurityPermissionFlag.NoFlags;
-
- public SecurityPermissionAttribute(SecurityAction action) : base(action) {
- if (!SecurityAction.IsDefined(typeof(SecurityAction), action)) {
- throw new System.ArgumentException();
- }
- }
-
- public bool Assertion {
- get{
- return ((m_Flags & SecurityPermissionFlag.Assertion) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.Assertion;
- }
- else{
- m_Flags -= SecurityPermissionFlag.Assertion;
- }
- }
- }
-
- public bool ControlAppDomain {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlAppDomain) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlAppDomain;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlAppDomain;
- }
- }
- }
-
- public bool ControlDomainPolicy {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlDomainPolicy) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlDomainPolicy;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlDomainPolicy;
- }
- }
- }
-
- public bool ControlEvidence {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlEvidence) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlEvidence;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlEvidence;
- }
- }
- }
-
- public bool ControlPolicy {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlPolicy) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlPolicy;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlPolicy;
- }
- }
- }
-
- public bool ControlPrincipal {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlPrincipal) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlPrincipal;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlPrincipal;
- }
- }
- }
-
- public bool ControlThread {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlThread) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlThread;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlThread;
- }
- }
- }
-
- public bool Execution {
- get{
- return ((m_Flags & SecurityPermissionFlag.Execution) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.Execution;
- }
- else{
- m_Flags -= SecurityPermissionFlag.Execution;
- }
- }
- }
-
- public bool Infrastructure {
- get{
- return ((m_Flags & SecurityPermissionFlag.Infrastructure) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.Infrastructure;
- }
- else{
- m_Flags -= SecurityPermissionFlag.Infrastructure;
- }
- }
- }
-
- public bool RemotingConfiguration {
- get{
- return ((m_Flags & SecurityPermissionFlag.RemotingConfiguration) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.RemotingConfiguration;
- }
- else{
- m_Flags -= SecurityPermissionFlag.RemotingConfiguration;
- }
- }
- }
-
- public bool SerializationFormatter {
- get{
- return ((m_Flags & SecurityPermissionFlag.SerializationFormatter) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.SerializationFormatter;
- }
- else{
- m_Flags -= SecurityPermissionFlag.SerializationFormatter;
- }
- }
- }
-
- public bool SkipVerification {
- get{
- return ((m_Flags & SecurityPermissionFlag.SkipVerification) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.SkipVerification;
- }
- else{
- m_Flags -= SecurityPermissionFlag.SkipVerification;
- }
- }
- }
-
- public override IPermission CreatePermission() {
- return new SecurityPermission(m_Flags);
- }
-
- public SecurityPermissionFlag Flags {
- get {
- return m_Flags;
- }
- set {
- m_Flags = value;
- }
- }
- } // public sealed class SecurityPermissionAttribute
-} // namespace System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs b/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs
deleted file mode 100755
index 84b561eb48d..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-// SecurityPermissionFlag.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:30:18 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum SecurityPermissionFlag {
-
- /// <summary>
- /// </summary>
- NoFlags = 0x00000000,
-
- /// <summary>
- /// </summary>
- Assertion = 0x00000001,
-
- /// <summary>
- /// </summary>
- UnmanagedCode = 0x00000002,
-
- /// <summary>
- /// </summary>
- SkipVerification = 0x00000004,
-
- /// <summary>
- /// </summary>
- Execution = 0x00000008,
-
- /// <summary>
- /// </summary>
- ControlThread = 0x00000010,
-
- ControlAppDomain = 0x00000020,
-
- ControlDomainPolicy = 0x00000040,
-
- ControlEvidence = 0x00000080,
-
- ControlPolicy = 0x00000100,
-
- ControlPrincipal = 0x00000200,
-
- Infrastructure = 0x00000400,
-
- RemotingConfiguration = 0x00000800,
-
- SerializationFormatter = 0x00001000,
-
- /// <summary>
- /// </summary>
- AllFlags = Assertion | UnmanagedCode | SkipVerification | Execution | ControlThread
- | ControlAppDomain | ControlDomainPolicy | ControlEvidence | ControlPolicy
- | ControlPrincipal | Infrastructure | RemotingConfiguration | SerializationFormatter,
- } // SecurityPermissionFlag
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermissionAttribute.cs
deleted file mode 100644
index 2b43f6c79e9..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermissionAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Security.Permissions.SiteIdentityPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class SiteIdentityPermissionAttribute : IsolatedStoragePermissionAttribute
- {
- // Fields
- private string site;
-
- // Constructor
- public SiteIdentityPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string Site
- {
- get { return site; }
- set { site = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/StrongNamePermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/StrongNamePermissionAttribute.cs
deleted file mode 100644
index 6fa4d197bf9..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/StrongNamePermissionAttribute.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Security.Permissions.StrongNameIdentityPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
-
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class StrongNameIdentityPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string name;
- private string key;
- private string version;
-
- // Constructor
- public StrongNameIdentityPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
-
- public string PublicKey
- {
- get { return key; }
- set { key = value; }
- }
-
- public string Version
- {
- get { return version; }
- set { version = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/UIPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/UIPermissionAttribute.cs
deleted file mode 100644
index 3c541cb2597..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/UIPermissionAttribute.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Security.Permissions.UIPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class UIPermissionAttribute : IsolatedStoragePermissionAttribute
- {
-
- // Fields
- private UIPermissionClipboard clipboard;
- private UIPermissionWindow window;
-
- // Constructor
- public UIPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public UIPermissionClipboard Clipboard
- {
- get { return clipboard; }
- set { clipboard = value; }
- }
-
- public UIPermissionWindow Window
- {
- get { return window; }
- set { window = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/UIPermissionClipboard.cs b/mcs/class/corlib/System.Security.Permissions/UIPermissionClipboard.cs
deleted file mode 100755
index 6ae9a795dc0..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/UIPermissionClipboard.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// UIPermissionClipboard.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:42:40 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum UIPermissionClipboard {
-
- /// <summary>
- /// </summary>
- NoClipboard = 0,
-
- /// <summary>
- /// </summary>
- OwnClipboard = 1,
-
- /// <summary>
- /// </summary>
- AllClipboard = 2,
- } // UIPermissionClipboard
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/UIPermissionWindow.cs b/mcs/class/corlib/System.Security.Permissions/UIPermissionWindow.cs
deleted file mode 100755
index 4d65080e744..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/UIPermissionWindow.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// UIPermissionWindow.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:42:30 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum UIPermissionWindow {
-
- /// <summary>
- /// </summary>
- NoWindows = 0,
-
- /// <summary>
- /// </summary>
- SafeSubWindows = 1,
-
- /// <summary>
- /// </summary>
- SafeTopLevelWindows = 2,
-
- /// <summary>
- /// </summary>
- AllWindows = 3,
- } // UIPermissionWindow
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/UrlIdentityPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/UrlIdentityPermissionAttribute.cs
deleted file mode 100644
index 29f4006cdc3..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/UrlIdentityPermissionAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Security.Permissions.UrlIdentityPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class UrlIdentityPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string url;
-
- // Constructor
- public UrlIdentityPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string Url
- {
- get { return url; }
- set { url = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/ZoneIdentityPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/ZoneIdentityPermissionAttribute.cs
deleted file mode 100644
index 48b97970ac2..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/ZoneIdentityPermissionAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Security.Permissions.ZoneIdentityPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class ZoneIdentityPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private SecurityZone zone;
-
- // Constructor
- public ZoneIdentityPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public SecurityZone Zone
- {
- get { return zone; }
- set { zone = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/AllMembershipCondition.cs b/mcs/class/corlib/System.Security.Policy/AllMembershipCondition.cs
deleted file mode 100755
index 858ef857c00..00000000000
--- a/mcs/class/corlib/System.Security.Policy/AllMembershipCondition.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// System.Security.Policy.AllMembershipCondition.cs
-//
-// Author:
-// Ajay kumar Dwivedi (adwiv@yahoo.com)
-//
-
-using System;
-using System.Security;
-
-
-namespace System.Security.Policy
-{
- /// <summary>
- /// Summary description for AllMembershipCondition.
- /// </summary>
- [Serializable]
- public sealed class AllMembershipCondition : IMembershipCondition,
- ISecurityEncodable, ISecurityPolicyEncodable
- {
- // Tag for Xml Data
- private static readonly string XmlTag = "IMembershipCondition";
-
- public AllMembershipCondition()
- {}
-
- //Always returns true
- public bool Check(Evidence evidence)
- {
- return true;
- }
-
- public IMembershipCondition Copy()
- {
- return new AllMembershipCondition();
- }
-
- public override bool Equals(object o)
- {
- if(o is System.Security.Policy.AllMembershipCondition)
- return true;
- return false;
- }
-
- public void FromXml(SecurityElement e)
- {
- FromXml(e, null);
- }
-
- //Fixme: is there a need for all this????
- public void FromXml(SecurityElement e, PolicyLevel level)
- {
- if(e == null)
- throw new ArgumentNullException("e");
- if(e.Tag != XmlTag)
- throw new ArgumentException("e","The Tag of SecurityElement must be "
- + AllMembershipCondition.XmlTag);
- }
-
- //What's the use of a hashcode here. Equals is always true.
- public override int GetHashCode()
- {
- return 0;
- }
-
- public override string ToString()
- {
- return "All Code";
- }
-
- public SecurityElement ToXml()
- {
- return ToXml(null);
- }
-
- public SecurityElement ToXml(PolicyLevel level)
- {
- SecurityElement se = new SecurityElement(XmlTag);
- Type type = this.GetType();
- string classString = type.FullName + ", " + type.Assembly;
- se.AddAttribute("class",classString);
- se.AddAttribute("version","1");
- return se;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/ChangeLog b/mcs/class/corlib/System.Security.Policy/ChangeLog
deleted file mode 100644
index 3295992a69c..00000000000
--- a/mcs/class/corlib/System.Security.Policy/ChangeLog
+++ /dev/null
@@ -1,56 +0,0 @@
-2002-02-14 Nick Drochak <ndrochak@gol.com>
-
- * FileCodeGroup.cs: Finish Equals()
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * PolicyStatement: New file (stub)
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * FileCodeGroup.cs: New file. All done except for GetHashCode and
- Resolve.
- * CodeGroup.cs: Fix small bug in ToXml()
- * Evidence.cs: Added method stub needed by FileCodeGroup.cs. Added
- MonoTODO's too.
-
-2002-02-07 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroup.cs: Went as far as I can for now. Need to look at
- the (To|From)XML methods when I understand PolicyLevels better.
-
-2002-02-02 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroup.cs: Not done, but checking in now just in case
-
-2002-01-30 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroup.cs: New file. Not nearly done with this, but saving it
- in cvs just in case.
- * PolicyLevel.cs: Sarted just a bit on this then relized i need CodeGroup
- first (among others). Checking in for disaster recovery.
-
-2002-01-29 Nick Drochak <ndrochak@gol.com>
-
- * PolicyStatementAttribute.cs: New file.
- * PolicyException.cs: Use correct namespace
- * PolicyLevel.cs: Add [Serializable] to class
-
-2002-01-19 Duncan Mak <duncan@ximian.com>
-
- * PolicyException.cs: New File.
-
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * IIdentityPermissionFactory.cs: New File
- * IMembershipCondition: New File
-
-2001-12-29 Nick Drochak <ndrochak@gol.com>
-
- * PolicyLevel.cs: New file
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * SecurityElement.cs, CodeAccessPermission.cs IPermission.cs
- IStackWalk.cs SecurityElement.cs ISecurityEncodable.cs: New files.
-
diff --git a/mcs/class/corlib/System.Security.Policy/CodeGroup.cs b/mcs/class/corlib/System.Security.Policy/CodeGroup.cs
deleted file mode 100644
index f2103476096..00000000000
--- a/mcs/class/corlib/System.Security.Policy/CodeGroup.cs
+++ /dev/null
@@ -1,252 +0,0 @@
-// System.Security.Policy.CodeGroup
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak, All rights reserved.
-
-using System.Security.Policy;
-using System.Security.Permissions;
-using System.Collections;
-using System; // for MonoTODO attribute
-
-namespace System.Security.Policy
-{
- [Serializable]
- public abstract class CodeGroup
- {
- PolicyStatement m_policy = null;
- IMembershipCondition m_membershipCondition = null;
- string m_description = null;
- string m_name = null;
- ArrayList m_children = new ArrayList();
- PolicyLevel m_level;
-
- public CodeGroup(IMembershipCondition membershipCondition,
- PolicyStatement policy)
- {
- if (null == membershipCondition)
- throw new ArgumentNullException("Value cannot be null.");
- m_policy = policy;
- m_membershipCondition = membershipCondition;
- }
-
- public abstract CodeGroup Copy();
- public abstract string MergeLogic {get;}
- public abstract PolicyStatement Resolve( Evidence evidence);
- public abstract CodeGroup ResolveMatchingCodeGroups(Evidence evidence);
-
- public PolicyStatement PolicyStatement
- {
- get
- {
- return m_policy;
- }
- set
- {
- m_policy = value;
- }
- }
-
- public string Description
- {
- get
- {
- return m_description;
- }
- set
- {
- m_description = value;
- }
- }
-
- public IMembershipCondition MembershipCondition
- {
- get
- {
- return m_membershipCondition;
- }
- set
- {
- if (null == value)
- throw new ArgumentException("Value cannot be null");
- m_membershipCondition = value;
- }
- }
-
- public string Name
- {
- get
- {
- return m_name;
- }
- set
- {
- m_name = value;
- }
- }
-
- public IList Children
- {
- get
- {
- return m_children;
- }
- set
- {
- if (null == value)
- throw new ArgumentException("Value cannot be null");
- m_children = new ArrayList(value);
- }
- }
-
- public virtual string AttributeString
- {
- get
- {
- if (null != m_policy)
- return m_policy.AttributeString;
-
- return null;
- }
- }
-
- public virtual string PermissionSetName
- {
- get
- {
- if (m_policy.PermissionSet is Security.NamedPermissionSet)
- return ((NamedPermissionSet)(m_policy.PermissionSet)).Name;
-
- return null;
- }
- }
-
- public void AddChild(CodeGroup group)
- {
- if (null == group)
- throw new ArgumentNullException("The group parameter cannot be null");
- m_children.Add(group);
- }
-
- public override bool Equals(object o)
- {
- if (!(o is CodeGroup))
- return false;
-
- return Equals((CodeGroup)o, false);
- }
-
- public bool Equals(CodeGroup cg, bool compareChildren)
- {
- if (cg.Name != this.Name)
- return false;
-
- if (cg.Description != this.Description)
- return false;
-
- if (cg.MembershipCondition != this.MembershipCondition)
- return false;
-
- if (compareChildren)
- {
- int childCount = cg.Children.Count;
- if (this.Children.Count != childCount)
- return false;
-
- for (int index = 0; index < childCount; index++)
- {
- // LAMESPEC: are we supposed to check child equality recursively?
- // The docs imply 'no' but it seems natural to do a 'deep' compare.
- // Will check the children's children, and so-on unless we find out that
- // we shouldn't
- if (!((CodeGroup)(this.Children[index])).Equals((CodeGroup)(cg.Children[index]), true))
- return false;
- }
- }
-
- return true;
-
- }
-
- public void RemoveChild(CodeGroup group)
- {
- if (!m_children.Contains(group))
- throw new ArgumentException();
-
- m_children.Remove(group);
- }
-
- [MonoTODO]
- public override int GetHashCode()
- {
- return 42;
- }
-
- public void FromXml(SecurityElement e)
- {
- FromXml(e, (PolicyLevel)null);
- }
-
- [MonoTODO]
- public void FromXml(SecurityElement e, PolicyLevel level )
- {
- if (null == e)
- throw new ArgumentNullException("e");
-
- // Not sure what might be serialized in this XML, so just do the strings for now
- // and null's for everything else
- m_children = null;
- m_policy = null;
- m_membershipCondition = null;
-
- m_name = e.Attribute("Name");
- m_description = e.Attribute("Description");
-
- // seems like we might need this to Resolve() in subclasses
- m_level = level;
-
- ParseXml(e, level);
- }
-
- protected virtual void ParseXml(SecurityElement e, PolicyLevel level)
- {
- }
-
- public SecurityElement ToXml()
- {
- return ToXml(null);
- }
-
- [MonoTODO("Not sure what to do with PolicyLevel parameter")]
- public SecurityElement ToXml(PolicyLevel level)
- {
- SecurityElement e = new SecurityElement("CodeGroup");
- e.AddAttribute("class", this.GetType().AssemblyQualifiedName);
- e.AddAttribute("version", "1");
-
- if (null != Name)
- e.AddAttribute("Name", Name);
-
- if (null != Description)
- e.AddAttribute("Description", Description);
-
- if (null != MembershipCondition)
- e.AddChild(MembershipCondition.ToXml());
-
- if (null != PolicyStatement)
- e.AddChild(PolicyStatement.PermissionSet.ToXml());
-
- foreach (CodeGroup child in Children)
- e.AddChild(child.ToXml());
-
- CreateXml(e, level);
- return e;
- }
-
- protected virtual void CreateXml(SecurityElement element, PolicyLevel level)
- {
- }
- } // public abstract class CodeGroup
-
-} // namespace System.Security.Policy \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security.Policy/Evidence.cs b/mcs/class/corlib/System.Security.Policy/Evidence.cs
deleted file mode 100644
index 80c7d2288fb..00000000000
--- a/mcs/class/corlib/System.Security.Policy/Evidence.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// System.Security.Policy.Evidence
-//
-// Authors:
-// Sean MacIsaac (macisaac@ximian.com)
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Ximian, Inc.
-
-using System.Collections;
-
-namespace System.Security.Policy
-{
- [MonoTODO]
- public sealed class Evidence
- {
-
- [MonoTODO]
- public Evidence () {
- }
-
- [MonoTODO]
- public IEnumerator GetHostEnumerator() {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/FileCodeGroup.cs b/mcs/class/corlib/System.Security.Policy/FileCodeGroup.cs
deleted file mode 100644
index debd7d3543a..00000000000
--- a/mcs/class/corlib/System.Security.Policy/FileCodeGroup.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-// System.Security.Policy.FileCodeGroup
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak, All rights reserved.
-
-using System.Security.Policy;
-using System.Security.Permissions;
-using System.Collections;
-using System; // for MonoTODO attribute
-
-namespace System.Security.Policy
-{
- [Serializable]
- public sealed class FileCodeGroup : CodeGroup
- {
- FileIOPermissionAccess m_access;
-
- [MonoTODO("Check if membershipCondition is valid")]
- public FileCodeGroup(IMembershipCondition membershipCondition,
- FileIOPermissionAccess access)
- : base(membershipCondition, null)
- {
- if (!Enum.IsDefined(typeof(FileIOPermissionAccess), access))
- throw new ArgumentException("Value not defined for FileIOPermissionAccess","access");
-
- m_access = access;
- }
-
- public override CodeGroup Copy()
- {
- FileCodeGroup copy = new FileCodeGroup(MembershipCondition, m_access);
- foreach (CodeGroup child in Children)
- {
- AddChild(child.Copy());
- }
-
- return copy;
- }
-
- public override string MergeLogic
- {
- get
- {
- return "Union";
- }
- }
-
- [MonoTODO]
- public override PolicyStatement Resolve( Evidence evidence)
- {
- if (null == evidence)
- throw new ArgumentNullException("evidence");
-
- if (null == PolicyStatement)
- throw new PolicyException();
-
- if (!MembershipCondition.Check(evidence))
- return null;
-
- IEnumerator hostEnumerator = evidence.GetHostEnumerator();
- while (hostEnumerator.MoveNext())
- {
- // FIXME: not sure what to do here
- // How do we check the URL and make a PolicyStatement?
- }
- throw new NotImplementedException();
- }
-
- public override CodeGroup ResolveMatchingCodeGroups(Evidence evidence)
- {
- if (null == evidence)
- throw new ArgumentNullException("evidence");
-
- if (!MembershipCondition.Check(evidence))
- return null;
-
- FileCodeGroup matchRoot = new FileCodeGroup(MembershipCondition, m_access);
-
- foreach (CodeGroup child in Children)
- {
- CodeGroup childMatchingCodeGroup = child.ResolveMatchingCodeGroups(evidence);
- if (childMatchingCodeGroup != null)
- AddChild(childMatchingCodeGroup);
- }
-
- return matchRoot;
- }
-
- public override string AttributeString
- {
- get
- {
- return null;
- }
- }
-
- public override string PermissionSetName
- {
- get
- {
- return "Same directory FileIO - " + m_access.ToString();
- }
- }
-
- public override bool Equals(object o)
- {
- if (!(o is FileCodeGroup))
- return false;
-
- if (this.m_access != ((FileCodeGroup)o).m_access)
- return false;
-
- return Equals((CodeGroup)o, false);
- }
-
- [MonoTODO]
- public override int GetHashCode()
- {
- throw new NotImplementedException();
- }
-
- protected override void ParseXml(SecurityElement e, PolicyLevel level)
- {
- m_access = (FileIOPermissionAccess)Enum.Parse(typeof(FileIOPermissionAccess), e.Attribute("Access"), true);
- }
-
- protected override void CreateXml(SecurityElement element, PolicyLevel level)
- {
- element.AddAttribute("Access", m_access.ToString());
- }
- } // public abstract class CodeGroup
-
-} // namespace System.Security.Policy \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security.Policy/IIdentityPermissionFactory.cs b/mcs/class/corlib/System.Security.Policy/IIdentityPermissionFactory.cs
deleted file mode 100644
index 5b82d9d934a..00000000000
--- a/mcs/class/corlib/System.Security.Policy/IIdentityPermissionFactory.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// System.Security.Policy.IIdentityPermissionFactory
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-namespace System.Security.Policy
-{
- public interface IIdentityPermissionFactory
- {
- IPermission CreateIdentityPermission(Evidence evidence);
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/IMembershipCondition.cs b/mcs/class/corlib/System.Security.Policy/IMembershipCondition.cs
deleted file mode 100644
index 030e1b1d283..00000000000
--- a/mcs/class/corlib/System.Security.Policy/IMembershipCondition.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// System.Security.Policy.IMembershipCondition.cs
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-namespace System.Security.Policy
-{
- public interface IMembershipCondition : ISecurityEncodable,
- ISecurityPolicyEncodable
- {
- bool Check(Evidence evidence);
- IMembershipCondition Copy();
- string ToString();
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Policy/PolicyException.cs b/mcs/class/corlib/System.Security.Policy/PolicyException.cs
deleted file mode 100644
index 3fc12347231..00000000000
--- a/mcs/class/corlib/System.Security.Policy/PolicyException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.PolicyException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Security.Policy
-{
- [Serializable]
- public class PolicyException : SystemException
- {
- // Constructors
- public PolicyException ()
- : base (Locale.GetText ("Cannot run because of policy."))
- {
- }
-
- public PolicyException (string message)
- : base (message)
- {
- }
-
- protected PolicyException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public PolicyException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs b/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs
deleted file mode 100644
index e135b8983f0..00000000000
--- a/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// System.Security.Policy.PolicyLevel
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-using System.Collections; // for IList
-
-namespace System.Security.Policy
-{
- [MonoTODO]
- [Serializable]
- public sealed class PolicyLevel
- {
- public IList FullTrustAssemblies
- {
- get
- {
- return (IList)null;
- }
- }
-
- public string Label
- {
- get
- {
- return "";
- }
- }
-
- public IList NamedPermissionSets
- {
- get
- {
- return (IList)null;
- }
- }
-
- public CodeGroup RootCodeGroup
- {
- get
- {
- return (CodeGroup)null;
- }
-
- set
- {
-
- }
- }
-
- public string StoreLocation
- {
- get
- {
- return "";
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/PolicyStatement.cs b/mcs/class/corlib/System.Security.Policy/PolicyStatement.cs
deleted file mode 100644
index 4724153ff99..00000000000
--- a/mcs/class/corlib/System.Security.Policy/PolicyStatement.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Security.Policy.PolicyStatement
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-namespace System.Security.Policy {
-
- public class PolicyStatement : ISecurityEncodable, ISecurityPolicyEncodable {
- public PolicyStatement (PermissionSet perms) :
- this (perms, PolicyStatementAttribute.Nothing)
- {
- }
-
- public PolicyStatement (PermissionSet perms, PolicyStatementAttribute attrs) {
- this.perms = perms;
- this.attrs = attrs;
- }
-
- public PermissionSet PermissionSet {
- get { return perms; }
- set { perms = value; }
- }
-
- public PolicyStatementAttribute Attributes {
- get { return attrs; }
- set { attrs = value; }
- }
-
- public string AttributeString {
- get { return attrs.ToString ("F"); }
- }
-
- // ISecurityEncodable
-
- [MonoTODO]
- public void FromXml (SecurityElement e) {
- }
-
- [MonoTODO]
- public void FromXml (SecurityElement e, PolicyLevel level) {
- }
-
- [MonoTODO]
- public SecurityElement ToXml () {
- return null;
- }
-
- [MonoTODO]
- public SecurityElement ToXml (PolicyLevel level) {
- return null;
- }
-
- private PermissionSet perms;
- private PolicyStatementAttribute attrs;
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/PolicyStatementAttribute.cs b/mcs/class/corlib/System.Security.Policy/PolicyStatementAttribute.cs
deleted file mode 100644
index be194224be9..00000000000
--- a/mcs/class/corlib/System.Security.Policy/PolicyStatementAttribute.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// System.Security.Policy.PolicyStatementAttribute
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-namespace System.Security.Policy
-{
- [Flags]
- [Serializable]
- public enum PolicyStatementAttribute {
- Nothing = 0,
- Exclusive = 1,
- LevelFinal = 2,
- All = 3
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/ChangeLog b/mcs/class/corlib/System.Security.Principal/ChangeLog
deleted file mode 100644
index ca072f91da8..00000000000
--- a/mcs/class/corlib/System.Security.Principal/ChangeLog
+++ /dev/null
@@ -1,3 +0,0 @@
-2002-01-07 Nick Drochak <ndrochak@gol.com>
-
- * PrincipalPolicy.cs: made enum public like it should be to get _AppDomain to compile.
diff --git a/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs b/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs
deleted file mode 100644
index 05b168c5a96..00000000000
--- a/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.Principal.GenericIdentity.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- public class GenericIdentity : IIdentity {
- string user_name;
- string authentication_type;
-
- public GenericIdentity (string user_name, string authentication_type)
- {
- this.user_name = user_name;
- this.authentication_type = authentication_type;
- }
-
- public GenericIdentity (string name)
- {
- this.user_name = user_name;
- }
-
- public string AuthenticationType {
- get {
- return authentication_type;
- }
- }
-
- public string Name {
- get {
- return user_name;
- }
- }
-
- public bool IsAuthenticated {
- get {
- return true;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs b/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs
deleted file mode 100644
index c1e96e282e5..00000000000
--- a/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Security.Principal.GenericPrincipal.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- public class GenericPrincipal : IPrincipal {
- IIdentity identity;
- string [] roles;
-
- public GenericPrincipal (IIdentity identity, string [] roles)
- {
- this.identity = identity;
- this.roles = roles;
- }
-
- public IIdentity Identity {
- get {
- return identity;
- }
- }
-
- public bool IsInRole (string role)
- {
- foreach (string r in roles)
- if (role == r)
- return true;
-
- return false;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/IIdentity.cs b/mcs/class/corlib/System.Security.Principal/IIdentity.cs
deleted file mode 100644
index e31f8eddd34..00000000000
--- a/mcs/class/corlib/System.Security.Principal/IIdentity.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Security.Principal.IIdentity.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- public interface IIdentity {
-
- string AuthenticationType {
- get;
- }
-
- bool IsAuthenticated {
- get;
- }
-
- string Name {
- get;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/IPrincipal.cs b/mcs/class/corlib/System.Security.Principal/IPrincipal.cs
deleted file mode 100644
index 55aece3a4dc..00000000000
--- a/mcs/class/corlib/System.Security.Principal/IPrincipal.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Security.Principal.IPrincipal.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- public interface IPrincipal {
-
- IIdentity Identity {
- get;
- }
-
- bool IsInRole (string role);
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/PrincipalPolicy.cs b/mcs/class/corlib/System.Security.Principal/PrincipalPolicy.cs
deleted file mode 100644
index 0fc36b14087..00000000000
--- a/mcs/class/corlib/System.Security.Principal/PrincipalPolicy.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Security.Principal.PrincipalPolicy.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- public enum PrincipalPolicy {
- UnauthenticatedPrincipal,
- NoPrincipal,
- WindowsPrincipal
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/WindowsAccountType.cs b/mcs/class/corlib/System.Security.Principal/WindowsAccountType.cs
deleted file mode 100644
index 6f88bb04f8a..00000000000
--- a/mcs/class/corlib/System.Security.Principal/WindowsAccountType.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Security.Principal.WindowsAccountType.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- enum WindowsAccountType {
- Normal,
- Guest,
- System,
- Anonymous
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/WindowsBuiltInRole.cs b/mcs/class/corlib/System.Security.Principal/WindowsBuiltInRole.cs
deleted file mode 100644
index 3e2b37e93c5..00000000000
--- a/mcs/class/corlib/System.Security.Principal/WindowsBuiltInRole.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Security.Principal.WindowsBuiltInRole.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- enum WindowsBuiltInRole {
- Administrator = 544,
- User = 545,
- Guest = 546,
- PowerUser = 547,
- AccountOperator = 548,
- SystemOperator = 549,
- PrintOperator = 550,
- BackupOperator = 551,
- Replicator = 552,
- }
-}
diff --git a/mcs/class/corlib/System.Security/ChangeLog b/mcs/class/corlib/System.Security/ChangeLog
deleted file mode 100755
index c29dcbfd5b0..00000000000
--- a/mcs/class/corlib/System.Security/ChangeLog
+++ /dev/null
@@ -1,42 +0,0 @@
-2002-02-23 Nick Drochak <ndrochak@gol.com>
-
- * SecurityElement.cs: fixed typo
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * NamedPermissionSet.cs: New file (stub)
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * SecurityException.cs: Reformatted to fit the form of other
- Exceptions. Added serialization bits.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * SecurityElement.cs : Insert MonoTODO attribute.
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * CodeAccessPermission.cs: Fix syntax error hidden by exclusion in .build file
-
-2001-12-30 Nick Drochak <ndrochak@gol.com>
-
- * PermissionSet.cs SecurityManager.cs: New Files
- * CodeAccessPermission.cs: Add Skeleton code
- * IPermission.cs: Make public and inherit from ISecurityEncodable
- * ISecurityEncodable.cs: Make interface public
- * ISecurityPolicyEncodable.cs: Ditto
- * IStackWalk.cs: Ditto
-
-2001-12-29 Nick Drochak <ndrochak@gol.com>
-
- * ISecurityPolicyEncodable.cs, PolicyLevelType.cs,
- SecurityZone.cs, SecurityException.cs, UnverifiableCodeAttribute.cs,
- SuppressUnmanagedCodeSecurityAttribute.cs,
- VerificationException.cs, XmlSyntaxException.cs: New files
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * SecurityElement.cs, CodeAccessPermission.cs IPermission.cs
- IStackWalk.cs SecurityElement.cs ISecurityEncodable.cs: New files.
-
diff --git a/mcs/class/corlib/System.Security/CodeAccessPermission.cs b/mcs/class/corlib/System.Security/CodeAccessPermission.cs
deleted file mode 100755
index 5eb85ff9f5d..00000000000
--- a/mcs/class/corlib/System.Security/CodeAccessPermission.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.Security.CodeAccessPermission.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security {
-
- public abstract class CodeAccessPermission : IPermission, ISecurityEncodable, IStackWalk
- {
- ///<summary>Constructs a new instance of the System.Security.CodeAccessPermission class.</summary>
- protected CodeAccessPermission(){}
-
- ///<summary> Asserts that calling code can access the resource identified by the current instance through the code that calls this method, even if callers have not been granted permission to access the resource. </summary>
- ///<exception cref="System.Security.SecurityException">The calling code does not have System.Security.Permissions.SecurityPermissionFlag.Assertion. </exception>
- public void Assert()
- {
- }
-
- ///<summary> Returns a System.Security.CodeAccessPermission containing the same values as the current instance.</summary>
- ///<returns> A new System.Security.CodeAccessPermission instance that is value equal to the current instance.</returns>
- public abstract IPermission Copy();
-
- ///<summary>Forces a System.Security.SecurityException if all callers do not have the permission specified by the current instance.</summary>
- ///<exception cref="System.Security.SecurityException"> A caller does not have the permission specified by the current instance. A caller has called System.Security.CodeAccessPermission.Deny for the resource protected by the current instance. </exception>
- public void Demand()
- {
- }
-
- ///<summary> Denies access to the resources specified by the current instance through the code that calls this method.</summary>
- public void Deny(){}
-
- ///<summary> Reconstructs the state of a System.Security.CodeAccessPermission object using the specified XML encoding.</summary>
- ///<param name="elem">A System.Security.SecurityElement instance containing the XML encoding to use to reconstruct the state of a System.Security.CodeAccessPermission object.</param>
- ///<exception cref="System.ArgumentException">elem does not contain the XML encoding for a instance of the same type as the current instance.The version number of elem is not valid.</exception>
- public abstract void FromXml(SecurityElement elem);
-
- ///<summary> Returns a System.Security.CodeAccessPermission object that is the intersection of the current instance and the specified object.</summary>
- ///<param name="target">A System.Security.CodeAccessPermission instance to intersect with the current instance.</param>
- ///<returns> A new System.Security.CodeAccessPermission instance that represents the intersection of the current instance andtarget. If the intersection is empty or target is null, returns null. If the current instance is unrestricted, returns a copy of target. Iftarget is unrestricted, returns a copy of the current instance.</returns>
- ///<exception cref="System.ArgumentException">target is not null and is not a System.Security.CodeAccessPermission object.</exception>
- public abstract IPermission Intersect(IPermission target);
-
- ///<summary>Determines whether the current instance is a subset of the specified object.</summary>
- ///<param name="target">A System.Security.CodeAccessPermission instance that is to be tested for the subset relationship.</param>
- ///<returns>true if the current instance is a subset of target; otherwise, false. If the current instance is unrestricted, and target is not, returnsfalse. If target is unrestricted, returns true.</returns>
- ///<exception cref="System.ArgumentException">target is not null and is not of type System.Security.CodeAccessPermission.</exception>
- public abstract bool IsSubsetOf(IPermission target);
-
- ///<summary> Returns the XML representation of the state of the current instance.</summary>
- ///<returns> A System.String containing the XML representation of the state of the current instance.</returns>
- public override string ToString()
- {
- return null;
- }
-
- ///<summary> Returns the XML encoding of the current instance.</summary>
- ///<returns>A System.Security.SecurityElement containing an XML encoding of the state of the current instance.</returns>
- public abstract SecurityElement ToXml();
-
- ///<summary> Returns a System.Security.CodeAccessPermission object that is the union of the current instance and the specified object.</summary>
- ///<param name="other">A System.Security.IPermission object of the same type as the current instance to be combined with the current instance.</param>
- ///<returns>If other is null, returns a copy of the current instance using the System.Security.IPermission.Copy method.</returns>
- ///<exception cref="System.ArgumentException">other is not of type System.Security.CodeAccessPermission.</exception>
- ///<exception cref="System.NotSupportedException">other is not null.</exception>
- public virtual IPermission Union(IPermission other)
- {
- if (!(other is System.Security.CodeAccessPermission))
- {
- throw new System.ArgumentException(); // other is not of type System.Security.CodeAccessPermission.
- }
- if (null != other)
- {
- throw new System.NotSupportedException(); // other is not null.
- }
- return null;
- }
-
- public void PermitOnly(){}
- }
-}
diff --git a/mcs/class/corlib/System.Security/IEvidenceFactory.cs b/mcs/class/corlib/System.Security/IEvidenceFactory.cs
deleted file mode 100644
index 3687f6d6f95..00000000000
--- a/mcs/class/corlib/System.Security/IEvidenceFactory.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// System.Security.IEvidenceFactory
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) Ximian, Inc. 2001
-
-namespace System.Security
-{
- public interface IEvidenceFactory
- {
- }
-}
diff --git a/mcs/class/corlib/System.Security/IPermission.cs b/mcs/class/corlib/System.Security/IPermission.cs
deleted file mode 100755
index 63aabfd4c4a..00000000000
--- a/mcs/class/corlib/System.Security/IPermission.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Security.IPermission.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security {
-
- public interface IPermission : ISecurityEncodable {
-
- IPermission Copy ();
-
- void Demand ();
-
- IPermission Intersect (IPermission target);
-
- bool IsSubsetOf (IPermission target);
-
- IPermission Union (IPermission target);
- }
-}
diff --git a/mcs/class/corlib/System.Security/ISecurityEncodable.cs b/mcs/class/corlib/System.Security/ISecurityEncodable.cs
deleted file mode 100755
index 55b9ebe2f55..00000000000
--- a/mcs/class/corlib/System.Security/ISecurityEncodable.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Security.ISecurityEncodable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security {
-
- public interface ISecurityEncodable {
-
- void FromXml (SecurityElement e);
-
- SecurityElement ToXml ();
- }
-}
diff --git a/mcs/class/corlib/System.Security/ISecurityPolicyEncodable.cs b/mcs/class/corlib/System.Security/ISecurityPolicyEncodable.cs
deleted file mode 100644
index 66418ab91d0..00000000000
--- a/mcs/class/corlib/System.Security/ISecurityPolicyEncodable.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Security.ISecurityPolicyEncodable.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Security.Policy;
-
-namespace System.Security {
-
- public interface ISecurityPolicyEncodable {
-
- void FromXml (SecurityElement e, PolicyLevel level);
-
- SecurityElement ToXml (PolicyLevel level);
- }
-}
diff --git a/mcs/class/corlib/System.Security/IStackWalk.cs b/mcs/class/corlib/System.Security/IStackWalk.cs
deleted file mode 100755
index f5b717ac57a..00000000000
--- a/mcs/class/corlib/System.Security/IStackWalk.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Security.IStackWalk.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security {
-
- public interface IStackWalk {
-
- void Assert ();
-
- void Demand ();
-
- void Deny ();
-
- void PermitOnly ();
- }
-}
diff --git a/mcs/class/corlib/System.Security/NamedPermissionSet.cs b/mcs/class/corlib/System.Security/NamedPermissionSet.cs
deleted file mode 100644
index fb12f699efb..00000000000
--- a/mcs/class/corlib/System.Security/NamedPermissionSet.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Security.NamedPermissionSet
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security {
-
- [MonoTODO]
- public sealed class NamedPermissionSet : PermissionSet {
- public NamedPermissionSet (string name, PermissionSet set) : base (set) {
- this.name = name;
- this.description = "";
- }
-
- public NamedPermissionSet (string name, PermissionState state) : base (state) {
- this.name = name;
- this.description = "";
- }
-
- public NamedPermissionSet (NamedPermissionSet set) : this (set.name, set) {
- }
-
- public NamedPermissionSet (string name) : this (name, PermissionState.None) {
- }
-
- public string Description {
- get { return description; }
- set { description = value; }
- }
-
- public string Name {
- get { return name; }
- set { name = value; }
- }
-
- public override PermissionSet Copy () {
- return null;
- }
-
- public NamedPermissionSet Copy (string name) {
- return null;
- }
-
- public override void FromXml (SecurityElement e) {
- }
-
- public override SecurityElement ToXml () {
- return null;
- }
-
- // private
-
- private string name;
- private string description;
- }
-}
diff --git a/mcs/class/corlib/System.Security/PermissionSet.cs b/mcs/class/corlib/System.Security/PermissionSet.cs
deleted file mode 100644
index be80c65248a..00000000000
--- a/mcs/class/corlib/System.Security/PermissionSet.cs
+++ /dev/null
@@ -1,201 +0,0 @@
-//
-// System.Security.PermissionSet.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System;
-using System.Collections;
-using System.Security.Permissions;
-using System.Security;
-using System.Runtime.Serialization;
-
-namespace System.Security
-{
- ///<summary> Represents a collection that can contain different kinds of permissions and perform security operations.</summary>
- public class PermissionSet: ISecurityEncodable, ICollection, IEnumerable, IStackWalk, IDeserializationCallback
- {
- ///<summary> Constructs a new instance of the System.Security.PermissionSet class with the specified value.</summary>
- ///<param name="state">A System.Security.Permissions.PermissionState value. This value is either System.Security.Permissions.PermissionState.None or System.Security.Permissions.PermissionState.Unrestricted, to specify fully restricted or fully unrestricted access. </param>
- ///<exception cref="System.ArgumentException">state is not a valid System.Security.Permissions.PermissionState value.</exception>
- public PermissionSet(PermissionState state)
- {
- if (!Enum.IsDefined(typeof(System.Security.Permissions.PermissionState), state))
- {
- throw new System.ArgumentException(); // state is not a valid System.Security.Permissions.PermissionState value.
- }
- }
-
- ///<summary> Constructs a new instance of the System.Security.PermissionSet class with the values of the specified System.Security.PermissionSet instance. </summary>
- ///<param name="permSet">The System.Security.PermissionSet instance with which to initialize the values of the new instance, or null to initialize an empty permission set.</param>
- ///<exception cref="System.ArgumentException">permSet is not an instance of System.Security.PermissionSet.</exception>
- public PermissionSet(PermissionSet permSet)
- {
- // LAMESPEC: This would be handled by the compiler. No way permSet is not a PermissionSet.
- //if (false)
- //{
- // throw new System.ArgumentException(); // permSet is not an instance of System.Security.PermissionSet.
- //}
- }
-
- ///<summary> Adds the specified System.Security.IPermission object to the current instance if that permission does not already exist in the current instance.</summary>
- ///<param name="perm">The System.Security.IPermission object to add.</param>
- ///<returns>The System.Security.IPermission is added if perm is notnull and a permission of the same type as perm does not already exist in the current instance. If perm is null, returns null. If a permission of the same type asperm already exists in the current instance, the union of the existing permission and perm is added to the current instance and is returned.</returns>
- ///<exception cref="System.ArgumentException">perm is not a System.Security.IPermission object.</exception>
- public virtual IPermission AddPermission(IPermission perm)
- {
- // LAMESPEC: This would be handled by the compiler. No way perm is not an IPermission.
- //if (false)
- //{
- // throw new System.ArgumentException(); // perm is not a System.Security.IPermission object.
- //}
- return null;
- }
-
- ///<summary>Asserts that calling code can access the resources identified by the permissions contained in the current instance through the code that calls this method, even if callers have not been granted permission to access the resource. </summary>
- ///<exception cref="System.Security.SecurityException">The asserting code does not have sufficient permission to call this method.-or-This method was called with permissions already asserted for the current stack frame.</exception>
- public virtual void Assert()
- {
- throw new System.Security.SecurityException(); // The asserting code does not have sufficient permission to call this method.-or-This method was called with permissions already asserted for the current stack frame.
- }
-
- ///<summary>Returns a new System.Security.PermissionSet containing copies of the objects in the current instance.</summary>
- ///<returns>A new System.Security.PermissionSet that is value equal to the current instance.</returns>
- public virtual PermissionSet Copy()
- {
- return null;
- }
-
- ///<summary>Copies the permission objects in the current instance to the specified location in the specified System.Array.</summary>
- ///<param name="array">The destination System.Array.</param>
- ///<param name="index">A System.Int32 that specifies the zero-based starting position in the array at which to begin copying.</param>
- ///<exception cref="System.ArgumentException">array has more than one dimension.</exception>
- ///<exception cref="System.IndexOutOfRangeException">index is outside the range of allowable values for array.</exception>
- ///<exception cref="System.ArgumentNullException">array is null.</exception>
- public virtual void CopyTo(Array array, int index)
- {
- if (array.Rank > 1)
- {
- throw new System.ArgumentException("Array has more than one dimension"); // array has more than one dimension.
- }
- if (index < 0 || index >= array.Length)
- {
- throw new System.IndexOutOfRangeException(); // index is outside the range of allowable values for array.
- }
- if (null == array)
- {
- throw new System.ArgumentNullException(); // array is null.
- }
- }
-
- ///<summary>Forces a System.Security.SecurityException if all callers do not have the permissions specified by the objects contained in the current instance.</summary>
- ///<exception cref="System.Security.SecurityException">A caller does not have the permission specified by the current instance.</exception>
- public virtual void Demand()
- {
- throw new System.Security.SecurityException(); // A caller does not have the permission specified by the current instance.
- }
-
- ///<summary>Denies access to the resources secured by the objects contained in the current instance through the code that calls this method.</summary>
- ///<exception cref="System.Security.SecurityException">A previous call to Deny has already restricted the permissions for the current stack frame.</exception>
- public virtual void Deny()
- {
- throw new System.Security.SecurityException(); // A previous call to Deny has already restricted the permissions for the current stack frame.
- }
-
- ///<summary>Reconstructs the state of a System.Security.PermissionSet object using the specified XML encoding.</summary>
- ///<param name="et">A System.Security.SecurityElement instance containing the XML encoding to use to reconstruct the state of a System.Security.PermissionSet object.</param>
- ///<exception cref="System.ArgumentNullException">et is null.</exception>
- ///<exception cref="System.ArgumentException">et does not contain an XML encoding for a System.Security.PermissionSet instance.An error occurred while reconstructing et.</exception>
- public virtual void FromXml(SecurityElement et)
- {
- if (null == et)
- {
- throw new System.ArgumentNullException("et"); // et is null.
- }
- if (true)
- {
- throw new System.ArgumentException("et does not contain an XML encoding for a System.Security.PermissionSet instance."); // et does not contain an XML encoding for a System.Security.PermissionSet instance.An error occurred while reconstructing et.
- }
- }
-
- ///<summary> Returns an enumerator used to iterate over the permissions in the current instance.</summary>
- ///<returns>A System.Collections.IEnumerator object for the permissions of the set.</returns>
- public virtual IEnumerator GetEnumerator()
- {
- return null;
- }
-
- ///<summary> Determines whether the current instance is a subset of the specified object.</summary>
- ///<param name="target">A System.Security.PermissionSet instance that is to be tested for the subset relationship. </param>
- ///<returns>true if the current instance is a subset of target; otherwise, false. If the current instance is unrestricted, andtarget is not, returns false. If target is unrestricted, returns true.</returns>
- public virtual bool IsSubsetOf(PermissionSet target)
- {
- return false;
- }
-
- ///<summary> Specifies that only the resources described by the current instance can be accessed by calling code, even if the code has been granted permission to access other resources.</summary>
- ///<exception cref="System.Security.SecurityException">A previous call to PermitOnly has already set the permissions for the current stack frame.</exception>
- public virtual void PermitOnly()
- {
- if (true)
- {
- throw new System.Security.SecurityException(); // A previous call to PermitOnly has already set the permissions for the current stack frame.
- }
- }
-
- ///<summary> Returns a System.String representation of the state of the current instance.</summary>
- ///<returns>A System.Stringcontaining the XML representation of the state of the current instance.</returns>
- public override string ToString()
- {
- return null;
- }
-
- ///<summary>Returns the XML encoding of the current instance.</summary>
- ///<returns>A System.Security.SecurityElement containing an XML encoding of the state of the current instance.</returns>
- public virtual SecurityElement ToXml()
- {
- return null;
- }
-
- ///<summary> Returns a System.Security.PermissionSet object that is the union of the current instance and the specified object.</summary>
- ///<param name="other">A System.Security.PermissionSet instance to be combined with the current instance.</param>
- ///<returns> A new System.Security.PermissionSet instance that represents the union of the current instance and other. If the current instance or other is unrestricted, returns a System.Security.PermissionSet instance that is unrestricted.</returns>
- public virtual PermissionSet Union(PermissionSet other)
- {
- return null;
- }
-
- ///<summary>Implemented to support the System.Collections.ICollection interface. [Note: For more information, see System.Collections.ICollection.Count.]</summary>
- int ICollection.Count
- {
- get
- {
- return 0;
- }
- }
-
- ///<summary>Implemented to support the System.Collections.ICollection interface. [Note: For more information, see System.Collections.ICollection.IsSynchronized.]</summary>
- bool ICollection.IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- ///<summary>Implemented to support the System.Collections.ICollection interface. [Note: For more information, see System.Collections.ICollection.SyncRoot.]</summary>
- object ICollection.SyncRoot
- {
- get
- {
- return null;
- }
- }
-
- void IDeserializationCallback.OnDeserialization(object sender){}
-
- }
-}
diff --git a/mcs/class/corlib/System.Security/PolicyLevelType.cs b/mcs/class/corlib/System.Security/PolicyLevelType.cs
deleted file mode 100644
index d9e8e5c50bf..00000000000
--- a/mcs/class/corlib/System.Security/PolicyLevelType.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Security.PolicyLevelType.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security {
-
- public enum PolicyLevelType {
- AppDomain,
- Enterprise,
- Machine,
- User
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security/SecurityElement.cs b/mcs/class/corlib/System.Security/SecurityElement.cs
deleted file mode 100755
index 07728e8c223..00000000000
--- a/mcs/class/corlib/System.Security/SecurityElement.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-//
-// System.Security.SecurityElement.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-
-using System.Globalization;
-using System.Collections;
-using System.Text;
-
-namespace System.Security {
-
- [MonoTODO ("See bottom of the class for missing methods")]
- public sealed class SecurityElement {
- string text;
- string tag;
-
- public SecurityElement (string tag, string text)
- {
- if (tag.IndexOfAny (invalid_chars) != -1)
- throw new ArgumentException (Locale.GetText ("Invalid XML string"));
- if (text.IndexOfAny (invalid_chars) != -1 ||
- tag.IndexOfAny (invalid_chars) != -1)
- throw new ArgumentException (Locale.GetText ("Invalid XML string"));
-
- this.tag = tag;
- this.text = text;
- }
- public SecurityElement (string tag)
- {
- if (tag.IndexOfAny (invalid_chars) != -1)
- throw new ArgumentException (Locale.GetText ("Invalid XML string"));
-
- this.tag = tag;
- }
-
- Hashtable attributes;
- public Hashtable Attributes {
- get {
- return attributes;
- }
-
- set {
- attributes = value;
- }
- }
-
- ArrayList children;
- public ArrayList Children {
- get {
- return children;
- }
-
- set {
- if (value != null){
- foreach (object o in children){
- if (o == null)
- throw new ArgumentNullException ();
- }
- }
- children = value;
- }
- }
-
- public string Tag {
- get {
- return tag;
- }
- set {
- if (value == null)
- throw new ArgumentNullException ();
- if (tag.IndexOfAny (invalid_chars) != -1)
- throw new ArgumentException (Locale.GetText ("Invalid XML string"));
- tag = value;
- }
- }
-
- public string Text {
- get {
- return text;
- }
-
- set {
- if (value != null && (value.IndexOfAny (invalid_chars) != -1))
- throw new ArgumentException (Locale.GetText ("Invalid XML string"));
-
- text = value;
- }
- }
-
- public void AddAttribute (string name, string value)
- {
- if (name == null || value == null)
- throw new ArgumentNullException ();
-
- if (attributes == null)
- attributes = new Hashtable ();
-
- //
- // The hashtable will throw ArgumentException if name is already there
- //
-
- if (name.IndexOfAny (invalid_chars) != -1)
- throw new ArgumentException (Locale.GetText ("Invalid XML string"));
-
- if (value.IndexOfAny (invalid_chars) != -1)
- throw new ArgumentException (Locale.GetText ("Invalid XML string"));
-
- attributes.Add (name, value);
- }
-
- public void AddChild (SecurityElement child)
- {
- if (child == null)
- throw new ArgumentNullException ();
-
- if (children == null)
- children = new ArrayList ();
-
- children.Add (child);
- }
-
- public string Attribute (string name)
- {
- if (name == null)
- throw new ArgumentNullException ();
-
- if (attributes != null)
- return (string) attributes [name];
- else
- return null;
- }
-
- public bool Equal (SecurityElement other)
- {
- if (other == null)
- return false;
-
- if (text != other.text)
- return false;
-
- if (tag != other.tag)
- return false;
-
- throw new Exception ("IMPLEMENT ME: Compare attributes and children");
- }
-
- static char [] invalid_chars = new char [] { '<', '>', '"', '\'', '&' };
-
- public static string Escape (string str)
- {
- StringBuilder sb;
-
- if (str.IndexOfAny (invalid_chars) == -1)
- return str;
-
- sb = new StringBuilder ();
- int len = str.Length;
-
- for (int i = 0; i < len; i++){
- char c = str [i];
-
- switch (c){
- case '<': sb.Append ("&lt;"); break;
- case '>': sb.Append ("&gt;"); break;
- case '"': sb.Append ("&quot;"); break;
- case '\'': sb.Append ("&apos;"); break;
- case '&': sb.Append ("&amp;"); break;
- default: sb.Append (c); break;
- }
- }
-
- return sb.ToString ();
- }
-
- public static bool IsInvalidAttributeName (string name)
- {
- return name.IndexOfAny (invalid_chars) != -1;
- }
-
- public static bool IsInvalidAttributeValue (string value)
- {
- return value.IndexOfAny (invalid_chars) != -1;
- }
-
- public static bool IsInvalidTag (string value)
- {
- return value.IndexOfAny (invalid_chars) != -1;
- }
-
- public static bool IsInvalidText (string value)
- {
- return value.IndexOfAny (invalid_chars) != -1;
- }
-
- //
- // TODO:
- //
- // SearchForChildByTag
- // SearchForTextOfTag
- // ToString
- }
-}
diff --git a/mcs/class/corlib/System.Security/SecurityException.cs b/mcs/class/corlib/System.Security/SecurityException.cs
deleted file mode 100644
index cb1fb392ed4..00000000000
--- a/mcs/class/corlib/System.Security/SecurityException.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.Security.SecurityException.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System.Security {
- public class SecurityException : Exception {
-
- // Fields
- string permissionState;
- Type permissionType;
-
- // Properties
- public string PermissionState
- {
- get { return permissionState; }
- }
-
- public Type PermissionType
- {
- get { return permissionType; }
- }
-
- // Constructors
- public SecurityException ()
- : base (Locale.GetText ("A security error has been detected."))
- {
- }
-
- public SecurityException (string message)
- : base (message)
- {
- }
-
- protected SecurityException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- permissionState = info.GetString ("permissionState");
- }
-
- public SecurityException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public SecurityException (string message, Type type)
- : base (message)
- {
- permissionType = type;
- }
-
- public SecurityException (string message, Type type, string state)
- : base (message)
- {
- permissionType = type;
- permissionState = state;
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("PermissionState", permissionState);
- }
-
- public override string ToString ()
- {
- return permissionType.FullName + ": " + permissionState;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security/SecurityManager.cs b/mcs/class/corlib/System.Security/SecurityManager.cs
deleted file mode 100644
index c5ec392b28a..00000000000
--- a/mcs/class/corlib/System.Security/SecurityManager.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// System.Security.SecurityManager.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Security.Policy;
-using System.Collections;
-
-namespace System.Security {
-
- public sealed class SecurityManager {
- private static bool checkExecutionRights;
- private static bool securityEnabled;
-
- public static bool CheckExecutionRights {
- get{
- return checkExecutionRights;
- }
- set{
- checkExecutionRights = value;
- }
- }
-
- public static bool SecurityEnabled {
- get{
- return securityEnabled;
- }
- set{
- securityEnabled = value;
- }
- }
-
- public static bool IsGranted(IPermission perm){
- return false;
- }
-
- public static PolicyLevel LoadPolicyLevelFromFile(
- string path,
- PolicyLevelType type)
- {
- return null;
- }
-
- public static PolicyLevel LoadPolicyLevelFromString(
- string str,
- PolicyLevelType type)
- {
- if (null == str){
- throw new ArgumentNullException("str");
- }
- return null;
- }
-
- public static IEnumerator PolicyHierarchy(){
- return null;
- }
-
- public static PermissionSet ResolvePolicy(Evidence evidence){
- return null;
- }
-
- public static PermissionSet ResolvePolicy(
- Evidence evidence,
- PermissionSet reqdPset,
- PermissionSet optPset,
- PermissionSet denyPset,
- out PermissionSet denied)
- {
- denied = null;
- return null;
- }
-
- public static IEnumerator ResolvePolicyGroups(Evidence evidence){
- return null;
- }
-
- public static void SavePolicy(){}
-
- public static void SavePolicyLevel(PolicyLevel level){}
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security/SecurityZone.cs b/mcs/class/corlib/System.Security/SecurityZone.cs
deleted file mode 100644
index 4d999f3f227..00000000000
--- a/mcs/class/corlib/System.Security/SecurityZone.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Security.SecurityZone.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security {
-
- public enum SecurityZone {
- Internet,
- Intranet,
- MyComputer,
- NoZone,
- Trusted,
- Untrusted
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs b/mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs
deleted file mode 100644
index 155ed996722..00000000000
--- a/mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// System.Security.SuppressUnmanagedCodeSecurityAttribute.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security {
-
- public sealed class SuppressUnmanagedCodeSecurityAttribute : Attribute {}
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs b/mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs
deleted file mode 100644
index 1fd2f2b67ef..00000000000
--- a/mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// System.Security.UnverifiableCodeAttribute.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security {
-
- public sealed class UnverifiableCodeAttribute : Attribute {}
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security/VerificationException.cs b/mcs/class/corlib/System.Security/VerificationException.cs
deleted file mode 100644
index 676d2bfaca6..00000000000
--- a/mcs/class/corlib/System.Security/VerificationException.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Security.VerificationException.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System.Security {
- public class VerificationException : SystemException {
-
- // Constructors
- public VerificationException(){}
- public VerificationException(string message)
- : base (message){}
- protected VerificationException(SerializationInfo info, StreamingContext context)
- : base (info, context) {}
- public VerificationException(string message, Exception inner)
- : base (message, inner) {}
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security/XmlSyntaxException.cs b/mcs/class/corlib/System.Security/XmlSyntaxException.cs
deleted file mode 100644
index 3f2aa1bcb4f..00000000000
--- a/mcs/class/corlib/System.Security/XmlSyntaxException.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Security.XmlSyntaxException.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Globalization;
-
-namespace System.Security {
- public sealed class XmlSyntaxException : SystemException {
-
- // Constructors
- public XmlSyntaxException(){}
- public XmlSyntaxException(int lineNumber)
- : base (Locale.GetText("Invalid syntax on line ") + lineNumber.ToString() + "."){}
- public XmlSyntaxException(int lineNumber, string message)
- : base (Locale.GetText("Invalid syntax on line ") + lineNumber.ToString() + " - " + message ){}
- public XmlSyntaxException(string message)
- : base (message){}
- public XmlSyntaxException(string message, Exception inner)
- : base (message, inner) {}
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Text/ASCIIEncoding.cs b/mcs/class/corlib/System.Text/ASCIIEncoding.cs
deleted file mode 100755
index 7c82fa66d23..00000000000
--- a/mcs/class/corlib/System.Text/ASCIIEncoding.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Text.ASCIIEncoding.cs
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Text {
-
- public class ASCIIEncoding : Encoding
- {
- public ASCIIEncoding () : base ("ASCII", false)
- {
- encoding_name = "US-ASCII";
- body_name = "us-ascii";
- header_name = "us-ascii";
- web_name = "us-ascii";
- is_browser_display = false;
- is_browser_save = false;
- is_mail_news_display = true;
- is_mail_news_save = true;
- }
-
- [MonoTODO]
- public override int GetMaxByteCount (int charCount)
- {
- // FIXME: this is wrong, dont know the right value
- return charCount*6;
- }
-
- public override int GetMaxCharCount (int byteCount)
- {
- return byteCount;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Text/ChangeLog b/mcs/class/corlib/System.Text/ChangeLog
deleted file mode 100755
index 1ceccae3401..00000000000
--- a/mcs/class/corlib/System.Text/ChangeLog
+++ /dev/null
@@ -1,78 +0,0 @@
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ASCIIEncoding.cs, Encoding.cs, UTF7Encoding.cs,
- UnicodeEncoding.cs: MonoTODO attribute marking.
-
- * StringBuilder.cs : Ditto.
-
-Wed Nov 14 17:05:22 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Encoding.cs: renamed some fields.
- * StringBuilder.cs: CLSCompliant updates.
-
-2001-10-29 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilder.cs: Throw exceptions when constructor paramter(s) are
- invalid. Just like MS does (as best as I can tell).
-
- Tests for these exceptions are now added to the unit tests as well.
-
-2001-10-25 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilder.cs: Throw exception if they try to make a StringBuilder
- whose capacity is greater than the MaxCapacity.
-
- I added some tests for the constructors and the above exception. More
- coming soon.
-
-2001-10-23 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilder.cs: Refactored constructor code into just one
- constructor. All the other construtors call it. Also supplied missing
- constructors so the class has all those in the spec.
-
- Added the MaxCapacity property as well, however this needs to be
- completed to return a value is related to the available system memory.
-
-2001-10-07 Miguel de Icaza <miguel@ximian.com>
-
- * Encoding.cs, UTF8Encoding.cs, UTF7Encoding.cs, ASCIIEncoding.cs,
- UnicodeEncoding.cs: Corrected API.
-
- * UTF8Encoding.cs: Checked in changes from Rafael.
-
-2001-08-28 Dietmar Maurer <dietmar@ximian.com>
-
- * UTF8Encoding.cs: impl. clumsy GetBytes
-
-2001-07-16 Marcin Szczepanski <marcins@zipworld.com.au>
-
- * StringBuilder.cs (Text): Fixed.
-
- * StringBuilderTest.cs: Implement Test suite.
-
-2001-07-12 Marcin Szczepanski <marcins@zipworld.com.au>
-
- * StringBuilder.cs: Implemented.
-
- The only methods left unimplemented are the AppendFormat( ... )
- ones just because it's probably better to wait until some of the
- Format related classes are implemented. I've put that as a TODO
- comment at the top and created the methods with a "nop" body.
-
-2001-06-26 Sean MacIsaac <macisaac@ximian.com>
-
- * UnicodeEncoding.cs: Members added so that a clean compile is
- possible.
-
- * ASCIIEncoding.cs: Members added so that a clean compile is
- possible.
-
- * UTF7Encoding.cs: Members added so that a clean compile is
- possible.
-
- * UTF8Encoding.cs: Members added so that a clean compile is
- possible.
-
- * Encoding.cs: All public members included. Most members
- unimplemented.
diff --git a/mcs/class/corlib/System.Text/Decoder.cs b/mcs/class/corlib/System.Text/Decoder.cs
deleted file mode 100644
index f0ac38187ad..00000000000
--- a/mcs/class/corlib/System.Text/Decoder.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// System.Text.Decoder.cs
-//
-// Authors:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Text
-{
-
- public abstract class Decoder
- {
-
- protected Decoder ()
- {
- // fixme: dont know what do do here
- }
-
- public abstract int GetCharCount (byte[] bytes, int index, int count);
-
- public abstract int GetChars (byte[] bytes, int byteIndex, int byteCount,
- char[] chars, int charIndex);
- }
-
- internal class DefaultDecoder : Decoder {
-
- public Encoding encoding;
-
- public DefaultDecoder (Encoding enc)
- {
- encoding = enc;
- }
-
- public override int GetCharCount (byte[] bytes, int index, int count)
- {
- return encoding.GetCharCount (bytes, index, count);
- }
-
- public override int GetChars (byte[] bytes, int byteIndex, int byteCount,
- char[] chars, int charIndex)
- {
- return encoding.GetChars (bytes, byteIndex, byteCount, chars, charIndex);
- }
-
- }
-
- internal class IConvDecoder : Decoder {
-
- private IntPtr converter;
-
- public IConvDecoder (string name, bool big_endian)
- {
- converter = Encoding.IConvNewDecoder (name, big_endian);
- }
-
- public override int GetCharCount (byte[] bytes, int index, int count)
- {
- return Encoding.IConvGetCharCount (converter, bytes, index, count);
- }
-
- public override int GetChars (byte[] bytes, int byteIndex, int byteCount,
- char[] chars, int charIndex)
- {
- return Encoding.IConvGetChars (converter, bytes, byteIndex, byteCount,
- chars, charIndex);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Text/Encoder.cs b/mcs/class/corlib/System.Text/Encoder.cs
deleted file mode 100644
index d4e97239ffa..00000000000
--- a/mcs/class/corlib/System.Text/Encoder.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.Text.Encoder.cs
-//
-// Authors:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Text
-{
-
- public abstract class Encoder
- {
-
- protected Encoder()
- {
- // fixme: dont know what do do here
- }
-
- public abstract int GetByteCount (char[] chars, int index, int count, bool flush);
-
- public abstract int GetBytes (char[] chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex, bool flush);
- }
-
- internal class DefaultEncoder : Encoder {
-
- public Encoding encoding;
-
- public DefaultEncoder (Encoding enc)
- {
- encoding = enc;
- }
-
- public override int GetByteCount (char[] chars, int index, int count, bool flush)
- {
- return encoding.GetByteCount (chars, index, count);
- }
-
- public override int GetBytes (char[] chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex, bool flush)
- {
- return encoding.GetBytes (chars, charIndex, charCount, bytes, byteIndex);
- }
-
- }
-
- internal class IConvEncoder : Encoder {
-
- private IntPtr converter;
-
- public IConvEncoder (string name, bool big_endian)
- {
- converter = Encoding.IConvNewEncoder (name, big_endian);
- }
-
- public override int GetByteCount (char[] chars, int index, int count, bool flush)
- {
- int res = Encoding.IConvGetByteCount (converter, chars, index, count);
-
- if (flush)
- Encoding.IConvReset (converter);
-
- return res;
- }
-
- public override int GetBytes (char[] chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex, bool flush)
- {
- int res = Encoding.IConvGetBytes (converter, chars, charIndex, charCount,
- bytes, byteIndex);
-
- if (flush)
- Encoding.IConvReset (converter);
-
- return res;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Text/Encoding.cs b/mcs/class/corlib/System.Text/Encoding.cs
deleted file mode 100755
index 3e5b9c85db6..00000000000
--- a/mcs/class/corlib/System.Text/Encoding.cs
+++ /dev/null
@@ -1,383 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Text.Encoding.cs
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System.Text {
-
- public abstract class Encoding {
- private static ASCIIEncoding ascii_encoding;
- private static UnicodeEncoding big_endian_unicode;
- private static UnicodeEncoding unicode_encoding;
- private static UTF7Encoding utf7_encoding;
- private static UTF8Encoding utf8_encoding;
-
- private int codepage;
-
- protected string body_name;
- protected string encoding_name;
- protected string header_name;
- protected string web_name;
-
- protected bool is_browser_display = false;
- protected bool is_browser_save = false;
- protected bool is_mail_news_display = false;
- protected bool is_mail_news_save = false;
-
- private Encoder default_encoder = null;
- private Decoder default_decoder = null;
-
- // used for iconv
- private string iconv_name;
- private bool big_endian;
- private Encoder iconv_encoder = null;
- private Decoder iconv_decoder = null;
-
- protected Encoding()
- {
- }
-
- protected Encoding (int codepage)
- {
- this.codepage = codepage;
- }
-
- internal protected Encoding (string name, bool big_endian)
- {
- this.iconv_name = name;
- this.big_endian = big_endian;
-
- iconv_decoder = new IConvDecoder (iconv_name, big_endian);
- iconv_encoder = new IConvEncoder (iconv_name, big_endian);
- }
-
- public static Encoding Unicode {
- get {
- if (unicode_encoding == null) {
- unicode_encoding = new UnicodeEncoding();
- }
- return unicode_encoding;
- }
- }
-
- public static Encoding UTF7 {
- get {
- if (utf7_encoding == null) {
- utf7_encoding = new UTF7Encoding();
- }
- return utf7_encoding;
- }
- }
-
- public static Encoding UTF8 {
- get {
- if (utf8_encoding == null) {
- utf8_encoding = new UTF8Encoding();
- }
- return utf8_encoding;
- }
- }
-
- public static Encoding ASCII {
- get {
- if (ascii_encoding == null)
- ascii_encoding = new ASCIIEncoding ();
- return ascii_encoding;
- }
- }
-
- public static Encoding BigEndianUnicode {
- get {
- if (big_endian_unicode == null)
- big_endian_unicode = new UnicodeEncoding (true, true);
- return big_endian_unicode;
- }
- }
-
- public virtual string BodyName {
- get {
- return body_name;
- }
- }
-
- public virtual int CodePage {
- get {
- return codepage;
- }
- }
-
- public static Encoding Default {
- get {
- return ASCII;
- }
- }
-
- public virtual string EncodingName {
- get {
- return encoding_name;
- }
- }
-
- public virtual string HeaderName {
- get {
- return header_name;
- }
- }
-
- public virtual bool IsBrowserDisplay {
- get {
- return is_browser_display;
- }
- }
-
- public virtual bool IsBrowserSave {
- get {
- return is_browser_save;
- }
- }
-
- public virtual bool IsMailNewsDisplay {
- get {
- return is_mail_news_display;
- }
- }
-
- public virtual bool IsMailNewsSave {
- get {
- return is_mail_news_save;
- }
- }
-
- public virtual string WebName {
- get {
- return web_name;
- }
- }
-
- [MonoTODO]
- public virtual int WindowsCodePage {
- get {
- // FIXME
- return 0;
- }
- }
-
- public static byte[] Convert(Encoding srcEncoding, Encoding dstEncoding, byte[] bytes)
- {
- return dstEncoding.GetBytes (srcEncoding.GetChars (bytes));
- }
-
- public static byte[] Convert(Encoding srcEncoding, Encoding dstEncoding,
- byte[] bytes, int index, int count)
- {
- return dstEncoding.GetBytes (srcEncoding.GetChars (bytes, index, count));
- }
-
- public override bool Equals (object value)
- {
- if (!(value is Encoding))
- return false;
-
- Encoding e = (Encoding) value;
-
- if (e.codepage != codepage)
- return false;
-
- if (e.body_name != body_name)
- return false;
-
- if (e.encoding_name != encoding_name)
- return false;
-
- if (e.header_name != header_name)
- return false;
-
- return true;
- }
-
- public virtual int GetByteCount (char[] chars)
- {
- return GetByteCount (chars, 0, chars.Length);
- }
-
- public virtual int GetByteCount (string s)
- {
- char [] chars = s.ToCharArray ();
-
- return GetByteCount (chars, 0, chars.Length);
- }
-
- public virtual int GetByteCount (char[] chars, int index, int count)
- {
- return iconv_encoder.GetByteCount (chars, index, count, false);
- }
-
- public virtual byte[] GetBytes(char[] chars)
- {
- return GetBytes (chars, 0, chars.Length);
- }
-
- public virtual byte[] GetBytes(string s)
- {
- char [] chars = s.ToCharArray ();
- return GetBytes (chars, 0, chars.Length);
- }
-
- public virtual byte[] GetBytes(char[] chars, int index, int count)
- {
- int bc = GetMaxByteCount (count - index);
- byte [] bytes = new byte [bc];
-
- int len = GetBytes (chars, index, count, bytes, 0);
- byte [] res = new byte [len];
-
- Array.Copy (bytes, res, len);
-
- return res;
- }
-
- public int GetBytes (char[] chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex)
- {
- return iconv_encoder.GetBytes (chars, charIndex, charCount, bytes, byteIndex, true);
- }
-
- public virtual int GetBytes(string s, int charIndex, int charCount,
- byte[] bytes, int byteIndex)
- {
- return GetBytes (s.ToCharArray (), charIndex, charCount, bytes, byteIndex);
- }
-
- public virtual int GetCharCount (byte[] bytes)
- {
- return GetCharCount (bytes, 0, bytes.Length);
- }
-
- public virtual int GetCharCount (byte[] bytes, int index, int count)
- {
- return iconv_decoder.GetCharCount (bytes, index, count);
- }
-
- public virtual char[] GetChars (byte[] bytes)
- {
- return GetChars (bytes, 0, bytes.Length);
- }
-
- public virtual char[] GetChars (byte[] bytes, int index, int count)
- {
- int cc = GetMaxCharCount (count - index);
- char [] chars = new char [cc];
-
- int len = GetChars (bytes, index, count, chars, 0);
- char [] res = new char [len];
-
- Array.Copy (chars, res, len);
-
- return res;
- }
-
- public virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
- {
- return iconv_decoder.GetChars (bytes, byteIndex, byteCount, chars, charIndex);
- }
-
- public virtual Decoder GetDecoder()
- {
- if (iconv_name != null)
- return new IConvDecoder (iconv_name, big_endian);
-
- if (default_decoder == null)
- default_decoder = new DefaultDecoder (this);
-
- return default_decoder;
- }
-
- public virtual Encoder GetEncoder()
- {
- if (iconv_name != null)
- return new IConvEncoder (iconv_name, big_endian);
-
- if (default_encoder == null)
- default_encoder = new DefaultEncoder (this);
-
- return default_encoder;
- }
-
- [MonoTODO]
- public virtual Encoding GetEncoding (int codepage)
- {
- // FIXME
- return null;
- }
-
- [MonoTODO]
- public virtual Encoding GetEncoding (string name)
- {
- // FIXME
- return null;
- }
-
- [MonoTODO]
- public override int GetHashCode()
- {
- // FIXME
- return 0;
- }
-
- public abstract int GetMaxByteCount (int charCount);
-
- public abstract int GetMaxCharCount (int byteCount);
-
- [MonoTODO]
- public virtual byte[] GetPreamble()
- {
- // FIXME
- return null;
- }
-
- public virtual string GetString(byte[] bytes)
- {
- return GetString (bytes, 0, bytes.Length);
- }
-
- public virtual string GetString(byte[] bytes, int index, int count)
- {
- char [] chars = GetChars (bytes, index, count);
-
- return chars.ToString ();
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static IntPtr IConvNewEncoder (string name, bool big_endian);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static IntPtr IConvNewDecoder (string name, bool big_endian);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static void IConvReset (IntPtr converter);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static int IConvGetByteCount (IntPtr converter, char[] chars,
- int index, int count);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static int IConvGetBytes (IntPtr converter, char[] chars, int charIndex,
- int charCount, byte[] bytes, int byteIndex);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static int IConvGetCharCount (IntPtr converter, byte[] bytes,
- int index, int count);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static int IConvGetChars (IntPtr converter, byte[] bytes, int byteIndex,
- int byteCount, char[] chars, int charIndex);
- }
-}
diff --git a/mcs/class/corlib/System.Text/StringBuilder.cs b/mcs/class/corlib/System.Text/StringBuilder.cs
deleted file mode 100644
index a9fa54432d7..00000000000
--- a/mcs/class/corlib/System.Text/StringBuilder.cs
+++ /dev/null
@@ -1,616 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Text.StringBuilder
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Implement the AppendFormat methods. Wasn't sure how
-// best to do this at this early stage, might want to see
-// how the String class and the IFormatProvider / IFormattable interfaces
-// pan out first.
-//
-// TODO: Make sure the coding complies to the ECMA draft, there's some
-// variable names that probably don't (like sString)
-//
-namespace System.Text {
-
- [MonoTODO ("Implement AppendFormat methods and IFormatProvider, IFormattable")]
- public sealed class StringBuilder {
-
- private const int defaultCapacity = 16;
-
- private int sCapacity;
- private int sLength;
- private char[] sString;
- private int sMaxCapacity = Int32.MaxValue;
-
- public StringBuilder(string value, int startIndex, int length, int capacity) {
- // first, check the parameters and throw appropriate exceptions if needed
- if(null==value) {
- throw new System.ArgumentNullException("value");
- }
-
- // make sure startIndex is zero or positive
- if(startIndex < 0) {
- throw new System.ArgumentOutOfRangeException("startIndex", startIndex, "StartIndex cannot be less than zero.");
- }
-
- // make sure length is zero or positive
- if(length < 0) {
- throw new System.ArgumentOutOfRangeException("length", length, "Length cannot be less than zero.");
- }
-
- // make sure startIndex and length give a valid substring of value
- if(startIndex + (length -1) > (value.Length - 1) ) {
- throw new System.ArgumentOutOfRangeException("startIndex", startIndex, "StartIndex and length must refer to a location within the string.");
- }
-
- // the capacity must be at least as big as the default capacity
- sCapacity = Math.Max(capacity, defaultCapacity);
-
- // LAMESPEC: what to do if capacity is too small to hold the substring?
- // Like the MS implementation, double the capacity until it is large enough
- while (sCapacity < length) {
- // However, take care not to double if that would make the number
- // larger than what an int can hold
- if (sCapacity <= Int32.MaxValue / 2) {
- sCapacity *= 2;
- }
- else{
- sCapacity = Int32.MaxValue;
- }
- }
-
- sString = new char[sCapacity];
- sLength = length;
-
- // if the length is not zero, then we have to copy some characters
- if (sLength > 0) {
- // Copy the correct number of characters into the internal array
- char[] tString = value.ToCharArray(startIndex, sLength);
- Array.Copy( tString, sString, sLength);
- }
- }
-
- public StringBuilder() : this(String.Empty, 0, 0, 0) {}
-
- public StringBuilder( int capacity ) : this("", 0, 0, capacity) {}
-
- public StringBuilder( int capacity, int maxCapacity ) : this("", 0, 0, capacity) {
- if(capacity > maxCapacity) {
- throw new System.ArgumentOutOfRangeException("capacity", "Capacity exceeds maximum capacity.");
- }
- sMaxCapacity = maxCapacity;
- }
-
- public StringBuilder( string value ) : this(value, 0, value == null ? 0 : value.Length, value == null? 0 : value.Length) {
- }
-
- public StringBuilder( string value, int capacity) : this(value, 0, value.Length, capacity) {}
-
- [MonoTODO]
- public int MaxCapacity {
- get {
- // TODO: Need to look at the memory of the system to return a useful value here
- return sMaxCapacity;
- }
- }
-
- public int Capacity {
- get {
- return sCapacity;
- }
-
- set {
- if( value < sLength ) {
- throw new ArgumentException( "Capacity must be > length" );
- } else {
- char[] tString = new char[value];
- Array.Copy( sString, tString, sLength );
- sString = tString;
- sCapacity = sString.Length;
- }
- }
- }
-
-
- public int Length {
- get {
- return sLength;
- }
-
- set {
- if( value < 0 || value > MaxCapacity) {
- throw new ArgumentOutOfRangeException();
- } else {
- if( value < sLength ) {
- // Truncate current string at value
-
- // LAMESPEC: The spec is unclear as to what to do
- // with the capacity when truncating the string.
- //
- // Don't change the capacity, as this is what
- // the MS implementation does.
-
- sLength = value;
- } else {
- // Expand the capacity to the new length and
- // pad the string with spaces.
-
- // LAMESPEC: The spec says to put the spaces on the
- // left of the string however the MS implementation
- // puts them on the right. We'll do that for
- // compatibility (!)
-
- char[] tString = new char[ value ];
- int padLength = value - sLength;
-
- string padding = new String( ' ', padLength );
- Array.Copy( sString, tString, sLength );
- Array.Copy( padding.ToCharArray(), 0, tString, sLength, padLength );
- sString = tString;
- sLength = sString.Length;
- sCapacity = value;
- }
- }
- }
- }
-
- public char this[ int index ] {
- get {
-
- if( index >= sLength || index < 0 ) {
- throw new IndexOutOfRangeException();
- }
- return sString[ index ];
- }
-
- set {
- if( index >= sLength || index < 0 ) {
- throw new IndexOutOfRangeException();
- }
- sString[ index ] = value;
- }
- }
-
- public override string ToString() {
- return ToString(0, sLength);
- }
-
- public string ToString( int startIndex, int length ) {
- if( startIndex < 0 || length < 0 || startIndex + length > sLength ) {
- throw new ArgumentOutOfRangeException();
- }
-
- return new String( sString, startIndex, length );
- }
-
- public int EnsureCapacity( int capacity ) {
- if( capacity < 0 ) {
- throw new ArgumentOutOfRangeException(
- "Capacity must be greater than 0." );
- }
-
- if( capacity <= sCapacity ) {
- return sCapacity;
- } else {
- Capacity = capacity;
- return sCapacity;
- }
- }
-
- public bool Equals( StringBuilder sb ) {
- if( this.ToString() == sb.ToString() ) {
- return true;
- } else {
- return false;
- }
- }
-
- public StringBuilder Remove( int startIndex, int length ) {
- if( startIndex < 0 || length < 0 || startIndex + length > sLength ) {
- throw new ArgumentOutOfRangeException();
- }
-
- // Copy everything after the 'removed' part to the start
- // of the removed part and truncate the sLength
-
- Array.Copy( sString, startIndex + length, sString,
- startIndex, length );
-
- sLength -= length;
- return this;
- }
-
- public StringBuilder Replace( char oldChar, char newChar ) {
-
- return Replace( oldChar, newChar, 0, sLength);
- }
-
- public StringBuilder Replace( char oldChar, char newChar, int startIndex, int count ) {
- if( startIndex + count > sLength || startIndex < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- }
-
- for( int replaceIterate = startIndex; replaceIterate < startIndex + count; replaceIterate++ ) {
- if( this[replaceIterate] == oldChar ) {
- this[replaceIterate] = newChar;
- }
- }
-
- return this;
- }
-
- public StringBuilder Replace( string oldValue, string newValue ) {
- return Replace( oldValue, newValue, 0, sLength );
- }
-
- public StringBuilder Replace( string oldValue, string newValue, int startIndex, int count ) {
- string startString = this.ToString();
- StringBuilder newStringB = new StringBuilder();
- string newString;
-
- if( oldValue == null ) {
- throw new ArgumentNullException(
- "The old value cannot be null.");
- }
-
- if( startIndex < 0 || count < 0 || startIndex + count > sLength ) {
- throw new ArgumentOutOfRangeException();
- }
-
- if( oldValue.Length == 0 ) {
- throw new ArgumentException(
- "The old value cannot be zero length.");
- }
-
- int nextIndex = startIndex; // Where to start the next search
- int lastIndex = nextIndex; // Where the last search finished
-
- while( nextIndex != -1 ) {
- nextIndex = startString.IndexOf( oldValue, lastIndex);
- if( nextIndex != -1 ) {
- // The MS implementation won't replace a substring
- // if that substring goes over the "count"
- // boundary, so we'll make sure the behaviour
- // here is the same.
-
- if( nextIndex + oldValue.Length <= startIndex + count ) {
-
- // Add everything to the left of the old
- // string
- newStringB.Append( startString.Substring( lastIndex, nextIndex - lastIndex ) );
-
- // Add the replacement string
- newStringB.Append( newValue );
-
- // Set the next start point to the
- // end of the last match
- lastIndex = nextIndex + oldValue.Length;
- } else {
- // We're past the "count" we're supposed to replace within
- nextIndex = -1;
- newStringB.Append(
- startString.Substring( lastIndex ) );
- }
-
- } else {
- // Append everything left over
- newStringB.Append( startString.Substring( lastIndex ) );
- }
- }
-
- newString = newStringB.ToString();
-
- EnsureCapacity( newString.Length );
- sString = newString.ToCharArray();
- sLength = newString.Length;
- return this;
- }
-
-
- /* The Append Methods */
-
- // TODO: Currently most of these methods convert the
- // parameter to a CharArray (via a String) and then pass
- // it to Append( char[] ). There might be a faster way
- // of doing this, but it's probably adequate and anything else
- // would make it too messy.
- //
- // As an example, a sample test run of appending a 100 character
- // string to the StringBuilder, and loooping this 50,000 times
- // results in an elapsed time of 2.4s using the MS StringBuilder
- // and 2.7s using this StringBuilder. Note that this results
- // in a 5 million character string. I believe MS uses a lot
- // of "native" DLLs for the "meat" of the base classes.
-
- [MonoTODO ("Look at all Append methods and complete them if necessary")]
- public StringBuilder Append( char[] value ) {
- if( sLength + value.Length > sCapacity ) {
- // Need more capacity, double the capacity StringBuilder
- // and make sure we have at least enough for the value
- // if that's going to go over double.
-
- Capacity = value.Length + ( sCapacity + sCapacity);
- }
-
- Array.Copy( value, 0, sString, sLength, value.Length );
- sLength += value.Length;
-
- return this;
- }
-
- public StringBuilder Append( string value ) {
- if( value != null ) {
- return Append( value.ToCharArray() );
- } else {
- return null;
- }
- }
-
- public StringBuilder Append( bool value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( byte value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( int index, char value) {
- char[] appendChar = new char[1];
-
- appendChar[0] = value;
- return Append( appendChar );
- }
-
-
- public StringBuilder Append( decimal value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( double value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( short value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( int value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( long value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( object value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Append( sbyte value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( float value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Append( ushort value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Append( uint value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Append( ulong value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( char value ) {
- return Append (value, 1);
- }
-
- public StringBuilder Append( char value, int repeatCount ) {
- if( repeatCount < 0 ) {
- throw new ArgumentOutOfRangeException();
- }
-
- return Append( new String( value, repeatCount) );
- }
-
- public StringBuilder Append( char[] value, int startIndex, int charCount ) {
-
- if( (charCount < 0 || startIndex < 0) ||
- ( charCount + startIndex > value.Length ) ) {
- throw new ArgumentOutOfRangeException();
- }
-
- if( value == null ) {
- if( !(startIndex == 0 && charCount == 0) ) {
- throw new ArgumentNullException();
- } else {
- return this;
- }
- } else {
- char[] appendChars = new char[ charCount ];
-
- Array.Copy( value, startIndex, appendChars, 0, charCount );
- return Append( appendChars );
- }
- }
-
- public StringBuilder Append( string value, int startIndex, int count ) {
- if( (count < 0 || startIndex < 0) ||
- ( startIndex + count > value.Length ) ) {
- throw new ArgumentOutOfRangeException();
- }
-
- return Append( value.Substring( startIndex, count ).ToCharArray() );
- }
-
- [MonoTODO]
- public StringBuilder AppendFormat( string format, object arg0 ) {
- // TODO: Implement
- return this;
- }
-
- [MonoTODO]
- public StringBuilder AppendFormat( string format, params object[] args ) {
- // TODO: Implement
- return this;
- }
-
- [MonoTODO]
- public StringBuilder AppendFormat( IFormatProvider provider, string format,
- params object[] args ) {
- // TODO: Implement
- return this;
- }
-
- [MonoTODO]
- public StringBuilder AppendFormat( string format, object arg0, object arg1 ) {
- // TODO: Implement;
- return this;
- }
-
- [MonoTODO]
- public StringBuilder AppendFormat( string format, object arg0, object arg1, object arg2 ) {
- // TODO Implement
- return this;
- }
-
- /* The Insert Functions */
-
- // Similarly to the Append functions, get everything down to a CharArray
- // and insert that.
-
- public StringBuilder Insert( int index, char[] value ) {
- if( index > sLength || index < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- if( value == null || value.Length == 0 ) {
- return this;
- } else {
- // Check we have the capacity to insert this array
- if( sCapacity < sLength + value.Length ) {
- Capacity = value.Length + ( sCapacity + sCapacity );
- }
-
- // Move everything to the right of the insert point across
- Array.Copy( sString, index, sString, index + value.Length, sLength - index);
-
- // Copy in stuff from the insert buffer
- Array.Copy( value, 0, sString, index, value.Length );
-
- sLength += value.Length;
- return this;
- }
- }
-
- public StringBuilder Insert( int index, string value ) {
- return Insert( index, value.ToCharArray() );
- }
-
- public StringBuilder Insert( int index, bool value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, byte value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, char value) {
- char[] insertChar = new char[1];
-
- insertChar[0] = value;
- return Insert( index, insertChar );
- }
-
- public StringBuilder Insert( int index, decimal value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, double value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, short value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, int value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, long value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, object value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Insert( int index, sbyte value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, float value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Insert( int index, ushort value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Insert( int index, uint value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Insert( int index, ulong value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, string value, int count ) {
- if ( count < 0 ) {
- throw new ArgumentOutOfRangeException();
- }
-
- if( value != null ) {
- if( value != "" ) {
- for( int insertCount = 0; insertCount < count;
- insertCount++ ) {
- Insert( index, value.ToCharArray() );
- }
- }
- }
- return this;
- }
-
- public StringBuilder Insert( int index, char[] value, int startIndex,
- int charCount ) {
-
- if( value != null ) {
- if( charCount < 0 || startIndex < 0 || startIndex + charCount > value.Length ) {
- throw new ArgumentOutOfRangeException();
- }
-
- char[] insertChars = new char[ charCount ];
- Array.Copy( value, startIndex, insertChars, 0, charCount );
- return Insert( index, insertChars );
- } else {
- return this;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Text/UTF7Encoding.cs b/mcs/class/corlib/System.Text/UTF7Encoding.cs
deleted file mode 100755
index 91fd3604236..00000000000
--- a/mcs/class/corlib/System.Text/UTF7Encoding.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Text.UTF7Encoding.cs
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Text {
-
- public class UTF7Encoding : Encoding
- {
- public UTF7Encoding () : base ("UTF-7", false)
- {
- encoding_name = "Unicode (UTF-7)";
- body_name = "utf-7";
- header_name = "utf-7";
- web_name = "utf-7";
- is_browser_display = false;
- is_browser_save = false;
- is_mail_news_display = true;
- is_mail_news_save = true;
-
- }
-
- [MonoTODO]
- public override int GetMaxByteCount (int charCount)
- {
- // FIXME: dont know if this is right
- return charCount*6;
- }
-
- public override int GetMaxCharCount (int byteCount)
- {
- return byteCount;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Text/UTF8Encoding.cs b/mcs/class/corlib/System.Text/UTF8Encoding.cs
deleted file mode 100755
index b5582804d27..00000000000
--- a/mcs/class/corlib/System.Text/UTF8Encoding.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Text.UTF8Encoding.cs
-//
-// Authors:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Text
-{
- public class UTF8Encoding : Encoding
- {
- public UTF8Encoding () : base ("UTF-8", false)
- {
- encoding_name = "Unicode (UTF-8)";
- body_name = "utf-8";
- header_name = "utf-8";
- web_name = "utf-8";
- is_browser_display = true;
- is_browser_save = true;
- is_mail_news_display = true;
- is_mail_news_save = true;
- }
-
- public override int GetMaxByteCount (int charCount)
- {
- return charCount*6;
- }
-
- public override int GetMaxCharCount (int byteCount)
- {
- return byteCount;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Text/UnicodeEncoding.cs b/mcs/class/corlib/System.Text/UnicodeEncoding.cs
deleted file mode 100755
index 74e274d7b17..00000000000
--- a/mcs/class/corlib/System.Text/UnicodeEncoding.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Text.UnicodeEncoding.cs
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-// FIXME: implement byteOrderMark
-
-namespace System.Text {
-
- [MonoTODO]
- public class UnicodeEncoding : Encoding
- {
- private bool byteOrderMark;
-
- private void init (bool byteOrderMark)
- {
- this.byteOrderMark = byteOrderMark;
- encoding_name = "Unicode";
- body_name = "utf-16";
- header_name = "utf-16";
- web_name = "utf-16";
- is_browser_display = false;
- is_browser_save = true;
- is_mail_news_display = false;
- is_mail_news_save = false;
- }
-
- public UnicodeEncoding () : base ("UNICODE", false)
- {
- init (false);
- }
-
- public UnicodeEncoding (bool bigEndian, bool byteOrderMark) : base ("UNICODE", bigEndian)
- {
- init (byteOrderMark);
- }
-
- public override int GetMaxByteCount (int charCount)
- {
- return charCount;
- }
-
- public override int GetMaxCharCount (int byteCount)
- {
- return byteCount / 2;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ApartmentState.cs b/mcs/class/corlib/System.Threading/ApartmentState.cs
deleted file mode 100755
index 0dfc50785b4..00000000000
--- a/mcs/class/corlib/System.Threading/ApartmentState.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Threading.ApartmentState.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public enum ApartmentState {
- STA = 0,
- MTA = 1,
- Unknown = 2
- }
-}
diff --git a/mcs/class/corlib/System.Threading/AutoResetEvent.cs b/mcs/class/corlib/System.Threading/AutoResetEvent.cs
deleted file mode 100755
index 3b5d71e63be..00000000000
--- a/mcs/class/corlib/System.Threading/AutoResetEvent.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Threading.AutoResetEvent.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-// Veronica De Santis (veron78@interfree.it)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
-
- public sealed class AutoResetEvent : WaitHandle
- {
- // Constructor
- public AutoResetEvent(bool initialState) {
- os_handle = NativeEventCalls.CreateEvent_internal(false,initialState,null);
- }
-
- // Methods
-
- public bool Set() {
- return(NativeEventCalls.SetEvent_internal(os_handle));
- }
-
- public bool Reset() {
- return(NativeEventCalls.ResetEvent_internal(os_handle));
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ChangeLog b/mcs/class/corlib/System.Threading/ChangeLog
deleted file mode 100644
index afa3656c0d9..00000000000
--- a/mcs/class/corlib/System.Threading/ChangeLog
+++ /dev/null
@@ -1,120 +0,0 @@
-
-Wed Feb 13 21:51:30 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Thread.cs: implement CurrentCulture property needed by
- Convert.ChangeType() (used when compiling enums).
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * ManualResetEvent.cs:
- * AutoResetEvent.cs: Fixed DOS line endings
-
-2002-01-22 Veronica De Santis <veron78@interfree.it>
-
- * NativeEventCalls : Class that contains internal calls shared by Auto
- and Manual Reset Events
- * AutoResetEvents.cs : Added class AutoResetEvents and its implementation
- * ManualResetEvents.cs : Added class ManualResetEvents and its implementation
-
-2002-01-16 Veronica De Santis <veron78@interfree.it>
-
- * WaitHandle.cs : Renamed handle to os_handle and make it protected
- instead of private.
- * Mutex.cs : Write the System.Threading.Mutex methods ( constructors
- and the ReleaseMutex)
-
-2002-01-15 Dick Porter <dick@ximian.com>
-
- * WaitHandle.cs:
- * Thread.cs: Make the runtime's idea of infinite timeouts coincide
- with the class library's
-
-2002-01-10 Dick Porter <dick@ximian.com>
-
- * WaitHandle.cs: Added checks for too many handles and null
- handles in WaitAll() and WaitAny
-
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * AutoResetEvent.cs, ManualResetEvent.cs, Monitor.cs : MonoTODO
- decoration.
-
- * Mutex.cs, Overlapped.cs, ReaderWriterLock.cs, RegisteredWaitHandle.cs,
- Thread.cs, ThreadAbortException.cs, ThreadPool.cs, Timer.cs, WaitHandler.cs : Ditto.
-
-2001-12-11 Dick Porter <dick@ximian.com>
-
- * WaitHandle.cs: Implemented WaitAll(), WaitAny() and WaitOne() as
- internal calls.
-
-2001-11-26 Dick Porter <dick@ximian.com>
-
- * Thread.cs: DataSlot uses a single system TLS slot, and a
- hashtable per thread. Some minor changes to reflect the new
- internal calls using the new IO library, and the newly-supported
- bool returns from internal calls.
-
- * Monitor.cs: Use bool returns from internal calls now they are
- supported by the runtime. Coalesce enter with the try_enter
- internal call.
-
-Wed Nov 14 17:06:18 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Overlapped.cs, ThreadPool.cs, Timer.cs: CLSCompliant updates.
-
-2001-10-03 Dick Porter <dick@ximian.com>
-
- * Monitor.cs: Implemented all methods except the two Wait()
- methods that take boolean parameters
-
-2001-09-28 Dick Porter <dick@ximian.com>
-
- * Thread.cs: Implemented AllocateDataSlot(),
- AllocateNamedDataSlot(), FreeNamedDataSlot(), GetData(),
- GetNamedDataSlot(), SetData(), IsBackground. Reworked Thread()
- and Start() to avoid a race condition. Added thread-safe state
- changing private operations.
-
- * Monitor.cs: Comment out the GetType() calls because it isn't implemented yet
-
-2001-09-25 Dick Porter <dick@ximian.com>
-
- * Thread.cs: Implement Join and timed Join, set correct state
- around Start, Join and Sleep calls, implement IsAlive and
- ThreadState properties.
-
- * ThreadState.cs (Threading): Added StopRequested,
- SuspendRequested, Suspended values
-
-2001-09-23 Dick Porter <dick@ximian.com>
-
- * Thread.cs: Implemented CurrentThread and Sleep (both versions)
- with internal calls, and Name.
-
-2001-09-21 Dick Porter <dick@ximian.com>
-
- * Thread.cs: Implement Thread(ThreadStart) constructor and Start()
- with an internal call
-
- * WaitHandle.cs: Close calls Dispose(false)
-
-2001-09-13 Dick Porter <dick@ximian.com>
-
- * ApartmentState.cs (Threading): Set the correct enum values
-
-2001-09-13 Dick Porter <dick@ximian.com>
-
- * ApartmentState.cs, AutoResetEvent.cs, IOCompletionCallback.cs,
- Interlocked.cs, LockCookie.cs, ManualResetEvent.cs, Monitor.cs,
- Mutex.cs, NativeOverlapped.cs, Overlapped.cs, ReaderWriterLock.cs,
- RegisteredWaitHandle.cs, SynchronizationLockException.cs,
- Thread.cs, ThreadAbortException.cs, ThreadInterruptedException.cs,
- ThreadPool.cs, ThreadStart.cs, ThreadStateException.cs,
- Timeout.cs, Timer.cs, TimerCallback.cs, WaitCallback.cs,
- WaitHandle.cs, WaitOrTimerCallback.cs: System.Threading class
- stubs.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * ThreadPriority.cs, ThreadState.cs: Add.
diff --git a/mcs/class/corlib/System.Threading/IOCompletionCallback.cs b/mcs/class/corlib/System.Threading/IOCompletionCallback.cs
deleted file mode 100755
index d78657c3ac7..00000000000
--- a/mcs/class/corlib/System.Threading/IOCompletionCallback.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Threading.IOCompletionCallback.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- // 'unsafe' wasn't in the spec, but the compiler insists because of
- // the pointer.
- public unsafe delegate void IOCompletionCallback(uint errorCode, uint numBytes, NativeOverlapped *pOVERLAP);
-}
diff --git a/mcs/class/corlib/System.Threading/Interlocked.cs b/mcs/class/corlib/System.Threading/Interlocked.cs
deleted file mode 100755
index f0c340ab2aa..00000000000
--- a/mcs/class/corlib/System.Threading/Interlocked.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// System.Threading.Interlocked.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class Interlocked
- {
- public static int CompareExchange(ref int location1, int value, int comparand) {
- // lock
- if(comparand==location1) {
- int ret;
-
- ret=location1;
- location1=value;
- return(ret);
- }
- return(location1);
- }
-
- public static object CompareExchange(ref object location1, object value, object comparand) {
- // lock
- if(comparand==location1) {
- object ret;
-
- ret=location1;
- location1=value;
- return(ret);
- }
- return(location1);
- }
-
- public static float CompareExchange(ref float location1, float value, float comparand) {
- // lock
- if(comparand==location1) {
- float ret;
-
- ret=location1;
- location1=value;
- return(ret);
- }
- return(location1);
- }
-
- public static int Decrement(ref int location) {
- // lock
- location--;
- return(location);
- }
-
- public static long Decrement(ref long location) {
- // lock
- location--;
- return(location);
- }
-
- public static int Exchange(ref int location1, int value) {
- // lock
- int ret;
-
- ret=location1;
- location1=value;
- return(ret);
- }
-
- public static object Exchange(ref object location1, object value) {
- // lock
- object ret;
-
- ret=location1;
- location1=value;
- return(ret);
- }
-
- public static float Exchange(ref float location1, float value) {
- // lock
- float ret;
-
- ret=location1;
- location1=value;
- return(ret);
- }
-
- public static int Increment(ref int location) {
- // lock
- location++;
- return(location);
- }
-
- public static long Increment(ref long location) {
- // lock
- location++;
- return(location);
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Threading/LockCookie.cs b/mcs/class/corlib/System.Threading/LockCookie.cs
deleted file mode 100755
index e7c89c4636b..00000000000
--- a/mcs/class/corlib/System.Threading/LockCookie.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Threading.LockCookie.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public struct LockCookie
- {
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ManualResetEvent.cs b/mcs/class/corlib/System.Threading/ManualResetEvent.cs
deleted file mode 100755
index 38a0e80b2f0..00000000000
--- a/mcs/class/corlib/System.Threading/ManualResetEvent.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Threading.ManualResetEvent.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-// Veronica De Santis (veron78@interfree.it)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
-
- public sealed class ManualResetEvent : WaitHandle
- {
- // Constructor
- public ManualResetEvent(bool initialState) {
- os_handle = NativeEventCalls.CreateEvent_internal(true,initialState,null);
- }
-
- // Methods
-
- public bool Set() {
- return(NativeEventCalls.SetEvent_internal(os_handle));
- }
-
- public bool Reset() {
- return(NativeEventCalls.ResetEvent_internal(os_handle));
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Monitor.cs b/mcs/class/corlib/System.Threading/Monitor.cs
deleted file mode 100755
index 0c7476dbf85..00000000000
--- a/mcs/class/corlib/System.Threading/Monitor.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// System.Threading.Monitor.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
- public sealed class Monitor
- {
- // Grabs the mutex on object 'obj', with a maximum
- // wait time 'ms' but doesn't block - if it can't get
- // the lock it returns false, true if it can
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool Monitor_try_enter(object obj, int ms);
- public static void Enter(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- Monitor_try_enter(obj, Timeout.Infinite);
- }
-
- // Releases the mutex on object 'obj'
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Monitor_exit(object obj);
-
- // Checks whether the current thread currently owns
- // the lock on object 'obj'
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool Monitor_test_owner(object obj);
-
- public static void Exit(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- if(Monitor_test_owner(obj)==false) {
- throw new SynchronizationLockException("The current thread does not own the lock");
- }
-
- Monitor_exit(obj);
- }
-
- // Signals one of potentially many objects waiting on
- // object 'obj'
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Monitor_pulse(object obj);
-
- // Checks whether object 'obj' is currently synchronised
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool Monitor_test_synchronised(object obj);
-
- public static void Pulse(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
-
- Monitor_pulse(obj);
- }
-
- // Signals all of potentially many objects waiting on
- // object 'obj'
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Monitor_pulse_all(object obj);
-
- public static void PulseAll(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
-
- Monitor_pulse_all(obj);
- }
-
- public static bool TryEnter(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- return(Monitor_try_enter(obj, 0));
- }
-
- public static bool TryEnter(object obj, int millisecondsTimeout) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- // LAMESPEC: should throw an exception when ms<0, but
- // Timeout.Infinite is -1
- if(millisecondsTimeout == Timeout.Infinite) {
- Enter(obj);
- return(true);
- }
-
- if(millisecondsTimeout<0) {
- throw new ArgumentException("millisecondsTimeout negative");
- }
-
- return(Monitor_try_enter(obj, millisecondsTimeout));
- }
-
- public static bool TryEnter(object obj, TimeSpan timeout) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- // LAMESPEC: should throw an exception when ms<0, but
- // Timeout.Infinite is -1
- if(timeout.Milliseconds == Timeout.Infinite) {
- Enter(obj);
- return(true);
- }
-
- if(timeout.Milliseconds < 0 ||
- timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("timeout out of range");
- }
-
- return(Monitor_try_enter(obj, timeout.Milliseconds));
- }
-
- // Waits for a signal on object 'obj' with maximum
- // wait time 'ms'. Returns true if the object was
- // signalled, false if it timed out
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool Monitor_wait(object obj, int ms);
-
- public static bool Wait(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
-
- return(Monitor_wait(obj, 0));
- }
-
- public static bool Wait(object obj, int millisecondsTimeout) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
- // LAMESPEC: no mention of timeout sanity checking
-
- return(Monitor_wait(obj, millisecondsTimeout));
- }
-
- public static bool Wait(object obj, TimeSpan timeout) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- // LAMESPEC: says to throw ArgumentException too
- if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("timeout out of range");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
-
- return(Monitor_wait(obj, timeout.Milliseconds));
- }
-
- [MonoTODO]
- public static bool Wait(object obj, int millisecondsTimeout, bool exitContext) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- // FIXME when I understand what a
- // "synchronisation domain" is and does
- return(false);
- }
-
- [MonoTODO]
- public static bool Wait(object obj, TimeSpan timeout, bool exitContext) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- // LAMESPEC: says to throw ArgumentException too
- if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("timeout out of range");
- }
-
- // FIXME when I understand what a
- // "synchronisation domain" is and does
- return(false);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Mutex.cs b/mcs/class/corlib/System.Threading/Mutex.cs
deleted file mode 100755
index f0926bf023a..00000000000
--- a/mcs/class/corlib/System.Threading/Mutex.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Threading.Mutex.cs
-//
-// Author:
-//
-// Dick Porter (dick@ximian.com)
-// Veronica De Santis (veron78@interfree.it)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
- public sealed class Mutex : WaitHandle
- {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern IntPtr CreateMutex_internal(
- bool initiallyOwned,
- string name);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void ReleaseMutex_internal(IntPtr handle);
-
- public Mutex() {
- os_handle=CreateMutex_internal(false,null);
- }
-
- public Mutex(bool initiallyOwned) {
- os_handle=CreateMutex_internal(initiallyOwned,null);
- }
-
- public Mutex(bool initiallyOwned, string name) {
- os_handle=CreateMutex_internal(initiallyOwned,name);
- }
-
-
- public Mutex(bool initiallyOwned, string name, out bool gotOwnership) {
- os_handle=CreateMutex_internal(initiallyOwned,name);
- gotOwnership=false;
- }
-
- public void ReleaseMutex() {
- ReleaseMutex_internal(os_handle);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/NativeEventCalls.cs b/mcs/class/corlib/System.Threading/NativeEventCalls.cs
deleted file mode 100755
index 08dd8363f23..00000000000
--- a/mcs/class/corlib/System.Threading/NativeEventCalls.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Threading.AutoResetEvent.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-// Veronica De Santis (veron78@interfree.it)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
- internal sealed class NativeEventCalls
- {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern IntPtr CreateEvent_internal(bool manual,bool initial,string name);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern bool SetEvent_internal(IntPtr handle);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern bool ResetEvent_internal(IntPtr handle);
-
- }
-}
diff --git a/mcs/class/corlib/System.Threading/NativeOverlapped.cs b/mcs/class/corlib/System.Threading/NativeOverlapped.cs
deleted file mode 100755
index 2f681fba4ba..00000000000
--- a/mcs/class/corlib/System.Threading/NativeOverlapped.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Threading.NativeOverlapped.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Threading
-{
- public struct NativeOverlapped {
- public int EventHandle;
- public int InternalHigh;
- public int InternalLow;
- public int OffsetHigh;
- public int OffsetLow;
-
- // (fields disappeared beta2 -> 1.0)
-
- // public GCHandle ReservedClassLib;
- // public int ReservedCOR1;
- // public GCHandle ReservedCOR2;
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Overlapped.cs b/mcs/class/corlib/System.Threading/Overlapped.cs
deleted file mode 100755
index 25f33bf8d5d..00000000000
--- a/mcs/class/corlib/System.Threading/Overlapped.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Threading.Overlapped.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public class Overlapped
- {
- [CLSCompliant(false)][MonoTODO]
- unsafe public static void Free(NativeOverlapped *nativeOverlappedPtr) {
- // FIXME
- }
-
- [CLSCompliant(false)][MonoTODO]
- unsafe public static Overlapped Unpack(NativeOverlapped *nativeOverlappedPtr) {
- // FIXME
- return(new Overlapped());
- }
-
- [MonoTODO]
- public Overlapped() {
- // FIXME
- }
-
- [MonoTODO]
- public Overlapped(int offsetLo, int offsetHi, int hEvent, IAsyncResult ar) {
- // FIXME
- }
-
- [MonoTODO]
- public IAsyncResult AsyncResult {
- get {
- // FIXME
- return(null);
- }
-
- set {
- }
- }
-
- [MonoTODO]
- public int EventHandle {
- get {
- // FIXME
- return(0);
- }
-
- set {
- }
- }
-
- [MonoTODO]
- public int OffsetHigh {
- get {
- // FIXME
- return(0);
- }
-
- set {
- }
- }
-
- [MonoTODO]
- public int OffsetLow {
- get {
- // FIXME
- return(0);
- }
-
- set {
- }
- }
-
- [CLSCompliant(false)][MonoTODO]
- unsafe public NativeOverlapped *Pack(IOCompletionCallback iocb) {
- // FIXME
- return(null);
- }
-
- [CLSCompliant(false)][MonoTODO]
- unsafe public NativeOverlapped *UnsafePack(IOCompletionCallback iocb) {
- // FIXME
- return(null);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ReaderWriterLock.cs b/mcs/class/corlib/System.Threading/ReaderWriterLock.cs
deleted file mode 100755
index 95784811682..00000000000
--- a/mcs/class/corlib/System.Threading/ReaderWriterLock.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// System.Threading.ReaderWriterLock.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class ReaderWriterLock
- {
- [MonoTODO]
- public ReaderWriterLock() {
- // FIXME
- }
-
- [MonoTODO]
- public bool IsReaderLockHeld {
- get {
- // FIXME
- return(false);
- }
- }
-
- [MonoTODO]
- public bool IsWriterLockHeld {
- get {
- // FIXME
- return(false);
- }
- }
-
- [MonoTODO]
- public int WriterSeqNum {
- get {
- // FIXME
- return(0);
- }
- }
-
-
- [MonoTODO]
- public void AcquireReaderLock(int millisecondsTimeout) {
- // FIXME
- }
-
- [MonoTODO]
- public void AcquireReaderLock(TimeSpan timeout) {
- // FIXME
- }
-
- [MonoTODO]
- public void AcquireWriterLock(int millisecondsTimeout) {
- // FIXME
- }
-
- [MonoTODO]
- public void AcquireWriterLock(TimeSpan timeout) {
- // FIXME
- }
-
- [MonoTODO]
- public bool AnyWritersSince(int seqNum) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public void DowngradeFromWriterLock(ref LockCookie lockCookie) {
- // FIXME
- }
-
- [MonoTODO]
- public LockCookie ReleaseLock() {
- // FIXME
- return(new LockCookie());
- }
-
- [MonoTODO]
- public void ReleaseReaderLock() {
- // FIXME
- }
-
- [MonoTODO]
- public void ReleaseWriterLock() {
- // FIXME
- }
-
- [MonoTODO]
- public void RestoreLock(ref LockCookie lockCookie) {
- // FIXME
- }
-
- [MonoTODO]
- public LockCookie UpgradeToWriterLock(int millisecondsTimeout) {
- // FIXME
- return(new LockCookie());
- }
-
- [MonoTODO]
- public LockCookie UpgradeToWriterLock(TimeSpan timeout) {
- // FIXME
- return(new LockCookie());
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs b/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
deleted file mode 100755
index e2e7ddd09f4..00000000000
--- a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Threading.RegisteredWaitHandle.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class RegisteredWaitHandle
- {
- [MonoTODO]
- public bool Unregister(WaitHandle waitObject) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- ~RegisteredWaitHandle() {
- // FIXME
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/SynchronizationLockException.cs b/mcs/class/corlib/System.Threading/SynchronizationLockException.cs
deleted file mode 100755
index ec73e9feab2..00000000000
--- a/mcs/class/corlib/System.Threading/SynchronizationLockException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Threading.SynchronizationLockException.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Threading
-{
- public class SynchronizationLockException : SystemException
- {
- public SynchronizationLockException()
- : base ("Synchronization Error") {
- }
-
- public SynchronizationLockException(string message)
- : base (message) {
- }
-
- protected SynchronizationLockException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public SynchronizationLockException(string message, Exception innerException)
- : base (message, innerException) {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs
deleted file mode 100755
index e2c14c5da02..00000000000
--- a/mcs/class/corlib/System.Threading/Thread.cs
+++ /dev/null
@@ -1,411 +0,0 @@
-//
-// System.Threading.Thread.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Contexts;
-using System.Security.Principal;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Collections;
-
-namespace System.Threading
-{
- public sealed class Thread
- {
-
- private CultureInfo current_culture;
-
- [MonoTODO]
- public static Context CurrentContext {
- get {
- // FIXME -
- // System.Runtime.Remoting.Context not
- // yet implemented
- return(null);
- }
- }
-
- [MonoTODO]
- public static IPrincipal CurrentPrincipal {
- get {
- // FIXME -
- // System.Security.Principal.IPrincipal
- // not yet implemented
- return(null);
- }
-
- set {
- }
- }
-
- // Looks up the object associated with the current thread
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static Thread CurrentThread_internal();
-
- public static Thread CurrentThread {
- get {
- return(CurrentThread_internal());
- }
- }
-
- // Looks up the slot hash for the current thread
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static Hashtable SlotHash_lookup();
-
- // Stores the slot hash for the current thread
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void SlotHash_store(Hashtable slothash);
-
- private static Hashtable GetTLSSlotHash() {
- Hashtable slothash=SlotHash_lookup();
- if(slothash==null) {
- // Not synchronised, because this is
- // thread specific anyway.
- slothash=new Hashtable();
- SlotHash_store(slothash);
- }
-
- return(slothash);
- }
-
- public static LocalDataStoreSlot AllocateDataSlot() {
- LocalDataStoreSlot slot = new LocalDataStoreSlot();
-
- return(slot);
- }
-
- // Stores a hash keyed by strings of LocalDataStoreSlot objects
- static Hashtable datastorehash = Hashtable.Synchronized(new Hashtable());
-
- public static LocalDataStoreSlot AllocateNamedDataSlot(string name) {
- LocalDataStoreSlot slot = (LocalDataStoreSlot)datastorehash[name];
- if(slot!=null) {
- // This exception isnt documented (of
- // course) but .net throws it
- throw new ArgumentException("Named data slot already added");
- }
-
- slot = new LocalDataStoreSlot();
-
- datastorehash.Add(name, slot);
-
- return(slot);
- }
-
- public static void FreeNamedDataSlot(string name) {
- LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name];
-
- if(slot!=null) {
- datastorehash.Remove(slot);
- }
- }
-
- public static object GetData(LocalDataStoreSlot slot) {
- Hashtable slothash=GetTLSSlotHash();
- return(slothash[slot]);
- }
-
- [MonoTODO]
- public static AppDomain GetDomain() {
- // FIXME
- return(null);
- }
-
- [MonoTODO]
- public static int GetDomainID() {
- // FIXME
- return(0);
- }
-
- public static LocalDataStoreSlot GetNamedDataSlot(string name) {
- LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name];
-
- if(slot==null) {
- slot=AllocateNamedDataSlot(name);
- }
-
- return(slot);
- }
-
- [MonoTODO]
- public static void ResetAbort() {
- // FIXME
- }
-
- public static void SetData(LocalDataStoreSlot slot,
- object data) {
- Hashtable slothash=GetTLSSlotHash();
- slothash.Add(slot, data);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Sleep_internal(int ms);
-
- public static void Sleep(int millisecondsTimeout) {
- if(millisecondsTimeout<0) {
- throw new ArgumentException("Negative timeout");
- }
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
-
- Sleep_internal(millisecondsTimeout);
- thread.clr_state(ThreadState.WaitSleepJoin);
- }
-
- public static void Sleep(TimeSpan timeout) {
- // LAMESPEC: says to throw ArgumentException too
- if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Timeout out of range");
- }
-
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
- Sleep_internal(timeout.Milliseconds);
- thread.clr_state(ThreadState.WaitSleepJoin);
- }
-
- // stores a thread handle
- private IntPtr system_thread_handle;
-
- // Returns the system thread handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern IntPtr Thread_internal(ThreadStart start);
-
- public Thread(ThreadStart start) {
- if(start==null) {
- throw new ArgumentNullException("Null ThreadStart");
- }
-
- // This is a two-stage thread launch. Thread_internal
- // creates the new thread, but blocks it until
- // Start() is called later.
- system_thread_handle=Thread_internal(start);
- }
-
- [MonoTODO]
- public ApartmentState ApartmentState {
- get {
- // FIXME
- return(ApartmentState.Unknown);
- }
-
- set {
- }
- }
-
- [MonoTODO]
- public CultureInfo CurrentCulture {
- get {
- if (current_culture == null)
- current_culture = new CultureInfo ("");
- return current_culture;
- }
-
- set {
- current_culture = value;
- }
- }
-
- [MonoTODO]
- public CultureInfo CurrentUICulture {
- get {
- // FIXME
- return(null);
- }
-
- set {
- }
- }
-
- public bool IsAlive {
- get {
- // LAMESPEC: is a Stopped or Suspended
- // thread dead?
- ThreadState curstate=state;
-
- if((curstate & ThreadState.Aborted) != 0 ||
- (curstate & ThreadState.AbortRequested) != 0 ||
- (curstate & ThreadState.Unstarted) != 0) {
- return(false);
- } else {
- return(true);
- }
- }
- }
-
- public bool IsBackground {
- get {
- if((state & ThreadState.Background) != 0) {
- return(true);
- } else {
- return(false);
- }
- }
-
- set {
- if(value==true) {
- set_state(ThreadState.Background);
- } else {
- clr_state(ThreadState.Background);
- }
- }
- }
-
- private string thread_name=null;
-
- public string Name {
- get {
- return(thread_name);
- }
-
- set {
- thread_name=value;
- }
- }
-
- [MonoTODO]
- public ThreadPriority Priority {
- get {
- // FIXME
- return(ThreadPriority.Lowest);
- }
-
- set {
- }
- }
-
- private ThreadState state=ThreadState.Unstarted;
-
- public ThreadState ThreadState {
- get {
- return(state);
- }
- }
-
- [MonoTODO]
- public void Abort() {
- // FIXME
- }
-
- [MonoTODO]
- public void Abort(object stateInfo) {
- // FIXME
- }
-
- [MonoTODO]
- public void Interrupt() {
- // FIXME
- }
-
- // The current thread joins with 'this'. Set ms to 0 to block
- // until this actually exits.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern bool Join_internal(int ms, IntPtr handle);
-
- public void Join() {
- if((state & ThreadState.Unstarted) != 0) {
- throw new ThreadStateException("Thread has not been started");
- }
-
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
- Join_internal(Timeout.Infinite, system_thread_handle);
- thread.clr_state(ThreadState.WaitSleepJoin);
- }
-
- public bool Join(int millisecondsTimeout) {
- if(millisecondsTimeout<0) {
- throw new ArgumentException("Timeout less than zero");
- }
- if((state & ThreadState.Unstarted) != 0) {
- throw new ThreadStateException("Thread has not been started");
- }
-
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
- bool ret=Join_internal(millisecondsTimeout,
- system_thread_handle);
- thread.clr_state(ThreadState.WaitSleepJoin);
-
- return(ret);
- }
-
- public bool Join(TimeSpan timeout) {
- // LAMESPEC: says to throw ArgumentException too
- if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("timeout out of range");
- }
- if((state & ThreadState.Unstarted) != 0) {
- throw new ThreadStateException("Thread has not been started");
- }
-
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
- bool ret=Join_internal(timeout.Milliseconds,
- system_thread_handle);
- thread.clr_state(ThreadState.WaitSleepJoin);
-
- return(ret);
- }
-
- [MonoTODO]
- public void Resume() {
- // FIXME
- }
-
- // Launches the thread
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void Start_internal(IntPtr handle);
-
- public void Start() {
- if((state & ThreadState.Unstarted) == 0) {
- throw new ThreadStateException("Thread has already been started");
- }
-
- // Mark the thread state as Running (which is
- // all bits cleared). Therefore just remove
- // the Unstarted bit
- clr_state(ThreadState.Unstarted);
-
- // Launch this thread
- Start_internal(system_thread_handle);
- }
-
- [MonoTODO]
- public void Suspend() {
- if((state & ThreadState.Unstarted) != 0 || !IsAlive) {
- throw new ThreadStateException("Thread has not been started, or is dead");
- }
-
- set_state(ThreadState.SuspendRequested);
- // FIXME - somehow let the interpreter know that
- // this thread should now suspend
- }
-
- [MonoTODO]
- ~Thread() {
- // FIXME
- }
-
- private void set_state(ThreadState set) {
- lock(this) {
- state |= set;
- }
- }
- private void clr_state(ThreadState clr) {
- lock(this) {
- state &= ~clr;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadAbortException.cs b/mcs/class/corlib/System.Threading/ThreadAbortException.cs
deleted file mode 100755
index 4278ce23ae7..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadAbortException.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Threading.ThreadAbortException.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class ThreadAbortException : SystemException
- {
- [MonoTODO]
- public object ExceptionState {
- get {
- // FIXME
- return(null);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs b/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs
deleted file mode 100755
index 133e523dbc3..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Threading.ThreadInterruptedException.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Threading
-{
- public class ThreadInterruptedException : SystemException
- {
- public ThreadInterruptedException()
- : base ("Thread interrupted") {
- }
-
- public ThreadInterruptedException(string message)
- : base (message) {
- }
-
- protected ThreadInterruptedException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public ThreadInterruptedException(string message, Exception innerException)
- : base (message, innerException) {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadPool.cs b/mcs/class/corlib/System.Threading/ThreadPool.cs
deleted file mode 100755
index 51a08d2062f..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadPool.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// System.Threading.ThreadPool.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class ThreadPool
- {
- [MonoTODO]
- public static bool BindHandle(IntPtr osHandle) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public static bool QueueUserWorkItem(WaitCallback callback) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public static bool QueueUserWorkItem(WaitCallback callback,
- object state) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject,
- WaitOrTimerCallback callback,
- object state,
- int millisecondsTimeOutInterval,
- bool executeOnlyOnce) {
- if(millisecondsTimeOutInterval < -1) {
- throw new ArgumentOutOfRangeException("timeout < -1");
- }
- // FIXME
- return(null);
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject,
- WaitOrTimerCallback callback,
- object state,
- long millisecondsTimeOutInterval,
- bool executeOnlyOnce) {
- if(millisecondsTimeOutInterval < -1) {
- throw new ArgumentOutOfRangeException("timeout < -1");
- }
- // FIXME
- return(null);
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, TimeSpan timeout, bool executeOnlyOnce) {
- // LAMESPEC: I assume it means "timeout" when it says "millisecondsTimeOutInterval"
- if(timeout.Milliseconds < -1) {
- throw new ArgumentOutOfRangeException("timeout < -1");
- }
- if(timeout.Milliseconds > Int32.MaxValue) {
- throw new NotSupportedException("timeout too large");
- }
- // FIXME
- return(null);
- }
-
- [CLSCompliant(false)][MonoTODO]
- public static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, uint millisecondsTimeOutInterval, bool executeOnlyOnce) {
- // FIXME
- return(null);
- }
-
- [MonoTODO]
- public static bool UnsafeQueueUserWorkItem(WaitCallback callback, object state) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, int millisecondsTimeOutInterval, bool executeOnlyOnce) {
- // FIXME
- return(null);
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, long millisecondsTimeOutInterval, bool executeOnlyOnce) {
- // FIXME
- return(null);
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, TimeSpan timeout, bool executeOnlyOnce) {
- // FIXME
- return(null);
- }
-
- [CLSCompliant(false)][MonoTODO]
- public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, uint millisecondsTimeOutInterval, bool executeOnlyOnce) {
- // FIXME
- return(null);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadPriority.cs b/mcs/class/corlib/System.Threading/ThreadPriority.cs
deleted file mode 100644
index ec7a32cae26..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadPriority.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// ThreadPriority.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:30:24 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Threading {
-
-
- /// <summary>
- /// </summary>
- public enum ThreadPriority {
-
- /// <summary>
- /// </summary>
- Lowest = 0,
-
- /// <summary>
- /// </summary>
- BelowNormal = 1,
-
- /// <summary>
- /// </summary>
- Normal = 2,
-
- /// <summary>
- /// </summary>
- AboveNormal = 3,
-
- /// <summary>
- /// </summary>
- Highest = 4,
- } // ThreadPriority
-
-} // System.Threading
diff --git a/mcs/class/corlib/System.Threading/ThreadStart.cs b/mcs/class/corlib/System.Threading/ThreadStart.cs
deleted file mode 100755
index ebd6bc9f764..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadStart.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.ThreadStart.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void ThreadStart();
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadState.cs b/mcs/class/corlib/System.Threading/ThreadState.cs
deleted file mode 100644
index 30c894f9e5a..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadState.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// ThreadState.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:30:30 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Threading {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ThreadState {
-
- /// <summary>
- /// </summary>
- Running = 0x00000000,
-
- StopRequested = 0x00000001,
- SuspendRequested = 0x00000002,
-
- /// <summary>
- /// </summary>
- Background = 0x00000004,
-
- /// <summary>
- /// </summary>
- Unstarted = 0x00000008,
-
- /// <summary>
- /// </summary>
- Stopped = 0x00000010,
-
- /// <summary>
- /// </summary>
- WaitSleepJoin = 0x00000020,
-
- Suspended = 0x00000040,
-
- /// <summary>
- /// </summary>
- AbortRequested = 0x00000080,
-
- /// <summary>
- /// </summary>
- Aborted = 0x00000100,
- } // ThreadState
-
-} // System.Threading
diff --git a/mcs/class/corlib/System.Threading/ThreadStateException.cs b/mcs/class/corlib/System.Threading/ThreadStateException.cs
deleted file mode 100755
index c1a09f31048..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadStateException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Threading.ThreadStateException.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Threading
-{
- public class ThreadStateException : SystemException
- {
- public ThreadStateException()
- : base ("Thread State Error") {
- }
-
- public ThreadStateException(string message)
- : base (message) {
- }
-
- protected ThreadStateException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public ThreadStateException(string message, Exception innerException)
- : base (message, innerException) {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Timeout.cs b/mcs/class/corlib/System.Threading/Timeout.cs
deleted file mode 100755
index 83da26f816f..00000000000
--- a/mcs/class/corlib/System.Threading/Timeout.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Threading.Timeout.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class Timeout
- {
- public const int Infinite=-1;
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Timer.cs b/mcs/class/corlib/System.Threading/Timer.cs
deleted file mode 100755
index 26b5ba45816..00000000000
--- a/mcs/class/corlib/System.Threading/Timer.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// System.Threading.Timer.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class Timer : IDisposable
- {
- [MonoTODO]
- public Timer(TimerCallback callback, object state, int dueTime, int period) {
- if(dueTime < -1) {
- throw new ArgumentOutOfRangeException("Due time < -1");
- }
- if(period < -1) {
- throw new ArgumentOutOfRangeException("Period < -1");
- }
-
- // FIXME
- }
-
- [MonoTODO]
- public Timer(TimerCallback callback, object state, long dueTime, long period) {
- if(dueTime < -1) {
- throw new ArgumentOutOfRangeException("Due time < -1");
- }
- if(period < -1) {
- throw new ArgumentOutOfRangeException("Period < -1");
- }
- // FIXME
- }
-
- [MonoTODO]
- public Timer(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period) {
- if(dueTime.Milliseconds < 0 || dueTime.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Due time out of range");
- }
- if(period.Milliseconds < 0 || period.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Period out of range");
- }
- // FIXME
- }
-
- [CLSCompliant(false)][MonoTODO]
- public Timer(TimerCallback callback, object state, uint dueTime, uint period) {
- // FIXME
- }
-
- [MonoTODO]
- public bool Change(int dueTime, int period) {
- if(dueTime < -1) {
- throw new ArgumentOutOfRangeException("Due time < -1");
- }
- if(period < -1) {
- throw new ArgumentOutOfRangeException("Period < -1");
- }
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public bool Change(long dueTime, long period) {
- if(dueTime < -1) {
- throw new ArgumentOutOfRangeException("Due time < -1");
- }
- if(period < -1) {
- throw new ArgumentOutOfRangeException("Period < -1");
- }
- if(dueTime > 4294967294) {
- throw new NotSupportedException("Due time too large");
- }
- if(period > 4294967294) {
- throw new NotSupportedException("Period too large");
- }
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public bool Change(TimeSpan dueTime, TimeSpan period) {
- // FIXME
- return(false);
- }
-
- [CLSCompliant(false)][MonoTODO]
- public bool Change(uint dueTime, uint period) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public void Dispose() {
- // FIXME
- }
-
- [MonoTODO]
- public bool Dispose(WaitHandle notifyObject) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- ~Timer() {
- // FIXME
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/TimerCallback.cs b/mcs/class/corlib/System.Threading/TimerCallback.cs
deleted file mode 100755
index 3afe1fc71f2..00000000000
--- a/mcs/class/corlib/System.Threading/TimerCallback.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.TimerCallback.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void TimerCallback(object state);
-}
diff --git a/mcs/class/corlib/System.Threading/WaitCallback.cs b/mcs/class/corlib/System.Threading/WaitCallback.cs
deleted file mode 100755
index ed1e39c0e28..00000000000
--- a/mcs/class/corlib/System.Threading/WaitCallback.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.WaitCallback.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void WaitCallback(object state);
-}
diff --git a/mcs/class/corlib/System.Threading/WaitHandle.cs b/mcs/class/corlib/System.Threading/WaitHandle.cs
deleted file mode 100755
index 1d6ec67ee80..00000000000
--- a/mcs/class/corlib/System.Threading/WaitHandle.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// System.Threading.WaitHandle.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
- public abstract class WaitHandle : MarshalByRefObject, IDisposable
- {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern bool WaitAll_internal(WaitHandle[] handles, int ms, bool exitContext);
-
- public static bool WaitAll(WaitHandle[] waitHandles) {
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAll_internal(waitHandles, Timeout.Infinite,
- false));
- }
-
- public static bool WaitAll(WaitHandle[] waitHandles,
- int millisecondsTimeout,
- bool exitContext) {
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAll_internal(waitHandles, millisecondsTimeout, false));
- }
-
- public static bool WaitAll(WaitHandle[] waitHandles,
- TimeSpan timeout,
- bool exitContext) {
- if(timeout.Milliseconds < 0 ||
- timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Timeout out of range");
- }
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAll_internal(waitHandles,
- timeout.Milliseconds,
- exitContext));
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int WaitAny_internal(WaitHandle[] handles, int ms, bool exitContext);
-
- // LAMESPEC: Doesn't specify how to signal failures
- public static int WaitAny(WaitHandle[] waitHandles) {
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAny_internal(waitHandles, Timeout.Infinite,
- false));
- }
-
- public static int WaitAny(WaitHandle[] waitHandles,
- int millisecondsTimeout,
- bool exitContext) {
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAny_internal(waitHandles,
- millisecondsTimeout,
- exitContext));
- }
-
- public static int WaitAny(WaitHandle[] waitHandles,
- TimeSpan timeout, bool exitContext) {
- if(timeout.Milliseconds < 0 ||
- timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Timeout out of range");
- }
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAny_internal(waitHandles,
- timeout.Milliseconds,
- exitContext));
- }
-
- [MonoTODO]
- public WaitHandle() {
- // FIXME
- }
-
- public const int WaitTimeout = 258;
-
- protected IntPtr os_handle = IntPtr.Zero;
-
- public virtual IntPtr Handle {
- get {
- return(os_handle);
- }
-
- set {
- os_handle=value;
- }
- }
-
- public virtual void Close() {
- Dispose(false);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- protected virtual extern bool WaitOne_internal(IntPtr handle, int ms, bool exitContext);
-
- public virtual bool WaitOne() {
- return(WaitOne_internal(os_handle, Timeout.Infinite,
- false));
- }
-
- public virtual bool WaitOne(int millisecondsTimeout, bool exitContext) {
- return(WaitOne_internal(os_handle,
- millisecondsTimeout,
- exitContext));
- }
-
- public virtual bool WaitOne(TimeSpan timeout, bool exitContext) {
- return(WaitOne_internal(os_handle,
- timeout.Milliseconds,
- exitContext));
- }
-
- protected static readonly IntPtr InvalidHandle;
-
- private bool disposed = false;
-
- public void Dispose() {
- Dispose(true);
- // Take yourself off the Finalization queue
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool explicitDisposing) {
- // Check to see if Dispose has already been called.
- if(!this.disposed) {
- // If this is a call to Dispose,
- // dispose all managed resources.
- if(explicitDisposing) {
- // Free up stuff here
- //Components.Dispose();
- }
-
- // Release unmanaged resources
- // Note that this is not thread safe.
- // Another thread could start
- // disposing the object after the
- // managed resources are disposed, but
- // before the disposed flag is set to
- // true.
- this.disposed=true;
- //Release(handle);
- //handle=IntPtr.Zero;
- }
- }
-
- ~WaitHandle() {
- Dispose(false);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs b/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs
deleted file mode 100755
index 03a03d7a318..00000000000
--- a/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.WaitOrTimerCallback.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void WaitOrTimerCallback(object state, bool timedOut);
-}
diff --git a/mcs/class/corlib/System/AppDomain.cs b/mcs/class/corlib/System/AppDomain.cs
deleted file mode 100755
index ebb4ba95bf2..00000000000
--- a/mcs/class/corlib/System/AppDomain.cs
+++ /dev/null
@@ -1,457 +0,0 @@
-//
-// System/AppDomain.cs
-//
-// Authors:
-// Paolo Molaro (lupus@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001, 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using System.Runtime.Remoting;
-using System.Security.Principal;
-using System.Security.Policy;
-using System.Security;
-
-namespace System {
-
- public sealed class AppDomain : MarshalByRefObject , _AppDomain , IEvidenceFactory {
-
- IntPtr _mono_app_domain;
-
- // Evidence evidence;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern AppDomainSetup getSetup ();
-
- public AppDomainSetup SetupInformation {
-
- get {
- return getSetup ();
- }
- }
-
- public string BaseDirectory {
-
- get {
- return SetupInformation.ApplicationBase;
- }
- }
-
- public string RelativeSearchPath {
-
- get {
- return SetupInformation.PrivateBinPath;
- }
- }
-
- public string DynamicDirectory {
-
- get {
- // fixme: dont know if this is right?
- return SetupInformation.DynamicBase;
- }
- }
-
- public bool ShadowCopyFiles {
-
- get {
- if (SetupInformation.ShadowCopyFiles == "true")
- return true;
- return false;
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern string getFriendlyName ();
-
- public string FriendlyName {
-
- get {
- return getFriendlyName ();
- }
- }
-
- public Evidence Evidence {
-
- get {
- return null;
- //return evidence;
- }
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private static extern AppDomain getCurDomain ();
-
- public static AppDomain CurrentDomain
- {
- get {
- return getCurDomain ();
- }
- }
-
- public void AppendPrivatePath (string path)
- {
- throw new NotImplementedException ();
- }
-
- public void ClearPrivatePath ()
- {
- throw new NotImplementedException ();
- }
-
- public void ClearShadowCopyPath ()
- {
- throw new NotImplementedException ();
- }
-
- public ObjectHandle CreateInstance (string assemblyName, string typeName)
- {
- return CreateInstance (assemblyName, typeName, false, 0,
- null, null, null, null, null);
- }
-
- public ObjectHandle CreateInstance (string assemblyName, string typeName,
- object[] activationAttributes)
- {
- return CreateInstance (assemblyName, typeName, false, 0,
- null, null, null, activationAttributes, null);
- }
-
- public ObjectHandle CreateInstance (string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes,
- Evidence securityAttribtutes)
- {
- throw new NotImplementedException ();
- }
-
- public ObjectHandle CreateInstanceFrom (string assemblyName, string typeName)
- {
- return CreateInstanceFrom (assemblyName, typeName, false, 0,
- null, null, null, null, null);
- }
-
- public ObjectHandle CreateInstanceFrom (string assemblyName, string typeName,
- object[] activationAttributes)
- {
- return CreateInstanceFrom (assemblyName, typeName, false, 0,
- null, null, null, activationAttributes, null);
- }
-
- public ObjectHandle CreateInstanceFrom (string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes,
- Evidence securityAttribtutes)
- {
- throw new NotImplementedException ();
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access)
- {
- return DefineDynamicAssembly (name, access, null, null,
- null, null, null, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- Evidence evidence)
- {
- return DefineDynamicAssembly (name, access, null, evidence,
- null, null, null, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir)
- {
- return DefineDynamicAssembly (name, access, dir, null,
- null, null, null, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence)
- {
- return DefineDynamicAssembly (name, access, dir, evidence,
- null, null, null, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions)
- {
- return DefineDynamicAssembly (name, access, null, null,
- requiredPermissions, optionalPermissions,
- refusedPersmissions, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions)
- {
- return DefineDynamicAssembly (name, access, null, evidence,
- requiredPermissions, optionalPermissions,
- refusedPersmissions, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions)
- {
- return DefineDynamicAssembly (name, access, dir, null,
- requiredPermissions, optionalPermissions,
- refusedPersmissions, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions)
- {
- return DefineDynamicAssembly (name, access, dir, evidence,
- requiredPermissions, optionalPermissions,
- refusedPersmissions, false);
-
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions,
- bool isSynchronized)
- {
- // FIXME: examine all other parameters
-
- AssemblyBuilder ab = new AssemblyBuilder (name, access);
- return ab;
- }
-
-
- public void DoCallBack (CrossAppDomainDelegate theDelegate)
- {
- throw new NotImplementedException ();
- }
-
- public override bool Equals (object other)
- {
- if (!(other is AppDomain))
- return false;
-
- return this._mono_app_domain == ((AppDomain)other)._mono_app_domain;
- }
-
- public int ExecuteAssembly (string assemblyFile)
- {
- return ExecuteAssembly (assemblyFile, new Evidence (), null);
- }
-
- public int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity)
- {
- return ExecuteAssembly (assemblyFile, new Evidence (), null);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern Assembly [] GetAssemblies ();
-
- public object GetDate (string name)
- {
- throw new NotImplementedException ();
- }
-
- public override int GetHashCode ()
- {
- return (int)_mono_app_domain;
- }
-
- public object GetLifetimeService ()
- {
- throw new NotImplementedException ();
- }
-
- public object InitializeLifetimeService ()
- {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern Assembly LoadAssembly (AssemblyName assemblyRef, Evidence securityEvidence);
-
- public Assembly Load (AssemblyName assemblyRef)
- {
- return Load (assemblyRef, new Evidence ());
- }
-
- public Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
- {
- return LoadAssembly (assemblyRef, assemblySecurity);
- }
-
- public Assembly Load (string assemblyString)
- {
- AssemblyName an = new AssemblyName ();
- an.Name = assemblyString;
-
- return Load (an, new Evidence ());
- }
-
- public Assembly Load (string assemblyString, Evidence assemblySecurity)
- {
- AssemblyName an = new AssemblyName ();
- an.Name = assemblyString;
-
- return Load (an, assemblySecurity);
- }
-
- public Assembly Load (byte[] rawAssembly)
- {
- return Load (rawAssembly, null, new Evidence ());
- }
-
- public Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore)
- {
- return Load (rawAssembly, rawSymbolStore, new Evidence ());
- }
-
- public Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence)
- {
- throw new NotImplementedException ();
- }
-
- public void SetAppDomainPolicy (PolicyLevel domainPolicy)
- {
- throw new NotImplementedException ();
- }
-
- public void SetCachePath (string s)
- {
- SetupInformation.CachePath = s;
- }
-
- public void SetPrincipalPolicy (PrincipalPolicy policy)
- {
- throw new NotImplementedException ();
- }
-
- public void SetShadowCopyPath (string s)
- {
- throw new NotImplementedException ();
- }
-
- public void SetThreadPrincipal (IPrincipal principal)
- {
- throw new NotImplementedException ();
- }
-
- public static AppDomain CreateDomain (string friendlyName)
- {
- return CreateDomain (friendlyName, new Evidence (), new AppDomainSetup ());
- }
-
- public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo)
- {
- return CreateDomain (friendlyName, securityInfo, new AppDomainSetup ());
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private static extern AppDomain createDomain (string friendlyName, AppDomainSetup info);
-
- public static AppDomain CreateDomain (string friendlyName,
- Evidence securityInfo,
- AppDomainSetup info)
- {
- if (friendlyName == null || securityInfo == null || info == null)
- throw new System.ArgumentNullException();
-
- AppDomain ad = createDomain (friendlyName, info);
-
- // ad.evidence = securityInfo;
-
- return ad;
- }
-
- public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo,
- string appBasePath, string appRelativeSearchPath,
- bool shadowCopyFiles)
- {
- AppDomainSetup info = new AppDomainSetup ();
-
- info.ApplicationBase = appBasePath;
- info.PrivateBinPath = appRelativeSearchPath;
-
- if (shadowCopyFiles)
- info.ShadowCopyFiles = "true";
- else
- info.ShadowCopyFiles = "false";
-
- return CreateDomain (friendlyName, securityInfo, info);
- }
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern void Unload (AppDomain domain);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern object GetData ();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern void SetData (string name, object data);
-
- public static int GetCurrentThreadId ()
- {
- throw new NotImplementedException ();
- }
-
-
- public event AssemblyLoadEventHandler AssemblyLoad;
-
- public event ResolveEventHandler AssemblyResolve;
-
- public event EventHandler DomainUnload;
-
- public event EventHandler ProcessExit;
-
- public event ResolveEventHandler ResourceResolve;
-
- public event ResolveEventHandler TypeResolve;
-
- public event UnhandledExceptionEventHandler UnhandledException;
-
- }
-}
diff --git a/mcs/class/corlib/System/AppDomainSetup.cs b/mcs/class/corlib/System/AppDomainSetup.cs
deleted file mode 100755
index fc8efbdecd3..00000000000
--- a/mcs/class/corlib/System/AppDomainSetup.cs
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// System/AppDomainSetup.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
-
- public sealed class AppDomainSetup : IAppDomainSetup {
- string application_base;
- string application_name;
- string cache_path;
- string configuration_file;
- string dynamic_base;
- string license_file;
- string private_bin_path;
- string private_bin_path_probe;
- string shadow_copy_directories;
- string shadow_copy_files;
- bool publisher_policy;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern AppDomainSetup InitAppDomainSetup (AppDomainSetup setup);
-
- public AppDomainSetup ()
- {
- InitAppDomainSetup (this);
- }
-
- public string ApplicationBase {
-
- get {
- return application_base;
- }
-
- set {
- application_base = value;
- }
- }
-
- public string ApplicationName {
-
- get {
- return application_name;
- }
-
- set {
- application_name = value;
- }
- }
-
- public string CachePath {
-
- get {
- return cache_path;
- }
-
- set {
- cache_path = value;
- }
- }
-
- public string ConfigurationFile {
-
- get {
- return configuration_file;
- }
-
- set {
- configuration_file = value;
- }
- }
-
- public bool DisallowPublisherPolicy {
- get {
- return publisher_policy;
- }
-
- set {
- publisher_policy = value;
- }
- }
-
- public string DynamicBase {
-
- get {
- return dynamic_base;
- }
-
- set {
- dynamic_base = value;
- }
- }
-
- public string LicenseFile {
-
- get {
- return license_file;
- }
-
- set {
- license_file = value;
- }
- }
-
-
-
- public string PrivateBinPath {
-
- get {
- return private_bin_path;
- }
-
- set {
- private_bin_path = value;
- }
- }
-
- public string PrivateBinPathProbe {
-
- get {
- return private_bin_path_probe;
- }
-
- set {
- private_bin_path_probe = value;
- }
- }
-
- public string ShadowCopyDirectories {
-
- get {
- return shadow_copy_directories;
- }
-
- set {
- shadow_copy_directories = value;
- }
- }
-
- public string ShadowCopyFiles {
-
- get {
- return shadow_copy_files;
- }
-
- set {
- shadow_copy_files = value;
- }
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/AppDomainUnloadedException.cs b/mcs/class/corlib/System/AppDomainUnloadedException.cs
deleted file mode 100644
index 9ca65e65c9c..00000000000
--- a/mcs/class/corlib/System/AppDomainUnloadedException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.AppDomainUnloadedException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class AppDomainUnloadedException : SystemException
- {
- // Constructors
- public AppDomainUnloadedException ()
- : base (Locale.GetText ("Can't access an unloaded application domain."))
- {
- }
-
- public AppDomainUnloadedException (string message)
- : base (message)
- {
- }
-
- protected AppDomainUnloadedException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public AppDomainUnloadedException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ApplicationException.cs b/mcs/class/corlib/System/ApplicationException.cs
deleted file mode 100644
index 9420c119430..00000000000
--- a/mcs/class/corlib/System/ApplicationException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.ApplicationException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Reflection;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
-
- [Serializable]
- public class ApplicationException : Exception
- {
- // Constructors
- public ApplicationException ()
- : base (Locale.GetText ("An application exception has occurred."))
- {
- }
-
- public ApplicationException (string message)
- : base (message)
- {
- }
-
- public ApplicationException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected ApplicationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ArgumentException.cs b/mcs/class/corlib/System/ArgumentException.cs
deleted file mode 100644
index 5a52271a530..00000000000
--- a/mcs/class/corlib/System/ArgumentException.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.ArgumentException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- public class ArgumentException : SystemException {
- private string param_name;
-
- // Constructors
- public ArgumentException ()
- : base (Locale.GetText ("An invalid argument was specified."))
- {
- }
-
- public ArgumentException (string message)
- : base (message)
- {
- }
-
- public ArgumentException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public ArgumentException (string message, string param_name)
- : base (message)
- {
- this.param_name = param_name;
- }
-
- public ArgumentException (string message, string param_name, Exception inner)
- : base (message, inner)
- {
- this.param_name = param_name;
- }
-
- protected ArgumentException (SerializationInfo info, StreamingContext sc)
- : base (info, sc)
- {
- param_name = info.GetString ("ParamName");
- }
-
- // Properties
- public virtual string ParamName {
- get {
- return param_name;
- }
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("ParamName", param_name);
- }
- }
-}
diff --git a/mcs/class/corlib/System/ArgumentNullException.cs b/mcs/class/corlib/System/ArgumentNullException.cs
deleted file mode 100644
index ba16a94c581..00000000000
--- a/mcs/class/corlib/System/ArgumentNullException.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.ArgumentNullException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- public class ArgumentNullException : ArgumentException {
- // Constructors
- public ArgumentNullException ()
- : base (Locale.GetText ("Argument cannot be null"))
- {
- }
-
- public ArgumentNullException (string param_name)
- : base (Locale.GetText ("Argument {0} cannot be null"), param_name)
- {
- }
-
- public ArgumentNullException (string param_name, string message)
- : base (message, param_name)
- {
- }
-
- protected ArgumentNullException (SerializationInfo info, StreamingContext sc)
- : base (info, sc)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ArgumentOutOfRangeException.cs b/mcs/class/corlib/System/ArgumentOutOfRangeException.cs
deleted file mode 100644
index b6f21f1f3dd..00000000000
--- a/mcs/class/corlib/System/ArgumentOutOfRangeException.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.ArgumentOutOfRangeException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class ArgumentOutOfRangeException : ArgumentException {
- private object actual_value;
-
- // Constructors
- public ArgumentOutOfRangeException ()
- : base (Locale.GetText ("Argument is out of range"))
- {
- }
-
- public ArgumentOutOfRangeException (string param_name)
- : base (Locale.GetText ("Argument is out of range"), param_name)
- {
- }
-
- public ArgumentOutOfRangeException (string param_name, string message)
- : base (message, param_name)
- {
- }
-
- public ArgumentOutOfRangeException (string param_name, object actual_value, string message)
- : base (message, param_name)
- {
- this.actual_value = actual_value;
- }
-
- public ArgumentOutOfRangeException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- actual_value = info.GetString ("ActualValue");
- }
-
- // Properties
- public virtual object ActualValue {
- get {
- return actual_value;
- }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("ActualValue", actual_value);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ArithmeticException.cs b/mcs/class/corlib/System/ArithmeticException.cs
deleted file mode 100644
index ff6c98cbb35..00000000000
--- a/mcs/class/corlib/System/ArithmeticException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ArithmeticException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
- [Serializable]
- public class ArithmeticException : SystemException {
- // Constructors
- public ArithmeticException ()
- : base (Locale.GetText ("The arithmetic operation is not allowed"))
- {
- }
-
- public ArithmeticException (string message)
- : base (message)
- {
- }
-
- public ArithmeticException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected ArithmeticException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/Array.cs b/mcs/class/corlib/System/Array.cs
deleted file mode 100644
index 49a4aa4b52c..00000000000
--- a/mcs/class/corlib/System/Array.cs
+++ /dev/null
@@ -1,547 +0,0 @@
-//
-// System.Array.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-using System.Runtime.CompilerServices;
-
-namespace System
-{
-
- [MonoTODO("This should implement IList and IEnumerable too")]
- public abstract class Array : ICloneable, ICollection
- {
- // Constructor
- protected Array ()
- {
- /* empty */
- }
-
- // Properties
- public int Length
- {
- get
- {
- int length = this.GetLength (0);
-
- for (int i = 1; i < this.Rank; i++) {
- length *= this.GetLength (i);
- }
-
- return length;
- }
- }
-
- public int Rank
- {
- get
- {
- return this.GetRank ();
- }
- }
-
- // InternalCall Methods
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern int GetRank ();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern int GetLength (int dimension);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern int GetLowerBound (int dimension);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern object GetValue (int[] idxs);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern void SetValue (object value, int[] idxs);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern static Array CreateInstanceImpl(Type elementType, int[] lengths, int [] bounds);
-
- // Properties
- public virtual int Count {
- get {
- return Length;
- }
- }
-
- [MonoTODO]
- public virtual bool IsSynchronized {
- get {
- // FIXME?
- return false;
- }
- }
-
- [MonoTODO]
- public virtual object SyncRoot {
- get {
- // FIXME
- return null;
- }
- }
-
- public virtual bool IsFixedSize
- {
- get {
- return true;
- }
- }
-
- public virtual bool IsReadOnly
- {
- get{
- return false;
- }
- }
-
- [MonoTODO]
- public virtual IEnumerator GetEnumerator ()
- {
- // FIXME
- return null;
- }
-
- public int GetUpperBound (int dimension)
- {
- return GetLowerBound (dimension) +
- GetLength (dimension) - 1;
- }
-
- public object GetValue (int idx)
- {
- int[] ind = new int [1];
-
- ind [0] = idx;
-
- return GetValue (ind);
- }
-
- public object GetValue (int idx1, int idx2)
- {
- int[] ind = new int [2];
-
- ind [0] = idx1;
- ind [1] = idx2;
-
- return GetValue (ind);
- }
-
- public object GetValue (int idx1, int idx2, int idx3)
- {
- int[] ind = new int [3];
-
- ind [0] = idx1;
- ind [1] = idx2;
- ind [2] = idx3;
-
- return GetValue (ind);
- }
-
- public void SetValue (object value, int idx)
- {
- int[] ind = new int [1];
-
- ind [0] = idx;
-
- SetValue (value, ind);
- }
-
- public void SetValue (object value, int idx1, int idx2)
- {
- int[] ind = new int [2];
-
- ind [0] = idx1;
- ind [1] = idx2;
-
- SetValue (value, ind);
- }
-
- public void SetValue (object value, int idx1, int idx2, int idx3)
- {
- int[] ind = new int [3];
-
- ind [0] = idx1;
- ind [1] = idx2;
- ind [2] = idx3;
-
- SetValue (value, ind);
- }
-
- public static Array CreateInstance(Type elementType, int length)
- {
- int[] lengths = new int [1];
- int[] bounds = null;
-
- lengths [0] = length;
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
- public static Array CreateInstance(Type elementType, int l1, int l2)
- {
- int[] lengths = new int [2];
- int[] bounds = null;
-
- lengths [0] = l1;
- lengths [1] = l2;
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
- public static Array CreateInstance(Type elementType, int l1, int l2, int l3)
- {
- int[] lengths = new int [3];
- int[] bounds = null;
-
- lengths [0] = l1;
- lengths [1] = l2;
- lengths [2] = l3;
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
- public static Array CreateInstance(Type elementType, int[] lengths)
- {
- int[] bounds = null;
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
- public static Array CreateInstance(Type elementType, int[] lengths, int [] bounds)
- {
- if(bounds == null)
- throw new ArgumentNullException("bounds");
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
-
- public static int BinarySearch (Array array, object value)
- {
- return BinarySearch (array, array.GetLowerBound (0), array.GetLength (0),
- value, null);
- }
-
- public static int BinarySearch (Array array, object value, IComparer comparer)
- {
- return BinarySearch (array, array.GetLowerBound (0), array.GetLength (0),
- value, comparer);
- }
-
- public static int BinarySearch (Array array, int index, int length, object value)
- {
- return BinarySearch (array, index, length, value, null);
- }
-
- public static int BinarySearch (Array array, int index,
- int length, object value,
- IComparer comparer)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (array.Rank > 1)
- throw new RankException ();
-
- if (index < array.GetLowerBound (0) || length < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (index + length > array.GetUpperBound (0) + 1)
- throw new ArgumentException ();
-
- if (comparer == null && !(value is IComparable))
- throw new ArgumentException ();
-
- // FIXME: Throw an ArgumentException if comparer
- // is null and value is not of the same type as the
- // elements of array.
-
- // FIXME: This is implementing linear search. While it should do a binary one
- // FIXME: Should not throw exception when values are null
-
- for (int i = 0; i < length; i++)
- {
- int result;
-
- if (comparer == null && !(array.GetValue(index + i) is IComparable))
- throw new ArgumentException ();
-
- if (comparer == null)
- result = (value as IComparable).CompareTo(array.GetValue(index + i));
- else
- result = comparer.Compare(value, array.GetValue(index + i));
-
- if (result == 0)
- return index + i;
- else if (result < 0)
- return ~(index + i);
- }
-
- return ~(index + length);
- }
-
- public static void Clear (Array array, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (array.Rank > 1)
- throw new RankException ();
-
- if (index < array.GetLowerBound (0) || length < 0 ||
- index + length > array.GetUpperBound (0) + 1)
- throw new ArgumentOutOfRangeException ();
-
- for (int i = 0; i < length; i++)
- {
- array.SetValue(null, index + i);
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public virtual extern object Clone ();
-
- public static void Copy (Array source, Array dest, int length)
- {
- // I don't know how to handle this ?
- if (source.Rank > 1 || dest.Rank > 1)
- throw new RankException ();
-
- Copy (source, source.GetLowerBound (0), dest, dest.GetLowerBound (0), length);
- }
-
- public static void Copy (Array source, int source_idx, Array dest, int dest_idx, int length)
- {
- // I don't know how to handle this ?
- if (source.Rank > 1 || dest.Rank > 1)
- throw new RankException ();
-
- if (length < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (source == null || dest == null)
- throw new ArgumentNullException ();
-
- if (source_idx < source.GetLowerBound (0) ||
- source_idx + length > source.GetUpperBound (0) + 1||
- dest_idx < dest.GetLowerBound (0) || dest_idx + length > dest.GetUpperBound (0) + 1)
- throw new ArgumentException ();
-
- if (source.Rank != dest.Rank)
- throw new RankException ();
-
- for (int i = 0; i < length; i++)
- {
- int index = source.GetLowerBound (0) + i + source_idx;
-
- dest.SetValue(source.GetValue(index), dest_idx + i + dest.GetLowerBound (0));
- }
-
- }
-
- public static int IndexOf (Array array, object value)
- {
- return IndexOf (array, value, 0, array.Length);
- }
-
- public static int IndexOf (Array array, object value, int index)
- {
- return IndexOf (array, value, index, array.Length - index);
- }
-
- public static int IndexOf (Array array, object value, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (length < 0 || index < array.GetLowerBound (0) ||
- index > array.GetUpperBound (0))
- throw new ArgumentOutOfRangeException ();
-
- for (int i = 0; i < length; i++)
- {
- if (array.GetValue(index + i).Equals(value))
- return index + i;
- }
-
- return array.GetLowerBound (0) - 1;
- }
-
- public static int LastIndexOf (Array array, object value)
- {
- return LastIndexOf (array, value, 0, array.Length);
- }
-
- public static int LastIndexOf (Array array, object value, int index)
- {
- return LastIndexOf (array, value, index, array.Length - index);
- }
-
- public static int LastIndexOf (Array array, object value, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (length < 0 || index < array.GetLowerBound (0) ||
- index > array.GetUpperBound (0))
- throw new ArgumentOutOfRangeException ();
-
- for (int i = length - 1; i >= 0; i--)
- {
- if (array.GetValue(index + i).Equals(value))
- return index + i;
- }
-
- return array.GetLowerBound (0) - 1;
- }
-
- public static void Reverse (Array array)
- {
- Reverse (array, array.GetLowerBound (0), array.GetLength (0));
- }
-
- public static void Reverse (Array array, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (array.Rank > 1)
- throw new RankException ();
-
- if (index < array.GetLowerBound (0) || length < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (index + length > array.GetUpperBound (0) + 1)
- throw new ArgumentException ();
-
- for (int i = 0; i < length/2; i++)
- {
- object tmp;
-
- tmp = array.GetValue (index + i);
- array.SetValue(array.GetValue (index + length - i - 1), index + i);
- array.SetValue(tmp, index + length - i - 1);
- }
- }
-
- public static void Sort (Array array)
- {
- Sort (array, null, array.GetLowerBound (0), array.GetLength (0), null);
- }
-
- public static void Sort (Array keys, Array items)
- {
- Sort (keys, items, keys.GetLowerBound (0), keys.GetLength (0), null);
- }
-
- public static void Sort (Array array, IComparer comparer)
- {
- Sort (array, null, array.GetLowerBound (0), array.GetLength (0), comparer);
- }
-
- public static void Sort (Array array, int index, int length)
- {
- Sort (array, null, index, length, null);
- }
-
- public static void Sort (Array keys, Array items, IComparer comparer)
- {
- Sort (keys, items, keys.GetLowerBound (0), keys.GetLength (0), comparer);
- }
-
- public static void Sort (Array keys, Array items, int index, int length)
- {
- Sort (keys, items, index, length, null);
- }
-
- public static void Sort (Array array, int index, int length, IComparer comparer)
- {
- Sort (array, null, index, length, comparer);
- }
-
- public static void Sort (Array keys, Array items, int index, int length, IComparer comparer)
- {
- int low0 = index;
- int high0 = index + length - 1;
-
- qsort (keys, items, index, index + length - 1, comparer);
- }
-
- private static void qsort (Array keys, Array items, int low0, int high0, IComparer comparer)
- {
- int pivot;
- int low = low0;
- int high = high0;
-
- if (keys.Rank > 1 || (items != null && items.Rank > 1))
- throw new RankException ();
-
- if (low >= high)
- return;
-
- pivot = (low + high) / 2;
-
- if (compare (keys.GetValue (low), keys.GetValue (pivot), comparer) > 0)
- swap (keys, items, low, pivot);
-
- if (compare (keys.GetValue (pivot), keys.GetValue (high), comparer) > 0)
- swap (keys, items, pivot, high);
-
- while (low < high)
- {
- // Move the walls in
- while (low < high && compare (keys.GetValue (low), keys.GetValue (pivot), comparer) < 0)
- low++;
- while (low < high && compare (keys.GetValue (pivot), keys.GetValue (high), comparer) < 0)
- high--;
-
- if (low < high)
- {
- swap (keys, items, low, high);
- low++;
- high--;
- }
- }
-
- qsort (keys, items, low0, low - 1, comparer);
- qsort (keys, items, high + 1, high0, comparer);
- }
-
- private static void swap (Array keys, Array items, int i, int j)
- {
- object tmp;
-
- tmp = keys.GetValue (i);
- keys.SetValue (keys.GetValue (j), i);
- keys.SetValue (tmp, j);
-
- if (items != null)
- {
- tmp = items.GetValue (i);
- items.SetValue (items.GetValue (j), i);
- items.SetValue (tmp, j);
- }
- }
-
- private static int compare (object value1, object value2, IComparer comparer)
- {
- if (comparer == null)
- return ((IComparable) value1).CompareTo(value2);
- else
- return comparer.Compare(value1, value2);
- }
-
- public virtual void CopyTo (Array array, int index)
- {
- Copy (this, this.GetLowerBound(0), array, index, this.GetLength (0));
- }
- }
-}
diff --git a/mcs/class/corlib/System/ArrayTypeMismatchException.cs b/mcs/class/corlib/System/ArrayTypeMismatchException.cs
deleted file mode 100644
index 2938300de61..00000000000
--- a/mcs/class/corlib/System/ArrayTypeMismatchException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ArrayTypeMismatchException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
- [Serializable]
- public class ArrayTypeMismatchException : SystemException {
- // Constructors
- public ArrayTypeMismatchException ()
- : base (Locale.GetText ("Source array type cannot be assigned to destination array type"))
- {
- }
-
- public ArrayTypeMismatchException (string message)
- : base (message)
- {
- }
-
- public ArrayTypeMismatchException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected ArrayTypeMismatchException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
-
- }
-}
diff --git a/mcs/class/corlib/System/AssemblyLoadEventArgs.cs b/mcs/class/corlib/System/AssemblyLoadEventArgs.cs
deleted file mode 100755
index 8857ac30368..00000000000
--- a/mcs/class/corlib/System/AssemblyLoadEventArgs.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.AssemblyLoadEventArgs.cs
-//
-// Author:
-// Chris Hynes (chrish@assistedsolutions.com)
-//
-// (C) 2001 Chris Hynes
-//
-
-using System;
-using System.Reflection;
-
-namespace System
-{
- public class AssemblyLoadEventArgs: EventArgs
- {
- protected Assembly m_loadedAssembly;
-
- public AssemblyLoadEventArgs(Assembly loadedAssembly)
- {
- this.m_loadedAssembly = loadedAssembly;
- }
-
- public Assembly LoadedAssembly
- {
- get
- {
- return m_loadedAssembly;
- }
- }
- }
-}
-
-
diff --git a/mcs/class/corlib/System/AssemblyLoadEventHandler.cs b/mcs/class/corlib/System/AssemblyLoadEventHandler.cs
deleted file mode 100755
index 46074f9523d..00000000000
--- a/mcs/class/corlib/System/AssemblyLoadEventHandler.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// System.AssemblyLoadEventHandler.cs
-//
-// Paolo Molaro
-//
-// (C) 2002 Ximian, Inc.
-
-namespace System
-{
- public delegate void AssemblyLoadEventHandler (object sender, AssemblyLoadEventArgs args);
-}
diff --git a/mcs/class/corlib/System/AsyncCallback.cs b/mcs/class/corlib/System/AsyncCallback.cs
deleted file mode 100644
index ba9ead8e6f2..00000000000
--- a/mcs/class/corlib/System/AsyncCallback.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// System/AsyncCallback.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
- public delegate void AsyncCallback (IAsyncResult ar);
-}
-
diff --git a/mcs/class/corlib/System/Attribute.cs b/mcs/class/corlib/System/Attribute.cs
deleted file mode 100644
index 4a09199629d..00000000000
--- a/mcs/class/corlib/System/Attribute.cs
+++ /dev/null
@@ -1,376 +0,0 @@
-//
-// System.Attribute.cs
-//
-// Authors:
-// Miguel de Icaza (miguel@ximian.com) - Original
-// Nick D. Drochak II (ndrochak@gol.com) - Implemented most of the guts
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-
-namespace System {
-
- public abstract class Attribute {
-
- protected Attribute ()
- {
- }
-
- public virtual object TypeId {
- get {
- // Derived classes should override this default behaviour as appropriate
- return this.GetType ();
- }
- }
-
- private static void CheckParameters (object element, Type attribute_type)
- {
- // neither parameter is allowed to be null
- if (null == element)
- {
- throw new ArgumentNullException ("element");
- }
-
- if (null == attribute_type)
- {
- throw new ArgumentNullException ("attribute_type");
- }
- }
-
- private static System.Attribute FindAttribute (object[] attributes)
- {
- // if there exists more than one attribute of the given type, throw an exception
- if (attributes.Length > 1) {
- throw new System.Reflection.AmbiguousMatchException (
- Locale.GetText ("<element> has more than one attribute of type <attribute_type>"));
- }
-
- if (attributes.Length < 1)
- return null;
-
- // tested above for '> 1' and and '< 1', so only '== 1' is left,
- // i.e. we found the attribute
-
- return (System.Attribute) attributes[0];
- }
-
- private static void CheckAncestry (Type attribute_type)
- {
- // attribute_type must be derived from type System.Attribute
- Type t = typeof (System.Attribute);
-
- /* fixme: thgi does not work for target monolib2
- if (!attribute_type.IsSubclassOf (t))
- {
- throw new ArgumentException ("Parameter is not a type derived from System.Attribute", "attribute_type");
- }
- */
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.ParameterInfo element,
- Type attribute_type)
- {
- return GetCustomAttribute (element, attribute_type, true);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.MemberInfo element,
- Type attribute_type)
- {
- return GetCustomAttribute (element, attribute_type, true);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.Assembly element,
- Type attribute_type)
- {
- return GetCustomAttribute (element, attribute_type, true);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.Module element,
- Type attribute_type)
- {
- return GetCustomAttribute (element, attribute_type, true);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.Module element,
- Type attribute_type, bool inherit)
- {
- // neither parameter is allowed to be null
- CheckParameters (element, attribute_type);
-
- // attribute_type must be derived from type System.Attribute
- CheckAncestry (attribute_type);
-
- // Module inheritance hierarchies CAN NOT be searched for attributes, so the second
- // parameter of GetCustomAttributes () is INGNORED.
- object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
-
- return FindAttribute (attributes);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.Assembly element,
- Type attribute_type, bool inherit)
- {
- // neither parameter is allowed to be null
- CheckParameters (element, attribute_type);
-
- // attribute_type must be derived from type System.Attribute
- CheckAncestry (attribute_type);
-
- // Assembly inheritance hierarchies CAN NOT be searched for attributes, so the second
- // parameter of GetCustomAttributes () is INGNORED.
- object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
-
- return FindAttribute (attributes);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.ParameterInfo element,
- Type attribute_type, bool inherit)
- {
- // neither parameter is allowed to be null
- CheckParameters (element, attribute_type);
-
- // attribute_type must be derived from type System.Attribute
- CheckAncestry (attribute_type);
-
- // ParameterInfo inheritance hierarchies CAN NOT be searched for attributes, so the second
- // parameter of GetCustomAttributes () is INGNORED.
- object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
-
- return FindAttribute (attributes);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.MemberInfo element,
- Type attribute_type, bool inherit)
- {
- // neither parameter is allowed to be null
- CheckParameters (element, attribute_type);
-
- // attribute_type must be derived from type System.Attribute
- CheckAncestry (attribute_type);
-
- // MemberInfo inheritance hierarchies can be searched for attributes, so the second
- // parameter of GetCustomAttributes () is respected.
- object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
-
- return FindAttribute (attributes);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Assembly element)
- {
- return System.Attribute.GetCustomAttributes (element, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.ParameterInfo element)
- {
- return System.Attribute.GetCustomAttributes (element, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.MemberInfo element){
- return System.Attribute.GetCustomAttributes (element, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Module element){
- return System.Attribute.GetCustomAttributes (element, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Assembly element,
- Type attribute_type)
- {
- return System.Attribute.GetCustomAttributes (element, attribute_type, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Module element,
- Type attribute_type)
- {
- return System.Attribute.GetCustomAttributes (element, attribute_type, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.ParameterInfo element,
- Type attribute_type)
- {
- return System.Attribute.GetCustomAttributes (element, attribute_type, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.MemberInfo element,
- Type attribute_type)
- {
- return System.Attribute.GetCustomAttributes (element, attribute_type, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Assembly element,
- Type attribute_type, bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, attribute_type);
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes;
-
- attributes = (System.Attribute[]) element.GetCustomAttributes (
- attribute_type, inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.ParameterInfo element,
- Type attribute_type, bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, attribute_type);
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- attribute_type, inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Module element,
- Type attribute_type, bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, attribute_type);
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- attribute_type, inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.MemberInfo element,
- Type attribute_type, bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, attribute_type);
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- attribute_type, inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Module element,
- bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, typeof (System.Attribute));
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Assembly element,
- bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, typeof (System.Attribute));
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.MemberInfo element,
- bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, typeof (System.Attribute));
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.ParameterInfo element,
- bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, typeof (System.Attribute));
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- inherit);
-
- return attributes;
- }
-
- public override int GetHashCode ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual bool IsDefaultAttribute ()
- {
- // Derived classes should override this default behaviour as appropriate
- return false;
- }
-
- public static bool IsDefined (System.Reflection.Module element, Type attribute_type)
- {
- return (System.Attribute.GetCustomAttributes (element, attribute_type).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.ParameterInfo element, Type attribute_type)
- {
- return (System.Attribute.GetCustomAttributes (element, attribute_type).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.MemberInfo element, Type attribute_type)
- {
- return (System.Attribute.GetCustomAttributes (element, attribute_type).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.Assembly element, Type attribute_type)
- {
- return (System.Attribute.GetCustomAttributes (element, attribute_type).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.MemberInfo element, Type attribute_type,
- bool inherit)
- {
- return (System.Attribute.GetCustomAttributes (
- element, attribute_type, inherit).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.Assembly element, Type attribute_type,
- bool inherit)
- {
- return (System.Attribute.GetCustomAttributes (
- element, attribute_type, inherit).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.Module element, Type attribute_type,
- bool inherit)
- {
- return (System.Attribute.GetCustomAttributes (
- element, attribute_type, inherit).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.ParameterInfo element,
- Type attribute_type, bool inherit)
- {
- return (System.Attribute.GetCustomAttributes (
- element, attribute_type, inherit).Length > 0);
- }
-
- public virtual bool Match (object obj)
- {
- // default action is the same as Equals.
- // Derived classes should override as appropriate
-
- return this.Equals (obj);
- }
- }
-}
diff --git a/mcs/class/corlib/System/AttributeTargets.cs b/mcs/class/corlib/System/AttributeTargets.cs
deleted file mode 100644
index a9cb1554ca6..00000000000
--- a/mcs/class/corlib/System/AttributeTargets.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// AttributeTargets.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Fri, 7 Sep 2001 16:31:48 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum AttributeTargets {
-
- /// <summary>
- /// </summary>
- Assembly = 0x00000001,
-
- /// <summary>
- /// </summary>
- Module = 0x00000002,
-
- /// <summary>
- /// </summary>
- Class = 0x00000004,
-
- /// <summary>
- /// </summary>
- Struct = 0x00000008,
-
- /// <summary>
- /// </summary>
- Enum = 0x00000010,
-
- /// <summary>
- /// </summary>
- Constructor = 0x00000020,
-
- /// <summary>
- /// </summary>
- Method = 0x00000040,
-
- /// <summary>
- /// </summary>
- Property = 0x00000080,
-
- /// <summary>
- /// </summary>
- Field = 0x00000100,
-
- /// <summary>
- /// </summary>
- Event = 0x00000200,
-
- /// <summary>
- /// </summary>
- Interface = 0x00000400,
-
- /// <summary>
- /// </summary>
- Parameter = 0x00000800,
-
- /// <summary>
- /// </summary>
- Delegate = 0x00001000,
-
- /// <summary>
- /// </summary>
- ReturnValue = 0x00002000,
-
- /// <summary>
- /// </summary>
- All = Assembly | Class | Struct | Enum | Constructor | Method | Property | Field | Event | Interface | Parameter | Delegate | ReturnValue,
- } // AttributeTargets
-
-} // System
diff --git a/mcs/class/corlib/System/AttributeUsage.cs b/mcs/class/corlib/System/AttributeUsage.cs
deleted file mode 100644
index f5e3ddf136f..00000000000
--- a/mcs/class/corlib/System/AttributeUsage.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.AttributeUsage.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- [AttributeUsage(AttributeTargets.All)]
- public class AttributeUsageAttribute : Attribute {
- AttributeTargets valid_on;
- bool allow_multiple, inherited;
-
- public AttributeUsageAttribute (AttributeTargets validOn)
- {
- valid_on = validOn;
- }
-
- public bool AllowMultiple {
- get {
- return allow_multiple;
- }
-
- set {
- allow_multiple = value;
- }
- }
-
- public bool Inherited {
- get {
- return inherited;
- }
-
- set {
- inherited = value;
- }
- }
-
- public AttributeTargets ValidOn {
- get {
- return valid_on;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System/BadImageFormatException.cs b/mcs/class/corlib/System/BadImageFormatException.cs
deleted file mode 100644
index 8ea5857f5fa..00000000000
--- a/mcs/class/corlib/System/BadImageFormatException.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// System.BadImageFormatException
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class BadImageFormatException : SystemException
- {
- // Fields
- private string msg; // we need this because System.Exception's message is private.
- private Exception inner;
- private string fileName;
- private string fusionLog;
-
- // Constructors
- public BadImageFormatException ()
- : base (Locale.GetText ("Invalid file image."))
- {
- msg = "Invalid file image.";
- }
-
- public BadImageFormatException (string message)
- : base (message)
- {
- msg = message;
- }
-
- protected BadImageFormatException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- fileName = info.GetString ("BadImageFormat_FileName");
- fusionLog = info.GetString ("BadImageFormat_FusionLog");
- }
-
- public BadImageFormatException (string message, Exception inner)
- : base (message, inner)
- {
- msg = message;
- this.inner = inner;
- }
-
- public BadImageFormatException (string message, string fileName)
- : base (message)
- {
- msg = message;
- this.fileName = fileName;
- }
-
- public BadImageFormatException (string message, string fileName, Exception inner)
- : base (message, inner)
- {
- msg = message;
- this.inner = inner;
- this.fileName = fileName;
- }
-
- // Properties
- public override string Message
- {
- get { return Locale.GetText (msg); }
- }
-
- public string FileName
- {
- get { return fileName; }
- }
-
- public string FusionLog
- {
- get { return fusionLog; }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("BadImageFormat_FileName", fileName);
- info.AddValue ("BadImageFormat_FusionLog", fusionLog);
- }
-
- public override string ToString ()
- {
- return inner.ToString();
- }
- }
-}
diff --git a/mcs/class/corlib/System/BitConverter.cs b/mcs/class/corlib/System/BitConverter.cs
deleted file mode 100755
index 87a62294cc3..00000000000
--- a/mcs/class/corlib/System/BitConverter.cs
+++ /dev/null
@@ -1,223 +0,0 @@
-//
-// System.BitConverter
-//
-// Author:
-// Matt Kimball (matt@kimball.net)
-//
-
-using System;
-
-namespace System {
- public class BitConverter {
- static bool AmILittleEndian() {
- byte[] one = GetBytes((int)1);
- return (one[0] == 1);
- }
-
- public static readonly bool IsLittleEndian = AmILittleEndian();
-
- public static long DoubleToInt64Bits(double value) {
- return ToInt64(GetBytes(value), 0);
- }
-
- public static double Int64BitsToDouble(long value) {
- return ToDouble(GetBytes(value), 0);
- }
-
- unsafe static byte[] GetBytes(byte *ptr, int count) {
- byte[] ret = new byte[count];
-
- for (int i = 0; i < count; i++) {
- ret[i] = ptr[i];
- }
-
- return ret;
- }
-
- unsafe public static byte[] GetBytes(bool value) {
- return GetBytes((byte *)&value, 1);
- }
-
- unsafe public static byte[] GetBytes(char value) {
- return GetBytes((byte *)&value, 2);
- }
-
- unsafe public static byte[] GetBytes(short value) {
- return GetBytes((byte *)&value, 2);
- }
-
- unsafe public static byte[] GetBytes(int value) {
- return GetBytes((byte *)&value, 4);
- }
-
- unsafe public static byte[] GetBytes(long value) {
- return GetBytes((byte *)&value, 8);
- }
-
- [CLSCompliant(false)]
- unsafe public static byte[] GetBytes(ushort value) {
- return GetBytes((byte *)&value, 2);
- }
-
- [CLSCompliant(false)]
- unsafe public static byte[] GetBytes(uint value) {
- return GetBytes((byte *)&value, 4);
- }
-
- [CLSCompliant(false)]
- unsafe public static byte[] GetBytes(ulong value) {
- return GetBytes((byte *)&value, 8);
- }
-
- unsafe public static byte[] GetBytes(float value) {
- return GetBytes((byte *)&value, 4);
- }
-
- unsafe public static byte[] GetBytes(double value) {
- return GetBytes((byte *)&value, 8);
- }
-
- unsafe static void PutBytes(byte *dst, byte[] src, int start_index, int count) {
- if (src == null) {
- throw new ArgumentNullException();
- }
-
- if (src.Length < start_index + count) {
- throw new ArgumentOutOfRangeException();
- }
-
- for (int i = 0; i < count; i++) {
- dst[i] = src[i + start_index];
- }
- }
-
- unsafe public static bool ToBoolean(byte[] value, int start_index) {
- bool ret;
-
- PutBytes((byte *)&ret, value, start_index, 1);
-
- return ret;
- }
-
- unsafe public static char ToChar(byte[] value, int start_index) {
- char ret;
-
- PutBytes((byte *)&ret, value, start_index, 2);
-
- return ret;
- }
-
- unsafe public static short ToInt16(byte[] value, int start_index) {
- short ret;
-
- PutBytes((byte *)&ret, value, start_index, 2);
-
- return ret;
- }
-
- unsafe public static int ToInt32(byte[] value, int start_index) {
- int ret;
-
- PutBytes((byte *)&ret, value, start_index, 4);
-
- return ret;
- }
-
- unsafe public static long ToInt64(byte[] value, int start_index) {
- long ret;
-
- PutBytes((byte *)&ret, value, start_index, 8);
-
- return ret;
- }
-
- [CLSCompliant(false)]
- unsafe public static ushort ToUInt16(byte[] value, int start_index) {
- ushort ret;
-
- PutBytes((byte *)&ret, value, start_index, 2);
-
- return ret;
- }
-
- [CLSCompliant(false)]
- unsafe public static uint ToUInt32(byte[] value, int start_index) {
- uint ret;
-
- PutBytes((byte *)&ret, value, start_index, 4);
-
- return ret;
- }
-
- [CLSCompliant(false)]
- unsafe public static ulong ToUInt64(byte[] value, int start_index) {
- ulong ret;
-
- PutBytes((byte *)&ret, value, start_index, 8);
-
- return ret;
- }
-
- unsafe public static float ToSingle(byte[] value, int start_index) {
- float ret;
-
- PutBytes((byte *)&ret, value, start_index, 4);
-
- return ret;
- }
-
- unsafe public static double ToDouble(byte[] value, int start_index) {
- double ret;
-
- PutBytes((byte *)&ret, value, start_index, 8);
-
- return ret;
- }
-
- public static string ToString(byte[] value) {
- return ToString(value, 0, value.Length);
- }
-
- public static string ToString(byte[] value, int start_index) {
- if (start_index >= value.Length) {
- throw new ArgumentOutOfRangeException();
- }
-
- return ToString(value, start_index, value.Length - start_index);
- }
-
- public static string ToString(byte[] value, int start_index, int length) {
- if (value == null) {
- throw new ArgumentNullException();
- }
-
- if (start_index < 0 || length < 0 || start_index + length > value.Length) {
- throw new ArgumentOutOfRangeException();
- }
-
- string ret = "";
-
- for (int i = 0; i < value.Length; i++) {
- if (i > 0)
- ret = ret + '-';
-
- char high = (char)((value[i] >> 4) & 0x0f);
- char low = (char)(value[i] & 0x0f);
-
- if (high < 10)
- high += '0';
- else
- high += 'A';
-
- if (low < 10)
- low += '0';
- else
- low += 'A';
-
- ret = ret + high + low;
- }
-
- return ret;
- }
- }
-}
diff --git a/mcs/class/corlib/System/Boolean.cs b/mcs/class/corlib/System/Boolean.cs
deleted file mode 100644
index 3b7e8d5ae79..00000000000
--- a/mcs/class/corlib/System/Boolean.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-//
-// System.Boolean.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// I guess this is the Boolean class. This was written word for word
-// off the Library specification for System.Boolean in the ECMA
-// TC39 TG2 and TG3 working documents.
-//
-// The XML style documentation isn't that elegant, but it seems to
-// be the standard way according to the poorly documented C#
-// Programmer's Reference section on XML Documentation.
-//
-// This header and the one above it can be formatted however, just trying
-// to keep it consistent w/ the existing mcs headers.
-//
-// Even though it's not in the ECMA docs, the .NET Framework Class Library
-// says this implements IConvertible, but if it does it has some other
-// member functions to implement.
-//
-
-using System.Globalization;
-namespace System {
-
- /// <summary>
- /// Represents the boolean values of logical true and false.
- /// </summary>
- public struct Boolean : IComparable, IConvertible {
-
- /// <value>
- /// The String representation of Boolean False
- /// </value>
- public static readonly string FalseString;
-
- /// <value>
- /// The String representation of Boolean True
- /// </value>
- public static readonly string TrueString;
-
- /// <value>
- /// Internal bool value for for this instance
- /// </value>
- //
- // HACK: we tag it as public, so the source will compile.
- public bool value;
-
- static Boolean ()
- {
- FalseString = "False";
- TrueString = "True";
- }
-
- /// <summary>
- /// Compares the current Boolean instance against another object.
- /// </summary>
- /// <remarks>
- /// Throws an ArgumentException if <c>obj</c> isn't null or
- /// a Boolean.
- /// </remarks>
- /// <param name="obj">
- /// The object to compare against
- /// </param>
- /// <returns>
- /// An int reflecting the sort order of this instance as
- /// compared to <c>obj</c>
- /// -1 if this instance is false and <c>obj</c> is true
- /// 0 if this instance is equal to <c>obj</c>
- /// 1 if this instance is true and <c>obj</c> is false,
- /// or <c>obj</c> is null
- /// </returns>
- public int CompareTo (object obj)
- {
- if (obj == null)
- return 1;
-
- if (!(obj is System.Boolean))
- throw new ArgumentException
- (Locale.GetText ("Object is not a Boolean and is not a null reference"));
-
- // for case #3
- if (obj == null || (value == true && (bool)obj == false))
- return 1;
-
- // for case #2, else it's #1
- return (value == (bool)obj) ? 0 : -1;
- }
-
- /// <summary>
- /// Determines whether this instance and another object represent the
- /// same type and value.
- /// </summary>
- /// <param name="obj">
- /// The object to check against
- /// </param>
- /// <returns>
- /// true if this instnace and <c>obj</c> are same value,
- /// otherwise false if it is not or null
- /// </returns>
- public override bool Equals (Object obj)
- {
- if (obj == null || !(obj is System.Boolean))
- return false;
-
- return ((bool)obj) == value;
- }
-
- /// <summary>
- /// Generates a hashcode for this object.
- /// </summary>
- /// <returns>
- /// An Int32 value holding the hash code
- /// </returns>
- public override int GetHashCode ()
- {
- // Guess there's not too many ways to hash a Boolean
- return value ? 1 : 0;
- }
-
- /// <summary>
- /// Returns a given string as a boolean value. The string must be
- /// equivalent to either TrueString or FalseString, with leading and/or
- /// trailing spaces, and is parsed case-insensitively.
- /// </summary>
- /// <remarks>
- /// Throws an ArgumentNullException if <c>val</c> is null, or a
- /// FormatException if <c>val</c> doesn't match <c>TrueString</c>
- /// or <c>FalseString</c>
- /// </remarks>
- /// <param name="val">
- /// The string value to parse
- /// </param>
- /// <returns>
- /// true if <c>val</c> is equivalent to TrueString,
- /// otherwise false
- /// </returns>
- public static bool Parse (string val)
- {
- if (val == null)
- throw new ArgumentNullException (
- Locale.GetText ("Value is a null reference"));
-
- val = val.Trim ();
-
- if (String.Compare (val, TrueString, true) == 0)
- return true;
-
- if (String.Compare (val, FalseString, true) == 0)
- return false;
-
- throw new FormatException (Locale.GetText (
- "Value is not equivalent to either TrueString or FalseString"));
- }
-
- /// <summary>
- /// Returns a string representation of this Boolean object.
- /// </summary>
- /// <returns>
- /// <c>FalseString</c> if the instance value is false, otherwise
- /// <c>TrueString</c>
- /// </returns>
- public override string ToString ()
- {
- return value ? TrueString : FalseString;
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Boolean;
- }
-
- public object ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType(value, conversionType, provider);
- }
-
- public bool ToBoolean (IFormatProvider provider)
- {
- return value;
- }
-
- public byte ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte(value);
- }
-
- public char ToChar (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- public DateTime ToDateTime (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public decimal ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal(value);
- }
-
- public double ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble(value);
- }
-
- public short ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16(value);
- }
-
- public int ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32(value);
- }
-
- public long ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64(value);
- }
-
- [CLSCompliant(false)]
- public sbyte ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte(value);
- }
-
- public float ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle(value);
- }
-
- public string ToString (IFormatProvider provider)
- {
- return ToString();
- }
-
- [CLSCompliant(false)]
- public ushort ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16(value);
- }
-
- [CLSCompliant(false)]
- public uint ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32(value);
- }
-
- [CLSCompliant(false)]
- public ulong ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64(value);
- }
-
- } // System.Boolean
-
-} // Namespace System
diff --git a/mcs/class/corlib/System/Buffer.cs b/mcs/class/corlib/System/Buffer.cs
deleted file mode 100755
index e7d20b7ee7a..00000000000
--- a/mcs/class/corlib/System/Buffer.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System/Buffer.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
- public sealed class Buffer {
-
- public static void BlockCopy( Array src, int srcOffset, Array dst, int dstOffset, int count)
- {
- throw new NotImplementedException ();
- }
-
- public static int ByteLength( Array array)
- {
- throw new NotImplementedException ();
- }
-
- public static byte GetByte( Array array, int index)
- {
- throw new NotImplementedException ();
- }
-
- public static void SetByte( Array array, int index, byte value)
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/corlib/System/Byte.cs b/mcs/class/corlib/System/Byte.cs
deleted file mode 100644
index 2da7a42234f..00000000000
--- a/mcs/class/corlib/System/Byte.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-//
-// System.Byte.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- public struct Byte : IComparable, IFormattable, IConvertible {
-
- public const byte MinValue = 0;
- public const byte MaxValue = 255;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public byte value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Byte))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Byte"));
-
- byte xv = (byte) v;
-
- if (value == xv)
- return 0;
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Byte))
- return false;
-
- return ((byte) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- public static byte Parse (string s)
- {
- byte val = 0;
- int len;
- int i;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- // look for the first non-whitespace character
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- // if it's all whitespace, then throw exception
- if (i == len)
- throw new FormatException ();
-
- // look for the optional '+' sign
- if (s [i] == '+')
- i++;
-
- // we should just have numerals followed by whitespace now
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- // shift left and accumulate every time we find a numeral
- byte d = (byte) (c - '0');
-
- val = checked ((byte) (val * 10 + d));
- digits_seen = true;
- } else {
- // after the last numeral, only whitespace is allowed
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
-
- // if all we had was a '+' sign, then throw exception
- if (!digits_seen)
- throw new FormatException ();
-
- return val;
- }
-
- public static byte Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static byte Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [MonoTODO]
- public static byte Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- if (null == s){
- throw new ArgumentNullException();
- }
-
- // TODO: Handle other styles and FormatProvider properties
- throw new NotImplementedException();
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (IFormatProvider provider)
- {
- return ToString (null, provider);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Byte;
- }
-
- public object ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType(value, conversionType, provider);
- }
-
- public bool ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean(value);
- }
-
- public byte ToByte (IFormatProvider provider)
- {
- return value;
- }
-
- public char ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar(value);
- }
-
- [CLSCompliant(false)]
- public DateTime ToDateTime (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public decimal ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal(value);
- }
-
- public double ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble(value);
- }
-
- public short ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16(value);
- }
-
- public int ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32(value);
- }
-
- public long ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64(value);
- }
-
- [CLSCompliant(false)]
- public sbyte ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte(value);
- }
-
- public float ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle(value);
- }
-
- string IConvertible.ToString (IFormatProvider provider)
- {
- return ToString("G", provider);
- }
-
- [CLSCompliant(false)]
- public ushort ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16(value);
- }
-
- [CLSCompliant(false)]
- public uint ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32(value);
- }
-
- [CLSCompliant(false)]
- public ulong ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64(value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/CLSCompliantAttribute.cs b/mcs/class/corlib/System/CLSCompliantAttribute.cs
deleted file mode 100755
index 8dbd5ad4445..00000000000
--- a/mcs/class/corlib/System/CLSCompliantAttribute.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.CLSCompliantAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// Used to indicate if an element of a program is CLS compliant.
- /// </summary>
- ///
- /// <remarks>
- /// </remarks>
- [AttributeUsage(AttributeTargets.All)]
- public class CLSCompliantAttribute : Attribute {
-
- bool is_compliant;
-
- public CLSCompliantAttribute (bool is_compliant)
- {
- this.is_compliant = is_compliant;
- }
-
- public bool IsCompliant {
- get {
- return is_compliant;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System/CannotUnloadAppDomainException.cs b/mcs/class/corlib/System/CannotUnloadAppDomainException.cs
deleted file mode 100644
index 1cd03735a35..00000000000
--- a/mcs/class/corlib/System/CannotUnloadAppDomainException.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.CannotUnloadAppDomainException
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class CannotUnloadAppDomainException : SystemException
- {
- // Constructors
- public CannotUnloadAppDomainException ()
- : base (Locale.GetText ("Attempt to unload application domain failed."))
- {
- }
-
- public CannotUnloadAppDomainException (string message)
- : base (message)
- {
- }
-
- protected CannotUnloadAppDomainException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public CannotUnloadAppDomainException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog
deleted file mode 100644
index 8255c16021e..00000000000
--- a/mcs/class/corlib/System/ChangeLog
+++ /dev/null
@@ -1,1297 +0,0 @@
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * WeakReference.cs: Committed for Ajay Kumar Dwivedi.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * TimeZone.cs: Use an internal enum rather than magic numbers to access the
- fields of the interncall GetTimeZoneData.
-
- * DateTime.cs: Implemented Parse and fixed a few bugs.
-
- * String.cs (TrimStart): Small fix.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTime.cs: ParseExact is now fully functional.
-
- * String.cs (TrimEnd): Small fix.
-
-2002-02-26 Duco Fijma <duco@lorentz.xs4all.nl>
- * TimeSpan.cs: Added method TimeSpan.FromMilliseconds, mysteriously
- missing for about six months.
-
-Tue Feb 26 14:21:19 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * UInt64.cs: fixed Parse method () to handle some of the NumberStyle flags.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTime.cs: Miguel already committed this, but there was still a
- ChangeLog entry for this missing ....
- We're now reusing functionality from TimeSpan, printing dates is
- fully implemented, currently working on parsing.
-
- * TimeZone.cs: Fully implemented this. There's a new InternCall in the
- runtime for this.
-
-Fri Feb 22 18:47:08 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs: disable constructor.
- * Object.cs: make GetType() an internalcall.
- * Type.cs: added correct bindingflags to GetMethods ().
- All such calls should be reviewed to use the correct flags.
-
-Thu Feb 21 19:23:46 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs, MonoType.cs: type_is_subtype_of () changed to include extra
- argument.
-
-Thu Feb 21 16:56:51 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs: implemented IsAssignableFrom.
-
-2002-02-21 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs: fixed Guid.Guid(string) ctor. Changed format:
- "{0xdddddddd,0xdddd,0xdddd,{0xdd},{0xdd},{0xdd},{0xdd},{0xdd},{0xdd}}"
- to "{0xdddddddd,0xdddd,0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}}"
- The former is documented by Microsoft. The latter is how they
- actually implemented it in mscorlib:-)
-
-Tue Feb 19 20:34:35 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoCustomAttrs.cs: hooks to get the custom attributes from the
- runtime.
- * MonoType.cs: Implemented custom attributes methods.
-
-
-2002-02-21 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs:
-
-Tue Feb 19 20:34:35 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoCustomAttrs.cs: hooks to get the custom attributes from the
- runtime.
- * MonoType.cs: Implemented custom attributes methods.
-
-2002-02-19 Dietmar Maurer <dietmar@ximian.com>
-
- * Array.cs (CopyTo): use GetLength() instead of GetUpperBound()
-
-2002-02-19 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs: Finished up the missing methods in Convert. Added a
- new private method ConvertFromBase.
-
-2002-02-19 Dietmar Maurer <dietmar@ximian.com>
-
- * String.cs: impl. IConvertible interface
-
-2002-02-18 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs: actual implementation for Guid.Guid(string) Ctor
-
-2002-02-18 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs: Changed from using Type.GetType (string) to just
- typeof (). Probably will speed things up a bit?
-
-2002-02-18 Ajay Kumar Dwivedi <AjayKumar.Dwivedi@dresdner-bank.com>
-
- * Array.cs:
- 1. Fix for GetUpperBound to return correct values
- 2. made some Properties virtual
- 3. Adds IsFixedSize and IsReadOnly properties.
- 4. changes CreateInstance(Type,int[],int[]) to throw Exception
- when third arg is null. InternalCall CreateInstance changed to
- CreateInstanceImpl
- 5. Fixed array.GetUpperBound at a couple of places
- 6. IndexOf and LastIndexOf now use Object.Equals instead of "=="
- 7. Added two FIXME's in BinarySearch functions.
-
-2002-02-17 Duncan Mak <duncan@ximian.com>
-
- * TimeZone.cs: Applied the rest of Ajay's patch for
- IsDaylightSavingTime. Thanks a lot for the nice explanation of how
- it works!
-
-2002-02-17 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs: added stub for Guid(string) ctor
-
-2002-02-17 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs: Near-complete implementation of Convert.cs
-
- Added all the To* methods taking (object) and
- (object, IFormatProvider) as parameters.
-
- Added [CLSCompliant (false)] attributes to methods dealing with
- unsigned types.
-
- Added the missing section on converting to and from DateTime. Only
- 6 missing methods, all marked with MonoTODOs. Will tackle them later.
-
-2002-02-16 Duncan Mak <duncan@ximian.com>
-
- * TimeZone.cs: patch from Ajay Kumar Dwivedi (adwiv@yahoo.com) to
- make IsDaylightSavingTime (DateTime) call
- IsDaylightSavingTime (DateTime, DaylightTime).
-
- Added internal class CurrentTimeZone from Ajay. It needs more work
- to fill in the appropriate internal calls.
-
-Sat Feb 16 12:41:41 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs: fix IsClass.
-
-Sat Feb 16 12:02:02 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: fix Trim().
-
-Fri Feb 15 21:02:46 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: fix more off by one errors.
-
-Thu Feb 14 18:54:09 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs: fix IsValueTypeImpl.
- * Type.cs: fix IsEnum. Implement Equals methods.
-
-Wed Feb 13 21:50:13 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Int32.cs: implement IConvertible interface.
-
-2002-02-12 Duncan Mak <duncan@ximian.com>
-
- * TimeZone.cs: Implemented and added to CVS.
-
-2002-02-11 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs: Implemented the ChangeType () methods.
-
-Mon Feb 11 19:48:58 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Array.cs: make Clone() an internal call.
-
-2002-02-09 Duco Fijma <duco@lorentz.xs4all.nl>
- * Changed Guid.NewGuid so that it can use both System.Random and
- System.Security.Cryptography.RandomNumberGenerator
-
-2002-02-09 Duco Fijma <duco@lorentz.xs4all.nl>
- * First version of Guid.NewGuid
-
-2002-02-08 Duncan Mak <duncan@ximian.com>
-
- * RuntimeArgumentHandle.cs: Added to CVS.
-
-Fri Feb 8 19:14:54 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * CrossAppDomainDelegate.cs, AssemblyLoadEventHandler.cs,
- UnhandledExceptionEventHandler.cs: added delegates.
-
-Fri Feb 8 18:06:20 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MarshalByRefObject.cs: add ToString () method
- (apparently needed by nunit).
- * _AppDomain.cs: uncomment ToString(): dietmar fixed the bug triggered
- by it in the runtime.
-
-2002-02-08 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * String.cs (Format): implemented
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * DuplicateWaitObjectException:
- * InvalidCastException:
- * NotImplementedException:
- * NotSupportedException:
- * NullReferenceException:
- * OutOfMemoryException:
- * OverflowException:
- * RankException:
- * StackOverflowException.cs:
- * UnauthorizedAccessException: Added missing constructor used for serialization.
-
-2002-02-07 Dietmar Maurer <dietmar@ximian.com>
-
- * String.cs (System.Compare): bug fix
-
-2002-02-06 Dietmar Maurer <dietmar@ximian.com>
-
- * Enum.cs (Parse, GetHashCode): impl.
-
-2002-02-05 Duncan Mak <duncan@ximian.com>
-
- * DBNull.cs: This is my first crack at the DBNull class. I think I
- actually got most of the IConvertible methods right, but I haven't
- done the research to test whether or not this is the correct
- behavior. IConvertible.ToType () is the most iffy of all, IMHO.
-
- * DllNotFoundException.cs: Inherits from TypeLoadException, not SystemException.
-
-2002-02-05 Dietmar Maurer <dietmar@ximian.com>
-
- * Enum.cs: added more functionality (GetName, ToObject, Equals)
-
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * InvalidOperationException.cs:
- * NotFiniteNumberException.cs:
- * ObjectDisposedException.cs:
- * TypeInitializationException.cs: Added missing bits for serialization/
-
- * AppDomainUnloadedException.cs:
- * ApplicationException.cs:
- * ArgumentOutOfRangeException.cs:
- * ArithmeticException.cs:
- * ArrayTypeMismatchException:
- * BadImageFormatException.cs:
- * Exception.cs:
- * MissingMemberException.cs:
- * TypeLoadException.cs: Added missing bits for serialization.
-
-2002-01-30 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs: implemented everything but Guid.NewGuid
-
-Tue Jan 29 22:32:36 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * _AppDomain.cs: remove ToString() method: it doesn't seem right
- to have it in this interface and it screws up the method vtable setup.
-
-2002-01-28 Andrei Zmievski <andrei@php.net>
-
- * Double.cs: implemented IConvertible interface.
-
-2002-01-28 Miguel de Icaza <miguel@ximian.com>
-
- * ArgumentException.cs: Implement serialization constructor.
- (GetObjectData): Implement serializer.
-
- * ArgumentNullException.cs: Implement serialization constructor.
-
- * Exception.cs: Implement serialization constructor.
- (GetObjectData): Implement serializer.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * DateTime.cs (UnixEpoch): The Begining of the Unix epoch.
-
-2002-01-23 Duncan Mak <duncan@ximian.com>
-
- * EntryPointNotFoundException.cs:
- * FormatException: Added missing constructor and related bits.
-
- * TypeLoadException: Added missing constructor, methods and properties.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * AppDomain.cs (GetAssemblies): Use foreach construct instead of
- manually getting the enumerator.
-
- (AppDomain.AppDomain): Prime the loaded assemblies with the
- assemblies loaded by the runtime in our behalf.
-
- * AppDomainSetup.cs: Remove private keyword, that is the default.
- Add a new property DisallowPublisherPolicy.
-
- * AppDomain.cs (AppDomain.GetAssemblies): Implement.
-
-Tue Jan 22 22:51:48 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs, Type.cs: many updates, corrected implementation,
- completed stubs.
-
-2002-01-20 Andrei Zmievski <andrei@php.net>
-
- * Byte.cs:
- * Char.cs: implemented IConvertible interface.
-
- * Boolean.cs: use our own ToString() method directly.
-
-2002-01-20 Duncan Mak <duncan@ximian.com>
-
- * Files I commited recently: Fixed indentation style.
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * SerializableAttribute.cs: this attrib can be used on enums, structs,
- and delegates too. Added the appropriate usage flags.
-
-2002-01-18 Duncan Mak <duncan@ximian.com>
-
- * CharEnumerator.cs: Implemented.
- * String.cs (System): Fixed the GetEnumerator () method(s).
-
- * ObsoleteAttribute.cs:
- * STAThreadAttribute.cs:
- * MTAThreadAttribute.cs:
- * ThreadStaticAttribute.cs:
- * LoaderOptimizationAttribute.cs:
- * PlatformNotSupportedException.cs:
- * LoaderOptimization.cs: Added to CVS.
-
-2002-01-18 Duncan Mak <duncan@ximian.com>
-
- * AppDomainUnloadedException.cs:
- * MethodAccessException.cs:
- * ContextMarshalException.cs:
- * CannotUnloadAppDomainException.cs:
- * DllNotFoundException.cs:
- * EntryPointNotFoundException.cs:
- * FieldAccessException.cs:
- * TypeUnloadedException.cs:
- * MissingFieldException.cs: Added to CVS.
-
- * ApplicationException.cs:
- * MemberAccessException.cs:
- * MissingMemberException.cs
- * MissingMethodException.cs:
- * SystemException.cs: Added [Serializable] attribute.
-
- * Exception.cs: Added [Serializable] attribute, made properties
- 'Message', 'Source' and 'StackTrace' virtual methods, per 1.0
- spec.
-
- * ContextStaticAttribute.cs: Added [Serializable] attribute and
- put in the missing constructor.
-
- * Environment.cs: Commented out references to
- EnvironmentPermissionAttribute, because they're just stubbed out
- right now and has no implementation.
-
-2002-01-16 Andrei Zmievski <andrei@php.net>
-
- * Boolean.cs: implemented IConvertible interface
-
-2002-01-15 Nick Drochak <ndrochak@gol.com>
-
- * ResolveEventArgs.cs: class should derive from EventArgs.
-
-2002-01-14 Miguel de Icaza <miguel@ximian.com>
-
- * String.cs (System): Use DefaultMemberName for the String class.
-
-Mon Jan 14 17:06:40 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: use IndexerName in index char accessor.
-
-Thu Jan 10 21:05:23 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs: add rank to MonoTypeInfo and implement GetArrayRank.
- * String.c: eliminate 64k+ method calls in search.
- * Type.cs: handle byref and array types in ToString ().
-
-2002-01-09 Duco Fijma <duco@lorentz.xs4all.nl>
-
- * Guid.cs: created first version
-
-2002-01-10 Dietmar Maurer <dietmar@ximian.com>
-
- * MonoType.cs: added missing TypeAttributes to MonoTypeInfo
-
-Wed Jan 9 19:35:07 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MulticastDelegate.cs: add == and != operator stubs.
- * String.cs: check for null in == operator.
- * Type.cs: use a virtual method to get TypeAttributes.
-
-Tue Jan 8 23:30:19 EST 2002 Matt Kimball <matt@kimball.net>
- * String.cs: Fixed several off-by-one errors in LastIndexOf* methods
-
-2002-01-09 Nick Drochak <ndrochak@gol.com>
-
- * Environment.cs: Comment out Security attribute and put a MonoTODO
- there as a reminder. We need mcs magic to handle security attributes in
- corlib.
-
-2002-01-07 Duco Fijma <duco@lorentz.xs4all.nl>
- * Created IAppDomainSetup.cs
-
-2002-01-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * Created System._AppDomain interface in _AppDomain.cs
-
-2002-01-06 Nick Drochak <ndrochak@gol.com>
-
- * ResolveEventArgs.cs: New File, completely implemented! ;)
-
-Sat Jan 5 15:53:50 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Enum.cs: dummy ToString impl.
- * String.cs: dummy format implementations to get compiler errors
- somewhat working.
- * Type.cs: implemented filter delegates. FindMembers runs the filter, now.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * TODOAttribute.cs : Augment some more; provide two constructors
- with support for a comment too.
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * Uncommented those MonoTODO's now that Ravi's got
- the class in there
-
-2001-01-04 Ravi Pratap <ravi@ximian.com>
-
- * TODOAttribute.cs : Actually add this time ;-)
-
- Change name to MonoTODO.
-
-2002-01-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (Trim): Fixed a few logic bugs in the code that
- calculated how much to trim off the end of the string.
-
-2001-01-04 Nick Drochak <ndrochak@gol.com>
-
- * Commented out the [TODO] attributes for now. We don't have the
- class written. Also changed it to [MonoTODO]
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * TODOAttribute.cs : Add. We use this attribute to tag all bits in
- our class libraries that are incomplete.
-
- * Array.cs : Apply attribute wherever we find a FIXME which says
- we need something to be implemented there.
-
- * Int32.cs : Ditto.
-
- * MulticastDelegate.cs : Ditto.
-
- * RuntimeFieldHandler.cs, RuntimeMethodHandle.cs,
- RuntimeTypeHandle.cs : Ditto.
-
- * String.cs : Ditto.
-
- * Type.cs : Ditto.
-
- * Byte.cs, Char.cs, ContextBoundObject.cs, DateTime.cs, Delegate.cs : Ditto.
-
- * Enum.cs, Environment.cs, Exception.cs, Int64.cs, SByte.cs, Single.cs,
- UInt16.cs, UInt32.cs, ValueType.cs: Ditto.
-
- * Byte.cs, Char.cs, ContextBoundObject.cs, DateTime.cs,
- Delegate.cs : Ditto.
-
- * Enum.cs, Environment.cs, Exception.cs, Int64.cs, SByte.cs,
- Single.cs, UInt16.cs, UInt32.cs, ValueType.cs: Ditto.
-
->>>>>>> 1.107
-Thu Jan 3 23:24:04 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Delegate.cs: add Remove() stub.
- * Enum.cs: add ToObject().
- * Type.cs: add IsEnum property.
-
-2002-01-03 Kristian Rietveld <kris@gtk.org>
-
- * Convert.cs: add non-CLS-compliant ToBoolean methods for char,
- DateTime and object.
-
-2001-12-30 Nick Drochak <ndrochak@gol.com>
-
- * Byte.cs (Parse): Add comments to aid in testing.
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * Char.cs (Parse): Implement.
-
- * Byte.cs (Parse): Implement a fast parser.
-
- * SByte.cs (Parse): Implement a fast parser.
-
- * UInt16.cs (Parse): Implement a fast parser.
-
- * Int16.cs (Parse): Implement a fast parser.
-
- * UInt32.cs (Parse): Implement a fast parser.
-
- * Int32.cs (Parse): Implement a fast parser.
-
-Fri Dec 21 15:14:52 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Array.cs: fix null ref in sort code.
- * UInt64.cs: add bare-bones parse.
-
-Thu Dec 20 15:29:52 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Byte.cs: removed use of Regexes.
-
-Tue Dec 18 18:39:54 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Enum.cs: implemented GetValues(), GetNames(), GetName(),
- IsDefined(), GetUnderlyingType().
- * String.cs: fix one instance of Compare().
- * Type.cs: implemented GetProperties(), GetProperty().
-
-Thu Dec 13 20:10:57 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Array.cs: implement CopyTo ().
- * Char.cs: implement ToString ().
- * Exception.cs: bugfix.
- * Int32.cs: bare-bones Parse ().
- * MonoType.cs: query the needed info with an internalcall.
- * String.cs: speedups, bugfixes, reduced copies.
- * Type.cs: added missing fields. Implemented many of the Is*
- properties. Implemented GetMethod(), GetConstructor(), GetMethods(),
- GetFields(), FindMembers(), ToString().
-
-2001-12-11 Dick Porter <dick@ximian.com>
-
- * DateTime.cs: Implemented FromFileTime() and ToFileTime()
-
- * Console.cs: Use handles rather than casting file descriptors
-
-2001-12-08 Nick Drochak <ndrochak@gol.com>
-
- * Byte.cs (Parse): Start implementation. Parse(string) works, but
- now we need to handle other formats
-
-2001-12-06 Dietmar Maurer <dietmar@ximian.com>
-
- * DateTime.cs: added an icall to GetNow()
-
-2001-12-04 Dietmar Maurer <dietmar@ximian.com>
-
- * Double.cs: added the parse method from Bob Smith
-
-2001-11-28 Miguel de Icaza <miguel@ximian.com>
-
- * UInt64.cs: ditto.
-
- * UInt32.cs: ditto.
-
- * Int32.cs (Int32.CompareTo): Fix because we can not just
- substract the values.
-
- Return possitive value if the object is null.
-
- * Boolean.cs: (Boolean.CompareTo): ditto.
-
- * Int16.cs (Int16.CompareTo): ditto.
-
- * Byte.cs (Byte.CompareTo): ditto.
-
- * SByte.cs (SByte.CompareTo): ditto.
-
- * Char.cs (Char.CompareTo): ditto.
-
- * Decimal.cs (Decimal.CompareTo): ditto.
-
- * Int64.cs (Int64.CompareTo): ditto.
-
- * Single.cs: Ditto.
-
- * UInt16.cs: Ditto.
-
-2001-11-28 Nick Drochak <ndrochak@gol.com>
-
- * Byte.cs: Throw NotImplementedException for Parse.
-
-2001-11-27 Derek Holden <dholden@draper.com>
-
- * IntegerFormatter.cs: Formatting of type "Number" was not
- using NumberFormatInfo.NumberNegativePattern.
-
-2001-11-26 Dick Porter <dick@ximian.com>
-
- * LocalDataStoreSlot.cs: No need to delete a system TLS slot in
- the finalise routine any more
-
-2001-11-21 Miguel de Icaza <miguel@ximian.com>
-
- * ApplicationException.cs: internationalize by adding calls to
- Locale.GetText (). And throw NotImplementedExceptions on calls
- that we have to implement.
-
- * Version.cs: Ditto.
-
- * ValueType.cs: ditto.
-
- * UnauthorizedAccessException.cs: ditto.
-
- * UInt32.cs: ditto.
-
- * UInt64.cs: ditto.
-
- * UInt16.cs: ditto.
-
- * TypeLoadException.cs: ditto
-
- * TypeInitializationException.cs: ditto.
-
- * Type.cs: ditto.
-
- * TimeSpan.cs: ditto.
-
- * SystemException.cs: ditto.
-
- * String.cs: ditto.
-
- * StackOverflowException.cs: ditto.x
-
- * Single.cs: ditto.
-
- * SByte.cs: ditto.
-
- * RuntimeTypeHandle.cs: ditto.
-
- * RuntimeMethodHandle.cs: ditto.
-
- * RuntimeFieldHandle.cs: ditto.
-
- * Random.cs: ditto.
-
- * OutOfMemoryException.cs: ditto.
-
- * OperatingSystem.cs: ditto.
-
- * ObjectDisposedException.cs: ditto.
-
- * NullReferenceException.cs: ditto.
-
- * NotImplementedException.cs: ditto.
-
- * NotFiniteNumberException.cs: ditto.o
-
- * MulticastNotSupportedException.cs: ditto.
-
- * MissingMethodException.cs: ditto.
-
- * MemberAccessException.cs: ditto.
-
- * Math.cs: ditto.
-
- * InvalidCastException.cs: ditto.
-
- * IntegerFormatter.cs: ditto.
-
- * Int32.cs: ditto.
-
- * Int16.cs: ditto.
-
- * IndexOutOfRangeException.cs: ditto.
-
- * Environment.cs: ditto
-
- * Enum.cs: ditto.
-
- * DuplicateWaitObjectException.cs: ditto.
-
- * DivideByZeroException.cs: ditto.
-
- * Delegate.cs: ditto
-
- * DecimalFormatter.cs: ditto.
-
- * Decimal.cs: ditto.
-
- * DateTime.cs: ditto.
-
- * Convert.cs: ditto.
-
- * Char.cs: ditto.
-
- * Byte.cs: ditto.
-
- * Boolean.cs: ditto.
-
- * ArrayTypeMismatchException.cs: ditto.
-
- * ArithmeticException.cs: ditto.
-
- * ArgumentOutOfRangeException.cs: ditto.
-
- * ArgumentNullException.cs: ditto.
-
- * Enum.cs: Make it derive from ValueType, add CompareTo method.
-
- * Attribute.cs: Reformat.
-
-2001-11-14 Miguel de Icaza <miguel@ximian.com>
-
- * Decimal.cs, Double.cs, Byte.cs, Char.cs, Int16, UInt16, Int32,
- UInt32, Int64, UInt64, SByte, Single (CompareTo): Throw the
- exception if the value is null too.
-
- * Char.cs (CompareTo): ditto.
-
- * ApplicationException.cs: Added constructor that does serialization.
-
- * ParamArrayAttribute.cs: Define attribute correctly.
-
-Wed Nov 14 16:31:19 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AppDomain.cs: rename dummy interface _AppDomain to AppDomain_Intf.
- * Array.cs: fix Array.Copy.
- * AssemblyLoadEventArgs.cs: rename field.
- * CLSCompliantAttribute.cs: use correct name for the class.
- * Char.cs: fix IsLetter.
- * Console.cs, DateTime.cs, Decimal.cs, IConvertible.cs, Math.cs,
- SByte.cs, UInt16.cs, UInt32.cs, UInt64.cs, UIntPtr.cs: CLSCompliant updates.
- * Convert.cs: CLSCompliant updates, add ChangeType() methods.
- * Delegate.cs: renamed target field to m_target.
- * Enum.cs: added missing methods.
- * MonoType.cs: add a constructor and some needed properties.
- * Object.cs: implement GetType().
- * String.cs: CLSCompliant updates. Fixes everywhere to remove the
- ending 0 char.
- * Type.cs: add missing methods/properties.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * AttributeUseage.cs: Should define AttributeUsageAttribute.
-
- * CLSCompliant.cs: Marked with AttributeUsage attribute.
-
- * Decimal.cs: Fixed CLSCompliant attributes.
-
- * Type.cs: changed _impl to internal (needs to be accessable by
- subclasses).
-
- (TypeHandle): Marked as abstract, implementation removed.
-
- (IsNotPublic, IsPublic, GetMethods, GetPropery, GetConstructor,
- GetMethod): Added stub implementations so NUnit would link against
- corlib
-
-Tue Nov 6 09:11:43 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AppDomain.cs: use an internal constructor for AssemblyBuilder.
-
-2001-11-05 Miguel de Icaza <miguel@ximian.com>
-
- * NonSerializedAttribute.cs: Add AttributeUsage rules for this
- attribute.
-
-Fri Nov 2 18:23:15 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: fix a couple of bugs.
- * AppDomain.cs: use new AppBuilder constructor.
- * Buffer.cs, GC.cs, NonSerializedAttribute.cs,
- NotImplementedException.cs, ObjectDisposedException.cs,
- UnauthorizedAccessException.cs: add implementation.
- * OverflowException.cs: fix class name.
-
-2001-10-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs: Don't use a terminating nil char for our internal
- array.
-
-2001-10-27 Miguel de Icaza <miguel@ximian.com>
-
- * Delegate.cs (Delegate.CombineImpl): Implement.
- (Delegate.Combine): Implement.
-
- * MulticastDelegate.cs (MulticastDelegate.Equals): Implement.
-
- (MulticastDelegate.CombineImpl): This was not as trivial as I
- thought.
-
- * ContextStaticAttribute.cs: Added AttributeUsage to
- ContextStaticAttribute.
-
- * FlagsAttribute.cs: Add AttributeUsage to FlagsAttribute
-
-2001-10-15 Martin Weindel <martin.weindel@t-online.de>
-
- * added Decimal.cs * added DecimalFormatter.cs (internal class
- used from System.Decimal)
-
-2001-10-11 Thomas Neidhart <tome@sbox.tugraz.at>
-
- * Convert.cs: Added methods for Base64 transforming just used the
- existing System.Security.Cryptography.ToBase64Transform, should
- be changed to use a stand-alone class, e.g. Base64Encoder
-
-2001-10-10 Derek Holden <dholden@draper.com>
-
- * IntegerFormatter.cs: Added. Implements ToString for all the
- integer data types for all the format types.
-
- * Byte.cs: Using IntegerFormatter for ToString's.
-
- * SByte.cs: Using IntegerFormatter for ToString's.
-
- * Int16.cs: Using IntegerFormatter for ToString's.
-
- * Int32.cs: Using IntegerFormatter for ToString's.
-
- * Int64.cs: Using IntegerFormatter for ToString's.
-
- * UInt16.cs: Using IntegerFormatter for ToString's.
-
- * UInt32.cs: Using IntegerFormatter for ToString's.
-
- * UInt64.cs: Using IntegerFormatter for ToString's.
-
-2001-10-07 Miguel de Icaza <miguel@ximian.com>
-
- * Exception.cs: Implement bits of serialization.
-
- * RuntimeFieldHandle.cs: Implement Serialization features.
-
- * Type.cs: Implement TypeHandle property.
-
-2001-09-28 Dick Porter <dick@ximian.com>
-
- * LocalDataStoreSlot.cs: Implemented
-
-Tue Sep 25 19:58:14 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: fix off-by-one error in Trim().
-
-Tue Sep 25 18:52:14 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs: added GetType () method.
-
-Tue Sep 25 17:29:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * MissingMethodException.cs, MissingMemberException.cs,
- MemberAccessException.cs: added.
-
-Tue Sep 25 16:46:43 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: don't access the string array out of bounds in
- LastIndexOf. * Type.cs: fix return type of the Assembly property.
-
-Mon Sep 24 20:35:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: make Intern and IsIntern internalcalls.
-
-2001-09-13 Dick Porter <dick@ximian.com>
-
- * Type.cs: Added a stub for the IsValueType property.
-
- * SystemException.cs (System): Added the other constructor, so
- that System.Threading exceptions can inherit it.
-
-2001-09-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (TrimStart): Don't keep looping through the trimchars
- once we've found a match.
- (TrimEnd): Same here.
- (Trim): And finally here.
-
-2001-09-07 Ravi Pratap <ravi@ximian.com>
-
- * Char.cs (IsLetterOrDigit): Implement.
- (IsLower): Implement, but we need to be Unicode aware.
- (IsNumber): Implement.
- (IsPunctuation): Implement.
- (IsWhiteSpace): Implement.
- (ToUpper): Fix to subtract 32 from the ASCII value, not 33 :)
- (ToLower): Same here.
-
-2001-09-04 Miguel de Icaza <miguel@ximian.com>
-
- * Object.cs: Shortcut, if (a == b) then return true.
-
-Fri Sep 7 18:34:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * Delegate.cs: we need a pointer to the method thunk in
- the delegate object.
-
-Fri Sep 7 12:28:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * AsyncCallback.cs, common.src: add AsyncCallback delegate.
-
-2001-09-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (System): Don't mix uint and int.
-
-2001-09-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (BoyerMoore): Modified to not use pointers and to instead
- use indexes.
- (IndexOf): Use BoyerMoore.
-
-2001-09-02 Miguel de Icaza <miguel@ximian.com>
-
- * All over: Use the autogenerated enumerations from the ECMA
- documentation that Sergey wrote.
-
- * PlatformID.cs: Add Unix definition.
-
- * OperatingSystem.cs: Use Unix instead of Linux here.
-
- * MarshalByRefObject.cs: Mark class as [Serializable].
-
-2001-08-28 Dietmar Maurer <dietmar@ximian.com>
-
- * Console.cs: impl. (write only)
- implemented the stdin stuff
-
- * Int32.cs: impl. real op_Equal
-
-2001-08-24 Miguel de Icaza <miguel@ximian.com>
-
- * (common.src): Removed IAsyncResult as it is not on CVS yet.
-
- * UIntPtr.cs: Removed CLSCompliant attribute before the namespace,
- as it breaks the build.
-
-2001-08-23 Michael Lambert <michaellambert@email.com>
-
- * IntPtr.cs: Optimized unsafe declaration, implemented GetObjectData,
- added CLSCompliant attribute
-
- * IAsyncResult.cs: Added
-
- * common.src: Added IAsyncResult.cs
-
-2001-08-23 Michael Lambert <michaellambert@email.com>
-
- * UIntPtr.cs: Added
-
- * common.src: Added UIntPtr.cs
-
-2001-08-20 Dietmar Maurer <dietmar@ximian.com>
-
- * Attribute.cs: uncomment some code to make it compile again
-
- * mono.src: removed duplicated Attribute.cs
-
-2001-08-16 Nick Drochak <ndrochak@gol.com>
-
- * Attribute.cs: implemented all methods except GetHashCode()
-
- * common.src: added Attribute.cs so it would compile in
-
-2001-08-10 Dietmar Maurer <dietmar@ximian.com>
-
- * Object.cs: changed MemberWiseClone to MemberwiseClone, and
- marked it as InternalCall
-
- * common.src: removed UriFormatException.cs because the file is
- not there.
-
- * RuntimeTypeHandle.cs: replaced IntrPtr with IntPtr
- * Char.cs: replaced byte with char
-
- * Array.cs: make it work with the mono interpreter
-
-2001-08-06 Miguel de Icaza <miguel@ximian.com>
-
- * Version.cs: Make the class sealed
-
-2001-08-08 Bob Smith <bob@thestuff.net>
-
- * Random.cs: Many compile fixes.
- * Random.cs: I read a bad spec. Class updated to match real spec.
-
-2001-08-06 Miguel de Icaza <miguel@ximian.com>
-
- * IntPtr.cs: Added and Completed implementation.
-
- * Uri.cs: Add a note.
-
-2001-08-06 Bob Smith <bob@thestuff.net>
-
- * Random.cs: Compile fix. Needs more testing.
-
-2001-08-06 Garrett Rooney <rooneg@electricjellyfish.net>
-
- * Uri.cs: Initial Implementation. Parsing needs to be fixed to take
- into account IPv6 addresses, url encoding needs to be implemented, and
- various minor methods need to be written, but this is a decent start.
-
-2001-08-06 Dietmar Maurer <dietmar@ximian.com>
-
- * common.src: added Object.cs
-
- * mono.src: added ValueType.cs
-
-2001-08-02 Dietmar Maurer <dietmar@ximian.com>
-
- * Math.cs: replaced libc with libm
-
-2001-08-02 Bob Smith <bob@thestuff.net>
-
- * Random.cs: Implemented. Needs testing.
-
-2001-08-02 Miguel de Icaza <miguel@ximian.com>
-
- * IServiceProvider.cs, EventHandler.cs: New files.
-
-2001-08-02 Marcel Narings <marcel@narings.nl>
-
- * DateTime.cs: Cleaned up a bit. Added the Add* family members.
- Added exceptions. Added IConvertible. Still needs some platform
- dependend stuff, the Parse and ToString members
-
-2001-08-01 Dietmar Maurer <dietmar@ximian.com>
-
- * Type.cs (GetTypeFromHandle): added placeholder
-
-2001-07-24 Derek Holden <dholden@draper.com>
-
- * Boolean.cs: Formatted to code style standard. Added GetTypeCode
- which is really an IConvertible defined method.
-
- * Byte.cs: Added a missing Parse method. Put in Parse and ToString
- behavior, still need to do the main Parse and ToString.
-
- * Char.cs: Added a bunch of missing ECMA methods. Commented a
- specification discrepency. Still didn't any unicode stuff, though
- every IsFoo(char c) method has an IsFoo(string, index)
- counterpart, added wrappers for those.
-
- * Convert.cs: Fixed NaN/Inf checking and double/float
- rounding. Added ToType for IConvertible classes
-
- * Double.cs: Fixed ECMA min and max values. Added IsInfinity /
- IsNaN methods. Changed Inf/NaN internals.
-
- * IConvertible.cs: Added comments for using
- Convert.ToType. Changed return values to draft base values.
-
- * Int16.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * Int32.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * Int64.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * Single.cs: Put in ECMA epsilon value. Added IsInfinity / IsNaN
- methods. Changed Inf/NaN internals.
-
- * SByte.cs: Added a missing Parse method. Put in Parse and
- ToString behavior, still need to do the main Parse and ToString.
-
- * UInt16.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * UInt32.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * UInt64.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
-2001-07-20 Miguel de Icaza <miguel@ximian.com>
-
- * MulticastDelegate.cs: New File.
-
- * Delegate.cs: New file.
-
- * Enum.cs: New file.
-
- * Attribute.cs: New file.
-
- * Type.cs: New file.
-
- * ParamArrayAttribute.cs: New file.
-
- * RuntimeTypeHandle.cs: New file.
-
- * MulticastDelegate.cs: Added.
-
- * DateTime.cs: Added
-
- * Delegate.cs: Added
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * AttributeTargets.cs: Add.
-
-2001-07-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * Char.cs: Made ToUpper and ToLower public methods.
-
- * String.cs: Lots and lots of compile fixes - just need to write
- DateTime.cs and this should build completely now.
-
-2001-07-19 Bob Smith (bob@thestuff.net)
-
- * Math.cs: Implemented.
-
-2001-07-19 Miguel de Icaza <miguel@ximian.com>
-
- * String.cs: Removed tolower and toupper.
-
- * Char.cs: Moved ToLower and ToUpper from string to here.
-
- * Convert.cs ToByte (float value), ToByte (double value) Use IsNan
- instead of comparing the value to Nan.
-
-2001-07-19 Duco Fijma (duco@lorentz.xs4all.nl)
-
- * TimeSpan.cs: New implementation.
-
-2001-07-18 Scott Sanders <scott@stonecobra.com>
-
- * UriFormatExcpetion.cs: Add - 85% complete
-
-2001-07-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (IndexOf): Slight optimization that allows skipping
- over a few chars here and there. This isn't as good as using my
- Boyer-Moore implementation, however, Boyer-Moore is only really
- good for long strings (I plan on making the code decide which
- string search algorithm it should use on-the-fly at some point).
- (LastIndexOf): Fix to work correctly.
- (BoyerMoore): Took out some unneeded code and fixed an edge-case.
-
-2001-07-16 Michael Lambert <michaellambert@email.com>
-
- * EventArgs.cs: Add.
-
-2001-07-16 Miguel de Icaza <miguel@ximian.com>
-
- * Version.cs: Remove my buggy comment.
-
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * String.cs: Spelling error of IComparable, object's
- MemberwiseClone cannot be overridden. Made indexer valid for now,
- but not sure what to do about this in the long run. Seems to be a
- couple bugs in csc.exe having to do with multiple pointer defs in
- the same statement, and returning subclasses of a class in the
- return type of an interface function implementation. Also moved
- operators inside of class definition.
-
-2001-07-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs: A tom of compile fixes, although we still don't compile.
-
- * IConvertible.cs: The To*Int64() methods return *Int64's, not
- *Int32's. Also, it's ToDateTime() not ToDateType().
-
-2001-07-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs: Apparently I needed to at least write stubs for the
- IConvertible interfaces. *sigh*
-
-2001-07-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs: Many logic/other fixes and better usage of the
- features of c#
- (tolower): New convenience method to help condense code.
- (toupper): Another new helper method.
- (Compare): Use the new helper methods.
- (ToLower): use tolower().
- (ToUpper): use toupper().
- (LastIndexOfAny): Implemented.
- (BoyerMoore): New private helper method that implements a modified
- version of the Boyer-Moore search algorithm. Noothing uses it yet
- as I'm not 100% sure it even works properly with unicode strings
- not to mention it uses a huge lookup-table :-)
- (Split): Implemented.
-
-2001-07-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * TODO: Added things that need to be finished in System.String
-
- * String.cs: New source file implementing the System.String class
-
-2001-07-12 Sean MacIsaac <macisaac@ximian.com>
-
- * TypeCode.cs: UInt64 was UInt63.
-
- * Object.cs: Fixed a numer of compiler errors.
-
- * Array.cs: Fixed some compiler errors.
-
- * IComparable.cs: Fixed some compiler errors.
-
- * ICloneable.cs: Fixed some compiler errors.
-
- * IConvertible.cs: Fixed some compiler errors.
-
- * IFormattable.cs: Fixed a compiler error.
-
- * IFormatProvider.cs: Fixed a compiler error.
-
- * IDisposable.cs: Fixed a compiler error.
-
- * IFormatProvider.cs: Added public accesability type to
- IFormatProvider.
-
- * Exception.cs: Added a using statement to remove compile time
- error.
-
- * ApplicationException.cs: Removed a ; that was causing a compiler
- error.
-
- * Int16.cs: Fixed some compiler errors.
-
- * Int32.cs: Fixed some compiler errors.
-
- * Int64.cs: Fixed some compiler errors.
-
- * SystemException.cs: Fixed a compiler error.
-
- * UInt16.cs: Fixed some compiler errors.
-
- * UInt32.cs: Fixed some compiler errors.
-
- * UInt64.cs: Fixed some compiler errors.
-
- * Void.cs: Fixed a compiler error.
-
-2001-07-12 Joe Shaw <joe@ximian.com>
-
- * Array.cs: Fix backwards parameters to Array.SetValue()
- throughout.
- (BinarySearch): Fix backward logic surrounding whether to call
- value.CompareTo or comparer.Compare.
- (LastIndexOf): Stop being stupid. I am so not used to strongly
- bounded arrays...
- (Sort): Implement a quicksort.
-
-2001-07-11 Joe Shaw <joe@ximian.com>
-
- * Array.cs: Change all instances of trying to access an array with
- the index operator to calls to GetValue and SetValue, and add
- InternalGetValue and InternalSetValue which are internal calls
- into the runtime. Ew.
-
-2001-07-10 Joe Shaw <joe@ximian.com>
-
- * Array.cs: Implemented everything but Sort().
-
-2001-07-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * Object.cs (Object::Equals): Object variable name is `o'.
-
-2001-07-06 Joe Shaw <joe@ximian.com>
-
- * Int16.cs, Int32.cs, Int64.cs, UInt16.cs, UInt32.cs, UInt64.cs:
- Implement the IComparable and IFormattable interfaces. Fix a typo
- (publig -> public)
-
- * ApplicationException.cs, ArgumentException.cs,
- ArgumentNullException.cs, ArgumentOutOfRangeException.cs,
- ArtithmeticException.cs, ArrayTypeMismatchException.cs,
- DivideByZeroException.cs, DuplicateWaitObjectException.cs,
- ExecutionEngineException.cs, FormatException.cs,
- IndexOutOfRangeException.cs, InvalidCastException.cs,
- InvalidOperationException.cs, InvalidProgramException.cs,
- MulticateNotSupportedException.cs, NotFiniteNumberException.cs,
- NotSupportedException.cs, NullReferenceException.cs,
- OutOfMemoryException.cs, OverflowException.cs, RankException.cs,
- StackOverflowException.cs, SystemException.cs,
- TypeInitializationException.cs: Added all of the exceptions
- specified by the language spec. Mmmm... bloat.
-
-2001-07-06 Miguel de Icaza <miguel@ximian.com>
-
- * Int64.cs, Int32.cs: Put. Parsing and ToString missing. Should
- do a generic routine all of these guys use.
-
- * Int16.cs: identified missing methods.
-
- * UInt16.cs, UInt32.cs, UInt64.cs: Add.
-
-2001-06-26 Miguel de Icaza <miguel@ximian.com>
-
- * TypeCode.cs: Implement
-
- * Void.cs: Implement.
-
- * TODO: Add file to keep track of pending tasks.
-
- * Object.cs, ValueType.cs: Implement.
diff --git a/mcs/class/corlib/System/Char.cs b/mcs/class/corlib/System/Char.cs
deleted file mode 100644
index 892aef3cf62..00000000000
--- a/mcs/class/corlib/System/Char.cs
+++ /dev/null
@@ -1,402 +0,0 @@
-//
-// System.Char.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-// Note about the ToString()'s. ECMA says there's only a ToString() method,
-// BUT it is just a wrapper for ToString(null). However there is no other ToString
-// in the docs. Turning to the NET framework sdk reveals that there is a
-// ToString(formatprovider) method, as well as a 'static ToString (char c)' method,
-// which appears to just be a Convert.ToString(char c) type method. ECMA also
-// doesn't list this class as implementing IFormattable.
-
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- public struct Char : IComparable, IConvertible { //, IFormattable {
- public const char MaxValue = (char) 0xffff;
- public const char MinValue = (char) 0;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public char value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Char))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Char"));
-
- char xv = (char) v;
- if (value == xv)
- return 0;
-
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Char))
- return false;
-
- return ((Char) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern double GetNumericValue (char c);
-
- public static double GetNumericValue (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
-
- return GetNumericValue (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern UnicodeCategory GetUnicodeCategory (char c);
-
- public static UnicodeCategory GetUnicodeCategory (string str, int index) {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText ("The value of index is less "+
- "than zero, or greater than or equal to the length of str"));
-
- return GetUnicodeCategory (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsControl (char c);
-
- public static bool IsControl (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("Str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsControl (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsDigit (char c);
-
- public static bool IsDigit (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("Str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsDigit (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsLetter (char c);
-
- public static bool IsLetter (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsLetter (str[index]);
- }
-
- public static bool IsLetterOrDigit (char c)
- {
- if (IsLetter (c) == false && IsDigit (c) == false)
- return false;
- else
- return true;
- }
-
- public static bool IsLetterOrDigit (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsLetterOrDigit (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsLower (char c);
-
- public static bool IsLower (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsLower (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsNumber (char c);
-
- public static bool IsNumber (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsNumber (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsPunctuation (char c);
-
- public static bool IsPunctuation (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsPunctuation (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsSeparator (char c);
-
- public static bool IsSeparator (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsSeparator (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsSurrogate (char c);
-
- public static bool IsSurrogate (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsSurrogate (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsSymbol (char c);
-
- public static bool IsSymbol (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsSymbol (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsUpper (char c);
-
- public static bool IsUpper (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsUpper (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsWhiteSpace (char c);
-
- public static bool IsWhiteSpace (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsWhiteSpace (str[index]);
- }
-
- public static char Parse (string str)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- int len = str.Length;
- if (len != 1){
- if (len < 1)
- throw new ArgumentNullException ();
- else
- throw new FormatException ();
- }
- return str [0];
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern char ToLower (char c);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern char ToUpper (char c);
-
- public override string ToString ()
- {
- // LAMESPEC: ECMA draft lists this as returning ToString (null),
- // However it doesn't list another ToString() method.
- return new String (value, 1);
- }
-
- public string ToString (IFormatProvider fp)
- {
- // LAMESPEC: ECMA draft doesn't say Char implements IFormattable
- return new String (value, 1);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Char;
- }
-
- public object ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType(value, conversionType, provider);
- }
-
- public bool ToBoolean (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public byte ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte(value);
- }
-
- public char ToChar (IFormatProvider provider)
- {
- return value;
- }
-
- [CLSCompliant(false)]
- public DateTime ToDateTime (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public decimal ToDecimal (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public double ToDouble (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public short ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16(value);
- }
-
- public int ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32(value);
- }
-
- public long ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64(value);
- }
-
- [CLSCompliant(false)]
- public sbyte ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte(value);
- }
-
- public float ToSingle (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- string IConvertible.ToString (IFormatProvider provider)
- {
- return ToString(provider);
- }
-
- [CLSCompliant(false)]
- public ushort ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16(value);
- }
-
- [CLSCompliant(false)]
- public uint ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32(value);
- }
-
- [CLSCompliant(false)]
- public ulong ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64(value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/CharEnumerator.cs b/mcs/class/corlib/System/CharEnumerator.cs
deleted file mode 100644
index c320482c357..00000000000
--- a/mcs/class/corlib/System/CharEnumerator.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// System.CharEnumerator.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System.Collections;
-
-namespace System
-{
- [Serializable]
- public sealed class CharEnumerator : IEnumerator, ICloneable
- {
- private string str;
- private int idx;
- private int len;
-
- // Constructor
- internal CharEnumerator (string s)
- {
- str = s;
- idx = -1;
- len = s.Length;
- }
-
- // Property
- public char Current
- {
- get { if (idx == -1)
- throw new InvalidOperationException ("The position is not valid.");
-
- return str [idx];
- }
- }
-
- object IEnumerator.Current
- {
- get { if (idx == -1)
- throw new InvalidOperationException ("The position is not valid");
-
- return str [idx];
- }
- }
-
- // Methods
- public object Clone ()
- {
- CharEnumerator x = new CharEnumerator (str);
- x.idx = idx;
- return x;
- }
-
- public bool MoveNext ()
- {
- if (len < 0)
- return false;
-
- idx++;
-
- if (idx > len) {
- idx = -2;
- return false;
- }
-
- return true;
- }
-
- public void Reset ()
- {
- idx = -1;
-
- }
- }
-}
diff --git a/mcs/class/corlib/System/Console.cs b/mcs/class/corlib/System/Console.cs
deleted file mode 100644
index 8f1802331d5..00000000000
--- a/mcs/class/corlib/System/Console.cs
+++ /dev/null
@@ -1,318 +0,0 @@
-//
-// System.Console.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.IO;
-using System.PAL;
-
-namespace System {
-
- public sealed class Console {
-
- private static TextWriter stdout;
- private static TextWriter stderr;
- private static TextReader stdin;
-
- private static OpSys _os = Platform.OS;
-
- static Console ()
- {
- stderr = new StreamWriter (OpenStandardError ());
- stdout = new StreamWriter (OpenStandardOutput ());
- stdin = new StreamReader (OpenStandardInput ());
- }
-
- public static TextWriter Error
- {
- get {
- return stderr;
- }
- }
-
- public static TextWriter Out
- {
- get {
- return stdout;
- }
- }
-
- public static TextReader In
- {
- get {
- return stdin;
- }
- }
-
- public static Stream OpenStandardError ()
- {
- return OpenStandardError (0);
- }
-
- public static Stream OpenStandardError (int bufferSize)
- {
- return new FileStream (_os.StderrHandle,
- FileAccess.Write,
- false, bufferSize);
- }
-
- public static Stream OpenStandardInput ()
- {
- return OpenStandardInput (0);
- }
-
- public static Stream OpenStandardInput (int bufferSize)
- {
- return new FileStream (_os.StdinHandle,
- FileAccess.Read,
- false, bufferSize);
- }
-
- public static Stream OpenStandardOutput ()
- {
- return OpenStandardOutput (0);
- }
-
- public static Stream OpenStandardOutput (int bufferSize)
- {
- return new FileStream (_os.StdoutHandle,
- FileAccess.Write,
- false, bufferSize);
- }
-
- public static void setError (TextWriter newError)
- {
- if (newError == null)
- throw new ArgumentNullException ();
-
- stderr = newError;
- }
-
- public static void setIn (TextReader newIn)
- {
- if (newIn == null)
- throw new ArgumentNullException ();
-
- stdin = newIn;
- }
-
- public static void setOut (TextWriter newOut)
- {
- if (newOut == null)
- throw new ArgumentNullException ();
-
- stdout = newOut;
- }
-
- public static void Write (bool value)
- {
- stdout.Write (value);
- }
-
- public static void Write (char value)
- {
- stdout.Write (value);
- }
-
- public static void Write (char[] value)
- {
- stdout.Write (value);
- }
-
- public static void Write (decimal value)
- {
- stdout.Write (value);
- }
-
- public static void Write (double value)
- {
- stdout.Write (value);
- }
-
- public static void Write (int value)
- {
- stdout.Write (value);
- }
-
- public static void Write (long value)
- {
- stdout.Write (value);
- }
-
- public static void Write (object value)
- {
- stdout.Write (value);
- }
-
- public static void Write (float value)
- {
- stdout.Write (value);
- }
-
- public static void Write (string value)
- {
- stdout.Write (value);
- }
-
- [CLSCompliant(false)]
- public static void Write (uint value)
- {
- stdout.Write (value);
- }
-
- [CLSCompliant(false)]
- public static void Write (ulong value)
- {
- stdout.Write (value);
- }
-
- public static void Write (string format, object arg0)
- {
- stdout.Write (format, arg0);
- }
-
- public static void Write (string format, params object[] arg)
- {
- stdout.Write (format, arg);
- }
-
- public static void Write (char[] buffer, int index, int count)
- {
- stdout.Write (buffer, index, count);
- }
-
- public static void Write (string format, object arg0, object arg1)
- {
- stdout.Write (format, arg0, arg1);
- }
-
- public static void Write (string format, object arg0, object arg1, object arg2 )
- {
- stdout.Write (format, arg0, arg1, arg2);
- }
-
- public static void WriteLine ()
- {
- stdout.WriteLine ();
- }
-
- public static void WriteLine (bool value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (char value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (char[] value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (decimal value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (double value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (int value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (long value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (object value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (float value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- [CLSCompliant(false)]
- public static void WriteLine (uint value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- [CLSCompliant(false)]
- public static void WriteLine (ulong value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string format, object arg0)
- {
- stdout.Write (format, arg0);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string format, params object[] arg)
- {
- stdout.Write (format, arg);
- stdout.WriteLine();
- }
-
- public static void WriteLine (char[] buffer, int index, int count)
- {
- stdout.Write (buffer, index, count);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string format, object arg0, object arg1)
- {
- stdout.Write (format, arg0, arg1);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string format, object arg0, object arg1, object arg2)
- {
- stdout.Write (format, arg0, arg1, arg2);
- stdout.WriteLine();
- }
-
- public static int Read ()
- {
- return stdin.Read ();
- }
-
- public static string ReadLine ()
- {
- return stdin.ReadLine ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ContextBoundObject.cs b/mcs/class/corlib/System/ContextBoundObject.cs
deleted file mode 100644
index 64bafd6a1d4..00000000000
--- a/mcs/class/corlib/System/ContextBoundObject.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.ContextBoundObject.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-namespace System {
-
- /// <summary>
- /// Base class for all the context-bound classes
- /// </summary>
- [MonoTODO]
- public abstract class ContextBoundObject {
-
- protected ContextBoundObject ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ContextMarshalException.cs b/mcs/class/corlib/System/ContextMarshalException.cs
deleted file mode 100644
index bb058cf2e09..00000000000
--- a/mcs/class/corlib/System/ContextMarshalException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.ContextMarshalException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class ContextMarshalException : SystemException
- {
- // Constructors
- public ContextMarshalException ()
- : base (Locale.GetText ("Attempt to marshal and object across a context failed."))
- {
- }
-
- public ContextMarshalException (string message)
- : base (message)
- {
- }
-
- protected ContextMarshalException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public ContextMarshalException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ContextStaticAttribute.cs b/mcs/class/corlib/System/ContextStaticAttribute.cs
deleted file mode 100755
index 054c9845e6f..00000000000
--- a/mcs/class/corlib/System/ContextStaticAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.ContextStaticAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// The ContextStatic attribute is used to flag fields as being unique
- /// </summary>
- ///
- /// <remarks>
- ///
- /// </remarks>
- [AttributeUsage (AttributeTargets.Field)]
- [Serializable]
- public class ContextStaticAttribute : Attribute {
-
- public ContextStaticAttribute () : base ()
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/Convert.cs b/mcs/class/corlib/System/Convert.cs
deleted file mode 100644
index 45c7e9d722b..00000000000
--- a/mcs/class/corlib/System/Convert.cs
+++ /dev/null
@@ -1,2192 +0,0 @@
-//
-// System.Convert.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// System.Convert class. This was written word for word off the
-// Library specification for System.Convert in the ECMA TC39 TG2
-// and TG3 working documents. The first page of which has a table
-// for all legal conversion scenerios.
-//
-// This header and the one above it can be formatted however, just trying
-// to keep it consistent w/ the existing mcs headers.
-//
-// This Convert class could be written another way, with each type
-// implementing IConvertible and defining their own conversion functions,
-// and this class just calling the type's implementation. Or, they can
-// be defined here and the implementing type can use these functions when
-// defining their IConvertible interface. Byte's ToBoolean() calls
-// Convert.ToBoolean(byte), or Convert.ToBoolean(byte) calls
-// byte.ToBoolean(). The first case is what is done here.
-//
-// See http://lists.ximian.com/archives/public/mono-list/2001-July/000525.html
-//
-// There are also conversion functions that are not defined in
-// the ECMA draft, such as there is no bool ToBoolean(DateTime value),
-// and placing that somewhere won't compile w/ this Convert since the
-// function doesn't exist. However calling that when using Microsoft's
-// System.Convert doesn't produce any compiler errors, it just throws
-// an InvalidCastException at runtime.
-//
-// Whenever a decimal, double, or single is converted to an integer
-// based type, it is even rounded. This uses Math.Round which only
-// has Round(decimal) and Round(double), so in the Convert from
-// single cases the value is passed to Math as a double. This
-// may not be completely necessary.
-//
-// The .NET Framework SDK lists DBNull as a member of this class
-// as 'public static readonly object DBNull;'.
-//
-// It should also be decided if all the cast return values should be
-// returned as unchecked or not.
-//
-// All the XML function comments were auto generated which is why they
-// sound someone redundant.
-//
-// TYPE | BOOL BYTE CHAR DT DEC DBL I16 I32 I64 SBYT SNGL STR UI16 UI32 UI64
-// -----+--------------------------------------------------------------------
-// BOOL | X X X X X X X X X X X X X
-// BYTE | X X X X X X X X X X X X X X
-// CHAR | X X X X X X X X X X
-// DT | X X
-// DEC | X X X X X X X X X X X X X
-// DBL | X X X X X X X X X X X X X
-// I16 | X X X X X X X X X X X X X X
-// I32 | X X X X X X X X X X X X X X
-// I64 | X X X X X X X X X X X X X X
-// SBYT | X X X X X X X X X X X X X X
-// SNGL | X X X X X X X X X X X X X
-// STR | X X X X X X X X X X X X X X X
-// UI16 | X X X X X X X X X X X X X X
-// UI32 | X X X X X X X X X X X X X X
-// UI64 | X X X X X X X X X X X X X X
-//
-
-using System.Security.Cryptography;
-using System.Globalization;
-
-namespace System {
-
- [CLSCompliant(false)]
- public sealed class Convert {
-
- // ========== BASE 64 Conversions ========== //
- // the BASE64 convert methods are using the Base64 converting methods
- // from System.Security.Cryptography.ToBase64Transform and
- // System.Security.Cryptography.FromBase64Transform
- //
- // should be changed to a stand-alone class Base64Encoder & Base64Decoder
-
- public static byte[] FromBase64CharArray(char[] inArray, int offset, int length)
- {
- if (inArray == null)
- throw new ArgumentNullException();
-
- int len = inArray.Length;
- if (len < 4 || len % 4 != 0)
- throw new FormatException();
-
- byte[] inArr = new System.Text.UnicodeEncoding().GetBytes(inArray);
- FromBase64Transform t = new FromBase64Transform();
-
- return t.TransformFinalBlock(inArr, 0, inArr.Length);
- }
-
- public static byte[] FromBase64String(string s)
- {
- if (s == null)
- throw new ArgumentNullException();
-
- char[] inArr = s.ToCharArray();
-
- return FromBase64CharArray(inArr, 0, inArr.Length);
- }
-
- public static int ToBase64CharArray(byte[] inArray, int offsetIn, int length,
- char[] outArray, int offsetOut)
- {
- if (inArray == null || outArray == null)
- throw new ArgumentNullException();
-
- if (offsetIn < 0 || length < 0 || offsetOut < 0 || (offsetIn + length) > inArray.Length)
- throw new ArgumentOutOfRangeException();
-
- ToBase64Transform t = new ToBase64Transform();
- byte[] outArr = t.TransformFinalBlock(inArray, offsetIn, length);
-
- char[] cOutArr = new System.Text.ASCIIEncoding().GetChars(outArr);
-
- if ((offsetOut + cOutArr.Length) > outArray.Length)
- throw new ArgumentOutOfRangeException();
-
- Array.Copy(cOutArr, 0, outArray, offsetOut, cOutArr.Length);
-
- return cOutArr.Length;
- }
-
- public static string ToBase64String(byte[] inArray)
- {
- if (inArray == null)
- throw new ArgumentNullException();
-
- return ToBase64String(inArray, 0, inArray.Length);
- }
-
- public static string ToBase64String(byte[] inArray, int offset, int length)
- {
- if (inArray == null)
- throw new ArgumentNullException();
-
- if (offset < 0 || length < 0 || (offset + length) > inArray.Length)
- throw new ArgumentOutOfRangeException();
-
- // FIXME: change to stand alone Base64 Encoder class
- ToBase64Transform t = new ToBase64Transform();
- byte[] outArr = t.TransformFinalBlock(inArray, offset, length);
-
- return (new System.Text.ASCIIEncoding().GetString(outArr));
- }
-
- // ========== Boolean Conversions ========== //
-
- public static bool ToBoolean (bool value)
- {
- return value;
- }
-
- public static bool ToBoolean (byte value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (char value)
- {
- throw new InvalidCastException (Locale.GetText ("Can't convert char to bool"));
- }
-
- public static bool ToBoolean (DateTime value)
- {
- throw new InvalidCastException (Locale.GetText ("Can't convert date to bool"));
- }
-
- public static bool ToBoolean (decimal value)
- {
- return (value != 0M);
- }
-
- public static bool ToBoolean (double value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (float value)
- {
- return (value != 0f);
- }
-
- public static bool ToBoolean (int value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (long value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (sbyte value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (short value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (string value)
- {
- return Boolean.Parse (value);
- }
-
- public static bool ToBoolean (uint value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (ulong value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (ushort value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (object value)
- {
- return (bool) ChangeType (value, typeof (System.Boolean));
- }
-
- // ========== Byte Conversions ========== //
-
- public static byte ToByte (bool value)
- {
- return (byte)(value ? 1 : 0);
- }
-
- public static byte ToByte (byte value)
- {
- return value;
- }
-
- public static byte ToByte (char value)
- {
- if (value > Byte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (decimal value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- // Returned Even-Rounded
- return (byte)(Math.Round (value));
- }
-
- public static byte ToByte (double value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- // This and the float version of ToByte are the only ones
- // the spec listed as checking for .NaN and Infinity overflow
- if (Double.IsNaN(value) || Double.IsInfinity(value))
- throw new OverflowException (Locale.GetText (
- "Value is equal to Double.NaN, Double.PositiveInfinity, or Double.NegativeInfinity"));
-
- // Returned Even-Rounded
- return (byte)(Math.Round (value));
- }
-
- public static byte ToByte (float value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.Minalue"));
-
- // This and the double version of ToByte are the only ones
- // the spec listed as checking for .NaN and Infinity overflow
- if (Single.IsNaN(value) || Single.IsInfinity(value))
- throw new OverflowException (Locale.GetText (
- "Value is equal to Single.NaN, Single.PositiveInfinity, or Single.NegativeInfinity"));
-
- // Returned Even-Rounded, pass it as a double, could have this
- // method just call Convert.ToByte ( (double)value)
- return (byte)(Math.Round ( (double)value));
- }
-
- public static byte ToByte (int value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (long value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (sbyte value)
- {
- if (value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than Byte.MinValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (short value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (string value)
- {
- return Byte.Parse (value);
- }
-
- public static byte ToByte (string value, IFormatProvider provider)
- {
- return Byte.Parse (value, provider);
- }
-
- public static byte ToByte (uint value)
- {
- if (value > Byte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (ulong value)
- {
- if (value > Byte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (ushort value)
- {
- if (value > Byte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (object value)
- {
- return (byte) ChangeType (value, typeof (System.Byte));
- }
-
- // ========== Char Conversions ========== //
-
- public static char ToChar (byte value)
- {
- return (char)value;
- }
-
- public static char ToChar (char value)
- {
- return value;
- }
-
- public static char ToChar (int value)
- {
- if (value > Char.MaxValue || value < Char.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue or less than Char.MinValue"));
-
- return (char)value;
- }
-
- public static char ToChar (long value)
- {
- if (value > Char.MaxValue || value < Char.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue or less than Char.MinValue"));
-
- return (char)value;
- }
-
- public static char ToChar (sbyte value)
- {
- if (value < Char.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than Char.MinValue"));
-
- return (char)value;
- }
-
- public static char ToChar (short value)
- {
- if (value < Char.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than Char.MinValue"));
-
- return (char)value;
- }
-
- public static char ToChar (string value)
- {
- return Char.Parse (value);
- }
-
- public static char ToChar (uint value)
- {
- if (value > Char.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue"));
-
- return (char)value;
- }
-
- public static char ToChar (ulong value)
- {
- if (value > Char.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue"));
-
- return (char)value;
- }
-
- public static char ToChar (ushort value)
- {
- if (value > Char.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue"));
-
- return (char)value;
- }
-
- public static char ToChar (object value)
- {
- return (char) ChangeType (value, typeof (System.Char));
- }
-
- // ========== DateTime Conversions ========== //
-
- public static DateTime ToDateTime (string value)
- {
- return DateTime.Parse (value);
- }
-
- public static DateTime ToDateTime (string value, IFormatProvider provider)
- {
- return DateTime.Parse (value, provider);
- }
-
- public static DateTime ToDateTime (bool value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (byte value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (char value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (DateTime value)
- {
- return value;
- }
-
- public static DateTime ToDateTime (decimal value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (double value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (short value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (int value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (long value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (object value)
- {
- return (DateTime) ChangeType (value, typeof (System.DateTime));
- }
-
- public static DateTime ToDateTime (object value, IFormatProvider provider)
- {
- return (DateTime) ChangeType (value, typeof (System.DateTime), provider);
- }
-
- [CLSCompliant (false)]
- public static DateTime ToDateTime (sbyte value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
- [CLSCompliant (false)]
- public static DateTime ToDateTime (ushort value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static DateTime ToDateTime (uint value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static DateTime ToDateTime (ulong value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- // ========== Decimal Conversions ========== //
-
- public static decimal ToDecimal (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static decimal ToDecimal (byte value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (char value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static decimal ToDecimal (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static decimal ToDecimal (decimal value)
- {
- return value;
- }
-
- public static decimal ToDecimal (double value)
- {
- if (value > (double)Decimal.MaxValue || value < (double)Decimal.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Decimal.MaxValue or less than Decimal.MinValue"));
-
- return (decimal)value;
- }
-
- public static decimal ToDecimal (float value)
- {
- return (decimal) Math.Round (value);
- }
-
- public static decimal ToDecimal (int value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (long value)
- {
- return (decimal)value;
- }
-
- [CLSCompliant (false)]
- public static decimal ToDecimal (sbyte value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (short value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (string value)
- {
- return Decimal.Parse (value);
- }
-
- public static decimal ToDecimal (string value, IFormatProvider provider)
- {
- return Decimal.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static decimal ToDecimal (uint value)
- {
- return (decimal)value;
- }
-
- [CLSCompliant (false)]
- public static decimal ToDecimal (ulong value)
- {
- return (decimal)value;
- }
-
- [CLSCompliant (false)]
- public static decimal ToDecimal (ushort value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (object value)
- {
- return (decimal) ChangeType (value, typeof (System.Decimal));
- }
-
- public static decimal ToDecimal (object value, IFormatProvider provider)
- {
- return (decimal) ChangeType (value, typeof (System.Decimal), provider);
- }
-
-
- // ========== Double Conversions ========== //
-
- public static double ToDouble (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static double ToDouble (byte value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static double ToDouble (char value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static double ToDouble (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static double ToDouble (decimal value)
- {
- return (double)value;
- }
-
- public static double ToDouble (double value)
- {
- return value;
- }
-
- public static double ToDouble (float value)
- {
- return (double) Math.Round (value);
- }
-
- public static double ToDouble (int value)
- {
- return (double)value;
- }
-
- public static double ToDouble (long value)
- {
- return (double)value;
- }
-
- [CLSCompliant (false)]
- public static double ToDouble (sbyte value)
- {
- return (double)value;
- }
-
- public static double ToDouble (short value)
- {
- return (double)value;
- }
-
- public static double ToDouble (string value)
- {
- return Double.Parse (value);
- }
-
- public static double ToDouble (string value, IFormatProvider provider)
- {
- return Double.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static double ToDouble (uint value)
- {
- return (double)value;
- }
-
- [CLSCompliant (false)]
- public static double ToDouble (ulong value)
- {
- return (double)value;
- }
-
- [CLSCompliant (false)]
- public static double ToDouble (ushort value)
- {
- return (double)value;
- }
-
- public static double ToDouble (object value)
- {
- return (double) ChangeType (value, typeof (System.Double));
- }
-
- public static double ToDouble (object value, IFormatProvider provider)
- {
- return (double) ChangeType (value, typeof (System.Double), provider);
- }
-
- // ========== Int16 Conversions ========== //
-
- public static short ToInt16 (bool value)
- {
- return (short)(value ? 1 : 0);
- }
-
- public static short ToInt16 (byte value)
- {
- return (short)value;
- }
-
- public static short ToInt16 (char value)
- {
- if (value > Int16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue"));
-
- return (short)value;
- }
-
- public static short ToInt16 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static short ToInt16 (decimal value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- // Returned Even-Rounded
- return (short)(Math.Round (value));
- }
-
- public static short ToInt16 (double value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- // Returned Even-Rounded
- return (short)(Math.Round (value));
- }
-
- public static short ToInt16 (float value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- // Returned Even-Rounded, use Math.Round pass as a double.
- return (short)Math.Round ( (double)value);
- }
-
- public static short ToInt16 (int value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- return (short)value;
- }
-
- public static short ToInt16 (long value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- return (short)value;
- }
-
- [CLSCompliant (false)]
- public static short ToInt16 (sbyte value)
- {
- return (short)value;
- }
-
- public static short ToInt16 (short value)
- {
- return value;
- }
-
- public static short ToInt16 (string value)
- {
- return Int16.Parse (value);
- }
-
- public static short ToInt16 (string value, IFormatProvider provider)
- {
- return Int16.Parse (value, provider);
- }
-
-
- public static short ToInt16 (string value, int fromBase)
- {
- if (NotValidBase (fromBase))
- throw new ArgumentException ("fromBase is not valid.");
-
- return (short) ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static short ToInt16 (uint value)
- {
- if (value > Int16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue"));
-
- return (short)value;
- }
-
- [CLSCompliant (false)]
- public static short ToInt16 (ulong value)
- {
- if (value > (ulong)Int16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue"));
- return (short)value;
- }
-
- [CLSCompliant (false)]
- public static short ToInt16 (ushort value)
- {
- if (value > Int16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue"));
-
- return (short)value;
- }
-
- public static short ToInt16 (object value)
- {
- return (short) ChangeType (value, typeof (System.Int16));
- }
-
- public static short ToInt16 (object value, IFormatProvider provider)
- {
- return (short) ChangeType (value, typeof (System.Int16), provider);
- }
-
- // ========== Int32 Conversions ========== //
-
- public static int ToInt32 (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static int ToInt32 (byte value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (char value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static int ToInt32 (decimal value)
- {
- if (value > Int32.MaxValue || value < Int32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue or less than Int32.MinValue"));
-
- // Returned Even-Rounded
- return (int)(Math.Round (value));
- }
-
- public static int ToInt32 (double value)
- {
- if (value > Int32.MaxValue || value < Int32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue or less than Int32.MinValue"));
-
- // Returned Even-Rounded
- return (int)(Math.Round (value));
- }
-
- public static int ToInt32 (float value)
- {
- if (value > Int32.MaxValue || value < Int32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue or less than Int32.MinValue"));
-
- // Returned Even-Rounded, pass as a double, could just call
- // Convert.ToInt32 ( (double)value);
- return (int)(Math.Round ( (double)value));
- }
-
- public static int ToInt32 (int value)
- {
- return value;
- }
-
- public static int ToInt32 (long value)
- {
- if (value > Int32.MaxValue || value < Int32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue or less than Int32.MinValue"));
-
- return (int)value;
- }
-
- [CLSCompliant (false)]
- public static int ToInt32 (sbyte value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (short value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (string value)
- {
- return Int32.Parse (value);
- }
-
- public static int ToInt32 (string value, IFormatProvider provider)
- {
- return Int32.Parse (value, provider);
- }
-
-
- public static int ToInt32 (string value, int fromBase)
- {
- if (NotValidBase (fromBase))
- throw new ArgumentException ("fromBase is not valid.");
-
- return ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static int ToInt32 (uint value)
- {
- if (value > Int32.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue"));
-
- return (int)value;
- }
-
- [CLSCompliant (false)]
- public static int ToInt32 (ulong value)
- {
- if (value > Int32.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue"));
-
- return (int)value;
- }
-
- [CLSCompliant (false)]
- public static int ToInt32 (ushort value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (object value)
- {
- return (int) ChangeType (value, typeof (System.Int32));
- }
-
- public static int ToInt32 (object value, IFormatProvider provider)
- {
- return (int) ChangeType (value, typeof (System.Int32), provider);
- }
-
- // ========== Int64 Conversions ========== //
-
- public static long ToInt64 (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static long ToInt64 (byte value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (char value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static long ToInt64 (decimal value)
- {
- if (value > Int64.MaxValue || value < Int64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int64.MaxValue or less than Int64.MinValue"));
-
- // Returned Even-Rounded
- return (long)(Math.Round (value));
- }
-
- public static long ToInt64 (double value)
- {
- if (value > Int64.MaxValue || value < Int64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int64.MaxValue or less than Int64.MinValue"));
-
- // Returned Even-Rounded
- return (long)(Math.Round (value));
- }
-
- public static long ToInt64 (float value)
- {
- if (value > Int64.MaxValue || value < Int64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int64.MaxValue or less than Int64.MinValue"));
-
- // Returned Even-Rounded, pass to Math as a double, could
- // just call Convert.ToInt64 ( (double)value);
- return (long)(Math.Round ( (double)value));
- }
-
- public static long ToInt64 (int value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (long value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static long ToInt64 (sbyte value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (short value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (string value)
- {
- return Int64.Parse (value);
- }
-
- public static long ToInt64 (string value, IFormatProvider provider)
- {
- return Int64.Parse (value, provider);
- }
-
- public static long ToInt64 (string value, int fromBase)
- {
- if (NotValidBase (fromBase))
- throw new ArgumentException ("fromBase is not valid.");
-
- return (long) ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static long ToInt64 (uint value)
- {
- return (long)value;
- }
-
- [CLSCompliant (false)]
- public static long ToInt64 (ulong value)
- {
- if (value > Int64.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int64.MaxValue"));
-
- return (long)value;
- }
-
- [CLSCompliant (false)]
- public static long ToInt64 (ushort value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (object value)
- {
- return (long) ChangeType (value, typeof (System.Int64));
- }
-
- public static long ToInt64 (object value, IFormatProvider provider)
- {
- return (long) ChangeType (value, typeof (System.Int64), provider);
- }
-
- // ========== SByte Conversions ========== //
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (bool value)
- {
- return (sbyte)(value ? 1 : 0);
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (byte value)
- {
- if (value > SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (char value)
- {
- if (value > SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (decimal value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- // Returned Even-Rounded
- return (sbyte)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (double value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- // Returned Even-Rounded
- return (sbyte)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (float value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.Minalue"));
-
- // Returned Even-Rounded, pass as double to Math
- return (sbyte)(Math.Round ( (double)value));
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (int value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (long value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (sbyte value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (short value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (string value)
- {
- return SByte.Parse (value);
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (string value, IFormatProvider provider)
- {
- return SByte.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (string value, int fromBase)
- {
- if (NotValidBase (fromBase))
- throw new ArgumentException ("fromBase is not valid.");
-
- return (sbyte) ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (uint value)
- {
- if (value > SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (ulong value)
- {
- if (value > (ulong)SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (ushort value)
- {
- if (value > SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (object value)
- {
- return (sbyte) ChangeType (value, typeof (System.SByte));
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (object value, IFormatProvider provider)
- {
- return (sbyte) ChangeType (value, typeof (System.SByte), provider);
- }
-
- // ========== Single Conversions ========== //
-
- public static float ToSingle (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static float ToSingle (byte value)
- {
- return (float)value;
- }
-
- public static float ToSingle (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static float ToSingle (decimal value)
- {
- return (float)value;
- }
-
- public static float ToSingle (double value)
- {
- if (value > Single.MaxValue || value < Single.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Single.MaxValue or less than Single.MinValue"));
-
- return (float)value;
- }
-
- public static float ToSingle (float value)
- {
- return value;
- }
-
- public static float ToSingle (int value)
- {
- return (float)value;
- }
-
- public static float ToSingle (long value)
- {
- return (float)value;
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (sbyte value)
- {
- return (float)value;
- }
-
- public static float ToSingle (short value)
- {
- return (float)value;
- }
-
- public static float ToSingle (string value)
- {
- return Single.Parse (value);
- }
-
- public static float ToSingle (string value, IFormatProvider provider)
- {
- return Single.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (uint value)
- {
- return (float)value;
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (ulong value)
- {
- return (float)value;
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (ushort value)
- {
- return (float)value;
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (object value)
- {
- return (float) ChangeType (value, typeof (System.Single));
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (object value, IFormatProvider provider)
- {
- return (float) ChangeType (value, typeof (System.Single), provider);
- }
-
- // ========== String Conversions ========== //
-
- public static string ToString (bool value)
- {
- return value.ToString ();
- }
-
- public static string ToString (byte value)
- {
- return value.ToString ();
- }
-
- public static string ToString (byte value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (char value)
- {
- return value.ToString ();
- }
-
- public static string ToString (DateTime value)
- {
- return value.ToString ();
- }
-
- public static string ToString (DateTime value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (decimal value)
- {
- return value.ToString ();
- }
-
- public static string ToString (decimal value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (double value)
- {
- return value.ToString ();
- }
-
- public static string ToString (double value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (float value)
- {
- return value.ToString ();
- }
-
- public static string ToString (float value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (int value)
- {
- return value.ToString ();
- }
-
- public static string ToString (int value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (long value)
- {
- return value.ToString ();
- }
-
- public static string ToString (long value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (object value)
- {
- return (string) ChangeType (value, typeof (System.String));
- }
-
- public static string ToString (object value, IFormatProvider provider)
- {
- return (string) ChangeType (value, typeof (System.String), provider);
- }
-
- public static string ToString (sbyte value)
- {
- return value.ToString ();
- }
-
- public static string ToString (sbyte value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (short value)
- {
- return value.ToString ();
- }
-
- public static string ToString (short value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (string value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static string ToString (uint value)
- {
- return value.ToString ();
- }
-
- [CLSCompliant (false)]
- public static string ToString (uint value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- [CLSCompliant (false)]
- public static string ToString (ulong value)
- {
- return value.ToString ();
- }
-
- [CLSCompliant (false)]
- public static string ToString (ulong value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- [CLSCompliant (false)]
- public static string ToString (ushort value)
- {
- return value.ToString ();
- }
-
- [CLSCompliant (false)]
- public static string ToString (ushort value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- // ========== UInt16 Conversions ========== //
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (bool value)
- {
- return (ushort)(value ? 1 : 0);
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (byte value)
- {
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (char value)
- {
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (decimal value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- // Returned Even-Rounded
- return (ushort)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (double value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- // Returned Even-Rounded
- return (ushort)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (float value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- // Returned Even-Rounded, pass as double to Math
- return (ushort)(Math.Round ( (double)value));
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (int value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (long value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (sbyte value)
- {
- if (value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt16.MinValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (short value)
- {
- if (value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt16.MinValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (string value)
- {
- return UInt16.Parse (value);
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (string value, IFormatProvider provider)
- {
- return UInt16.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (string value, int fromBase)
- {
- if (NotValidBase (fromBase))
- throw new ArgumentException ("fromBase is not valid.");
-
- return (ushort) ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (uint value)
- {
- if (value > UInt16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (ulong value)
- {
- if (value > (ulong)UInt16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (ushort value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (object value)
- {
- return (ushort) ChangeType (value, typeof (System.UInt16));
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (object value, IFormatProvider provider)
- {
- return (ushort) ChangeType (value, typeof (System.UInt16), provider);
- }
-
- // ========== UInt32 Conversions ========== //
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (bool value)
- {
- return (uint)(value ? 1 : 0);
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (byte value)
- {
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (char value)
- {
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (decimal value)
- {
- if (value > UInt32.MaxValue || value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue or less than UInt32.MinValue"));
-
- // Returned Even-Rounded
- return (uint)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (double value)
- {
- if (value > UInt32.MaxValue || value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue or less than UInt32.MinValue"));
-
- // Returned Even-Rounded
- return (uint)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (float value)
- {
- if (value > UInt32.MaxValue || value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue or less than UInt32.MinValue"));
-
- // Returned Even-Rounded, pass as double to Math
- return (uint)(Math.Round ( (double)value));
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (int value)
- {
- if (value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt32.MinValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (long value)
- {
- if (value > UInt32.MaxValue || value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue or less than UInt32.MinValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (sbyte value)
- {
- if (value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt32.MinValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (short value)
- {
- if (value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt32.MinValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (string value)
- {
- return UInt32.Parse (value);
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (string value, IFormatProvider provider)
- {
- return UInt32.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (uint value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (ulong value)
- {
- if (value > UInt32.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (ushort value)
- {
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (object value)
- {
- return (uint) ChangeType (value, typeof (System.UInt32));
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (object value, IFormatProvider provider)
- {
- return (uint) ChangeType (value, typeof (System.UInt32), provider);
- }
-
-
- // ========== UInt64 Conversions ========== //
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (bool value)
- {
- return (ulong)(value ? 1 : 0);
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (byte value)
- {
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (char value)
- {
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUint64 (DateTime value)
- {
- throw new InvalidCastException ("The conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (decimal value)
- {
- if (value > UInt64.MaxValue || value < UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt64.MaxValue or less than UInt64.MinValue"));
-
- // Returned Even-Rounded
- return (ulong)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (double value)
- {
- if (value > UInt64.MaxValue || value < UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt64.MaxValue or less than UInt64.MinValue"));
-
- // Returned Even-Rounded
- return (ulong)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (float value)
- {
- if (value > UInt64.MaxValue || value < UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt64.MaxValue or less than UInt64.MinValue"));
-
- // Returned Even-Rounded, pass as a double to Math
- return (ulong)(Math.Round ( (double)value));
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (int value)
- {
- if (value < (int)UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt64.MinValue"));
-
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (long value)
- {
- if (value < (long)UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt64.MinValue"));
-
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (sbyte value)
- {
- if (value < (sbyte)UInt64.MinValue)
- throw new OverflowException
- ("Value is less than UInt64.MinValue");
-
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (short value)
- {
- if (value < (short)UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt64.MinValue"));
-
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (string value)
- {
- return UInt64.Parse (value);
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (string value, IFormatProvider provider)
- {
- return UInt64.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static ulong ToUint64 (string value, int fromBase)
- {
- if (NotValidBase (fromBase))
- throw new ArgumentException ("fromBase is not valid.");
-
- return (ulong) ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (uint value)
- {
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (ulong value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (ushort value)
- {
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (object value)
- {
- return (ulong) ChangeType (value, typeof (System.UInt64));
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (object value, IFormatProvider provider)
- {
- return (ulong) ChangeType (value, typeof (System.UInt64), provider);
- }
-
-
- // ========== Conversion / Helper Fucntions ========== //
-
- public static object ChangeType (object value, Type conversionType)
- {
- CultureInfo ci = CultureInfo.CurrentCulture;
- NumberFormatInfo number = ci.NumberFormat;
- return ToType (value, conversionType, number);
- }
-
- public static object ChangeType (object value, TypeCode typeCode)
- {
- CultureInfo ci = CultureInfo.CurrentCulture;
- Type conversionType = conversionTable [(int)typeCode];
- NumberFormatInfo number = ci.NumberFormat;
- return ToType (value, conversionType, number);
- }
-
- public static object ChangeType (object value, Type conversionType, IFormatProvider provider)
- {
- return ToType (value, conversionType, provider);
- }
-
- public static object ChangeType (object value, TypeCode typeCode, IFormatProvider provider)
- {
- Type conversionType = conversionTable [(int)typeCode];
- return ToType (value, conversionType, provider);
- }
-
- private static bool NotValidBase (int value)
- {
- if ((value == 2) || (value == 8) ||
- (value == 10) || (value == 16))
- return false;
-
- return true;
- }
-
- private static int ConvertFromBase (string value, int fromBase)
- {
- int result = 0;
-
- foreach (char c in value) {
- if (Char.IsLetter (c))
- result = (fromBase) * result + c - 'a' + 10;
- else
- result = (fromBase) * result + c - '0';
- }
- return result;
- }
-
- // Lookup table for the conversion ToType method. Order
- // is important! Used by ToType for comparing the target
- // type, and uses hardcoded array indexes.
- private static Type[] conversionTable = {
- // Valid ICovnertible Types
- typeof (Boolean), // 0 TypeCode.Boolean
- typeof (Byte), // 1 TypeCode.Byte
- typeof (Char), // 2 TypeCode.Char
- typeof (DateTime), // 3 TypeCode.DateTime
- typeof (Decimal), // 4 TypeCode.Decimal
- typeof (Double), // 5 TypeCode.Double
- typeof (Int16), // 6 TypeCode.Int16
- typeof (Int32), // 7 TypeCode.Int32
- typeof (Int64), // 8 TypeCode.Int64
- typeof (SByte), // 9 TypeCode.Sbyte
- typeof (Single), // 10 TypeCode.Single
- typeof (String), // 11 TypeCode.String
- typeof (UInt16), // 12 TypeCode.UInt16
- typeof (UInt32), // 13 TypeCode.UInt32
- typeof (UInt64), // 14 TypeCode.UInt64
-
- // Invalid IConvertible Interface Types
- typeof (Object) // 15 TypeCode.Object
- };
-
- // Function to convert an object to another type and return
- // it as an object. In place for the core data types to use
- // when implementing IConvertible. Uses hardcoded indexes in
- // the conversionTypes array, so if modify carefully.
- internal static object ToType (object value, Type conversionType,
- IFormatProvider provider)
- {
- if (value == null)
- throw new ArgumentException (Locale.GetText (
- "Invalid conversion from null value"));
-
- if (value is IConvertible) {
- IConvertible convertValue = (IConvertible)value;
-
- if (conversionType == conversionTable[0]) {
- // 0 TypeCode.Boolean
- return (object)(convertValue.ToBoolean (provider));
-
- } else if (conversionType == conversionTable[1]) {
- // 1 TypeCode.Byte
- return (object)(convertValue.ToByte (provider));
-
- } else if (conversionType == conversionTable[2]) {
- // 2 TypeCode.Char
- return (object)(convertValue.ToChar (provider));
-
- } else if (conversionType == conversionTable[3]) {
- // 3 TypeCode.DateTime
- return (object)(convertValue.ToDateTime (provider));
-
- } else if (conversionType == conversionTable[4]) {
- // 4 TypeCode.Decimal
- return (object)(convertValue.ToDecimal (provider));
-
- } else if (conversionType == conversionTable[5]) {
- // 5 TypeCode.Double
- return (object)(convertValue.ToDouble (provider));
-
- } else if (conversionType == conversionTable[6]) {
- // 6 TypeCode.Int16
- return (object)(convertValue.ToInt16 (provider));
-
- } else if (conversionType == conversionTable[7]) {
- // 7 TypeCode.Int32
- return (object)(convertValue.ToInt32 (provider));
-
- } else if (conversionType == conversionTable[8]) {
- // 8 TypeCode.Int64
- return (object)(convertValue.ToInt64 (provider));
-
- } else if (conversionType == conversionTable[9]) {
- // 9 TypeCode.Sbyte
- return (object)(convertValue.ToSByte (provider));
-
- } else if (conversionType == conversionTable[10]) {
- // 10 TypeCode.Single
- return (object)(convertValue.ToSingle (provider));
-
- } else if (conversionType == conversionTable[11]) {
- // 11 TypeCode.String
- return (object)(convertValue.ToString (provider));
-
- } else if (conversionType == conversionTable[12]) {
- // 12 TypeCode.UInt16
- return (object)(convertValue.ToUInt16 (provider));
-
- } else if (conversionType == conversionTable[13]) {
- // 13 TypeCode.UInt32
- return (object)(convertValue.ToUInt32 (provider));
-
- } else if (conversionType == conversionTable[14]) {
- // 14 TypeCode.UInt64
- return (object)(convertValue.ToUInt64 (provider));
-
- } else if (conversionType == conversionTable[15]) {
- // 15 TypeCode.Object
- return (object)(value);
-
- } else {
- // Not in the conversion table
- throw new InvalidCastException (Locale.GetText (
- "Unknown target conversion type"));
- }
- } else {
- // Value is not IConvertible
- throw new ArgumentException (Locale.GetText (
- "Value is not a convertible object: "+ value.GetType().ToString()+" to "+conversionType.ToString()));
- }
- }
- }
-}
-
-
-
-
diff --git a/mcs/class/corlib/System/CrossAppDomainDelegate.cs b/mcs/class/corlib/System/CrossAppDomainDelegate.cs
deleted file mode 100755
index d8cded40afa..00000000000
--- a/mcs/class/corlib/System/CrossAppDomainDelegate.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// System.CrossAppDomainDelegate.cs
-//
-// Paolo Molaro
-//
-// (C) 2002 Ximian, Inc.
-
-namespace System
-{
- public delegate void CrossAppDomainDelegate ();
-}
diff --git a/mcs/class/corlib/System/DBNull.cs b/mcs/class/corlib/System/DBNull.cs
deleted file mode 100644
index f1a98085350..00000000000
--- a/mcs/class/corlib/System/DBNull.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// System.DBNull.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public sealed class DBNull : ISerializable, IConvertible
- {
- // Fields
- public static readonly DBNull Value = new DBNull ();
-
- // Private constructor
- private DBNull () {}
-
- // Methods
- [MonoTODO]
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- }
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.DBNull;
- }
-
- [MonoTODO]
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return false;
- }
-
- [MonoTODO]
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return Byte.MinValue;
- }
-
- [MonoTODO]
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return Char.MinValue;
- }
-
- [MonoTODO]
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return DateTime.MinValue;
- }
-
- [MonoTODO]
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return Decimal.MinValue;
- }
-
- [MonoTODO]
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return Double.MinValue;
- }
-
- [MonoTODO]
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return Int16.MinValue;
- }
-
- [MonoTODO]
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return Int32.MinValue;
- }
-
- [MonoTODO]
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return Int64.MinValue;
- }
-
- [MonoTODO]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return SByte.MinValue;
- }
-
- [MonoTODO]
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return Single.MinValue;
- }
-
- [MonoTODO]
- object IConvertible.ToType (Type type, IFormatProvider provider)
- {
- return null;
- }
-
- [MonoTODO]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return UInt16.MinValue;
- }
-
- [MonoTODO]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return UInt32.MinValue;
- }
-
- [MonoTODO]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return UInt64.MinValue;
- }
-
- public override string ToString ()
- {
- return String.Empty;
- }
-
- public string ToString (IFormatProvider provider)
- {
- return String.Empty;
- }
- }
-}
diff --git a/mcs/class/corlib/System/DateTime.cs b/mcs/class/corlib/System/DateTime.cs
deleted file mode 100644
index 13fca4959bb..00000000000
--- a/mcs/class/corlib/System/DateTime.cs
+++ /dev/null
@@ -1,1461 +0,0 @@
-//
-// System.DateTime.cs
-//
-// author:
-// Marcel Narings (marcel@narings.nl)
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2001 Marcel Narings
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-
-namespace System
-{
- /// <summary>
- /// The DateTime structure represents dates and time ranging from
- /// 1-1-0001 12:00:00 AM to 31-12-9999 23:59:00 Common Era.
- /// </summary>
- ///
- public struct DateTime : IComparable , IFormattable , IConvertible
- {
- private TimeSpan ticks;
-
- private const int dp400 = 146097;
- private const int dp100 = 36524;
- private const int dp4 = 1461;
-
- // w32 file time starts counting from 1/1/1601 00:00 GMT
- // which is the constant ticks from the .NET epoch
- private const long w32file_epoch = 504911232000000000L;
-
- //
- // The UnixEpoch, it begins on Jan 1, 1970 at 0:0:0, expressed
- // in Ticks
- //
- internal const long UnixEpoch = 621355968000000000L;
-
- public static readonly DateTime MaxValue = new DateTime (false,TimeSpan.MaxValue);
- public static readonly DateTime MinValue = new DateTime (false,TimeSpan.MinValue);
-
- private enum Which
- {
- Day,
- DayYear,
- Month,
- Year
- };
-
- private static int[] daysmonth = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
- private static int[] daysmonthleap = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-
- private static int AbsoluteDays (int year, int month, int day)
- {
- int[] days;
- int temp = 0, m=1 ;
-
- days = (IsLeapYear(year) ? daysmonthleap : daysmonth);
-
- while (m < month)
- temp += days[m++];
- return ((day-1) + temp + (365* (year-1)) + ((year-1)/4) - ((year-1)/100) + ((year-1)/400));
- }
-
- private int FromTicks(Which what)
- {
- int num400, num100, num4, numyears;
- int M =1;
-
- int[] days = daysmonth;
- int totaldays = this.ticks.Days;
-
- num400 = (totaldays / dp400);
- totaldays -= num400 * dp400;
-
- num100 = (totaldays / dp100);
- if (num100 == 4) // leap
- num100 = 3;
- totaldays -= (num100 * dp100);
-
- num4 = totaldays / dp4;
- totaldays -= (num4 * dp4);
-
- numyears = totaldays / 365 ;
-
- if (numyears == 4) //leap
- numyears =3 ;
- if (what == Which.Year )
- return num400*400 + num100*100 + num4*4 + numyears + 1;
-
- totaldays -= (numyears * 365) ;
- if (what == Which.DayYear )
- return totaldays + 1;
-
- if ((numyears==3) && ((num100 == 3) || !(num4 == 24)) ) //31 dec leapyear
- days = daysmonthleap;
-
- while (totaldays >= days[M])
- totaldays -= days[M++];
-
- if (what == Which.Month )
- return M;
-
- return totaldays +1;
- }
-
-
- // Constructors
-
- /// <summary>
- /// Constructs a DateTime for specified ticks
- /// </summary>
- ///
- public DateTime (long newticks)
- // `local' must default to false here to avoid
- // a recursion loop.
- : this (false, newticks) {}
-
- internal DateTime (bool local, long newticks)
- : this (true, new TimeSpan (newticks))
- {
- if (local) {
- TimeZone tz = TimeZone.CurrentTimeZone;
-
- TimeSpan utcoffset = tz.GetUtcOffset (this);
-
- ticks = ticks + utcoffset;
- }
- }
-
- public DateTime (int year, int month, int day)
- : this (year, month, day,0,0,0,0) {}
-
- public DateTime (int year, int month, int day, int hour, int minute, int second)
- : this (year, month, day, hour, minute, second, 0) {}
-
- public DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond)
- {
- if ( year < 1 || year > 9999 ||
- month < 1 || month >12 ||
- day < 1 || day > DaysInMonth(year, month) ||
- hour < 0 || hour > 23 ||
- minute < 0 || minute > 59 ||
- second < 0 || second > 59 )
- throw new ArgumentOutOfRangeException() ;
-
- ticks = new TimeSpan (AbsoluteDays(year,month,day), hour, minute, second, millisecond);
- }
-
- public DateTime (int year, int month, int day, Calendar calendar)
- : this (year, month, day, 0, 0, 0, 0, calendar) {}
-
-
- public DateTime (int year, int month, int day, int hour, int minute, int second, Calendar calendar)
- : this (year, month, day, hour, minute, second, 0, calendar) {}
-
-
- public DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar)
- : this (year, month, day, hour, minute, second, millisecond)
- {
- if (calendar == null)
- throw new ArgumentNullException();
- }
-
- internal DateTime (bool check, TimeSpan value)
- {
- if (check && (value.Ticks < MinValue.Ticks || value.Ticks > MaxValue.Ticks))
- throw new ArgumentOutOfRangeException ();
-
- ticks = value;
- }
-
- /* Properties */
-
- public DateTime Date
- {
- get
- {
- return new DateTime (Year, Month, Day);
- }
- }
-
- public int Month
- {
- get
- {
- return FromTicks(Which.Month);
- }
- }
-
-
- public int Day
- {
- get
- {
- return FromTicks(Which.Day);
- }
- }
-
- public DayOfWeek DayOfWeek
- {
- get
- {
- return ( (DayOfWeek) ((ticks.Days+1) % 7) );
- }
- }
-
- public int DayOfYear
- {
- get
- {
- return FromTicks(Which.DayYear);
- }
- }
-
- public TimeSpan TimeOfDay
- {
- get
- {
- return new TimeSpan(ticks.Ticks % TimeSpan.TicksPerDay );
- }
-
- }
-
- public int Hour
- {
- get
- {
- return ticks.Hours;
- }
- }
-
- public int Minute
- {
- get
- {
- return ticks.Minutes;
- }
- }
-
- public int Second
- {
- get
- {
- return ticks.Seconds;
- }
- }
-
- public int Millisecond
- {
- get
- {
- return ticks.Milliseconds;
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern long GetNow ();
-
- public static DateTime Now
- {
- get
- {
- return new DateTime (true, GetNow ());
- }
- }
-
- public long Ticks
- {
- get
- {
- return ticks.Ticks;
- }
- }
-
- public static DateTime Today
- {
- get
- {
- return new DateTime (false, (GetNow () / TimeSpan.TicksPerDay) * TimeSpan.TicksPerDay);
- }
- }
-
- public static DateTime UtcNow
- {
- get {
- return new DateTime (GetNow ());
- }
- }
-
- public int Year
- {
- get
- {
- return FromTicks(Which.Year);
- }
- }
-
- /* methods */
-
- public DateTime Add (TimeSpan ts)
- {
- return new DateTime (true, ticks) + ts;
- }
-
- public DateTime AddDays (double days)
- {
- return AddMilliseconds (days * 86400000);
- }
-
- public DateTime AddTicks (long t)
- {
- return Add (new TimeSpan (t));
- }
-
- public DateTime AddHours (double hours)
- {
- return AddMilliseconds (hours * 3600000);
- }
-
- public DateTime AddMilliseconds (double ms)
- {
- long msticks;
-
- msticks = (long) (ms += ms > 0 ? 0.5 : -0.5) * TimeSpan.TicksPerMillisecond ;
-
- return AddTicks (msticks);
- }
-
- public DateTime AddMinutes (double minutes)
- {
- return AddMilliseconds (minutes * 60000);
- }
-
- public DateTime AddMonths (int months)
- {
- int day, month, year, maxday ;
- DateTime temp ;
-
- day = this.Day;
- month = this.Month + (months % 12);
- year = this.Year + months/12 ;
-
- if (month < 1)
- {
- month = 12 + month ;
- year -- ;
- }
- else if (month>12)
- {
- month = month -12;
- year ++;
- }
- maxday = DaysInMonth(year, month);
- if (day > maxday)
- day = maxday;
-
- temp = new DateTime (year, month, day);
- return temp.Add (this.TimeOfDay);
- }
-
- public DateTime AddSeconds (double seconds)
- {
- return AddMilliseconds (seconds*1000);
- }
-
- public DateTime AddYears (int years )
- {
- return AddMonths(years * 12);
- }
-
- public static int Compare (DateTime t1, DateTime t2)
- {
- if (t1.ticks < t2.ticks)
- return -1;
- else if (t1.ticks > t2.ticks)
- return 1;
- else
- return 0;
- }
-
- public int CompareTo (object v)
- {
- if ( v == null)
- return 1;
-
- if (!(v is System.DateTime))
- throw new ArgumentException (Locale.GetText (
- "Value is not a System.DateTime"));
-
- return Compare (this, (DateTime) v);
- }
-
- public static int DaysInMonth (int year, int month)
- {
- int[] days ;
-
- if (month < 1 || month >12)
- throw new ArgumentOutOfRangeException ();
-
- days = (IsLeapYear(year) ? daysmonthleap : daysmonth);
- return days[month];
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.DateTime))
- return false;
-
- return ((DateTime) o).ticks == ticks;
- }
-
- public static bool Equals (DateTime t1, DateTime t2 )
- {
- return (t1.ticks == t2.ticks );
- }
-
- public static DateTime FromFileTime (long fileTime)
- {
- return new DateTime (w32file_epoch + fileTime);
- }
-
- // TODO: Implement me.
- [MonoTODO]
- public static DateTime FromOADate (double d)
- {
- return new DateTime(0);
- }
-
- // TODO: Implement me.
- [MonoTODO]
- public string[] GetDateTimeFormats()
- {
- return null;
- }
-
- //TODO: implement me
- [MonoTODO]
- public string[] GetDateTimeFormats(char format)
- {
- return null;
- }
-
- // TODO: implement me
- [MonoTODO]
- public string[] GetDateTimeFormats(IFormatProvider provider)
- {
- return null;
- }
-
- //TODO: implement me
- [MonoTODO]
- public string[] GetDateTimeFormats(char format,IFormatProvider provider )
- {
- return null;
- }
-
- public override int GetHashCode ()
- {
- return (int) ticks.Ticks;
- }
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.DateTime;
- }
-
- public static bool IsLeapYear (int year)
- {
- return ( (year % 4 == 0 && year % 100 != 0) || year % 400 == 0) ;
- }
-
- public static DateTime Parse (string s)
- {
- return Parse (s, null);
- }
-
- public static DateTime Parse (string s, IFormatProvider fp)
- {
- return Parse (s, null, DateTimeStyles.AllowWhiteSpaces);
- }
-
- public static DateTime Parse (string s, IFormatProvider fp, DateTimeStyles styles)
- {
- string[] formats = {
- // Full date and time
- "F", "G", "r", "s", "u", "U",
- // Full date and time, but no seconds
- "f", "g",
- // Only date
- "d", "D",
- // Only time
- "T", "t",
- // Only date, but no year
- "m", "M",
- // Only date, but no day
- "y", "Y"
- };
-
- return ParseExact (s, formats, fp, styles);
- }
-
- public static DateTime ParseExact (string s, string format, IFormatProvider fp)
- {
- return ParseExact (s, format, fp, DateTimeStyles.None);
- }
-
- internal static int _ParseNumber (string s, int digits, bool leadingzero,
- bool sloppy_parsing, out int num_parsed)
- {
- int number = 0, i;
-
- if (sloppy_parsing)
- leadingzero = false;
-
- if (!leadingzero) {
- int real_digits = 0;
- for (i = 0; i < digits; i++) {
- if ((i >= s.Length) || !Char.IsDigit (s[i]))
- break;
-
- real_digits++;
- }
-
- digits = real_digits;
- }
-
- if (s.Length < digits) {
- num_parsed = -1;
- return 0;
- }
-
- for (i = 0; i < digits; i++) {
- char c = s[i];
- if (!Char.IsDigit (c)) {
- num_parsed = -1;
- return 0;
- }
-
- number = number * 10 + (byte) (c - '0');
- }
-
- num_parsed = digits;
- return number;
- }
-
- internal static int _ParseEnum (string s, string[] values, out int num_parsed)
- {
- int i;
-
- for (i = 0; i < values.Length; i++) {
- if (s.Length < values[i].Length)
- continue;
- String tmp = s.Substring (0, values[i].Length);
- if (String.Compare (tmp, values[i], true) == 0) {
- num_parsed = values[i].Length;
- return i;
- }
- }
-
- num_parsed = -1;
- return -1;
- }
-
- internal static bool _ParseString (string s, int maxlength, string value, out int num_parsed)
- {
- if (maxlength > 0)
- value = value.Substring (0, maxlength);
-
- s = s.Substring (0, value.Length);
-
- if (String.Compare (s, value, true) == 0) {
- num_parsed = value.Length;
- return true;
- }
-
- num_parsed = -1;
- return false;
- }
-
- internal static bool _DoParse (string s, string format, bool exact,
- out DateTime result,
- DateTimeFormatInfo dfi,
- DateTimeStyles style)
- {
- bool useutc = false, use_localtime = true;
- bool sloppy_parsing = false;
-
- if (format.Length == 1)
- format = _GetStandardPattern (format[0], dfi, out useutc);
-
- if ((style & DateTimeStyles.AllowLeadingWhite) != 0) {
- format = format.TrimStart (null);
- s = s.TrimStart (null);
- }
-
- if ((style & DateTimeStyles.AllowTrailingWhite) != 0) {
- format = format.TrimEnd (null);
- s = s.TrimEnd (null);
- }
-
- if ((style & DateTimeStyles.AllowInnerWhite) != 0)
- sloppy_parsing = true;
-
- char[] chars = format.ToCharArray ();
- int len = format.Length, pos = 0, num = 0;
-
- int day = -1, dayofweek = -1, month = -1, year = -1;
- int hour = -1, minute = -1, second = -1, millisecond = -1;
- int ampm = -1, century = (Now.Year / 100) * 100;
- int tzsign = -1, tzoffset = -1, tzoffmin = -1;
-
- result = new DateTime (0);
-
- while (pos+num < len)
- {
- if (s.Length == 0)
- return false;
-
- if (Char.IsWhiteSpace (s[0])) {
- s = s.Substring (1);
-
- if (Char.IsWhiteSpace (chars[pos])) {
- pos++;
- continue;
- }
-
- if ((style & DateTimeStyles.AllowInnerWhite) == 0)
- return false;
- }
-
- if (chars[pos] == '\'') {
- num = 1;
- while (pos+num < len) {
- if (chars[pos+num] == '\'')
- break;
-
- if (s.Length == 0)
- return false;
- if (s[0] != chars[pos+num])
- return false;
- s = s.Substring (1);
-
- num++;
- }
- if (pos+num > len)
- return false;
-
- pos += num + 1;
- num = 0;
- continue;
- } else if (chars[pos] == '\\') {
- if (pos+1 >= len)
- return false;
-
- if (s[0] != chars[pos+num])
- return false;
- s = s.Substring (1);
- if (s.Length == 0)
- return false;
-
- pos++;
- continue;
- } else if (chars[pos] == '%') {
- pos++;
- continue;
- }
-
- if ((pos+num+1 < len) && (chars[pos+num+1] == chars[pos+num])) {
- num++;
- continue;
- }
-
- int num_parsed = 0;
-
- switch (chars[pos])
- {
- case 'd':
- if (day != -1)
- return false;
- if (num == 0)
- day = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else if (num == 1)
- day = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- else if (num == 2)
- dayofweek = _ParseEnum (s, dfi.AbbreviatedDayNames, out num_parsed);
- else
- {
- dayofweek = _ParseEnum (s, dfi.DayNames, out num_parsed);
- num = 3;
- }
- break;
- case 'M':
- if (month != -1)
- return false;
- if (num == 0)
- month = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else if (num == 1)
- month = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- else if (num == 2)
- month = _ParseEnum (s, dfi.AbbreviatedMonthNames , out num_parsed) + 1;
- else
- {
- month = _ParseEnum (s, dfi.MonthNames, out num_parsed) + 1;
- num = 3;
- }
- if ((month < 1) || (month > 12))
- return false;
- break;
- case 'y':
- if (year != -1)
- return false;
- if (num == 0)
- year = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed) + century;
- else if (num < 3)
- year = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed) + century;
- else
- {
- year = _ParseNumber (s, 4, false, sloppy_parsing, out num_parsed);
- num = 3;
- }
- break;
- case 'h':
- if (hour != -1)
- return false;
- if (num == 0)
- hour = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else
- {
- hour = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- num = 1;
- }
- if (hour >= 12)
- return false;
- break;
- case 'H':
- if ((hour != -1) || (ampm >= 0))
- return false;
- if (num == 0)
- hour = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else
- {
- hour = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- num = 1;
- }
- if (hour >= 24)
- return false;
- ampm = -2;
- break;
- case 'm':
- if (minute != -1)
- return false;
- if (num == 0)
- minute = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else
- {
- minute = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- num = 1;
- }
- if (minute >= 60)
- return false;
- break;
- case 's':
- if (second != -1)
- return false;
- if (num == 0)
- second = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else
- {
- second = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- num = 1;
- }
- if (second >= 60)
- return false;
- break;
- case 'f':
- if (millisecond != -1)
- return false;
- num = Math.Min (num, 6);
- millisecond = _ParseNumber (s, num+1, true, sloppy_parsing, out num_parsed);
- break;
- case 't':
- if (ampm != -1)
- return false;
- if (num == 0)
- {
- if (_ParseString (s, 1, dfi.AMDesignator, out num_parsed))
- ampm = 0;
- else if (_ParseString (s, 1, dfi.PMDesignator, out num_parsed))
- ampm = 1;
- else
- return false;
- }
- else
- {
- if (_ParseString (s, 0, dfi.AMDesignator, out num_parsed))
- ampm = 0;
- else if (_ParseString (s, 0, dfi.PMDesignator, out num_parsed))
- ampm = 1;
- else
- return false;
- num = 1;
- }
- break;
- case 'z':
- if (tzsign != -1)
- return false;
- if (s[0] == '+')
- tzsign = 0;
- else if (s[0] == '-')
- tzsign = 1;
- else
- return false;
- s = s.Substring (1);
- if (num == 0)
- tzoffset = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else if (num == 1)
- tzoffset = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- else
- {
- tzoffset = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- if (num_parsed < 0)
- return false;
- s = s.Substring (num_parsed);
- if (!_ParseString (s, 0, dfi.TimeSeparator, out num_parsed))
- return false;
- s = s.Substring (num_parsed);
- tzoffmin = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- if (num_parsed < 0)
- return false;
- num = 2;
- }
- break;
- case ':':
- if (!_ParseString (s, 0, dfi.TimeSeparator, out num_parsed))
- return false;
- break;
- case '/':
- if (!_ParseString (s, 0, dfi.DateSeparator, out num_parsed))
- return false;
- break;
- default:
- if (s[0] != chars[pos])
- return false;
- num = 0;
- num_parsed = 1;
- break;
- }
-
- if (num_parsed < 0)
- return false;
-
- s = s.Substring (num_parsed);
-
- pos = pos + num + 1;
- num = 0;
- }
-
- if (hour == -1)
- hour = 0;
- if (minute == -1)
- minute = 0;
- if (second == -1)
- second = 0;
- if (millisecond == -1)
- millisecond = 0;
-
- // If no date was given
- if ((day == -1) && (month == -1) && (year == -1)) {
- if ((style & DateTimeStyles.NoCurrentDateDefault) != 0) {
- day = 1;
- month = 1;
- year = 1;
- } else {
- day = Today.Day;
- month = Today.Month;
- year = Today.Year;
- }
- }
-
- if (day == -1)
- day = 1;
- if (month == -1)
- month = 1;
- if (year == -1) {
- if ((style & DateTimeStyles.NoCurrentDateDefault) != 0)
- year = 1;
- else
- year = Today.Year;
- }
-
- if (ampm == 1)
- hour = hour + 12;
-
- result = new DateTime (year, month, day, hour, minute, second, millisecond);
-
- if ((dayofweek != -1) && (dayofweek != (int) result.DayOfWeek))
- throw new FormatException (Locale.GetText ("String was not recognized as valid DateTime because the day of week was incorrect."));
-
- // If no timezone was specified, default to the local timezone.
- TimeSpan utcoffset;
- if (useutc)
- utcoffset = new TimeSpan (0, 0, 0);
- else if (tzsign == -1) {
- TimeZone tz = TimeZone.CurrentTimeZone;
- utcoffset = tz.GetUtcOffset (result);
- } else {
- if ((style & DateTimeStyles.AdjustToUniversal) != 0)
- use_localtime = false;
-
- if (tzoffmin == -1)
- tzoffmin = 0;
- if (tzoffset == -1)
- tzoffset = 0;
- if (tzsign == 1)
- tzoffset = -tzoffset;
-
- utcoffset = new TimeSpan (tzoffset, tzoffmin, 0);
- }
-
- long newticks = (result.ticks - utcoffset).Ticks;
-
- result = new DateTime (use_localtime, newticks);
-
- return true;
- }
-
-
- public static DateTime ParseExact (string s, string format,
- IFormatProvider fp, DateTimeStyles style)
- {
- string[] formats;
-
- formats = new string [1];
- formats[0] = format;
-
- return ParseExact (s, formats, fp, style);
- }
-
- public static DateTime ParseExact (string s, string[] formats,
- IFormatProvider fp,
- DateTimeStyles style)
- {
- DateTimeFormatInfo dfi = DateTimeFormatInfo.GetInstance (fp);
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
- if (formats.Length == 0)
- throw new ArgumentNullException (Locale.GetText ("format is null"));
-
- int i;
- for (i = 0; i < formats.Length; i++)
- {
- DateTime result;
-
- if (_DoParse (s, formats[i], true, out result, dfi, style))
- return result;
- }
-
- throw new FormatException ();
- }
-
- public TimeSpan Subtract(DateTime dt)
- {
- return new TimeSpan(ticks.Ticks) - dt.ticks;
- }
-
- public DateTime Subtract(TimeSpan ts)
- {
- TimeSpan newticks;
-
- newticks = (new TimeSpan (ticks.Ticks)) - ts;
- return new DateTime(true,newticks);
- }
-
- public long ToFileTime()
- {
- if(ticks.Ticks < w32file_epoch) {
- throw new ArgumentOutOfRangeException("file time is not valid");
- }
-
- return(ticks.Ticks - w32file_epoch);
- }
-
- public string ToLongDateString()
- {
- return ToString ("D");
- }
-
- public string ToLongTimeString()
- {
- return ToString ("T");
- }
-
- [MonoTODO]
- public double ToOADate()
- {
- // TODO implement me
- return 0;
- }
-
- public string ToShortDateString()
- {
- return ToString ("d");
- }
-
- public string ToShortTimeString()
- {
- return ToString ("t");
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- internal static string _GetStandardPattern (char format, DateTimeFormatInfo dfi, out bool useutc)
- {
- String pattern;
-
- useutc = false;
-
- switch (format)
- {
- case 'd':
- pattern = dfi.ShortDatePattern;
- break;
- case 'D':
- pattern = dfi.LongDatePattern;
- break;
- case 'f':
- pattern = dfi.LongDatePattern + " " + dfi.ShortTimePattern;
- break;
- case 'F':
- pattern = dfi.FullDateTimePattern;
- break;
- case 'g':
- pattern = dfi.ShortDatePattern + " " + dfi.ShortTimePattern;
- break;
- case 'G':
- pattern = dfi.ShortDatePattern + " " + dfi.LongTimePattern;
- break;
- case 'm':
- case 'M':
- pattern = dfi.MonthDayPattern;
- break;
- case 'r':
- case 'R':
- pattern = dfi.RFC1123Pattern;
- useutc= true;
- break;
- case 's':
- pattern = dfi.SortableDateTimePattern;
- break;
- case 't':
- pattern = dfi.ShortTimePattern;
- break;
- case 'T':
- pattern = dfi.LongTimePattern;
- break;
- case 'u':
- pattern = dfi.UniversalSortableDateTimePattern;
- useutc = true;
- break;
- case 'U':
- pattern = dfi.LongDatePattern + " " + dfi.LongTimePattern;
- useutc = true;
- break;
- case 'y':
- case 'Y':
- pattern = dfi.YearMonthPattern;
- break;
- default:
- pattern = null;
- break;
- }
-
- return pattern;
- }
-
- internal string _ToString (string format, DateTimeFormatInfo dfi)
- {
- String str = null, result = null;
- char[] chars = format.ToCharArray ();
- int len = format.Length, pos = 0, num = 0;
-
- TimeZone tz = TimeZone.CurrentTimeZone;
- TimeSpan utcoffset = tz.GetUtcOffset (this);
-
- while (pos < len)
- {
- if (chars[pos] == '\'') {
- num = 1;
- while (pos+num <= len) {
- if (chars[pos+num] == '\'')
- break;
-
- result += chars[pos+num];
- num++;
- }
- if (pos+num > len)
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- pos += num+1;
- num = 0;
- continue;
- } else if (chars[pos] == '\\') {
- if (pos+1 >= len)
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- result += chars[pos+1];
- pos += 2;
- continue;
- } else if (chars[pos] == '%') {
- pos++;
- continue;
- }
-
- if ((pos+num+1 < len) && (chars[pos+num+1] == chars[pos+num])) {
- num++;
- continue;
- }
-
- switch (chars[pos])
- {
- case 'd':
- if (num == 0)
- str = Day.ToString ("d");
- else if (num == 1)
- str = Day.ToString ("d02");
- else if (num == 2)
- str = dfi.GetAbbreviatedDayName (DayOfWeek);
- else {
- str = dfi.GetDayName (DayOfWeek);
- num = 3;
- }
- break;
- case 'M':
- if (num == 0)
- str = Month.ToString ("d");
- else if (num == 1)
- str = Month.ToString ("d02");
- else if (num == 2)
- str = dfi.GetAbbreviatedMonthName (Month);
- else {
- str = dfi.GetMonthName (Month);
- num = 3;
- }
- break;
- case 'y':
- if (num == 0) {
- int shortyear = Year % 100;
- str = shortyear.ToString ("d");
- } else if (num == 1) {
- int shortyear = Year % 100;
- str = shortyear.ToString ("d02");
- } else {
- str = Year.ToString ("d");
- num = 3;
- }
- break;
- case 'g':
- // FIXME
- break;
- case 'f':
- num = Math.Min (num, 6);
-
- long ms = (long) Millisecond;
- long exp = 10;
- for (int i = 0; i < num; i++)
- exp = exp * 10;
- long maxexp = TimeSpan.TicksPerMillisecond;
-
- exp = Math.Min (exp, maxexp);
- ms = ms * exp / maxexp;
-
- String prec = (num+1).ToString ("d02");
- str = ms.ToString (String.Concat ("d", prec));
-
- break;
- case 'h':
- if (num == 0) {
- int shorthour = Hour % 12;
- str = shorthour.ToString ("d");
- } else {
- int shorthour = Hour % 12;
- str = shorthour.ToString ("d02");
- num = 1;
- }
- break;
- case 'H':
- if (num == 0)
- str = Hour.ToString ("d");
- else {
- str = Hour.ToString ("d02");
- num = 1;
- }
- break;
- case 'm':
- if (num == 0)
- str = Minute.ToString ("d");
- else {
- str = Minute.ToString ("d02");
- num = 1;
- }
- break;
- case 's':
- if (num == 0)
- str = Second.ToString ("d");
- else {
- str = Second.ToString ("d02");
- num = 1;
- }
- break;
- case 't':
- if (Hour < 12)
- str = dfi.AMDesignator;
- else
- str = dfi.PMDesignator;
-
- if (num == 0)
- str = str.Substring (0,1);
- else
- num = 1;
- break;
- case 'z':
- if (num == 0) {
- int offset = utcoffset.Hours;
- str = offset.ToString ("d");
- if (offset > 0)
- str = String.Concat ("+", str);
- } else if (num == 1) {
- int offset = utcoffset.Hours;
- str = offset.ToString ("d02");
- if (offset > 0)
- str = String.Concat ("+", str);
- } else if (num == 2) {
- int offhour = utcoffset.Hours;
- int offminute = utcoffset.Minutes;
- str = offhour.ToString ("d02");
- str = String.Concat (str, dfi.TimeSeparator);
- str = String.Concat (str, offminute.ToString ("d02"));
- if (offhour > 0)
- str = String.Concat ("+", str);
- num = 2;
- }
- break;
- case ':':
- str = dfi.TimeSeparator;
- num = 0;
- break;
- case '/':
- str = dfi.DateSeparator;
- num = 0;
- break;
- default:
- str = String.Concat (chars [pos]);
- num = 0;
- break;
- }
-
- result = String.Concat (result, str);
-
- pos += num + 1;
- num = 0;
- }
-
- return result;
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- DateTimeFormatInfo dfi = DateTimeFormatInfo.GetInstance(fp);
-
- if (format == null)
- format = dfi.FullDateTimePattern;
-
- bool useutc = false;
-
- if (format.Length == 1) {
- char fchar = (format.ToCharArray ())[0];
- format = _GetStandardPattern (fchar, dfi, out useutc);
- }
-
- if (useutc)
- return this.ToUniversalTime ()._ToString (format, dfi);
- else
- return this._ToString (format, dfi);
- }
-
- public DateTime ToLocalTime()
- {
- TimeZone tz = TimeZone.CurrentTimeZone;
-
- TimeSpan offset = tz.GetUtcOffset (this);
-
- return new DateTime (true, ticks + offset);
- }
-
- public DateTime ToUniversalTime()
- {
- TimeZone tz = TimeZone.CurrentTimeZone;
-
- TimeSpan offset = tz.GetUtcOffset (this);
-
- return new DateTime (true, ticks - offset);
- }
-
- /* OPERATORS */
-
- public static DateTime operator +(DateTime d, TimeSpan t)
- {
- return new DateTime (true, d.ticks + t);
- }
-
- public static bool operator ==(DateTime d1, DateTime d2)
- {
- return (d1.ticks == d2.ticks);
- }
-
- public static bool operator >(DateTime t1,DateTime t2)
- {
- return (t1.ticks > t2.ticks);
- }
-
- public static bool operator >=(DateTime t1,DateTime t2)
- {
- return (t1.ticks >= t2.ticks);
- }
-
- public static bool operator !=(DateTime d1, DateTime d2)
- {
- return (d1.ticks != d2.ticks);
- }
-
- public static bool operator <(DateTime t1, DateTime t2)
- {
- return (t1.ticks < t2.ticks );
- }
-
- public static bool operator <=(DateTime t1,DateTime t2)
- {
- return (t1.ticks <= t2.ticks);
- }
-
- public static TimeSpan operator -(DateTime d1,DateTime d2)
- {
- return new TimeSpan((d1.ticks - d2.ticks).Ticks);
- }
-
- public static DateTime operator -(DateTime d,TimeSpan t)
- {
- return new DateTime (true, d.ticks - t);
- }
-
- public bool ToBoolean(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public byte ToByte(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public char ToChar(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- // TODO Implement me
- [MonoTODO]
- public System.DateTime ToDateTime(IFormatProvider provider)
- {
- return new System.DateTime(true,this.ticks);
- }
-
- public decimal ToDecimal(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public double ToDouble(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public Int16 ToInt16(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public Int32 ToInt32(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public Int64 ToInt64(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- public SByte ToSByte(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public Single ToSingle(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public object ToType(Type conversionType,IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- UInt16 System.IConvertible.ToUInt16(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- public UInt32 ToUInt32(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- public UInt64 ToUInt64(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
- }
-}
-
-namespace System
-{
- public enum DayOfWeek
- {
- Sunday,
- Monday,
- Tuesday,
- Wednesday,
- Thursday,
- Friday,
- Saturday
- }
-}
diff --git a/mcs/class/corlib/System/Decimal.cs b/mcs/class/corlib/System/Decimal.cs
deleted file mode 100644
index d1b9c28a2a6..00000000000
--- a/mcs/class/corlib/System/Decimal.cs
+++ /dev/null
@@ -1,1026 +0,0 @@
-//
-// System.Decimal.cs
-//
-// Represents a floating-point decimal data type with up to 29
-// significant digits, suitable for financial and commercial calculations.
-//
-// Author:
-// Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) 2001 Martin Weindel
-//
-
-using System;
-using System.Globalization;
-using System.Text;
-using System.Runtime.CompilerServices;
-#if MSTEST
-using System.Runtime.InteropServices;
-#endif
-
-
-namespace System
-{
- /// <summary>
- /// Represents a floating-point decimal data type with up to 29 significant
- /// digits, suitable for financial and commercial calculations
- /// </summary>
- public struct Decimal: IComparable, IFormattable
- {
- public static readonly Decimal MinValue = new Decimal(-1, -1, -1, true, 0);
- public static readonly Decimal MaxValue = new Decimal(-1, -1, -1, false, 0);
- public static readonly Decimal MinusOne = new Decimal(1, 0, 0, true, 0);
- public static readonly Decimal One = new Decimal(1, 0, 0, false, 0);
- public static readonly Decimal Zero = new Decimal(0, 0, 0, false, 0);
-
- // maximal decimal value as double
- private static readonly double dDecMaxValue = 7.922816251426433759354395033e28;
- // epsilon decimal value as double
- private static readonly double dDecEpsilon = 0.5e-28; // == 0.5 * 1 / 10^28
-
- // some constants
- private const int DECIMAL_DIVIDE_BY_ZERO = 5;
- private const uint MAX_SCALE = 28;
- private const int iMAX_SCALE = 28;
- private const uint SIGN_FLAG = 0x80000000;
- private const uint SCALE_MASK = 0x00FF0000;
- private const int SCALE_SHIFT = 16;
- private const uint RESERVED_SS32_BITS = 0x7F00FFFF;
-
- // internal representation of decimal
- private uint ss32;
- private uint hi32;
- private uint lo32;
- private uint mid32;
-
- // LAMESPEC: this constructor is missing in specification
- // but exists in MS Csharp implementation
- public Decimal(int lo, int mid, int hi, bool isNegative, byte scale)
- {
- unchecked
- {
- lo32 = (uint) lo;
- mid32 = (uint) mid;
- hi32 = (uint) hi;
-
- if (scale > MAX_SCALE)
- {
- throw new ArgumentOutOfRangeException (Locale.GetText ("scale must be between 0 and 28"));
- }
-
- ss32 = scale;
- ss32 <<= SCALE_SHIFT;
- if (isNegative) ss32 |= SIGN_FLAG;
- }
- }
-
- public Decimal(int val)
- {
- unchecked
- {
- hi32 = mid32 = 0;
- if (val < 0)
- {
- ss32 = SIGN_FLAG;
- lo32 = ((uint)~val) + 1;
- }
- else
- {
- ss32 = 0;
- lo32 = (uint) val;
- }
- }
- }
-
- [CLSCompliant(false)]
- public Decimal(uint val)
- {
- lo32 = val;
- ss32 = hi32 = mid32 = 0;
- }
-
- public Decimal(long val)
- {
- unchecked
- {
- hi32 = 0;
- if (val < 0)
- {
- ss32 = SIGN_FLAG;
- ulong u = ((ulong)~val) + 1;
- lo32 = (uint)u;
- mid32 = (uint)(u >> 32);
- }
- else
- {
- ss32 = 0;
- ulong u = (ulong)val;
- lo32 = (uint)u;
- mid32 = (uint)(u >> 32);
- }
- }
- }
-
- [CLSCompliant(false)]
- public Decimal(ulong uval)
- {
- unchecked
- {
- ss32 = hi32 = 0;
- lo32 = (uint)uval;
- mid32 = (uint)(uval >> 32);
- }
- }
-
- public Decimal(float val)
- {
- if (double2decimal(out this, val, 7) != 0)
- {
- throw new OverflowException();
- }
- }
-
- public Decimal(double val)
- {
- if (double2decimal(out this, val, 15) != 0)
- {
- throw new OverflowException();
- }
- }
-
- public Decimal(int[] bits)
- {
- if (bits == null)
- {
- throw new ArgumentNullException(Locale.GetText ("Bits is a null reference"));
- }
-
- if (bits.GetLength(0) != 4)
- {
- throw new ArgumentException(Locale.GetText ("bits does not contain four values"));
- }
-
- unchecked {
- lo32 = (uint) bits[0];
- mid32 = (uint) bits[1];
- hi32 = (uint) bits[2];
- ss32 = (uint) bits[3];
- byte scale = (byte)(ss32 >> SCALE_SHIFT);
- if (scale > MAX_SCALE || (ss32 & RESERVED_SS32_BITS) != 0)
- {
- throw new ArgumentException(Locale.GetText ("Invalid bits[3]"));
- }
- }
- }
-
- public static int[] GetBits(Decimal d)
- {
- unchecked
- {
- return new int[] { (int)d.lo32, (int)d.mid32, (int)d.hi32,
- (int)d.ss32 };
- }
- }
-
- public static Decimal Negate(Decimal d)
- {
- d.ss32 ^= SIGN_FLAG;
- return d;
- }
-
-
- public static Decimal Add(Decimal d1, Decimal d2)
- {
- if (decimalIncr(ref d1, ref d2) == 0)
- return d1;
- else
- throw new OverflowException(Locale.GetText ("Overflow on adding decimal nummber"));
- }
-
- public static Decimal Subtract(Decimal d1, Decimal d2)
- {
- d2.ss32 ^= SIGN_FLAG;
- if (decimalIncr(ref d1, ref d2) == 0)
- return d1;
- else
- throw new OverflowException(Locale.GetText ("Overflow on subtracting decimal nummbers"));
- }
-
- public override int GetHashCode()
- {
- return (int)lo32;
- }
-
- public static Decimal operator +(Decimal d1, Decimal d2)
- {
- return Add(d1, d2);
- }
-
- public static Decimal operator --(Decimal d)
- {
- return Add(d, MinusOne);
- }
-
- public static Decimal operator ++(Decimal d)
- {
- return Add(d, One);
- }
-
- public static Decimal operator -(Decimal d1, Decimal d2)
- {
- return Subtract(d1, d2);
- }
-
- public static Decimal operator -(Decimal d)
- {
- return Negate(d);
- }
-
- public static Decimal operator +(Decimal d)
- {
- return d;
- }
-
- public static Decimal operator *(Decimal d1, Decimal d2)
- {
- return Multiply(d1, d2);
- }
-
- public static Decimal operator /(Decimal d1, Decimal d2)
- {
- return Divide(d1, d2);
- }
-
- public static Decimal operator %(Decimal d1, Decimal d2)
- {
- return Remainder(d1, d2);
- }
-
- public static explicit operator byte(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > Byte.MaxValue || result < Byte.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (byte) result;
- }
-
- [CLSCompliant(false)]
- public static explicit operator sbyte(Decimal val)
- {
- long result;
-
- if (decimal2Int64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > SByte.MaxValue || result < SByte.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (sbyte) result;
- }
-
- public static explicit operator char(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > Char.MaxValue || result < Char.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (char) result;
- }
-
- public static explicit operator short(Decimal val)
- {
- long result;
-
- if (decimal2Int64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > Int16.MaxValue || result < Int16.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (short) result;
- }
-
- [CLSCompliant(false)]
- public static explicit operator ushort(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > UInt16.MaxValue || result < UInt16.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (ushort) result;
- }
-
- public static explicit operator int(Decimal val)
- {
- long result;
-
- if (decimal2Int64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > Int32.MaxValue || result < Int32.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (int) result;
- }
-
- [CLSCompliant(false)]
- public static explicit operator uint(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > UInt32.MaxValue || result < UInt32.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (uint) result;
- }
-
- public static explicit operator long(Decimal val)
- {
- long result;
-
- if (decimal2Int64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- return result;
- }
-
- [CLSCompliant(false)]
- public static explicit operator ulong(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- return result;
- }
-
- public static implicit operator Decimal(byte val)
- {
- return new Decimal(val);
- }
-
- [CLSCompliant(false)]
- public static implicit operator Decimal(sbyte val)
- {
- return new Decimal(val);
- }
-
- public static implicit operator Decimal(short val)
- {
- return new Decimal(val);
- }
-
- [CLSCompliant(false)]
- public static implicit operator Decimal(ushort val)
- {
- return new Decimal(val);
- }
-
- public static implicit operator Decimal(char val)
- {
- return new Decimal(val);
- }
-
- public static implicit operator Decimal(int val)
- {
- return new Decimal(val);
- }
-
- [CLSCompliant(false)]
- public static implicit operator Decimal(uint val)
- {
- return new Decimal(val);
- }
-
- public static implicit operator Decimal(long val)
- {
- return new Decimal(val);
- }
-
- [CLSCompliant(false)]
- public static implicit operator Decimal(ulong val)
- {
- return new Decimal(val);
- }
-
- public static explicit operator Decimal(float val)
- {
- return new Decimal(val);
- }
-
- public static explicit operator Decimal(double val)
- {
- return new Decimal(val);
- }
-
- public static explicit operator float(Decimal val)
- {
- return (float) (double) val;
- }
-
- public static explicit operator double(Decimal val)
- {
- return decimal2double(ref val);
- }
-
-
- public static bool operator !=(Decimal d1, Decimal d2)
- {
- return !Equals(d1, d2);
- }
-
- public static bool operator ==(Decimal d1, Decimal d2)
- {
- return Equals(d1, d2);
- }
-
- public static bool operator >(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) > 0;
- }
-
- public static bool operator >=(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) >= 0;
- }
-
- public static bool operator <(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) < 0;
- }
-
- public static bool operator <=(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) <= 0;
- }
-
- public static bool Equals(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) == 0;
- }
-
- public override bool Equals(object o)
- {
- if (!(o is Decimal))
- return false;
-
- return Equals((Decimal) o, this);
- }
-
- public static Decimal Floor(Decimal d)
- {
- decimalFloorAndTrunc(ref d, 1);
- return d;
- }
-
- public static Decimal Truncate(Decimal d)
- {
- decimalFloorAndTrunc(ref d, 0);
- return d;
- }
-
- public static Decimal Round(Decimal d, int decimals)
- {
- if (decimals < 0 || decimals > iMAX_SCALE)
- {
- throw new ArgumentOutOfRangeException(Locale.GetText ("decimals must be between 0 and 28"));
- }
-
- decimalRound(ref d, decimals);
- return d;
- }
-
- public static Decimal Multiply(Decimal d1, Decimal d2)
- {
- if (decimalMult(ref d1, ref d2) != 0)
- {
- throw new OverflowException();
- }
-
- return d1;
- }
-
- public static Decimal Divide(Decimal d1, Decimal d2)
- {
- Decimal d3;
- int rc = decimalDiv(out d3, ref d1, ref d2);
-
- if (rc != 0)
- {
- if (rc == DECIMAL_DIVIDE_BY_ZERO)
- throw new DivideByZeroException();
- else
- throw new OverflowException();
- }
-
- return d3;
- }
-
- public static Decimal Remainder(Decimal d1, Decimal d2)
- {
- Decimal d3;
- int rc = decimalIntDiv(out d3, ref d1, ref d2);
-
- if (rc != 0)
- {
- if (rc == DECIMAL_DIVIDE_BY_ZERO)
- throw new DivideByZeroException();
- else
- throw new OverflowException();
- }
-
- return d1 - d3 * d2;
- }
-
- public static int Compare(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2);
- }
-
- public int CompareTo(object val)
- {
- if (val == null)
- return 1;
-
- if (!(val is Decimal))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Decimal"));
-
- Decimal d2 = (Decimal)val;
- return decimalCompare(ref this, ref d2);
- }
-
- public static Decimal Parse(string s)
- {
- return Parse(s, NumberStyles.Number, null);
- }
-
- public static Decimal Parse(string s, NumberStyles style)
- {
- return Parse(s, style, null);
- }
-
- public static Decimal Parse(string s, IFormatProvider provider)
- {
- return Parse(s, NumberStyles.Number, provider);
- }
-
- private static NumberFormatInfo GetNumberFormatInfoFromIFormatProvider(IFormatProvider provider)
- {
- NumberFormatInfo nfi = null;
-
- if (provider != null)
- {
- nfi = (NumberFormatInfo) provider.GetFormat(typeof(System.Decimal));
- if (nfi == null && provider is NumberFormatInfo)
- {
- nfi = (NumberFormatInfo) provider;
- }
- }
-
- if (nfi == null)
- {
- nfi = NumberFormatInfo.CurrentInfo;
- }
-
- return nfi;
- }
-
- private static string stripStyles(string s, NumberStyles style, NumberFormatInfo nfi,
- out int decPos, out bool isNegative, out bool expFlag, out int exp)
- {
- string invalidChar = Locale.GetText ("Invalid character at position ");
- string invalidExponent = Locale.GetText ("Invalid exponent");
- isNegative = false;
- expFlag = false;
- exp = 0;
- decPos = -1;
-
- bool hasSign = false;
- bool hasOpeningParentheses = false;
- bool hasDecimalPoint = false;
- bool allowedLeadingWhiteSpace = ((style & NumberStyles.AllowLeadingWhite) != 0);
- bool allowedTrailingWhiteSpace = ((style & NumberStyles.AllowTrailingWhite) != 0);
- bool allowedLeadingSign = ((style & NumberStyles.AllowLeadingSign) != 0);
- bool allowedTrailingSign = ((style & NumberStyles.AllowTrailingSign) != 0);
- bool allowedParentheses = ((style & NumberStyles.AllowParentheses) != 0);
- bool allowedThousands = ((style & NumberStyles.AllowThousands) != 0);
- bool allowedDecimalPoint = ((style & NumberStyles.AllowDecimalPoint) != 0);
- bool allowedExponent = ((style & NumberStyles.AllowExponent) != 0);
-
- /* get rid of currency symbol */
- bool hasCurrency = false;
- if ((style & NumberStyles.AllowCurrencySymbol) != 0)
- {
- int index = s.IndexOf(nfi.CurrencySymbol);
- if (index >= 0)
- {
- s = s.Remove(index, nfi.CurrencySymbol.Length);
- hasCurrency = true;
- }
- }
-
- string decimalSep = (hasCurrency) ? nfi.CurrencyDecimalSeparator : nfi.NumberDecimalSeparator;
- string groupSep = (hasCurrency) ? nfi.CurrencyGroupSeparator : nfi.NumberGroupSeparator;
-
- int pos = 0;
- int len = s.Length;
-
- StringBuilder sb = new StringBuilder(len);
-
- // leading
- while (pos < len)
- {
- char ch = s[pos];
- if (Char.IsDigit(ch))
- {
- break; // end of leading
- }
- else if (allowedLeadingWhiteSpace && Char.IsWhiteSpace(ch))
- {
- pos++;
- }
- else if (allowedParentheses && ch == '(' && !hasSign && !hasOpeningParentheses)
- {
- hasOpeningParentheses = true;
- hasSign = true;
- isNegative = true;
- pos++;
- }
- else if (allowedLeadingSign && ch == nfi.NegativeSign[0] && !hasSign)
- {
- int slen = nfi.NegativeSign.Length;
- if (slen == 1 || s.IndexOf(nfi.NegativeSign, pos, slen) == pos)
- {
- hasSign = true;
- isNegative = true;
- pos += slen;
- }
- }
- else if (allowedLeadingSign && ch == nfi.PositiveSign[0] && !hasSign)
- {
- int slen = nfi.PositiveSign.Length;
- if (slen == 1 || s.IndexOf(nfi.PositiveSign, pos, slen) == pos)
- {
- hasSign = true;
- pos += slen;
- }
- }
- else if (allowedDecimalPoint && ch == decimalSep[0])
- {
- int slen = decimalSep.Length;
- if (slen != 1 && s.IndexOf(decimalSep, pos, slen) != pos)
- {
- throw new FormatException(invalidChar + pos);
- }
- break;
- }
- else
- {
- throw new FormatException(invalidChar + pos);
- }
- }
-
- if (pos == len)
- throw new FormatException(Locale.GetText ("No digits found"));
-
- // digits
- while (pos < len)
- {
- char ch = s[pos];
- if (Char.IsDigit(ch))
- {
- sb.Append(ch);
- pos++;
- }
- else if (allowedThousands && ch == groupSep[0])
- {
- int slen = groupSep.Length;
- if (slen != 1 && s.IndexOf(groupSep, pos, slen) != pos)
- {
- throw new FormatException(invalidChar + pos);
- }
- pos += slen;
- }
- else if (allowedDecimalPoint && ch == decimalSep[0] && !hasDecimalPoint)
- {
- int slen = decimalSep.Length;
- if (slen == 1 || s.IndexOf(decimalSep, pos, slen) == pos)
- {
- decPos = sb.Length;
- hasDecimalPoint = true;
- pos += slen;
- }
- }
- else
- {
- break;
- }
- }
-
- // exponent
- if (pos < len)
- {
- char ch = s[pos];
- if (allowedExponent && Char.ToUpper(ch) == 'E')
- {
- expFlag = true;
- pos++; if (pos >= len) throw new FormatException(invalidExponent);
- ch = s[pos];
- bool isNegativeExp = false;
- if (ch == nfi.PositiveSign[0])
- {
- int slen = nfi.PositiveSign.Length;
- if (slen == 1 || s.IndexOf(nfi.PositiveSign, pos, slen) == pos)
- {
- pos += slen; if (pos >= len) throw new FormatException(invalidExponent);
- }
- }
- else if (ch == nfi.NegativeSign[0])
- {
- int slen = nfi.NegativeSign.Length;
- if (slen == 1 || s.IndexOf(nfi.NegativeSign, pos, slen) == pos)
- {
- pos += slen; if (pos >= len) throw new FormatException(invalidExponent);
- isNegativeExp = true;
- }
- }
- ch = s[pos];
- if (!Char.IsDigit(ch)) throw new FormatException(invalidExponent);
- exp = ch - '0';
- pos++;
- while (pos < len && Char.IsDigit(s[pos]))
- {
- exp *= 10;
- exp += s[pos] - '0';
- pos++;
- }
- if (isNegativeExp) exp *= -1;
- }
- }
-
- // trailing
- while (pos < len)
- {
- char ch = s[pos];
- if (allowedTrailingWhiteSpace && Char.IsWhiteSpace(ch))
- {
- pos++;
- }
- else if (allowedParentheses && ch == ')' && hasOpeningParentheses)
- {
- hasOpeningParentheses = false;
- pos++;
- }
- else if (allowedTrailingSign && ch == nfi.NegativeSign[0] && !hasSign)
- {
- int slen = nfi.NegativeSign.Length;
- if (slen == 1 || s.IndexOf(nfi.NegativeSign, pos, slen) == pos)
- {
- hasSign = true;
- isNegative = true;
- pos += slen;
- }
- }
- else if (allowedTrailingSign && ch == nfi.PositiveSign[0] && !hasSign)
- {
- int slen = nfi.PositiveSign.Length;
- if (slen == 1 || s.IndexOf(nfi.PositiveSign, pos, slen) == pos)
- {
- hasSign = true;
- pos += slen;
- }
- }
- else
- {
- throw new FormatException(invalidChar + pos);
- }
- }
-
- if (hasOpeningParentheses) throw new FormatException (
- Locale.GetText ("Closing Parentheses not found"));
-
- if (!hasDecimalPoint) decPos = sb.Length;
-
- return sb.ToString();
- }
-
- public static Decimal Parse(string s, NumberStyles style, IFormatProvider provider)
- {
- NumberFormatInfo nfi = GetNumberFormatInfoFromIFormatProvider(provider);
-
- if (s == null) throw new ArgumentNullException (Locale.GetText ("string s"));
-
- int iDecPos, exp;
- bool isNegative, expFlag;
- s = stripStyles(s, style, nfi, out iDecPos, out isNegative, out expFlag, out exp);
-
- if (iDecPos < 0)
- throw new Exception (Locale.GetText ("Error in System.Decimal.Parse"));
- uint decPos = (uint) iDecPos;
-
- Decimal d;
- int digits = s.Length;
- int sign = (isNegative) ? 1 : 0;
- if (string2decimal(out d, s, decPos, sign) != 0)
- {
- throw new OverflowException();
- }
-
- if (expFlag)
- {
- if (decimalSetExponent(ref d, exp) != 0)
- throw new OverflowException();
- }
-
- return d;
- }
-
- public string ToString(string format, IFormatProvider provider)
- {
- NumberFormatInfo nfi = GetNumberFormatInfoFromIFormatProvider(provider);
-
- if (format == null) format = "G";
-
- return DecimalFormatter.NumberToString(format, nfi, this);
- }
-
- public override string ToString()
- {
- return ToString("G", null);
- }
-
- public string ToString(string format)
- {
- return ToString(format, null);
- }
-
- public string ToString(IFormatProvider provider)
- {
- return ToString("G", provider);
- }
-
-#if !MSTEST
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimal2UInt64(ref Decimal val,
- out ulong result);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimal2Int64(ref Decimal val,
- out long result);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int double2decimal(out Decimal erg,
- double val, int digits);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalIncr(ref Decimal d1, ref Decimal d2);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern int decimal2string(ref Decimal val,
- int digits, int decimals, char[] bufDigits, int bufSize, out int decPos, out int sign);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern int string2decimal(out Decimal val, String sDigits, uint decPos, int sign);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern int decimalSetExponent(ref Decimal val, int exp);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern double decimal2double(ref Decimal val);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void decimalFloorAndTrunc(ref Decimal val,
- int floorFlag);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void decimalRound(ref Decimal val, int decimals);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalMult(ref Decimal pd1, ref Decimal pd2);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalDiv(out Decimal pc, ref Decimal pa, ref Decimal pb);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalIntDiv(out Decimal pc, ref Decimal pa, ref Decimal pb);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalCompare(ref Decimal d1, ref Decimal d2);
-#else
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimal2UInt64")]
- private static extern int decimal2UInt64(ref Decimal val,
- out ulong result);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimal2Int64")]
- private static extern int decimal2Int64(ref Decimal val,
- out long result);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="double2decimal")]
- private static extern int double2decimal(out Decimal erg,
- double val, int digits);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalIncr")]
- private static extern int decimalIncr(ref Decimal d1, ref Decimal d2);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimal2string")]
- internal static extern int decimal2string(ref Decimal val,
- int digits, int decimals,
- [MarshalAs(UnmanagedType.LPWStr)]StringBuilder bufDigits,
- int bufSize, out int decPos, out int sign);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="string2decimal")]
- internal static extern int string2decimal(out Decimal val,
- [MarshalAs(UnmanagedType.LPWStr)]String sDigits,
- uint decPos, int sign);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalSetExponent")]
- internal static extern int decimalSetExponent(ref Decimal val, int exp);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimal2double")]
- private static extern double decimal2double(ref Decimal val);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalFloorAndTrunc")]
- private static extern void decimalFloorAndTrunc(ref Decimal val,
- int floorFlag);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalRound")]
- private static extern void decimalRound(ref Decimal val, int decimals);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalMult")]
- private static extern int decimalMult(ref Decimal pd1, ref Decimal pd2);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalDiv")]
- private static extern int decimalDiv(out Decimal pc, ref Decimal pa, ref Decimal pb);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalIntDiv")]
- private static extern int decimalIntDiv(out Decimal pc, ref Decimal pa, ref Decimal pb);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalCompare")]
- private static extern int decimalCompare(ref Decimal d1, ref Decimal d2);
-
-#endif
- }
-}
diff --git a/mcs/class/corlib/System/DecimalFormatter.cs b/mcs/class/corlib/System/DecimalFormatter.cs
deleted file mode 100644
index 2f2d8a7d14e..00000000000
--- a/mcs/class/corlib/System/DecimalFormatter.cs
+++ /dev/null
@@ -1,383 +0,0 @@
-//
-// System.DecimalFormatter.cs
-//
-// Author:
-// Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, Derek Holden dholden@draper.com
-//
-
-//
-// Internal class for formatting decimal numbers.
-
-using System.Globalization;
-using System.Text;
-using S = System; // only used for switching test implementation
-
-namespace System
-{
-
- internal sealed class DecimalFormatter
- {
-
- private static bool ParseFormat (string format, out char specifier, out int precision)
- {
- precision = -1;
- specifier = '\0';
-
- int length = format.Length;
- if (length < 1 || length > 3)
- return false;
-
- char[] chars = format.ToCharArray ();
- specifier = Char.ToUpper(chars[0]);
-
- if (length == 1)
- return true;
-
- if (length == 2)
- {
- if (chars[1] < '0' || chars[1] > '9')
- return false;
-
- precision = chars[1] - '0';
- }
- else
- {
- if (chars[1] < '0' || chars[2] < '0' || chars[1] > '9' || chars[2] > '9')
- return false;
-
- precision = (chars[1] - '0') * 10 + (chars[2] - '0');
- }
-
- return true;
- }
-
- public static string NumberToString(string format, NumberFormatInfo nfi, S.Decimal value)
- {
- char specifier;
- int precision;
- if (!DecimalFormatter.ParseFormat(format, out specifier, out precision))
- {
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
-
- int digits = -1;
- int decimals = 0;
- // first calculate number of digits or decimals needed for format
- switch (specifier)
- {
- case 'C':
- decimals = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- break;
- case 'F': goto case 'N';
- case 'N':
- decimals = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- break;
- case 'G':
- digits = (precision >= 0) ? precision : 0;
- break;
- case 'E':
- digits = (precision >= 0) ? precision+1 : 7;
- break;
- case 'P':
- decimals = (precision >= 0) ? precision+2 : nfi.PercentDecimalDigits+2;
- break;
- case 'Z':
- digits = 0;
- break;
- }
-
- // get digit string
- const int bufSize = 40;
- int decPos = 0, sign = 0;
-#if !MSTEST
- char[] buf = new char[bufSize];
- if (S.Decimal.decimal2string(ref value, digits, decimals, buf, bufSize, out decPos, out sign) != 0)
- {
- throw new FormatException(); // should never happen
- }
-
- StringBuilder sb = new StringBuilder(new String(buf), bufSize);
-#else
- StringBuilder sb = new StringBuilder(bufSize);
- if (S.Decimal.decimal2string(ref value, digits, decimals, sb, bufSize, out decPos, out sign) != 0)
- {
- throw new FormatException(); // should never happen
- }
-#endif
-
- // now build the format
- switch (specifier)
- {
- case 'C': return FormatCurrency(nfi, sb, decimals, decPos, sign);
- case 'N': return FormatNumber(nfi, sb, decimals, decPos, sign);
- case 'F': return FormatFixedPoint(nfi, sb, decimals, decPos, sign);
- case 'G': return FormatGeneral(nfi, sb, digits, decPos, sign, format[0]);
- case 'E': return FormatExponential(nfi, sb, digits, decPos, sign, format[0], true);
- case 'P': return FormatPercent(nfi, sb, decimals, decPos, sign);
- case 'Z': return FormatNormalized(nfi, sb, digits, decPos, sign);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- private static string FormatFixedPoint(NumberFormatInfo nfi, StringBuilder sb,
- int decimals, int decPos, int sign)
- {
- if (decimals > 0)
- {
- sb.Insert((decPos <= 0) ? 1 : decPos, nfi.NumberDecimalSeparator);
- }
-
- if (sign != 0)
- {
- sb.Insert(0, nfi.NegativeSign);
- }
-
- return sb.ToString();
- }
-
- private static string FormatExponential(NumberFormatInfo nfi, StringBuilder sb,
- int digits, int decPos, int sign, char echar, bool exp3flag)
- {
- // insert decimal separator
- if (digits > 1 || (digits == 0 && sb.Length > 1))
- {
- sb.Insert(1, nfi.NumberDecimalSeparator);
- }
-
- // insert sign
- if (sign != 0)
- {
- sb.Insert(0, nfi.NegativeSign);
- }
-
- // append exponent
- sb.Append(echar);
- decPos--;
- sb.Append((decPos >= 0) ? nfi.PositiveSign : nfi.NegativeSign);
- if (decPos < 0) decPos *= -1;
- if (exp3flag) sb.Append('0');
- sb.Append((char)('0' + decPos/10));
- sb.Append((char)('0' + decPos%10));
-
- return sb.ToString();
- }
-
- private static string FormatGeneral(NumberFormatInfo nfi, StringBuilder sb,
- int digits, int decPos, int sign, char gchar)
- {
- int dig = digits;
- bool bFix = (digits == 0 && decPos >= -3) || (digits >= decPos && decPos >= -3 && digits != 0);
-
- // remove trailing digits
- while (sb.Length > 1 && (sb.Length > decPos || !bFix) && sb[sb.Length-1] == '0')
- {
- sb.Remove(sb.Length-1, 1);
- if (dig != 0) dig--;
- }
-
- if (bFix)
- {
- while (decPos <= 0)
- {
- sb.Insert(0, '0');
- if (dig != 0 && decPos != 0) dig++;
- decPos++;
- }
- return FormatFixedPoint(nfi, sb, sb.Length - decPos, decPos, sign);
- }
- else
- {
- return FormatExponential(nfi, sb, dig, decPos, sign, (char)(gchar-2), false);
- }
- }
-
- private static string FormatGroupAndDec(StringBuilder sb, int decimals, int decPos,
- int[] groupSizes, string groupSeparator, string decSeparator)
- {
- int offset = 0;
-
- // Groups
- if (decPos > 0)
- {
- if (groupSizes != null)
- {
- int lastSize = 0;
- int digitCount = 0;
- for (int i = 0; i < groupSizes.GetLength(0); i++)
- {
- int size = groupSizes[i];
- if (size > 0)
- {
- digitCount += size;
- if (digitCount < decPos)
- {
- sb.Insert(decPos - digitCount, groupSeparator);
- offset += groupSeparator.Length;
- }
- }
- lastSize = size;
- }
-
- if (lastSize > 0)
- {
- while (true)
- {
- digitCount +=lastSize;
- if (digitCount >= decPos) break;
- sb.Insert(decPos - digitCount, groupSeparator);
- offset += groupSeparator.Length;
- }
- }
- }
- }
-
- if (decimals > 0)
- {
- sb.Insert(offset + ((decPos <= 0) ? 1 : decPos), decSeparator);
- }
-
- return sb.ToString();
- }
-
- private static string FormatNumber(NumberFormatInfo nfi, StringBuilder sb,
- int decimals, int decPos, int sign)
- {
- string s = FormatGroupAndDec(sb, decimals, decPos,
- nfi.NumberGroupSizes, nfi.NumberGroupSeparator, nfi.NumberDecimalSeparator);
-
- // sign
- if (sign != 0)
- {
- switch (nfi.NumberNegativePattern)
- {
- case 0:
- return "(" + s + ")";
- case 1:
- return nfi.NegativeSign + s;
- case 2:
- return nfi.NegativeSign + " " + s;
- case 3:
- return s + nfi.NegativeSign;
- case 4:
- return s + " " + nfi.NegativeSign;
- default:
- throw new ArgumentException(Locale.GetText ("Invalid NumberNegativePattern"));
- }
- }
- else
- {
- return s;
- }
- }
-
- private static string FormatCurrency(NumberFormatInfo nfi, StringBuilder sb,
- int decimals, int decPos, int sign)
- {
- string s = FormatGroupAndDec(sb, decimals, decPos,
- nfi.CurrencyGroupSizes, nfi.CurrencyGroupSeparator, nfi.CurrencyDecimalSeparator);
-
- if (sign != 0)
- { // negative
- switch (nfi.CurrencyNegativePattern)
- {
- case 0:
- return "(" + nfi.CurrencySymbol + s + ")";
- case 1:
- return nfi.NegativeSign + nfi.CurrencySymbol + s;
- case 2:
- return nfi.CurrencySymbol + nfi.NegativeSign + s;
- case 3:
- return nfi.CurrencySymbol + s + nfi.NegativeSign;
- case 4:
- return "(" + s + nfi.CurrencySymbol + ")";
- case 5:
- return nfi.NegativeSign + s + nfi.CurrencySymbol;
- case 6:
- return s + nfi.NegativeSign + nfi.CurrencySymbol;
- case 7:
- return s + nfi.CurrencySymbol + nfi.NegativeSign;
- case 8:
- return nfi.NegativeSign + s + " " + nfi.CurrencySymbol;
- case 9:
- return nfi.NegativeSign + nfi.CurrencySymbol + " " + s;
- case 10:
- return s + " " + nfi.CurrencySymbol + nfi.NegativeSign;
- case 11:
- return nfi.CurrencySymbol + " " + s + nfi.NegativeSign;
- case 12:
- return nfi.CurrencySymbol + " " + nfi.NegativeSign + s;
- case 13:
- return s + nfi.NegativeSign + " " + nfi.CurrencySymbol;
- case 14:
- return "(" + nfi.CurrencySymbol + " " + s + ")";
- case 15:
- return "(" + s + " " + nfi.CurrencySymbol + ")";
- default:
- throw new ArgumentException(Locale.GetText ("Invalid CurrencyNegativePattern"));
- }
- }
- else
- {
- switch (nfi.CurrencyPositivePattern)
- {
- case 0:
- return nfi.CurrencySymbol + s;
- case 1:
- return s + nfi.CurrencySymbol;
- case 2:
- return nfi.CurrencySymbol + " " + s;
- case 3:
- return s + " " + nfi.CurrencySymbol;
- default:
- throw new ArgumentException(Locale.GetText ("Invalid CurrencyPositivePattern"));
- }
- }
- }
-
- private static string FormatPercent(NumberFormatInfo nfi, StringBuilder sb,
- int decimals, int decPos, int sign)
- {
- string s = FormatGroupAndDec(sb, decimals, decPos+2,
- nfi.PercentGroupSizes, nfi.PercentGroupSeparator, nfi.PercentDecimalSeparator);
-
- if (sign != 0)
- { // negative
- switch (nfi.PercentNegativePattern)
- {
- case 0:
- return nfi.NegativeSign + s + " " + nfi.PercentSymbol;
- case 1:
- return nfi.NegativeSign + s + nfi.PercentSymbol;
- case 2:
- return nfi.NegativeSign + nfi.PercentSymbol + s;
- default:
- throw new ArgumentException(Locale.GetText ("Invalid PercentNegativePattern"));
- }
- }
- else
- {
- switch (nfi.PercentPositivePattern)
- {
- case 0:
- return s + " " + nfi.PercentSymbol;
- case 1:
- return s + nfi.PercentSymbol;
- case 2:
- return nfi.PercentSymbol + s;
- default:
- throw new ArgumentException("Invalid PercentPositivePattern");
- }
- }
- }
-
- private static string FormatNormalized(NumberFormatInfo nfi, StringBuilder sb,
- int digits, int decPos, int sign)
- {
- //LAMESPEC: how should this format look like ? Is this a fixed point format ?
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/corlib/System/Delegate.cs b/mcs/class/corlib/System/Delegate.cs
deleted file mode 100644
index 5b09545376b..00000000000
--- a/mcs/class/corlib/System/Delegate.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// System.Delegate.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [MonoTODO]
- public abstract class Delegate : ICloneable, ISerializable {
- protected Type target_type;
- protected object m_target;
- protected string method;
- protected IntPtr method_ptr;
-
- protected Delegate (object target, string method)
- {
- if (target == null)
- throw new ArgumentNullException (Locale.GetText ("Target object is null"));
-
- if (method == null)
- throw new ArgumentNullException (Locale.GetText ("method name is null"));
-
- this.target_type = null;
- this.method_ptr = IntPtr.Zero;
- this.m_target = target;
- this.method = method;
- }
-
- protected Delegate (Type target_type, string method)
- {
- if (m_target == null)
- throw new ArgumentNullException (Locale.GetText ("Target type is null"));
-
- if (method == null)
- throw new ArgumentNullException (Locale.GetText ("method string is null"));
-
- this.target_type = target_type;
- this.method_ptr = IntPtr.Zero;
- this.m_target = null;
- this.method = method;
- }
-
-#if NOTYET
- public MethodInfo Method {
- get {
- return null;
- }
- }
-#endif
-
- public object Target {
- get {
- return m_target;
- }
- }
-
-
- //
- // Methods
- //
-
- public abstract object Clone ();
-
- public override bool Equals (object o)
- {
- if (!(o is System.Delegate))
- return false;
-
- Delegate d = (Delegate) o;
-
- if ((d.target_type == target_type) &&
- (d.m_target == m_target) &&
- (d.method == method))
- return true;
-
- return false;
- }
-
- public override int GetHashCode ()
- {
- return method.GetHashCode ();
- }
-
- // This is from ISerializable
- [MonoTODO]
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- // TODO: IMPLEMENT ME
- }
-
- public static Delegate Combine (Delegate a, Delegate b)
- {
- if (a == null){
- if (b == null)
- return null;
- return b;
- } else
- if (b == null)
- return a;
-
- if (a.GetType () != b.GetType ())
- throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types"));
-
- return a.CombineImpl (b);
- }
-
- protected virtual Delegate CombineImpl (Delegate d)
- {
- throw new MulticastNotSupportedException ("");
- }
-
- public static Delegate Remove( Delegate source, Delegate value) {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/corlib/System/DivideByZeroException.cs b/mcs/class/corlib/System/DivideByZeroException.cs
deleted file mode 100644
index 2558eafe262..00000000000
--- a/mcs/class/corlib/System/DivideByZeroException.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.DivideByZeroException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-namespace System {
-
- public class DivideByZeroException : ArithmeticException {
- // Constructors
- public DivideByZeroException ()
- : base (Locale.GetText ("Division by zero"))
- {
- }
-
- public DivideByZeroException (string message)
- : base (message)
- {
- }
-
- public DivideByZeroException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/DllNotFoundException.cs b/mcs/class/corlib/System/DllNotFoundException.cs
deleted file mode 100644
index 867953d2773..00000000000
--- a/mcs/class/corlib/System/DllNotFoundException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.DllNotFoundException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class DllNotFoundException : TypeLoadException
- {
- // Constructors
- public DllNotFoundException ()
- : base (Locale.GetText ("DLL not found."))
- {
- }
-
- public DllNotFoundException (string message)
- : base (message)
- {
- }
-
- public DllNotFoundException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public DllNotFoundException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/Double.cs b/mcs/class/corlib/System/Double.cs
deleted file mode 100644
index ae54e62c16b..00000000000
--- a/mcs/class/corlib/System/Double.cs
+++ /dev/null
@@ -1,259 +0,0 @@
-//
-// System.Double.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Bob Smith (bob@thestuff.net)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-// (C) Bob Smith. http://www.thestuff.net
-//
-
-using System.Globalization;
-
-namespace System {
-
- public struct Double : IComparable, IFormattable, IConvertible {
- public const double Epsilon = 4.9406564584124650e-324;
- public const double MaxValue = 1.7976931348623157e308;
- public const double MinValue = -1.7976931348623157e308;
- public const double NaN = 0.0d / 0.0d;
- public const double NegativeInfinity = -1.0d / 0.0d;
- public const double PositiveInfinity = 1.0d / 0.0d;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public double value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Double))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Double"));
-
- return (int) (value - ((double) v));
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Double))
- return false;
-
- return ((double) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int) value;
- }
-
- public static bool IsInfinity (double d)
- {
- return (d == PositiveInfinity || d == NegativeInfinity);
- }
-
- public static bool IsNaN (double d)
- {
- return (d != d);
- }
-
- public static bool IsNegativeInfinity (double d)
- {
- return (d < 0.0d && (d == NegativeInfinity || d == PositiveInfinity));
- }
-
- public static bool IsPositiveInfinity (double d)
- {
- return (d > 0.0d && (d == NegativeInfinity || d == PositiveInfinity));
- }
-
- public static double Parse (string s)
- {
- return Parse (s, (NumberStyles.Float | NumberStyles.AllowThousands), null);
- }
-
- public static double Parse (string s, IFormatProvider fp)
- {
- return Parse (s, (NumberStyles.Float | NumberStyles.AllowThousands), fp);
- }
-
- public static double Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- public static double Parse (string s, NumberStyles style, IFormatProvider provider)
- {
- if (s == null) throw new ArgumentNullException();
- if (style > NumberStyles.Any)
- {
- throw new ArgumentException();
- }
- NumberFormatInfo format = NumberFormatInfo.GetInstance(provider);
- if (format == null) throw new Exception("How did this happen?");
- if (s == format.NaNSymbol) return Double.NaN;
- if (s == format.PositiveInfinitySymbol) return Double.PositiveInfinity;
- if (s == format.NegativeInfinitySymbol) return Double.NegativeInfinity;
- string[] sl;
- long integral = 0;
- long fraction = 0;
- long exponent = 1;
- double retval = 0;
- if ((style & NumberStyles.AllowLeadingWhite) != 0)
- {
- s.TrimStart(null);
- }
- if ((style & NumberStyles.AllowTrailingWhite) != 0)
- {
- s.TrimEnd(null);
- }
- sl = s.Split(new Char[] {'e', 'E'}, 2);
- if (sl.Length > 1)
- {
- if ((style & NumberStyles.AllowExponent) == 0)
- {
- throw new FormatException();
- }
- exponent = long.Parse(sl[1], NumberStyles.AllowLeadingSign, format);
- }
- s = sl[0];
- sl = s.Split(format.NumberDecimalSeparator.ToCharArray(), 2);
- if (sl.Length > 1)
- {
- if ((style & NumberStyles.AllowDecimalPoint) == 0)
- {
- throw new FormatException();
- }
- fraction = long.Parse(sl[1], NumberStyles.None, format);
- }
- NumberStyles tempstyle = NumberStyles.None;
- if ((style & NumberStyles.AllowLeadingSign) != 0){
- tempstyle = NumberStyles.AllowLeadingSign;
- }
- integral = long.Parse(sl[0], tempstyle, format);
- retval = fraction;
- while (retval >1) retval /= 10;
- if (integral < 0){
- retval -= integral;
- retval = -retval;
- }
- else retval += integral;
- if (exponent != 1) retval *= Math.Pow(10, exponent);
- return retval;
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- throw new NotImplementedException ();
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Double;
- }
-
- public object ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType(value, conversionType, provider);
- }
-
- public bool ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean(value);
- }
-
- public byte ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte(value);
- }
-
- public char ToChar (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- public DateTime ToDateTime (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- public decimal ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal(value);
- }
-
- public double ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble(value);
- }
-
- public short ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16(value);
- }
-
- public int ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32(value);
- }
-
- public long ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64(value);
- }
-
- [CLSCompliant(false)]
- public sbyte ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte(value);
- }
-
- public float ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle(value);
- }
-
- string IConvertible.ToString (IFormatProvider provider)
- {
- return ToString(provider);
- }
-
- [CLSCompliant(false)]
- public ushort ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16(value);
- }
-
- [CLSCompliant(false)]
- public uint ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32(value);
- }
-
- [CLSCompliant(false)]
- public ulong ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64(value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/DuplicateWaitObjectException.cs b/mcs/class/corlib/System/DuplicateWaitObjectException.cs
deleted file mode 100644
index 12ed31c86bb..00000000000
--- a/mcs/class/corlib/System/DuplicateWaitObjectException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.DuplicateWaitObjectException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class DuplicateWaitObjectException : ArgumentException {
- // Constructors
- public DuplicateWaitObjectException ()
- : base (Locale.GetText ("Duplicate objects in argument"))
- {
- }
-
- public DuplicateWaitObjectException (string param_name)
- : base (Locale.GetText ("Duplicate objects in argument"), param_name)
- {
- }
-
- public DuplicateWaitObjectException (string param_name, string message)
- : base (message, param_name)
- {
- }
-
- protected DuplicateWaitObjectException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/EntryPointNotFoundException.cs b/mcs/class/corlib/System/EntryPointNotFoundException.cs
deleted file mode 100644
index 672d5261490..00000000000
--- a/mcs/class/corlib/System/EntryPointNotFoundException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.EntryPointNotFoundException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class EntryPointNotFoundException : TypeLoadException
- {
- // Constructors
- public EntryPointNotFoundException ()
- : base (Locale.GetText ("Cannot load class because of missing entry method."))
- {
- }
-
- public EntryPointNotFoundException (string message)
- : base (message)
- {
- }
-
- protected EntryPointNotFoundException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public EntryPointNotFoundException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/Enum.cs b/mcs/class/corlib/System/Enum.cs
deleted file mode 100644
index 0ed2648640e..00000000000
--- a/mcs/class/corlib/System/Enum.cs
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// System.Enum.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
- internal struct MonoEnumInfo {
- internal Type utype;
- internal Array values;
- internal string[] names;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void get_enum_info (Type enumType, out MonoEnumInfo info);
-
- internal static void GetInfo (Type enumType, out MonoEnumInfo info) {
- get_enum_info (enumType, out info);
- Array.Sort (info.values, info.names);
- }
- };
-
- [MonoTODO]
- public abstract class Enum : ValueType, IComparable {
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern object get_value ();
-
- public static Array GetValues (Type enumType) {
- MonoEnumInfo info;
- MonoEnumInfo.GetInfo (enumType, out info);
- return info.values;
- }
-
- public static string[] GetNames (Type enumType) {
- MonoEnumInfo info;
- MonoEnumInfo.GetInfo (enumType, out info);
- return info.names;
- }
-
- public static string GetName (Type enumType, object value) {
- MonoEnumInfo info;
- int i;
- MonoEnumInfo.GetInfo (enumType, out info);
- for (i = 0; i < info.values.Length; ++i) {
- if (value.Equals (info.values.GetValue (i)))
- return info.names [i];
- }
- return null;
- }
-
- public static bool IsDefined (Type enumType, object value) {
- return GetName (enumType, value) != null;
- }
-
- public static Type GetUnderlyingType (Type enumType) {
- MonoEnumInfo info;
- MonoEnumInfo.GetInfo (enumType, out info);
- return info.utype;
- }
-
- public static object Parse (Type enumType, string value)
- {
- return Parse (enumType, value, false);
- }
-
- public static object Parse (Type enumType, string value, bool ignoreCase)
- {
- MonoEnumInfo info;
- int i;
- MonoEnumInfo.GetInfo (enumType, out info);
- for (i = 0; i < info.values.Length; ++i) {
- if (String.Compare (value, info.names [i], ignoreCase) == 0)
- return ToObject (enumType, info.values.GetValue (i));
- }
- throw new ArgumentException ("The rquested value was not found");
- }
-
- /// <summary>
- /// Compares the enum value with another enum value of the same type.
- /// </summary>
- ///
- /// <remarks>
- ///
- int IComparable.CompareTo (object obj)
- {
- if (obj == null)
- return 1;
-
- object value1, value2;
-
- value1 = this.get_value ();
-
- if (obj is Enum)
- value2 = ((Enum)obj).get_value();
- else
- value2 = obj;
-
- return ((IComparable)value1).CompareTo (value2);
- }
-
- public override string ToString ()
- {
- return ToString ("G", null);
- }
-
- public string ToString (IFormatProvider provider)
- {
- return ToString ("G", provider);
- }
-
- public string ToString (String format)
- {
- return ToString (format, null);
- }
-
- public string ToString (String format, IFormatProvider provider)
- {
- // fixme: consider format and provider
- return GetName (this.GetType(), this.get_value ());
- }
-
- public static object ToObject(Type enumType, byte value)
- {
- return ToObject (enumType, (object)value);
- }
-
- public static object ToObject(Type enumType, short value)
- {
- return ToObject (enumType, (object)value);
- }
- public static object ToObject(Type enumType, int value)
- {
- return ToObject (enumType, (object)value);
- }
- public static object ToObject(Type enumType, long value)
- {
- return ToObject (enumType, (object)value);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern object ToObject(Type enumType, object value);
-
- [CLSCompliant(false)]
- public static object ToObject(Type enumType, sbyte value)
- {
- return ToObject (enumType, (object)value);
- }
- [CLSCompliant(false)]
- public static object ToObject(Type enumType, ushort value)
- {
- return ToObject (enumType, (object)value);
- }
- [CLSCompliant(false)]
- public static object ToObject(Type enumType, uint value)
- {
- return ToObject (enumType, (object)value);
- }
- [CLSCompliant(false)]
- public static object ToObject(Type enumType, ulong value)
- {
- return ToObject (enumType, (object)value);
- }
-
- public override bool Equals (object obj)
- {
- if (!(obj is Enum))
- return false;
-
- object v1 = this.get_value ();
- object v2 = ((Enum)obj).get_value ();
-
- return v1.Equals (v2);
- }
-
- public override int GetHashCode ()
- {
- object v = this.get_value ();
- return v.GetHashCode ();
- }
-
- public static string Format (Type enumType, object value, string format)
- {
- // fixme: consider format
- return GetName (enumType, value);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/Environment.cs b/mcs/class/corlib/System/Environment.cs
deleted file mode 100644
index 92a3fdd91f1..00000000000
--- a/mcs/class/corlib/System/Environment.cs
+++ /dev/null
@@ -1,293 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Environment.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Saturday, August 11, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.IO;
-//using System.Diagnostics;
-using System.Collections;
-using System.Security;
-using System.PAL;
-using System.Security.Permissions;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- public sealed class Environment
- {
- private static OpSys _os = Platform.OS;
-
- [MonoTODO]
- public enum SpecialFolder
- { // TODO: Determine if these windoze style folder identifiers
- // have unix/linux counterparts
- ApplicationData,
- CommonApplicationData,
- CommonProgramFiles,
- Cookies,
- DesktopDirectory,
- Favorites,
- History,
- InternetCache,
- LocalApplicationData,
- Personal,
- ProgramFiles,
- Programs,
- Recent,
- SendTo,
- StartMenu,
- Startup,
- System,
- Templates
- }
-
- // TODO: Make sure the security attributes do what I expect
-
- /// <summary>
- /// Gets the command line for this process
- /// </summary>
- [MonoTODO]
- public static string CommandLine
- { // TODO: Coordinate with implementor of EnvironmentPermissionAttribute
- // [EnvironmentPermissionAttribute(SecurityAction.Demand, Read = "COMMANDLINE")]
- get
- {
- return _os.CommandLine;
- }
- }
-
- /// <summary>
- /// Gets or sets the current directory. Actually this is supposed to get
- /// and/or set the process start directory acording to the documentation
- /// but actually test revealed at beta2 it is just Getting/Setting the CurrentDirectory
- /// </summary>
- public static string CurrentDirectory
- {
- // originally it was my thought that the external call would be made in
- // the directory class however that class has additional security requirements
- // so the Directory class will call this class for its get/set current directory
-
- // [EnvironmentPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
- get
- {
- return _os.GetCurrentDirectory();
- }
- [MonoTODO("disabled because of compile error. Need mcs magic.")]
- //[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- set
- {
- _os.SetCurrentDirectory(value);
- }
- }
-
- /// <summary>
- /// Gets or sets the exit code of this process
- /// </summary>
- [MonoTODO]
- public static int ExitCode
- { // TODO: find a way to implement this property
- get
- {
- throw new NotImplementedException ();
- }
- set
- {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// Gets the name of the local computer
- /// </summary>
- public static string MachineName
- {
- get
- {
- return _os.MachineName;
- }
- }
-
- /// <summary>
- /// Gets the standard new line value
- /// </summary>
- public static string NewLine
- {
- get
- {
- return _os.NewLineSequence;
- }
- }
-
- /// <summary>
- /// Gets the current OS version information
- /// </summary>
- public static OperatingSystem OSVersion
- {
- get
- {
- return _os.OSVersion;
- }
- }
-
- /// <summary>
- /// Get StackTrace
- /// </summary>
- public static string StackTrace
- {
- get
- {
- return null;
- }
- }
-
- /// <summary>
- /// Get a fully qualified path to the system directory
- /// </summary>
- public static string SystemDirectory
- {
- get
- {
- return GetFolderPath(SpecialFolder.System);
- }
- }
-
- /// <summary>
- /// Get the number of milliseconds that have elapsed since the system was booted
- /// </summary>
- public static int TickCount
- {
- get
- {
- return 0;
- //return getTickCount();
- }
- }
-
- /// <summary>
- /// Get UserDomainName
- /// </summary>
- public static string UserDomainName
- {
- get
- {
- return null;
- }
- }
-
- /// <summary>
- /// Gets a flag indicating whether the process is in interactive mode
- /// </summary>
- public static bool UserInteractive
- {
- get
- {
- return false;
- }
- }
-
- /// <summary>
- /// Get the user name of current process is running under
- /// </summary>
- [MonoTODO]
- public static string UserName
- {
- get
- {
- // TODO: needs more research/work/thought
- string result = GetEnvironmentVariable("USERNAME");
- if(result == null || result.Equals(string.Empty))
- {
- result = GetEnvironmentVariable("USER");
- }
- return result;
- }
- }
-
- /// <summary>
- /// Get the version of an assembly
- /// </summary>
- public static Version Version
- {
- get
- {
- return null;
- }
- }
-
- /// <summary>
- /// Get the amount of physical memory mapped to process
- /// </summary>
- public static long WorkingSet
- {
- get
- {
- return 0;
- }
- }
-
- public static void Exit(int exitCode)
- {
- }
-
- /// <summary>
- /// Substitute environment variables in the argument "name"
- /// </summary>
- public static string ExpandEnvironmentVariables(string name)
- {
- return name;
- }
-
- /// <summary>
- /// Return an array of the command line arguments of the current process
- /// </summary>
- public static string[] GetCommandLineArgs()
- {
- char[] delimiter = new char[1];
- delimiter[0] = ' ';
- return _os.CommandLine.Split(delimiter);
- }
-
- /// <summary>
- /// Return a string containing the value of the environment
- /// variable identifed by parameter "variable"
- /// </summary>
- public static string GetEnvironmentVariable(string variable)
- {
- return _os.GetEnvironmentVariable(variable);
- }
-
- /// <summary>
- /// Return a set of all environment variables and their values
- /// </summary>
-
- public static IDictionary GetEnvironmentVariables()
- {
- return _os.EnvironmentVariables;
- }
-
- /// <summary>
- /// Returns the fully qualified path of the
- /// folder specified by the "folder" parameter
- /// </summary>
- public static string GetFolderPath(SpecialFolder folder)
- {
- return null;
- }
-
- /// <summary>
- /// Returns an array of the logical drives
- /// </summary>
- public static string[] GetLogicalDrives()
- {
- return null;
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/EventArgs.cs b/mcs/class/corlib/System/EventArgs.cs
deleted file mode 100644
index be0d2be54e9..00000000000
--- a/mcs/class/corlib/System/EventArgs.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.EventArgs.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Mon 07/16/2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace System {
-
- public class EventArgs
- {
- public static readonly EventArgs Empty = new EventArgs();
-
- public EventArgs() { }
- }
-
-} // System
-
-
diff --git a/mcs/class/corlib/System/EventHandler.cs b/mcs/class/corlib/System/EventHandler.cs
deleted file mode 100644
index 407255b604e..00000000000
--- a/mcs/class/corlib/System/EventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.EventHandler.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public delegate void EventHandler (object sender, EventArgs e);
-
-}
-
-
diff --git a/mcs/class/corlib/System/Exception.cs b/mcs/class/corlib/System/Exception.cs
deleted file mode 100644
index 6a70f9f55b0..00000000000
--- a/mcs/class/corlib/System/Exception.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// System.Exception.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Reflection;
-
-namespace System {
-
- [Serializable]
-// [ClassInterface (ClassInterfaceType.AutoDual)] (no implementation yet)
- [MonoTODO]
- public class Exception : ISerializable {
- Exception inner_exception;
- string message;
- string help_link;
- string class_name;
- string stack_trace = "TODO: implement stack traces";
- string remote_stack_trace = "TODO: Implement remote stack trace";
- int remote_stack_index;
- int hresult;
- string source;
-
- public Exception ()
- {
- inner_exception = null;
- message = "";
- }
-
- public Exception (string msg)
- {
- inner_exception = null;
- message = msg;
- }
-
- protected Exception (SerializationInfo info, StreamingContext sc)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- class_name = info.GetString ("ClassName");
- message = info.GetString ("Message");
- inner_exception = (Exception) info.GetValue ("InnerException", typeof (Exception));
- help_link = info.GetString ("HelpURL");
- stack_trace = info.GetString ("StackTraceString");
- remote_stack_trace = info.GetString ("RemoteStackTrace");
- remote_stack_index = info.GetInt32 ("RemoteStackIndex");
- hresult = info.GetInt32 ("HResult");
- source = info.GetString ("Source");
- }
-
- public Exception (string msg, Exception e)
- {
- inner_exception = e;
- message = msg;
- }
-
- public Exception InnerException {
- get {
- return inner_exception;
- }
- }
-
- public virtual string HelpLink {
- get {
- return help_link;
- }
-
- set {
- help_link = value;
- }
- }
-
- protected int HResult {
- get {
- return hresult;
- }
-
- set {
- hresult = value;
- }
- }
-
- public virtual string Message {
- get {
- return message;
- }
- }
-
- [MonoTODO]
- public virtual string Source {
- get {
- // TODO: if source is null, we must return
- // the name of the assembly where the error
- // originated.
- return source;
- }
-
- set {
- source = value;
- }
- }
-
- public virtual string StackTrace {
- get {
- return stack_trace;
- }
- }
-
- [MonoTODO]
- public MethodBase TargetSite {
- get {
- // TODO: Implement this.
- return null;
- }
- }
-
- public virtual Exception GetBaseException ()
- {
- Exception inner = inner_exception;
-
- while (inner != null){
- if (inner.InnerException != null)
- inner = inner.InnerException;
- else
- return inner;
- }
-
- return this;
- }
-
- public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("ClassName", class_name);
- info.AddValue ("Message", message);
- info.AddValue ("InnerException", inner_exception);
- info.AddValue ("HelpURL", help_link);
- info.AddValue ("StackTraceString", stack_trace);
- info.AddValue ("RemoteStackTrace", remote_stack_trace);
- info.AddValue ("RemoteStackIndex", remote_stack_index);
- info.AddValue ("HResult", hresult);
- info.AddValue ("Source", source);
- }
-
- public override string ToString ()
- {
- return this.GetType ().FullName + "\n" +
- message +
- GetBaseException ().GetType ().FullName +
- stack_trace;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System/ExecutionEngineException.cs b/mcs/class/corlib/System/ExecutionEngineException.cs
deleted file mode 100644
index e791864e530..00000000000
--- a/mcs/class/corlib/System/ExecutionEngineException.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.ExecutionEngineException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-namespace System {
-
- public sealed class ExecutionEngineException : SystemException {
- // Constructors
- public ExecutionEngineException ()
- : base (Locale.GetText ("Internal error occurred")) // Haha. Nice.
- {
- }
-
- public ExecutionEngineException (string message)
- : base (message)
- {
- }
-
- public ExecutionEngineException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/FieldAccessException.cs b/mcs/class/corlib/System/FieldAccessException.cs
deleted file mode 100644
index 53b389ec526..00000000000
--- a/mcs/class/corlib/System/FieldAccessException.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.FieldAccessException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class FieldAccessException : SystemException
- {
- // Constructors
- public FieldAccessException ()
- : base (Locale.GetText ("Attempt to access a private/protected field failed."))
- {
- }
-
- public FieldAccessException (string message)
- : base (message)
- {
- }
-
- public FieldAccessException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public FieldAccessException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/FlagsAttribute.cs b/mcs/class/corlib/System/FlagsAttribute.cs
deleted file mode 100755
index 91cc4581bc6..00000000000
--- a/mcs/class/corlib/System/FlagsAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.FlagsAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// The FlagsAttribute tags enumerations as bitfields.
- /// </summary>
- ///
- /// <remarks>
- /// The FlagsAttribute can be used to tag an enumeration to be
- /// a bit field. This will allow the compiler and visual tools
- /// to treat the bits in an enumeration as a set of flags.
- /// </remarks>
-
- [AttributeUsage (AttributeTargets.Enum)]
- public class FlagsAttribute : Attribute {
-
- // No methods.
-
- }
-}
diff --git a/mcs/class/corlib/System/FormatException.cs b/mcs/class/corlib/System/FormatException.cs
deleted file mode 100644
index e2557f26564..00000000000
--- a/mcs/class/corlib/System/FormatException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.FormatException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class FormatException : SystemException {
- // Constructors
- public FormatException ()
- : base (Locale.GetText ("Invalid format"))
- {
- }
-
- public FormatException (string message)
- : base (message)
- {
- }
-
- public FormatException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public FormatException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/GC.cs b/mcs/class/corlib/System/GC.cs
deleted file mode 100755
index 90e7cb0c4dd..00000000000
--- a/mcs/class/corlib/System/GC.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-//
-// System/GC.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System {
- public sealed class GC {
-
- public static void SuppressFinalize (object obj)
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/Guid.cs b/mcs/class/corlib/System/Guid.cs
deleted file mode 100755
index 7dcd8e85777..00000000000
--- a/mcs/class/corlib/System/Guid.cs
+++ /dev/null
@@ -1,627 +0,0 @@
-//
-// System.Guid
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using System.Globalization;
-using System.Security.Cryptography;
-
-namespace System {
-
-public struct Guid : IFormattable, IComparable {
-
- private uint _timeLow;
- private ushort _timeMid;
- private ushort _timeHighAndVersion;
- private byte _clockSeqHiAndReserved;
- private byte _clockSeqLow;
- private byte _node0;
- private byte _node1;
- private byte _node2;
- private byte _node3;
- private byte _node4;
- private byte _node5;
-
- internal class GuidState {
- protected Random _prnd; // Pseudo RNG
- protected RandomNumberGenerator _rnd; // Strong RNG
- protected bool _usePRnd; // 'true' for pseudo RNG
- protected ushort _clockSeq;
- protected ulong _lastTimestamp;
- protected byte[] _mac;
-
- public int NextInt(uint x) {
- if (_usePRnd) {
- return _prnd.Next ((int) x);
- }
- else {
- byte[] b = new byte[4];
- _rnd.GetBytes (b);
-
- uint res = BitConverter.ToUInt32 (b, 0);
- res = (res % x);
- return (int) res;
- }
- }
-
- public void NextBytes(byte[] b) {
- if ( _usePRnd ) {
- _prnd . NextBytes (b);
- }
- else {
- _rnd . GetBytes (b);
- }
- }
-
- [MonoTODO("Get real MAC address")]
- public GuidState (bool usePRnd) {
- _usePRnd = usePRnd;
- if ( _usePRnd ) {
- _prnd = new Random(unchecked((int) DateTime.Now.Ticks));
- }
- else {
- _rnd = RandomNumberGenerator.Create ();
- }
- _clockSeq = (ushort) NextInt (0x4000); // 14 bits
- _lastTimestamp = 0ul;
- _mac = new byte[6];
- NextBytes (_mac);
- _mac[0] |= 0x80;
- }
-
- public ulong NewTimestamp () {
- ulong timestamp;
-
- do {
- timestamp = (ulong) (DateTime.UtcNow - new DateTime(1582, 10, 15, 0, 0, 0)).Ticks;
- if (timestamp < _lastTimestamp) {
- // clock moved backwards!
- _clockSeq++;
- _clockSeq = (ushort) (_clockSeq & 0x3fff);
- return timestamp;
- }
- if (timestamp > _lastTimestamp) {
- _lastTimestamp = timestamp;
- return timestamp;
- }
- }
- while (true);
- }
-
- public ushort ClockSeq {
- get {
- return _clockSeq;
- }
- }
-
- public byte[] MAC {
- get {
- return _mac;
- }
-
- }
-
- };
-
- internal class GuidParser {
-
- private string _src;
- private int _length;
- private int _cur;
-
- public GuidParser (string src) {
- _src = src;
- Reset ();
- }
-
- private void Reset () {
- _cur = 0;
- _length = _src.Length;
- }
-
- private bool AtEnd () {
- return _cur >= _length;
- }
-
- private void ThrowFormatException () {
- throw new FormatException (Locale.GetText ("Invalid format for Guid.Guid(string)"));
- }
-
- private ulong ParseHex(int length, bool strictLength)
- {
- ulong res = 0;
- int i;
- bool end = false;
-
- for (i=0; (!end) && i<length; ++i) {
- if (AtEnd ()) {
- if (strictLength || i==0) {
- ThrowFormatException ();
- }
- else {
- end = true;
- }
- }
- else {
- char c = Char.ToLower (_src[_cur]);
- if (Char.IsDigit (c)) {
- res = res * 16 + c - '0';
- _cur++;
- }
- else if (c >= 'a' && c <= 'f') {
- res = res * 16 + c - 'a' + 10;
- _cur++;
- }
- else {
- if (strictLength || i==0) {
- ThrowFormatException ();
- }
- else {
- end = true;
- }
- }
- }
- }
-
- return res;
- }
-
- private bool ParseOptChar (char c) {
- if (!AtEnd() && _src[_cur] == c) {
- _cur++;
- return true;
- }
- else {
- return false;
- }
- }
-
- private void ParseChar (char c) {
- bool b = ParseOptChar (c);
- if (!b) {
- ThrowFormatException ();
- }
- }
-
- private Guid ParseGuid1 () {
- bool openBrace;
- int a;
- short b;
- short c;
- byte[] d = new byte[8];
- int i;
-
- openBrace = ParseOptChar ('{');
- a = (int) ParseHex(8, true);
- ParseChar('-');
- b = (short) ParseHex(4, true);
- ParseChar('-');
- c = (short) ParseHex(4, true);
- ParseChar('-');
- for (i=0; i<8; ++i) {
- d[i] = (byte) ParseHex(2, true);
- if (i == 1) {
- ParseChar('-');
- }
- }
-
- if (openBrace && !ParseOptChar('}')) {
- ThrowFormatException ();
- }
-
- return new Guid(a, b, c, d);
- }
-
- private void ParseHexPrefix () {
- ParseChar ('0');
- ParseChar ('x');
- }
-
- private Guid ParseGuid2 ()
- {
- int a;
- short b;
- short c;
- byte[] d = new byte[8];
- int i;
-
- ParseChar ('{');
- ParseHexPrefix ();
- a = (int) ParseHex (8, false);
- ParseChar (',');
- ParseHexPrefix ();
- b = (short) ParseHex (4, false);
- ParseChar (',');
- ParseHexPrefix ();
- c = (short) ParseHex (4, false);
- ParseChar (',');
- ParseChar ('{');
- for (i=0; i<8; ++i) {
- ParseHexPrefix ();
- d[i] = (byte) ParseHex (2, false);
- if (i != 7) {
- ParseChar(',');
- }
-
- }
- ParseChar ('}');
- ParseChar ('}');
-
- return new Guid (a,b,c,d);
-
- }
-
- public Guid Parse ()
- {
- Guid g;
-
- try {
- g = ParseGuid1 ();
- }
- catch (FormatException) {
- Reset ();
- g = ParseGuid2 ();
- }
- if (!AtEnd () ) {
- ThrowFormatException ();
- }
- return g;
- }
-
- }
-
- private static GuidState _guidState = new GuidState ( true /* use pseudo RNG? */ );
-
- private static void CheckNull (object o) {
- if (o == null) {
- throw new ArgumentNullException (Locale.GetText ("Value cannot be null."));
- }
- }
-
- private static void CheckLength (byte[] o, int l)
- {
- if (o . Length != l) {
- throw new ArgumentException (String.Format(Locale.GetText ("Array should be exactly {0} bytes long."), l));
- }
- }
-
- private static void CheckArray (byte[] o, int l) {
- CheckNull (o);
- CheckLength (o, l);
- }
-
- public Guid (byte[] b) {
- CheckArray (b, 16);
- _timeLow = System.BitConverter.ToUInt32 (b, 0);
- _timeMid = System.BitConverter.ToUInt16 (b, 4);
- _timeHighAndVersion = System.BitConverter.ToUInt16 (b, 6);
- _clockSeqHiAndReserved = b[8];
- _clockSeqLow = b[9];
- _node0 = b[10];
- _node1 = b[11];
- _node2 = b[12];
- _node3 = b[13];
- _node4 = b[14];
- _node5 = b[15];
- }
-
- public Guid (string g)
- {
- CheckNull (g);
-
- GuidParser p = new GuidParser (g);
- Guid guid = p.Parse();
-
- this = guid;
- }
-
- public Guid (int a, short b, short c, byte[] d)
- {
- CheckArray(d, 8);
- _timeLow = (uint) a;
- _timeMid = (ushort) b;
- _timeHighAndVersion = (ushort) c;
- _clockSeqHiAndReserved = d[0];
- _clockSeqLow = d[1];
- _node0 = d[2];
- _node1 = d[3];
- _node2 = d[4];
- _node3 = d[5];
- _node4 = d[6];
- _node5 = d[7];
- }
-
- public Guid (
- int a,
- short b,
- short c,
- byte d,
- byte e,
- byte f,
- byte g,
- byte h,
- byte i,
- byte j,
- byte k)
- : this((uint) a, (ushort) b, (ushort) c, d, e, f, g, h, i, j, k) {}
-
- [CLSCompliant(false)]
- public Guid (
- uint a,
- ushort b,
- ushort c,
- byte d,
- byte e,
- byte f,
- byte g,
- byte h,
- byte i,
- byte j,
- byte k)
- {
- _timeLow = a;
- _timeMid = b;
- _timeHighAndVersion = c;
- _clockSeqHiAndReserved = d;
- _clockSeqLow = e;
- _node0 = f;
- _node1 = g;
- _node2 = h;
- _node3 = i;
- _node4 = j;
- _node5 = k;
- }
-
- public static readonly Guid Empty = new Guid(0,0,0,0,0,0,0,0,0,0,0);
-
- private static int Compare (uint x, uint y)
- {
- if (x < y) {
- return -1;
- }
- else {
- return 1;
- }
- }
-
- public int CompareTo (object value ) {
- if (value == null )
- return 1;
-
- if (!(value is Guid)) {
- throw new ArgumentException (Locale.GetText (
- "Argument of System.Guid.CompareTo should be a Guid"));
- }
-
- Guid v = (Guid) value;
-
- if (_timeLow != v._timeLow ) {
- return Compare(_timeLow, v._timeLow);
- }
- else if (_timeMid != v._timeMid) {
- return Compare(_timeMid, v._timeMid);
- }
- else if (_timeHighAndVersion != v._timeHighAndVersion) {
- return Compare(_timeHighAndVersion, v._timeHighAndVersion);
- }
- else if (_clockSeqHiAndReserved != v._clockSeqHiAndReserved) {
- return Compare(_clockSeqHiAndReserved, v._clockSeqHiAndReserved);
- }
- else if (_clockSeqLow != v._clockSeqLow) {
- return Compare(_clockSeqLow, v._clockSeqLow);
- }
- else if (_node0 != v._node0) {
- return Compare(_node0, v._node0);
- }
- else if (_node1 != v._node1) {
- return Compare(_node1, v._node1);
- }
- else if (_node2 != v._node2) {
- return Compare(_node2, v._node2);
- }
- else if (_node3 != v._node3) {
- return Compare(_node3, v._node3);
- }
- else if (_node4 != v._node4) {
- return Compare(_node4, v._node4);
- }
- else if (_node5 != v._node5) {
- return Compare(_node5, v._node5);
- }
-
- return 0;
- }
-
- public override bool Equals ( object o ) {
- try {
- return CompareTo(o) == 0;
- }
- catch ( ArgumentException ) {
- return false;
- }
- }
-
- public override int GetHashCode () {
- int res;
-
- res = (int) _timeLow;
- res = res ^ ((int) _timeMid << 16 | _timeHighAndVersion);
- res = res ^ ((int) _clockSeqHiAndReserved << 24);
- res = res ^ ((int) _clockSeqLow << 16);
- res = res ^ ((int) _node0 << 8);
- res = res ^ ((int) _node1);
- res = res ^ ((int) _node2 << 24);
- res = res ^ ((int) _node3 << 16);
- res = res ^ ((int) _node4 << 8);
- res = res ^ ((int) _node5);
-
- return res;
- }
-
- private static Guid NewTimeGuid() {
- ulong timestamp = _guidState.NewTimestamp ();
-
- // Bit [31..0] (32 bits) for timeLow
- uint timeLow = (uint) (timestamp & 0x00000000fffffffful);
- // Bit [47..32] (16 bits) for timeMid
- ushort timeMid = (ushort) ((timestamp & 0x0000ffff00000000ul) >> 32);
- // Bit [59..48] (12 bits) for timeHi
- ushort timeHi = (ushort) ((timestamp & 0x0fff000000000000ul) >> 48);
- // Bit [7..0] (8 bits) for clockSeqLo
- byte clockSeqLow = (byte) (Guid._guidState.ClockSeq & 0x00ffu);
- // Bit [13..8] (6 bits) for clockSeqHi
- byte clockSeqHi = (byte) ((Guid._guidState.ClockSeq & 0x3f00u) >> 8);
- byte[] mac = _guidState.MAC;
-
- clockSeqHi = (byte) (clockSeqHi | 0x80u); // Bit[7] = 1, Bit[6] = 0 (Variant)
- timeHi = (ushort) (timeHi | 0x1000u); // Bit[15..13] = 1 (Guid is time-based)
-
- return new Guid(timeLow, timeMid, timeHi, clockSeqHi, clockSeqLow, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
- }
-
- private static Guid NewRandomGuid () {
- byte[] b = new byte[16];
-
- _guidState.NextBytes (b);
-
- Guid res = new Guid(b);
- // Mask in Variant 1-0 in Bit[7..6]
- res._clockSeqHiAndReserved = (byte) ((res._clockSeqHiAndReserved & 0x3fu) | 0x80u);
- // Mask in Version 4 (random based Guid) in Bits[15..13]
- res._timeHighAndVersion = (ushort) ((res._timeHighAndVersion & 0x0fffu) | 0x4000u);
- return res;
- }
-
- [MonoTODO]
- public static Guid NewGuid () {
- return NewRandomGuid();
- }
-
- public byte[] ToByteArray () {
- byte[] res = new byte[16];
- byte[] tmp;
- int d = 0;
- int s;
-
- tmp = BitConverter.GetBytes(_timeLow);
- for (s=0; s<4; ++s) {
- res[d++] = tmp[s];
- }
-
- tmp = BitConverter.GetBytes(_timeMid);
- for (s=0; s<2; ++s) {
- res[d++] = tmp[s];
- }
-
- tmp = BitConverter.GetBytes(_timeHighAndVersion);
- for (s=0; s<2; ++s) {
- res[d++] = tmp[s];
- }
-
- res[8] = _clockSeqHiAndReserved;
- res[9] = _clockSeqLow;
- res[10] = _node0;
- res[11] = _node1;
- res[12] = _node2;
- res[13] = _node3;
- res[14] = _node4;
- res[15] = _node5;
-
- return res;
- }
-
- private string BaseToString(bool h, bool p, bool b) {
- string res = "";
-
- if (p) {
- res += "(";
- }
- else if (b) {
- res += "{";
- }
-
- res += _timeLow.ToString("x8");
- if (h) {
- res += "-";
- }
- res += _timeMid.ToString("x4");
- if (h) {
- res += "-";
- }
- res += _timeHighAndVersion.ToString("x4");
- if (h) {
- res += "-";
- }
- res += _clockSeqHiAndReserved.ToString("x2");
- res += _clockSeqLow.ToString("x2");
- if (h) {
- res += "-";
- }
- res += _node0.ToString("x2");
- res += _node1.ToString("x2");
- res += _node2.ToString("x2");
- res += _node3.ToString("x2");
- res += _node4.ToString("x2");
- res += _node5.ToString("x2");
-
- if (p) {
- res += ")";
- }
- else if (b) {
- res += "}";
- }
-
- return res;
- }
-
- public override string ToString () {
- return BaseToString (true, false, false);
- }
-
- public string ToString (string format) {
- string f;
- bool h = false;
- bool p = false;
- bool b = false;
-
- if (format != null) {
- f = format.ToLower();
-
- if (f == "b") {
- h = true;
- b = true;
- }
- else if (f == "p") {
- h = true;
- p = true;
- }
- else if (f == "d") {
- h = true;
- }
- else if (f != "n" && f != "") {
- throw new FormatException ( Locale.GetText ("Argument to Guid.ToString(string format) should be \"b\", \"B\", \"d\", \"D\", \"n\", \"N\", \"p\" or \"P\""));
- }
- }
-
- return BaseToString (h, p, b);
- }
-
- public string ToString (string format, IFormatProvider provider) {
- return ToString (format);
- }
-
- public static bool operator == (Guid a, Guid b) {
- return a.Equals(b);
- }
-
- public static bool operator != (Guid a, Guid b) {
- return !( a.Equals (b) );
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/System/IAppDomainSetup.cs b/mcs/class/corlib/System/IAppDomainSetup.cs
deleted file mode 100644
index 31eddcd62b7..00000000000
--- a/mcs/class/corlib/System/IAppDomainSetup.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-
-//
-// System/IAppDomainSetup.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System {
-
- public interface IAppDomainSetup {
-
- string ApplicationBase { get; set; }
-
- string ApplicationName { get; set; }
-
- string CachePath { get; set; }
-
- string ConfigurationFile { get; set; }
-
- string DynamicBase { get; set; }
-
- string LicenseFile { get; set; }
-
- string PrivateBinPath { get; set; }
-
- string PrivateBinPathProbe { get; set; }
-
- string ShadowCopyDirectories { get; set; }
-
- string ShadowCopyFiles { get; set; }
- }
-}
diff --git a/mcs/class/corlib/System/IAsyncResult.cs b/mcs/class/corlib/System/IAsyncResult.cs
deleted file mode 100644
index aabe7995bbc..00000000000
--- a/mcs/class/corlib/System/IAsyncResult.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IAsyncResult.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Mon 08/24/2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Threading;
-
-namespace System {
-
- public interface IAsyncResult
- {
- object AsyncState
- {
- get;
- }
-
- WaitHandle AsyncWaitHandle
- {
- get;
- }
-
- bool CompletedSynchronously
- {
- get;
- }
-
- bool IsCompleted
- {
- get;
- }
- }
-
-} // Namespace System
-
-
diff --git a/mcs/class/corlib/System/ICloneable.cs b/mcs/class/corlib/System/ICloneable.cs
deleted file mode 100644
index 792550db1f5..00000000000
--- a/mcs/class/corlib/System/ICloneable.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.ICloneable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface ICloneable {
- object Clone ();
- }
-}
diff --git a/mcs/class/corlib/System/IComparable.cs b/mcs/class/corlib/System/IComparable.cs
deleted file mode 100644
index 50af10d15e2..00000000000
--- a/mcs/class/corlib/System/IComparable.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.IComparable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface IComparable {
- int CompareTo (object obj);
- }
-}
diff --git a/mcs/class/corlib/System/IConvertible.cs b/mcs/class/corlib/System/IConvertible.cs
deleted file mode 100644
index 95612b04c21..00000000000
--- a/mcs/class/corlib/System/IConvertible.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.IConvertible.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Functions Implementing this interface should check out
-// System.Convert. Most of these methods are implemented
-// there for all these data types.
-//
-// System.Convert has ToType helper method for the object
-// ToType (Type conversionType, IFormatProvider provider)
-// method. In most cases you can specify your ToType function
-// as calling
-//
-// public Type value; // value of this data type
-// public object ToType(Type conversionType, IFormatProvider provider) {
-// Convert.ToType (value, conversionType, provider);
-// }
-//
-// Which is just a wrapper for your ToType methods.
-//
-// See http://lists.ximian.com/archives/public/mono-list/2001-July/000525.html
-// for more discussion on the topic
-//
-
-namespace System {
-
- [CLSCompliant(false)]
- public interface IConvertible {
-
- TypeCode GetTypeCode ();
-
- bool ToBoolean (IFormatProvider provider);
- byte ToByte (IFormatProvider provider);
- char ToChar (IFormatProvider provider);
- DateTime ToDateTime (IFormatProvider provider);
- decimal ToDecimal (IFormatProvider provider);
- double ToDouble (IFormatProvider provider);
- short ToInt16 (IFormatProvider provider);
- int ToInt32 (IFormatProvider provider);
- long ToInt64 (IFormatProvider provider);
- sbyte ToSByte (IFormatProvider provider);
- float ToSingle (IFormatProvider provider);
- string ToString (IFormatProvider provider);
- object ToType (Type conversionType, IFormatProvider provider);
- ushort ToUInt16 (IFormatProvider provider);
- uint ToUInt32 (IFormatProvider provider);
- ulong ToUInt64 (IFormatProvider provider);
- }
-}
diff --git a/mcs/class/corlib/System/ICustomFormatter.cs b/mcs/class/corlib/System/ICustomFormatter.cs
deleted file mode 100644
index a370647f37f..00000000000
--- a/mcs/class/corlib/System/ICustomFormatter.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.ICustomFormatter.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- interface ICustomFormatter {
- string Format (string format, object arg, IFormatProvider formatProvider);
- }
-}
diff --git a/mcs/class/corlib/System/IDisposable.cs b/mcs/class/corlib/System/IDisposable.cs
deleted file mode 100644
index 6c3ca1b6367..00000000000
--- a/mcs/class/corlib/System/IDisposable.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.IDisposable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface IDisposable {
-
- void Dispose ();
-
- }
-}
diff --git a/mcs/class/corlib/System/IFormatProvider.cs b/mcs/class/corlib/System/IFormatProvider.cs
deleted file mode 100644
index 266c62d1295..00000000000
--- a/mcs/class/corlib/System/IFormatProvider.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.IFormatProvider.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface IFormatProvider {
- object GetFormat (Type format_type);
- }
-}
diff --git a/mcs/class/corlib/System/IFormattable.cs b/mcs/class/corlib/System/IFormattable.cs
deleted file mode 100644
index 1769f4034c0..00000000000
--- a/mcs/class/corlib/System/IFormattable.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.IFormattable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface IFormattable {
- string ToString (string format, IFormatProvider format_provider);
- }
-}
diff --git a/mcs/class/corlib/System/IServiceProvider.cs b/mcs/class/corlib/System/IServiceProvider.cs
deleted file mode 100644
index c10c880cee2..00000000000
--- a/mcs/class/corlib/System/IServiceProvider.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.IServiceProvider.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface IServiceProvider {
-
- object GetService (Type serviceType);
-
- }
-}
diff --git a/mcs/class/corlib/System/IndexOutOfRangeException.cs b/mcs/class/corlib/System/IndexOutOfRangeException.cs
deleted file mode 100644
index 6e0b5ffc1c5..00000000000
--- a/mcs/class/corlib/System/IndexOutOfRangeException.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.IndexOutOfRangeException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-namespace System {
-
- public sealed class IndexOutOfRangeException : SystemException {
- // Constructors
- public IndexOutOfRangeException ()
- : base (Locale.GetText ("Array index is out of range"))
- {
- }
-
- public IndexOutOfRangeException (string message)
- : base (message)
- {
- }
-
- public IndexOutOfRangeException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/Int16.cs b/mcs/class/corlib/System/Int16.cs
deleted file mode 100644
index 2d28b8eba61..00000000000
--- a/mcs/class/corlib/System/Int16.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// System.Int16.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- public struct Int16 : IComparable, IFormattable { //, IConvertible {
-
- public const short MaxValue = 32767;
- public const short MinValue = -32768;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public short value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Int16))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Int16"));
-
- short xv = (short) v;
- if (value == xv)
- return 0;
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Int16))
- return false;
-
- return ((short) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- public static short Parse (string s)
- {
- short val = 0;
- int len;
- int i;
- bool neg = false;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- c = s [i];
- if (c == '+')
- i++;
- else if (c == '-'){
- neg = true;
- i++;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- val = checked ((short) (val * 10 + (c - '0')));
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- if (neg)
- val = checked ((short) -val);
-
- return val;
- }
-
- public static short Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static short Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- public static short Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- throw new NotImplementedException ();
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Int16;
- }
- }
-}
diff --git a/mcs/class/corlib/System/Int32.cs b/mcs/class/corlib/System/Int32.cs
deleted file mode 100644
index 660af49be1a..00000000000
--- a/mcs/class/corlib/System/Int32.cs
+++ /dev/null
@@ -1,223 +0,0 @@
-//
-// System.Int32.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- public struct Int32 : IComparable, IFormattable, IConvertible {
-
- public const int MaxValue = 0x7fffffff;
- public const int MinValue = -2147483648;
-
- public int value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Int32))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Int32"));
-
- int xv = (int) v;
- if (value == xv)
- return 0;
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Int32))
- return false;
-
- return ((int) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- public static int Parse (string s)
- {
- int val = 0;
- int len;
- int i;
- bool neg = false;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- c = s [i];
- if (c == '+')
- i++;
- else if (c == '-'){
- neg = true;
- i++;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- val = checked (val * 10 + (c - '0'));
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- if (neg)
- val = -val;
-
- return val;
- }
-
- public static int Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static int Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [MonoTODO]
- public static int Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- // FIXME: Better than nothing ;-)
- return Parse (s);
- //throw new NotImplementedException ();
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp )
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString (format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Int32;
- }
-
- public bool ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean (value);
- }
- public byte ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte (value);
- }
- public char ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar (value);
- }
- public DateTime ToDateTime (IFormatProvider provider)
- {
- throw new NotImplementedException ();
- }
- public decimal ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal (value);
- }
- public double ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble (value);
- }
- public short ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16 (value);
- }
- public int ToInt32 (IFormatProvider provider)
- {
- return value;
- }
- public long ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64 (value);
- }
- [CLSCompliant(false)]
- public sbyte ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte (value);
- }
- public float ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle (value);
- }
- public object ToType (Type conversionType, IFormatProvider provider)
- {
- throw new NotImplementedException ();
- }
- [CLSCompliant(false)]
- public ushort ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16 (value);
- }
- [CLSCompliant(false)]
- public uint ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32 (value);
- }
- [CLSCompliant(false)]
- public ulong ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64 (value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/Int64.cs b/mcs/class/corlib/System/Int64.cs
deleted file mode 100644
index c7d3d47776e..00000000000
--- a/mcs/class/corlib/System/Int64.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// System.Int64.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- public struct Int64 : IComparable, IFormattable { //, IConvertible {
-
- public const long MaxValue = 0x7fffffffffffffff;
- public const long MinValue = -9223372036854775808;
-
- public long value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Int64))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Int64"));
-
- if (value == (long) v)
- return 0;
-
- if (value < (long) v)
- return -1;
-
- return 1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Int64))
- return false;
-
- return ((long) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int)(value & 0xffffffff) ^ (int)(value >> 32);
- }
-
- public static long Parse (string s)
- {
- long val = 0;
- int len;
- int i;
- bool neg = false;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- c = s [i];
- if (c == '+')
- i++;
- else if (c == '-'){
- neg = true;
- i++;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- val = checked (val * 10 + (c - '0'));
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- if (neg)
- val = -val;
-
- return val;
- }
-
- public static long Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static long Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [MonoTODO]
- public static long Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- // TODO: Implement me
- // throw new NotImplementedException ();
- // good enough for now
- return Parse (s);
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString (format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Int64;
- }
- }
-}
diff --git a/mcs/class/corlib/System/IntPtr.cs b/mcs/class/corlib/System/IntPtr.cs
deleted file mode 100644
index 480e9a4b6e3..00000000000
--- a/mcs/class/corlib/System/IntPtr.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// System.IntPtr.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// Maintainer:
-// Michael Lambert, michaellambert@email.com
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// Remarks: Requires '/unsafe' compiler option. This class uses void*,
-// in overloaded constructors, conversion, and cast members in
-// the public interface. Using pointers is not valid CLS and
-// the methods in question have been marked with the
-// CLSCompliant attribute that avoid compiler warnings.
-//
-// FIXME: How do you specify a native int in C#? I am going to have to do some figuring out
-//
-
-using System;
-using System.Runtime.Serialization;
-
-[
- assembly: System.CLSCompliant(true)
-]
-
-namespace System {
-
- [
- CLSCompliant(true)
- ]
- public unsafe struct IntPtr : ISerializable {
-
- private void *value;
-
- public static IntPtr Zero;
-
- static IntPtr ()
- {
- Zero.value = (void *) 0;
- }
-
- public IntPtr (int i32)
- {
- value = (void *) i32;
- }
-
- public IntPtr (long i64)
- {
- value = (void *) i64;
- }
-
- [
- CLSCompliant(false)
- ]
- unsafe public IntPtr (void *ptr)
- {
- value = ptr;
- }
-
- public static int Size {
- get {
- return sizeof (void *);
- }
- }
-
- public void GetObjectData (SerializationInfo si, StreamingContext sc)
- {
- if( si == null )
- throw new ArgumentNullException( "si" );
-
- si.AddValue("value", (long) value);
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.IntPtr))
- return false;
-
- return ((IntPtr) o).value == value;
- }
-
- public override int GetHashCode ()
- {
- return (int) value;
- }
-
- public int ToInt32 ()
- {
- return (int) value;
- }
-
- public long ToInt64 ()
- {
- return (long) value;
- }
-
- [
- CLSCompliant(false)
- ]
- unsafe public void *ToPointer ()
- {
- return value;
- }
-
- override public string ToString ()
- {
- if (Size == 4)
- return ((int) value).ToString ();
- else
- return ((long) value).ToString ();
- }
-
- public static bool operator == (IntPtr a, IntPtr b)
- {
- return (a.value == b.value);
- }
-
- public static bool operator != (IntPtr a, IntPtr b)
- {
- return (a.value != b.value);
- }
-
- public static explicit operator IntPtr (int value)
- {
- return new IntPtr (value);
- }
-
- public static explicit operator IntPtr (long value)
- {
- return new IntPtr (value);
- }
-
- [
- CLSCompliant(false)
- ]
- unsafe public static explicit operator IntPtr (void *value)
- {
- return new IntPtr (value);
- }
-
- public static explicit operator int (IntPtr value)
- {
- return (int) value.value;
- }
-
- public static explicit operator long (IntPtr value)
- {
- return (long) value.value;
- }
-
- [
- CLSCompliant(false)
- ]
- unsafe public static explicit operator void * (IntPtr value)
- {
- return value.value;
- }
- }
-}
diff --git a/mcs/class/corlib/System/IntegerFormatter.cs b/mcs/class/corlib/System/IntegerFormatter.cs
deleted file mode 100644
index ef9383c6a67..00000000000
--- a/mcs/class/corlib/System/IntegerFormatter.cs
+++ /dev/null
@@ -1,3432 +0,0 @@
-//
-// System.IntegerFormatter.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-//
-// (C) Derek Holden dholden@draper.com
-//
-
-//
-// Format integer types. Completely based off ECMA docs
-// for IFormattable specification. Has been tested w/
-// all integral types, from boundry to boundry, w/ all
-// formats A## ("G", "G0" ... "G99", "P", "P0" ... "P99").
-//
-// If you make any changes, please make sure to check the
-// boundry format precisions (0, 99) and the min / max values
-// of the data types (Int32.[Max/Min]Value).
-//
-// Using int as an example, it is currently set up as
-//
-// Int32 {
-// int value;
-// public string ToString (string format, NumberFormatInfo nfi) {
-// return IntegerFormatter.NumberToString (format, nfi, value);
-// }
-//
-// IntegerFormatter {
-// public string NumberToString (string format, NumberFormatInfo nfi, int value) {
-// ParseFormat (format);
-// switch (format type) {
-// case 'G' FormatGeneral(value, precision);
-// case 'R' throw Exception("Invalid blah blah");
-// case 'C' FromatCurrency(value, precision, nfi);
-// etc...
-// }
-// }
-// }
-//
-// There is a property in NumberFormatInfo for NegativeSign, though the
-// definition of IFormattable just uses '-' in context. So all the
-// hardcoded uses of '-' in here may need to be changed to nfi.NegativeSign
-//
-// For every integral type.
-//
-// Before every Format<Format Type> block there is a small paragraph
-// detailing its requirements, and a blurb of what I was thinking
-// at the time.
-//
-// Some speedup suggestions to be done when after this appears
-// to be working properly:
-//
-// * Deal w/ out of range numbers better. Specifically with
-// regards to boundry cases such as Long.MinValue etc.
-// The previous way of if (value < 0) value = -value;
-// fails under this assumption, since the largest
-// possible MaxValue is < absolute value of the MinValue.
-// I do the first iteration outside of the loop, and then
-// convert the number to positive, then continue in the loop.
-//
-// * Replace all occurances of max<Type>Length with their
-// numerical values. Plus the places where things are set
-// to max<Type>Length - 1. Hardcode these to numbers.
-//
-// * Move the code for all the NumberToString()'s into the
-// the main ToString (string, NumberFormatInfo) method in
-// the data types themselves. That way they'd be throwing
-// their own exceptions on error and it'd save a function
-// call.
-//
-// * For integer to char buffer transformation, you could
-// implement the calculations of the 10's and 100's place
-// the same time w/ another table to shorten loop time.
-//
-// * Someone smarter can prolly find a much more efficient
-// way of formatting the exponential notation. It's still
-// done in pass, just may have too many repositioning
-// calculations.
-//
-// * Decide whether it be better to have functions that
-// handle formatting for all types, or just cast their
-// values out and format them. Just if library size is
-// more important than speed in saving a cast and a
-// function call.
-//
-
-using System.Globalization;
-
-namespace System {
-
- internal sealed class IntegerFormatter {
-
- private static int maxByteLength = 4;
- private static int maxShortLength = 6;
- private static int maxIntLength = 12;
- private static int maxLongLength = 22;
-
- private static char[] digitLowerTable =
- { '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
-
- private static char[] digitUpperTable =
- { '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
- private static bool ParseFormat (string format, out char specifier, out int precision)
- {
- precision = -1;
- specifier = '\0';
-
- int length = format.Length;
- if (length < 1 || length > 3)
- return false;
-
- char[] chars = format.ToCharArray ();
- specifier = chars[0];
-
- if (length == 1)
- return true;
-
- if (length == 2) {
- if (chars[1] < '0' || chars[1] > '9')
- return false;
-
- precision = chars[1] - '0';
- } else {
- if (chars[1] < '0' || chars[2] < '0' || chars[1] > '9' || chars[2] > '9')
- return false;
-
- precision = (chars[1] - '0') * 10 + (chars[2] - '0');
- }
-
- return true;
- }
-
- // ============ Public Interface to all the integer types ============ //
-
- public static string NumberToString (string format, NumberFormatInfo nfi, byte value)
- {
- char specifier;
- int precision;
-
- if (!ParseFormat (format, out specifier, out precision))
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, short value)
- {
- char specifier;
- int precision;
-
- if (!ParseFormat (format, out specifier, out precision))
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this insance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, int value)
- {
- char specifier;
- int precision;
-
- if (!ParseFormat (format, out specifier, out precision))
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, long value)
- {
- char specifier;
- int precision;
-
- if (!ParseFormat (format, out specifier, out precision))
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, sbyte value)
- {
- char specifier;
- int precision;
-
- if (!ParseFormat (format, out specifier, out precision))
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, ushort value)
- {
- char specifier;
- int precision;
-
- if (!ParseFormat (format, out specifier, out precision))
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, uint value)
- {
- char specifier;
- int precision;
-
- if (!ParseFormat (format, out specifier, out precision))
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, ulong value)
- {
- char specifier;
- int precision;
-
- if (!ParseFormat (format, out specifier, out precision))
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- // ============ Currency Type Formating ============ //
-
- //
- // Currency Format: Used for strings containing a monetary value. The
- // CurrencySymbol, CurrencyGroupSizes, CurrencyGroupSeparator, and
- // CurrencyDecimalSeparator members of a NumberFormatInfo supply
- // the currency symbol, size and separator for digit groupings, and
- // decimal separator, respectively.
- // CurrencyNegativePattern and CurrencyPositivePattern determine the
- // symbols used to represent negative and positive values. For example,
- // a negative value may be prefixed with a minus sign, or enclosed in
- // parentheses.
- // If the precision specifier is omitted
- // NumberFormatInfo.CurrencyDecimalDigits determines the number of
- // decimal places in the string. Results are rounded to the nearest
- // representable value when necessary.
- //
- // The pattern of the NumberFormatInfo determines how the output looks, where
- // the dollar sign goes, where the negative sign goes, etc.
- // IFormattable documentation lists the patterns and their values,
- // I have them commented out in the large switch statement
- //
-
- private static string FormatCurrency (byte value, int precision, NumberFormatInfo nfi)
- {
- return FormatCurrency ((uint)value, precision, nfi);
- }
-
- private static string FormatCurrency (short value, int precision, NumberFormatInfo nfi)
- {
- return FormatCurrency ((int)value, precision, nfi);
- }
-
- private static string FormatCurrency (int value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- bool negative = (value < 0);
-
- char[] groupSeparator = nfi.CurrencyGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.CurrencyDecimalSeparator.ToCharArray ();
- char[] currencySymbol = nfi.CurrencySymbol.ToCharArray ();
- int[] groupSizes = nfi.CurrencyGroupSizes;
- int pattern = negative ? nfi.CurrencyNegativePattern : nfi.CurrencyPositivePattern;
- int symbolLength = currencySymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- int size = maxIntLength + (groupSeparator.Length * maxIntLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // ($nnn)
- buffy[--position] = ')';
- break;
- // case 1: // -$nnn
- // break;
- // case 2: // $-nnn
- // break;
- case 3: // $nnn-
- buffy[--position] = '-';
- break;
- case 4: // (nnn$)
- buffy[--position] = ')';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 5: // -nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 6: // nnn-$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- case 7: // nnn$-
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 8: // -nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- // case 9: // -$ nnn
- // break;
- case 10: // nnn $-
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 11: // $ nnn-
- buffy[--position] = '-';
- break;
- // case 12: // $ -nnn
- // break;
- case 13: // nnn- $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- buffy[--position] = '-';
- break;
- case 14: // ($ nnn)
- buffy[--position] = ')';
- break;
- case 15: // (nnn $)
- buffy[--position] = ')';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- // case 0: // $nnn
- // break;
- case 1: // nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 2: // $ nnn
- // break;
- case 3: // nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // just in place to take care of the negative boundries (Int32.MinValue)
- if (negative) {
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
- }
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // ($nnn)
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '(';
- break;
- case 1: // -$nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- case 2: // $-nnn
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 3: // $nnn-
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 4: // (nnn$)
- buffy[--position] = '(';
- break;
- case 5: // -nnn$
- buffy[--position] = '-';
- break;
- // case 6: // nnn-$
- // break;
- // case 7: // nnn$-
- // break;
- case 8: // -nnn $
- buffy[--position] = '-';
- break;
- // case 9: // -$ nnn
- // break;
- // case 10: // nnn $-
- // break;
- case 11: // $ nnn-
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 12: // $ -nnn
- buffy[--position] = '-';
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 13: // nnn- $
- // break;
- case 14: // ($ nnn)
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '(';
- break;
- case 15: // (nnn $)
- buffy[--position] = '(';
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- case 0: // $nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 1: // nnn$
- // break;
- case 2: // $ nnn
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 3: // nnn $
- // break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatCurrency (long value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- bool negative = (value < 0);
-
- char[] groupSeparator = nfi.CurrencyGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.CurrencyDecimalSeparator.ToCharArray ();
- char[] currencySymbol = nfi.CurrencySymbol.ToCharArray ();
- int[] groupSizes = nfi.CurrencyGroupSizes;
- int pattern = negative ? nfi.CurrencyNegativePattern : nfi.CurrencyPositivePattern;
- int symbolLength = currencySymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- int size = maxLongLength + (groupSeparator.Length * maxLongLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // ($nnn)
- buffy[--position] = ')';
- break;
- // case 1: // -$nnn
- // break;
- // case 2: // $-nnn
- // break;
- case 3: // $nnn-
- buffy[--position] = '-';
- break;
- case 4: // (nnn$)
- buffy[--position] = ')';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 5: // -nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 6: // nnn-$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- case 7: // nnn$-
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 8: // -nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- // case 9: // -$ nnn
- // break;
- case 10: // nnn $-
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 11: // $ nnn-
- buffy[--position] = '-';
- break;
- // case 12: // $ -nnn
- // break;
- case 13: // nnn- $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- buffy[--position] = '-';
- break;
- case 14: // ($ nnn)
- buffy[--position] = ')';
- break;
- case 15: // (nnn $)
- buffy[--position] = ')';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- // case 0: // $nnn
- // break;
- case 1: // nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 2: // $ nnn
- // break;
- case 3: // nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- if (negative) {
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
- }
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // ($nnn)
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '(';
- break;
- case 1: // -$nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- case 2: // $-nnn
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 3: // $nnn-
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 4: // (nnn$)
- buffy[--position] = '(';
- break;
- case 5: // -nnn$
- buffy[--position] = '-';
- break;
- // case 6: // nnn-$
- // break;
- // case 7: // nnn$-
- // break;
- case 8: // -nnn $
- buffy[--position] = '-';
- break;
- // case 9: // -$ nnn
- // break;
- // case 10: // nnn $-
- // break;
- case 11: // $ nnn-
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 12: // $ -nnn
- buffy[--position] = '-';
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 13: // nnn- $
- // break;
- case 14: // ($ nnn)
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '(';
- break;
- case 15: // (nnn $)
- buffy[--position] = '(';
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- case 0: // $nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 1: // nnn$
- // break;
- case 2: // $ nnn
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 3: // nnn $
- // break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatCurrency (sbyte value, int precision, NumberFormatInfo nfi)
- {
- return FormatCurrency ((int)value, precision, nfi);
- }
-
- private static string FormatCurrency (ushort value, int precision, NumberFormatInfo nfi)
- {
- return FormatCurrency ((uint)value, precision, nfi);
- }
-
- private static string FormatCurrency (uint value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
-
- char[] groupSeparator = nfi.CurrencyGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.CurrencyDecimalSeparator.ToCharArray ();
- char[] currencySymbol = nfi.CurrencySymbol.ToCharArray ();
- int[] groupSizes = nfi.CurrencyGroupSizes;
- int pattern = nfi.CurrencyPositivePattern;
- int symbolLength = currencySymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- int size = maxIntLength + (groupSeparator.Length * maxIntLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible, no negative
- i = symbolLength;
- switch (pattern) {
- // case 0: // $nnn
- // break;
- case 1: // nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 2: // $ nnn
- // break;
- case 3: // nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- i = symbolLength;
- switch (pattern) {
- case 0: // $nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 1: // nnn$
- // break;
- case 2: // $ nnn
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 3: // nnn $
- // break;
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatCurrency (ulong value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
-
- char[] groupSeparator = nfi.CurrencyGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.CurrencyDecimalSeparator.ToCharArray ();
- char[] currencySymbol = nfi.CurrencySymbol.ToCharArray ();
- int[] groupSizes = nfi.CurrencyGroupSizes;
- int pattern = nfi.CurrencyPositivePattern;
- int symbolLength = currencySymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- int size = maxLongLength + (groupSeparator.Length * maxLongLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible, no negative
- i = symbolLength;
- switch (pattern) {
- // case 0: // $nnn
- // break;
- case 1: // nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 2: // $ nnn
- // break;
- case 3: // nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- i = symbolLength;
- switch (pattern) {
- case 0: // $nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 1: // nnn$
- // break;
- case 2: // $ nnn
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 3: // nnn $
- // break;
- }
-
- return new string (buffy, position, (size - position));
- }
-
- // ============ Format Decimal Types ============ //
-
- //
- // Used only for integral data types. Negative values are
- // represented by using a '-' sign. The precision specifies
- // how many digits are to appear in the string. If it is >
- // how many digits we need, the left side is padded w/ 0's.
- // If it is smaller than what we need, it is discarded.
- //
- // Fairly simple implementation. Fill the buffer from right
- // to left w/ numbers, then if we still have precision left
- // over, pad w/ zeros.
- //
-
- private static string FormatDecimal (byte value, int precision)
- {
- return FormatDecimal ((uint)value, precision);
- }
-
- private static string FormatDecimal (short value, int precision)
- {
- return FormatDecimal ((int)value, precision);
- }
-
- private static string FormatDecimal (int value, int precision)
- {
- int size = (precision > 0) ? (maxIntLength + precision) : maxIntLength;
- char[] buffy = new char[size];
- int position = size;
- bool negative = (value < 0);
-
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
- } else value = -value;
-
- // get our value into a buffer from right to left
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // if we have precision left over, fill with 0's
- precision -= (size - position);
- while (precision-- > 0 && position > 1)
- buffy[--position] = '0';
-
- if (negative)
- buffy[--position] = '-';
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatDecimal (long value, int precision)
- {
- int size = (precision > 0) ? (maxLongLength + precision) : maxLongLength;
- char[] buffy = new char[size];
- int position = size;
- bool negative = (value < 0);
-
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
- } else value = -value;
-
- // get our value into a buffer from right to left
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // if we have precision left over, fill with 0's
- precision -= (size - position);
- while (precision-- > 0 && position > 1)
- buffy[--position] = '0';
-
- if (negative)
- buffy[--position] = '-';
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatDecimal (sbyte value, int precision)
- {
- return FormatDecimal ((int)value, precision);
- }
-
- private static string FormatDecimal (ushort value, int precision)
- {
- return FormatDecimal ((uint)value, precision);
- }
-
- private static string FormatDecimal (uint value, int precision)
- {
- int size = (precision > 0) ? (maxIntLength + precision) : maxIntLength;
- char[] buffy = new char[size];
- int position = size;
-
- // get our value into a buffer from right to left
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // if we have precision left over, fill with 0's
- precision -= (size - position);
- while (precision-- > 0 && position > 1)
- buffy[--position] = '0';
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatDecimal (ulong value, int precision)
- {
- int size = (precision > 0) ? (maxLongLength + precision) : maxLongLength;
- char[] buffy = new char[size];
- int position = size;
-
- // get our value into a buffer from right to left
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // if we have precision left over, fill with 0's
- precision -= (size - position);
- while (precision-- > 0 && position > 1)
- buffy[--position] = '0';
-
- return new string (buffy, position, (size - position));
- }
-
- // ============ Format Exponentials ============ //
-
- //
- // Used for strings in the format [-]M.DDDDDDe+XXX.
- // Exaclty one non-zero digit must appear in M, w/
- // a '-' sign if negative. The precision determines
- // number of decimal places, if not given go 6 places.
- // If precision > the number of places we need, it
- // is right padded w/ 0's. If it is smaller than what
- // we need, we cut off and round. The format specifier
- // decides whether we use an uppercase E or lowercase e.
- //
- // Tried to do this in one pass of one buffer, but it
- // wasn't happening. Get a buffer + 7 extra slots for
- // the -, ., E, +, and XXX. Parse the value into another
- // temp buffer, then build the new string. For the
- // integral data types, there are a couple things that
- // can be hardcoded. Since an int and a long can't be
- // larger than 20 something spaces, the first X w/
- // always be 0, and the the exponential value will only
- // be 2 digits long. Also integer types w/ always
- // have a positive exponential.
- //
-
- private static string FormatExponential (byte value, int precision, bool upper)
- {
- return FormatExponential ((uint)value, precision, upper);
- }
-
- private static string FormatExponential (short value, int precision, bool upper)
- {
- return FormatExponential ((int)value, precision, upper);
- }
-
- private static string FormatExponential (int value, int precision, bool upper)
- {
- bool negative = (value < 0);
- int padding = (precision >= 0) ? precision : 6;
- char[] buffy = new char[(padding + 8)];
- char[] tmp = new char [maxIntLength];
- int exponent = 0, position = maxIntLength;
- int exp = 0, idx = 0;
- ulong pow = 10;
-
- // ugly, but doing it since abs(Int32.MinValue) > Int.MaxValue
- uint number = (negative) ? (uint)((-(value + 1)) + 1) : (uint)value;
-
- // need to calculate the number of places to know if we need to round later
- if (negative && value <= -10) {
- value /= -10;
- exp++;
- }
-
- while (value >= 10) {
- value /= 10;
- exp++;
- }
-
- if (exp > padding) {
-
- // highest number we should goto before we round
- while (idx++ <= padding)
- pow *= 10;
-
- // get our value into a buffer
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
- }
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number% 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
- idx = 0;
-
- // go left to right in filling up new string
- if (negative)
- buffy[idx++] = '-';
-
- // we know we have at least one in there, followed
- // by a decimal point
- buffy[idx++] = tmp[position++];
- if (precision != 0)
- buffy[idx++] = '.';
-
- // copy over the remaining digits until we run out,
- // or we've passed our specified precision
- while (padding > 0 && position < maxIntLength) {
- buffy[idx++] = tmp[position++];
- padding--;
- }
-
- // if we still have more precision to go, add some
- // zeros
- while (padding > 0) {
- buffy[idx++] = '0';
- padding--;
- }
-
- // we know these next 3 spots
- buffy[idx++] = upper ? 'E' : 'e';
- buffy[idx++] = '+';
- buffy[idx++] = '0';
-
- // next two digits depend on our length
- if (exponent >= 10) {
- buffy[idx++] = digitLowerTable[(exponent / 10)];
- buffy[idx] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[idx++] = '0';
- buffy[idx] = digitLowerTable[exponent];
- }
-
- return new string(buffy, 0, ++idx);
- }
-
- private static string FormatExponential (long value, int precision, bool upper)
- {
- bool negative = (value < 0);
- int padding = (precision >= 0) ? precision : 6;
- char[] buffy = new char[(padding + 8)];
- char[] tmp = new char [maxLongLength];
- int exponent = 0, position = maxLongLength;
- int exp = 0, idx = 0;
- ulong pow = 10;
-
- // ugly, but doing it since abs(Int32.MinValue) > Int.MaxValue
- ulong number = (negative) ? (ulong)((-(value + 1)) + 1) : (ulong)value;
-
- // need to calculate the number of places to know if we need to round later
- if (negative && value <= -10) {
- value /= -10;
- exp++;
- }
-
- while (value >= 10) {
- value /= 10;
- exp++;
- }
-
- if (exp > padding) {
-
- // highest number we should goto before we round
- while (idx++ <= padding)
- pow *= 10;
-
- // get our value into a buffer
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
- }
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number% 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
- idx = 0;
-
- // go left to right in filling up new string
- if (negative)
- buffy[idx++] = '-';
-
- // we know we have at least one in there, followed
- // by a decimal point
- buffy[idx++] = tmp[position++];
- if (precision != 0)
- buffy[idx++] = '.';
-
- // copy over the remaining digits until we run out,
- // or we've passed our specified precision
- while (padding > 0 && position < maxLongLength) {
- buffy[idx++] = tmp[position++];
- padding--;
- }
-
- // if we still have more precision to go, add some
- // zeros
- while (padding > 0) {
- buffy[idx++] = '0';
- padding--;
- }
-
- // we know these next 3 spots
- buffy[idx++] = upper ? 'E' : 'e';
- buffy[idx++] = '+';
- buffy[idx++] = '0';
-
- // next two digits depend on our length
- if (exponent >= 10) {
- buffy[idx++] = digitLowerTable[(exponent / 10)];
- buffy[idx] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[idx++] = '0';
- buffy[idx] = digitLowerTable[exponent];
- }
-
- return new string(buffy, 0, ++idx);
- }
-
- private static string FormatExponential (sbyte value, int precision, bool upper)
- {
- return FormatExponential ((int)value, precision, upper);
- }
-
- private static string FormatExponential (ushort value, int precision, bool upper)
- {
- return FormatExponential ((uint)value, precision, upper);
- }
-
- private static string FormatExponential (uint value, int precision, bool upper)
- {
- int padding = (precision >= 0) ? precision : 6;
- char[] buffy = new char[(padding + 8)];
- char[] tmp = new char [maxIntLength];
- int exponent = 0, position = maxIntLength;
- int exp = 0, idx = 0;
- ulong pow = 10;
- ulong number = (ulong)value;
-
- // need to calculate the number of places to know if we need to round later
- while (value >= 10) {
- value /= 10;
- exp++;
- }
-
- if (exp > padding) {
-
- // highest number we should goto before we round
- while (idx++ <= padding)
- pow *= 10;
-
- // get our value into a buffer
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
- }
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number% 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
- idx = 0;
-
- // we know we have at least one in there, followed
- // by a decimal point
- buffy[idx++] = tmp[position++];
- if (precision != 0)
- buffy[idx++] = '.';
-
- // copy over the remaining digits until we run out,
- // or we've passed our specified precision
- while (padding > 0 && position < maxIntLength) {
- buffy[idx++] = tmp[position++];
- padding--;
- }
-
- // if we still have more precision to go, add some
- // zeros
- while (padding > 0) {
- buffy[idx++] = '0';
- padding--;
- }
-
- // we know these next 3 spots
- buffy[idx++] = upper ? 'E' : 'e';
- buffy[idx++] = '+';
- buffy[idx++] = '0';
-
- // next two digits depend on our length
- if (exponent >= 10) {
- buffy[idx++] = digitLowerTable[(exponent / 10)];
- buffy[idx] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[idx++] = '0';
- buffy[idx] = digitLowerTable[exponent];
- }
-
- return new string(buffy, 0, ++idx);
- }
-
- private static string FormatExponential (ulong value, int precision, bool upper)
- {
- int padding = (precision >= 0) ? precision : 6;
- char[] buffy = new char[(padding + 8)];
- char[] tmp = new char [maxLongLength];
- int exponent = 0, position = maxLongLength;
- int exp = 0, idx = 0;
- ulong pow = 10;
- ulong number = value;
-
- // need to calculate the number of places to know if we need to round later
- while (value >= 10) {
- value /= 10;
- exp++;
- }
-
- if (exp > padding) {
-
- // highest number we should goto before we round
- while (idx++ <= padding)
- pow *= 10;
-
- // get our value into a buffer
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
- }
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number% 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
- idx = 0;
-
- // we know we have at least one in there, followed
- // by a decimal point
- buffy[idx++] = tmp[position++];
- if (precision != 0)
- buffy[idx++] = '.';
-
- // copy over the remaining digits until we run out,
- // or we've passed our specified precision
- while (padding > 0 && position < maxLongLength) {
- buffy[idx++] = tmp[position++];
- padding--;
- }
-
- // if we still have more precision to go, add some
- // zeros
- while (padding > 0) {
- buffy[idx++] = '0';
- padding--;
- }
-
- // we know these next 3 spots
- buffy[idx++] = upper ? 'E' : 'e';
- buffy[idx++] = '+';
- buffy[idx++] = '0';
-
- // next two digits depend on our length
- if (exponent >= 10) {
- buffy[idx++] = digitLowerTable[(exponent / 10)];
- buffy[idx] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[idx++] = '0';
- buffy[idx] = digitLowerTable[exponent];
- }
-
- return new string(buffy, 0, ++idx);
- }
-
- // ============ Format Fixed Points ============ //
-
- //
- // Used for strings in the following form "[-]M.DD...D"
- // At least one non-zero digit precedes the '.', w/ a
- // '-' before that if negative. Precision specifies number
- // of decimal places 'D' to go. If not given, use
- // NumberFormatInfo.NumbeDecimalDigits. Results are rounded
- // if necessary.
- //
- // Fairly simple implementation for integral types. Going
- // from right to left, fill up precision number of 0's,
- // plop a . down, then go for our number.
- //
-
- private static string FormatFixedPoint (byte value, int precision, NumberFormatInfo nfi)
- {
- return FormatFixedPoint ((uint)value, precision, nfi);
- }
-
- private static string FormatFixedPoint (short value, int precision, NumberFormatInfo nfi)
- {
- return FormatFixedPoint ((int)value, precision, nfi);
- }
-
- private static string FormatFixedPoint (int value, int precision, NumberFormatInfo nfi)
- {
- int padding = (precision >= 0) ? (precision + maxIntLength) : (nfi.NumberDecimalDigits + maxIntLength);
- char[] buffy = new char[padding];
- int position = padding;
- bool negative = (value < 0);
-
- // fill up w/ precision # of 0's
- while (position > (maxIntLength - 1))
- buffy[--position] = '0';
-
- if (precision != 0)
- buffy[position--] = '.';
-
- if (negative)
- if (value <= -10) {
- buffy[position--] = digitLowerTable[-(value % 10)];
- value = value / -10;
- } else value = -value;
-
- // fill up w/ the value
- while (value >= 10) {
- buffy[position--] = digitLowerTable[(value % 10)];
- value = value / 10;
- }
-
- buffy[position] = digitLowerTable[value];
-
- if (negative)
- buffy[--position] = '-';
-
- return new string (buffy, position, (padding - position));
- }
-
- private static string FormatFixedPoint (long value, int precision, NumberFormatInfo nfi)
- {
- int padding = (precision >= 0) ? (precision + maxLongLength) : (nfi.NumberDecimalDigits + maxLongLength);
- char[] buffy = new char[padding];
- int position = padding;
- bool negative = (value < 0);
-
- // fill up w/ precision # of 0's
- while (position > (maxLongLength - 1))
- buffy[--position] = '0';
-
- if (precision != 0)
- buffy[position--] = '.';
-
- if (negative)
- if (value <= -10) {
- buffy[position--] = digitLowerTable[-(value % 10)];
- value = value / -10;
- } else value = -value;
-
- // fill up w/ the value
- while (value >= 10) {
- buffy[position--] = digitLowerTable[(value % 10)];
- value = value / 10;
- }
-
- buffy[position] = digitLowerTable[value];
-
- if (negative)
- buffy[--position] = '-';
-
- return new string (buffy, position, (padding - position));
- }
-
- private static string FormatFixedPoint (sbyte value, int precision, NumberFormatInfo nfi)
- {
- return FormatFixedPoint ((int)value, precision, nfi);
- }
-
- private static string FormatFixedPoint (ushort value, int precision, NumberFormatInfo nfi)
- {
- return FormatFixedPoint ((uint)value, precision, nfi);
- }
-
- private static string FormatFixedPoint (uint value, int precision, NumberFormatInfo nfi)
- {
- int padding = (precision >= 0) ? (precision + maxIntLength) : (nfi.NumberDecimalDigits + maxIntLength);
- char[] buffy = new char[padding];
- int position = padding;
-
- // fill up w/ precision # of 0's
- while (position > (maxIntLength - 1))
- buffy[--position] = '0';
-
- if (precision != 0)
- buffy[position--] = '.';
-
- // fill up w/ the value
- while (value >= 10) {
- buffy[position--] = digitLowerTable[(value % 10)];
- value = value / 10;
- }
-
- buffy[position] = digitLowerTable[value];
-
- return new string (buffy, position, (padding - position));
- }
-
- private static string FormatFixedPoint (ulong value, int precision, NumberFormatInfo nfi)
- {
- int padding = (precision >= 0) ? (precision + maxLongLength) : (nfi.NumberDecimalDigits + maxLongLength);
- char[] buffy = new char[padding];
- int position = padding;
-
- // fill up w/ precision # of 0's
- while (position > (maxLongLength - 1))
- buffy[--position] = '0';
-
- if (precision != 0)
- buffy[position--] = '.';
-
- // fill up w/ the value
- while (value >= 10) {
- buffy[position--] = digitLowerTable[(value % 10)];
- value = value / 10;
- }
-
- buffy[position] = digitLowerTable[value];
-
- return new string (buffy, position, (padding - position));
- }
-
- // ============ Format General ============ //
-
- //
- // Strings are formatted in either Fixed Point or Exponential
- // format. Results are rounded when needed. If no precision is
- // given, the defaults are:
- //
- // short & ushort: 5
- // int & uint: 10
- // long & ulong: 19
- // float: 7
- // double: 15
- // decimal: 29
- //
- // The value is formatted using fixed-point if exponent >= -4
- // and exponent < precision, where exponent is he exponenent of
- // the value in exponential format. The decimal point and trailing
- // zeros are removed when possible.
- //
- // For all other values, exponential format is used. The case of
- // the format specifier determines whether 'e' or 'E' prefixes
- // the exponent.
- //
- // In either case, the number of digits that appear in the result
- // (not including the exponent) will not exceed the value of the
- // precision. The result is rounded as needed.
- //
- // Integral values are formatted using Fixed Point whenever
- // precision is omitted. (This actually doesn't make sense when
- // coupled w/ the 1st paragraph).
- //
- // Okay, so the decimal point is removed along with any trailing
- // zeros. So, ignoring the last paragraph, we can consider an int
- // ToString() to format it w/ exponential format w/ a default
- // precision of 10, but since it will just be .00000000, it's
- // discarded.
- //
-
- private static string FormatGeneral (byte value, int precision, NumberFormatInfo nfi, bool upper) {
- return FormatGeneral ((uint)value, precision, nfi, upper);
- }
-
- private static string FormatGeneral (short value, int precision, NumberFormatInfo nfi, bool upper) {
- return FormatGeneral ((int)value, precision, nfi, upper);
- }
-
- private static string FormatGeneral (int value, int precision, NumberFormatInfo nfi, bool upper)
- {
- bool negative = (value < 0);
- char[] tmp = new char [maxIntLength];
- int exponent = 0;
- int position = maxIntLength;
-
- // ugly, but doing it since abs(Int32.MinValue) > Int.MaxValue
- uint number = (negative) ? (uint)((-(value + 1)) + 1) : (uint)value;
-
- // get number into a buffer, going to be doing this no matter what
- if (negative)
- if (value <= -10) {
- tmp[--position] = digitLowerTable[-(value % 10)];
- value /= -10;
- exponent++;
- } else value = -value;
-
- while (value >= 10) {
- tmp[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[value];
-
- // integral values are formatted using fixed point when precision
- // is not specified. But also trailing decimal point and zeros are
- // discared. So for int's it will always be .00, so just compute
- // here and save the call to FormatFixedPoint & trim.
- if (precision <= 0 || exponent < precision) {
- if (negative)
- tmp[--position] = '-';
-
- return new string (tmp, position, (maxIntLength - position));
- }
-
- // else our exponent was > precision, use exponential format
- // precision = number of digits to show.
- int idx = 0;
- ulong pow = 1;
-
- exponent = 0;
- position = maxIntLength;
-
- // Loop through while our number is less than the 10 ^ precision, then
- // add 5 to that to round it out, and keep continuing
- while (idx++ <= precision)
- pow *= 10;
-
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
-
- // finally, make our final buffer, at least precision + 6 for 'E+XX' and '-'
- // and reuse pow for size
- idx = position;
- position = 0;
- pow = (ulong)(precision + 6);
- char[] buffy = new char[pow];
-
- if (negative)
- buffy[position++] = '-';
-
- buffy[position++] = tmp[idx++];
- buffy[position] = '.';
-
- // for the remaining precisions copy over rounded tmp
- precision--;
- while (precision-- > 0)
- buffy[++position] = tmp[idx++];
-
- // get rid of ending zeros
- while (buffy[position] == '0')
- position--;
-
- // if we backed up all the way to the ., over write it
- if (buffy[position] != '.')
- position++;
-
- // ints can only be +, e or E depending on format, plus XX
- buffy[position++] = upper ? 'E' : 'e';
- buffy[position++] = '+';
-
- if (exponent >= 10) {
- buffy[position++] = digitLowerTable[(exponent / 10)];
- buffy[position++] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[position++] = '0';
- buffy[position++] = digitLowerTable[exponent];
- }
-
- return new string (buffy, 0, position);
- }
-
- private static string FormatGeneral (long value, int precision, NumberFormatInfo nfi, bool upper)
- {
- bool negative = (value < 0);
- char[] tmp = new char [maxLongLength];
- int exponent = 0;
- int position = maxLongLength;
-
- // ugly, but doing it since abs(Int32.MinValue) > Int.MaxValue
- ulong number = (negative) ? (ulong)(-(value + 1) + 1) : (ulong)value;
-
- // get number into a buffer, going to be doing this no matter what
- if (negative)
- if (value <= -10) {
- tmp[--position] = digitLowerTable[-(value % 10)];
- value /= -10;
- } else value = -value;
-
- while (value >= 10) {
- tmp[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- tmp[--position] = digitLowerTable[value];
- exponent = (maxLongLength - position) - 1;
-
- // integral values are formatted using fixed point when precision
- // is not specified. But also trailing decimal point and zeros are
- // discared. So for int's it will always be .00, so just compute
- // here and save the call to FormatFixedPoint & trim.
- if (precision <= 0 || exponent < precision) {
- if (negative)
- tmp[--position] = '-';
-
- return new string (tmp, position, (maxLongLength - position));
- }
-
- // else our exponent was > precision, use exponential format
- // precision = number of digits to show.
- int idx = 0;
- ulong pow = 1;
-
- exponent = 0;
- position = maxLongLength;
-
- // Loop through while our number is less than the 10 ^ precision, then
- // add 5 to that to round it out, and keep continuing
- while (idx++ <= precision)
- pow *= 10;
-
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
-
- // finally, make our final buffer, at least precision + 6 for 'E+XX' and '-'
- // and reuse pow for size
- idx = position;
- position = 0;
- pow = (ulong)precision + 6;
- char[] buffy = new char[pow];
-
- if (negative)
- buffy[position++] = '-';
-
- buffy[position++] = tmp[idx++];
- buffy[position] = '.';
-
- // for the remaining precisions copy over rounded tmp
- precision--;
- while (precision-- > 0)
- buffy[++position] = tmp[idx++];
-
- // get rid of ending zeros
- while (buffy[position] == '0')
- position--;
-
- // if we backed up all the way to the ., over write it
- if (buffy[position] != '.')
- position++;
-
- // ints can only be +, e or E depending on format, plus XX
- buffy[position++] = upper ? 'E' : 'e';
- buffy[position++] = '+';
-
- if (exponent >= 10) {
- buffy[position++] = digitLowerTable[(exponent / 10)];
- buffy[position++] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[position++] = '0';
- buffy[position++] = digitLowerTable[exponent];
- }
-
- return new string (buffy, 0, position);
- }
-
- private static string FormatGeneral (sbyte value, int precision, NumberFormatInfo nfi, bool upper) {
- return FormatGeneral ((int)value, precision, nfi, upper);
- }
-
- private static string FormatGeneral (ushort value, int precision, NumberFormatInfo nfi, bool upper) {
- return FormatGeneral ((uint)value, precision, nfi, upper);
- }
-
- private static string FormatGeneral (uint value, int precision, NumberFormatInfo nfi, bool upper)
- {
- char[] tmp = new char [maxIntLength];
- int exponent = 0;
- int position = maxIntLength;
- ulong number = (ulong)value;
-
- // get number into a buffer, going to be doing this no matter what
- while (value >= 10) {
- tmp[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- tmp[--position] = digitLowerTable[value];
- exponent = (maxIntLength - position) - 1;
-
- // integral values are formatted using fixed point when precision
- // is not specified. But also trailing decimal point and zeros are
- // discared. So for int's it will always be .00, so just compute
- // here and save the call to FormatFixedPoint & trim.
- if (precision <= 0 || exponent < precision)
- return new string (tmp, position, (maxIntLength - position));
-
- // else our exponent was > precision, use exponential format
- // precision = number of digits to show.
- int idx = 0;
- ulong pow = 1;
-
- exponent = 0;
- position = maxIntLength;
-
- // Loop through while our number is less than the 10 ^ precision, then
- // add 5 to that to round it out, and keep continuing
- while (idx++ <= precision)
- pow *= 10;
-
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
-
- // finally, make our final buffer, at least precision + 6 for 'E+XX' and '-'
- // and reuse pow for size
- idx = position;
- position = 0;
- pow = (ulong)(precision + 6);
- char[] buffy = new char[pow];
-
- buffy[position++] = tmp[idx++];
- buffy[position] = '.';
-
- // for the remaining precisions copy over rounded tmp
- precision--;
- while (precision-- > 0)
- buffy[++position] = tmp[idx++];
-
- // get rid of ending zeros
- while (buffy[position] == '0')
- position--;
-
- // if we backed up all the way to the ., over write it
- if (buffy[position] != '.')
- position++;
-
- // ints can only be +, e or E depending on format, plus XX
- buffy[position++] = upper ? 'E' : 'e';
- buffy[position++] = '+';
-
- if (exponent >= 10) {
- buffy[position++] = digitLowerTable[(exponent / 10)];
- buffy[position++] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[position++] = '0';
- buffy[position++] = digitLowerTable[exponent];
- }
-
- return new string (buffy, 0, position);
- }
-
- private static string FormatGeneral (ulong value, int precision, NumberFormatInfo nfi, bool upper)
- {
- char[] tmp = new char [maxLongLength];
- int exponent = 0;
- int position = maxLongLength;
- ulong number = value;
-
- // get number into a buffer, going to be doing this no matter what
- while (value >= 10) {
- tmp[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[value];
-
- // integral values are formatted using fixed point when precision
- // is not specified. But also trailing decimal point and zeros are
- // discared. So for int's it will always be .00, so just compute
- // here and save the call to FormatFixedPoint & trim.
- if (precision <= 0 || exponent < precision)
- return new string (tmp, position, (maxLongLength - position));
-
- // else our exponent was > precision, use exponential format
- // precision = number of digits to show.
- int idx = 0;
- ulong pow = 1;
-
- exponent = 0;
- position = maxLongLength;
-
- // Loop through while our number is less than the 10 ^ precision, then
- // add 5 to that to round it out, and keep continuing
- while (idx++ <= precision)
- pow *= 10;
-
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
-
- // finally, make our final buffer, at least precision + 6 for 'E+XX' and '-'
- // and reuse pow for size
- idx = position;
- position = 0;
- pow = (ulong)precision + 6;
- char[] buffy = new char[pow];
-
- buffy[position++] = tmp[idx++];
- buffy[position] = '.';
-
- // for the remaining precisions copy over rounded tmp
- precision--;
- while (precision-- > 0)
- buffy[++position] = tmp[idx++];
-
- // get rid of ending zeros
- while (buffy[position] == '0')
- position--;
-
- // if we backed up all the way to the ., over write it
- if (buffy[position] != '.')
- position++;
-
- // ints can only be +, e or E depending on format, plus XX
- buffy[position++] = upper ? 'E' : 'e';
- buffy[position++] = '+';
-
- if (exponent >= 10) {
- buffy[position++] = digitLowerTable[(exponent / 10)];
- buffy[position++] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[position++] = '0';
- buffy[position++] = digitLowerTable[exponent];
- }
-
- return new string (buffy, 0, position);
- }
-
- // ============ Format Number ============ //
-
- //
- // Used for strings in the following form "[-]d,ddd,ddd.dd...d"
- // The minus sign only appears if it is negative. At least one
- // non-zero digit preceeds the decimal separator. The precision
- // specifier determines the number of decimal places. If it is
- // not given, use NumberFormatInfo.NumberDecimalDigits.
- // The NumberGroupSizes, NumberGroupSeparator, and NumberDecimalSeparator
- // members of NumberFormatInfo supply the size and separator
- // for digit groupings. See IFormattable.
- //
- // The group sizes is an array of ints that determine the grouping
- // of numbers. All digits are in the range 1-9, with the last digit
- // being between 0-9. The number formats the string backwards, with
- // the last digit being the group size for the rest of (leftmost) the
- // the string, 0 being none.
- //
- // For instance:
- // groupSizes = { 3, 2, 1, 0 };
- // int n = 1234567890 => "1234,5,67,890"
- // groupSizes = { 3, 2, 1 };
- // int n = 1234567890 => "1,2,3,4,5,67,890"
- // groupSizes = { 2, 0 };
- // int n = 1234567890 => "1234567,90";
- //
- // Not too difficult, jsut keep track of where you are in the array
- // and when to print the separator
- //
- // The max size of the buffer is assume we have a separator every
- // number, plus the precision on the end, plus a spot for the negative
- // and a spot for decimal separator.
- //
-
- private static string FormatNumber (byte value, int precision, NumberFormatInfo nfi) {
- return FormatNumber ((uint)value, precision, nfi);
- }
-
- private static string FormatNumber (short value, int precision, NumberFormatInfo nfi) {
- return FormatNumber ((int)value, precision, nfi);
- }
-
- private static string FormatNumber (int value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- char[] groupSeparator = nfi.NumberGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.NumberDecimalSeparator.ToCharArray ();
- int[] groupSizes = nfi.NumberGroupSizes;
-
- int padding = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- int pattern = nfi.NumberNegativePattern;
- int size = maxIntLength + (maxIntLength * groupSeparator.Length) + padding +
- decimalSeparator.Length + 4;
- char[] buffy = new char[size];
- int position = size;
- bool negative = (value < 0);
-
- // pattern for negative values, defined in NumberFormatInfo
- if (negative) {
- switch (pattern) {
- case 0: // (nnn)
- buffy[--position] = ')';
- break;
- // case 1: // -nnn
- // break;
- // case 2: // - nnn
- // break;
- case 3: // nnn-
- buffy[--position] = '-';
- break;
- case 4: // nnn -
- buffy[--position] = '-';
- buffy[--position] = ' ';
- break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator
- if (position != size) {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // negative hack for numbers past MinValue
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // pattern for negative values, defined in NumberFormatInfo
- if (negative) {
- switch (pattern) {
- case 0: // (nnn)
- buffy[--position] = '(';
- break;
- case 1: // -nnn
- buffy[--position] = '-';
- break;
- case 2: // - nnn
- buffy[--position] = ' ';
- buffy[--position] = '-';
- break;
- // case 3: // nnn-
- // break;
- // case 4: // nnn -
- // break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatNumber (long value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- char[] groupSeparator = nfi.NumberGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.NumberDecimalSeparator.ToCharArray ();
- int[] groupSizes = nfi.NumberGroupSizes;
-
- int padding = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- int pattern = nfi.NumberNegativePattern;
- int size = maxLongLength + (maxLongLength * groupSeparator.Length) + padding +
- decimalSeparator.Length + 4;
- char[] buffy = new char[size];
- int position = size;
- bool negative = (value < 0);
-
- // pattern for negative values, defined in NumberFormatInfo
- if (negative) {
- switch (pattern) {
- case 0: // (nnn)
- buffy[--position] = ')';
- break;
- // case 1: // -nnn
- // break;
- // case 2: // - nnn
- // break;
- case 3: // nnn-
- buffy[--position] = '-';
- break;
- case 4: // nnn -
- buffy[--position] = '-';
- buffy[--position] = ' ';
- break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator
- if (position != size) {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // negative hack for numbers past MinValue
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // pattern for negative values, defined in NumberFormatInfo
- if (negative) {
- switch (pattern) {
- case 0: // (nnn)
- buffy[--position] = '(';
- break;
- case 1: // -nnn
- buffy[--position] = '-';
- break;
- case 2: // - nnn
- buffy[--position] = ' ';
- buffy[--position] = '-';
- break;
- // case 3: // nnn-
- // break;
- // case 4: // nnn -
- // break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatNumber (sbyte value, int precision, NumberFormatInfo nfi) {
- return FormatNumber ((int)value, precision, nfi);
- }
-
- private static string FormatNumber (ushort value, int precision, NumberFormatInfo nfi) {
- return FormatNumber ((uint)value, precision, nfi);
- }
-
- private static string FormatNumber (uint value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- char[] groupSeparator = nfi.NumberGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.NumberDecimalSeparator.ToCharArray ();
- int[] groupSizes = nfi.NumberGroupSizes;
-
- int padding = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- int size = maxIntLength + (maxIntLength * groupSeparator.Length) + padding +
- decimalSeparator.Length + 2;
- char[] buffy = new char[size];
- int position = size;
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator
- if (position != size) {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatNumber (ulong value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- char[] groupSeparator = nfi.NumberGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.NumberDecimalSeparator.ToCharArray ();
- int[] groupSizes = nfi.NumberGroupSizes;
-
- int padding = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- int size = maxLongLength + (maxLongLength * groupSeparator.Length) + padding +
- decimalSeparator.Length + 2;
- char[] buffy = new char[size];
- int position = size;
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator
- if (position != size) {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- return new string (buffy, position, (size - position));
- }
-
- // ============ Percent Formatting ============ //
-
- //
- // Percent Format: Used for strings containing a percentage. The
- // PercentSymbol, PercentGroupSizes, PercentGroupSeparator, and
- // PercentDecimalSeparator members of a NumberFormatInfo supply
- // the Percent symbol, size and separator for digit groupings, and
- // decimal separator, respectively.
- // PercentNegativePattern and PercentPositivePattern determine the
- // symbols used to represent negative and positive values. For example,
- // a negative value may be prefixed with a minus sign, or enclosed in
- // parentheses.
- // If no precision is specified, the number of decimal places in the result
- // is set by NumberFormatInfo.PercentDecimalDigits. Results are
- // rounded to the nearest representable value when necessary.
- // The result is scaled by 100 (.99 becomes 99%).
- //
- // The pattern of the number determines how the output looks, where
- // the percent sign goes, where the negative sign goes, etc.
- // IFormattable documentation lists the patterns and their values,
- // I have them commented out in the switch statement
- //
-
- private static string FormatPercent (byte value, int precision, NumberFormatInfo nfi)
- {
- return FormatPercent ((uint)value, precision, nfi);
- }
-
- private static string FormatPercent (short value, int precision, NumberFormatInfo nfi)
- {
- return FormatPercent ((int)value, precision, nfi);
- }
-
- private static string FormatPercent (int value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- bool negative = (value < 0);
-
- char[] groupSeparator = nfi.PercentGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.PercentDecimalSeparator.ToCharArray ();
- char[] percentSymbol = nfi.PercentSymbol.ToCharArray ();
- int[] groupSizes = nfi.PercentGroupSizes;
- int pattern = negative ? nfi.PercentNegativePattern : nfi.PercentPositivePattern;
- int symbolLength = percentSymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.PercentDecimalDigits;
- int size = maxIntLength + (groupSeparator.Length * maxIntLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // -nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // -nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // -%nnn
- // break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- case 0: // nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // %nnn
- // break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // all values are multiplied by 100, so tack on two 0's
- if (value != 0)
- for (int c = 0; c < 2; c++) {
- buffy[--position] = '0';
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- // negative hack for numbers past MinValue
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // -nnn %
- buffy[--position] = '-';
- break;
- case 1: // -nnn%
- buffy[--position] = '-';
- break;
- case 2: // -%nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- // case 0: // nnn %
- // break;
- // case 1: // nnn%
- // break;
- case 2: // %nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatPercent (long value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- bool negative = (value < 0);
-
- char[] groupSeparator = nfi.PercentGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.PercentDecimalSeparator.ToCharArray ();
- char[] percentSymbol = nfi.PercentSymbol.ToCharArray ();
- int[] groupSizes = nfi.PercentGroupSizes;
- int pattern = negative ? nfi.PercentNegativePattern : nfi.PercentPositivePattern;
- int symbolLength = percentSymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.PercentDecimalDigits;
- int size = maxLongLength + (groupSeparator.Length * maxLongLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // -nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // -nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // -%nnn
- // break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- case 0: // nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // %nnn
- // break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // all values are multiplied by 100, so tack on two 0's
- if (value != 0)
- for (int c = 0; c < 2; c++) {
- buffy[--position] = '0';
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- // negative hack for numbers past MinValue
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // -nnn %
- buffy[--position] = '-';
- break;
- case 1: // -nnn%
- buffy[--position] = '-';
- break;
- case 2: // -%nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- // case 0: // nnn %
- // break;
- // case 1: // nnn%
- // break;
- case 2: // %nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatPercent (sbyte value, int precision, NumberFormatInfo nfi)
- {
- return FormatPercent ((int)value, precision, nfi);
- }
-
- private static string FormatPercent (ushort value, int precision, NumberFormatInfo nfi)
- {
- return FormatPercent ((uint)value, precision, nfi);
- }
-
- private static string FormatPercent (uint value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
-
- char[] groupSeparator = nfi.PercentGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.PercentDecimalSeparator.ToCharArray ();
- char[] percentSymbol = nfi.PercentSymbol.ToCharArray ();
- int[] groupSizes = nfi.PercentGroupSizes;
- int pattern = nfi.PercentPositivePattern;
- int symbolLength = percentSymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.PercentDecimalDigits;
- int size = maxIntLength + (groupSeparator.Length * maxIntLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- i = symbolLength;
- switch (pattern) {
- case 0: // -nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // -nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // -%nnn
- // break;
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- if (value != 0)
- for (int c = 0; c < 2; c++) {
- buffy[--position] = '0';
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- i = symbolLength;
- switch (pattern) {
- // case 0: // nnn %
- // break;
- // case 1: // nnn%
- // break;
- case 2: // %nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatPercent (ulong value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
-
- char[] groupSeparator = nfi.PercentGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.PercentDecimalSeparator.ToCharArray ();
- char[] percentSymbol = nfi.PercentSymbol.ToCharArray ();
- int[] groupSizes = nfi.PercentGroupSizes;
- int pattern = nfi.PercentPositivePattern;
- int symbolLength = percentSymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.PercentDecimalDigits;
- int size = maxLongLength + (groupSeparator.Length * maxLongLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- i = symbolLength;
- switch (pattern) {
- case 0: // -nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // -nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // -%nnn
- // break;
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- if (value != 0)
- for (int c = 0; c < 2; c++) {
- buffy[--position] = '0';
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- i = symbolLength;
- switch (pattern) {
- // case 0: // nnn %
- // break;
- // case 1: // nnn%
- // break;
- case 2: // %nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- }
-
- return new string (buffy, position, (size - position));
- }
-
- // ============ Format Hexadecimal ============ //
-
- //
- // For strings in base 16. Only valid w/ integers. Precision
- // specifies number of digits in the string, if it specifies
- // more digits than we need, left pad w/ 0's. The case of the
- // the format specifier 'X' or 'x' determines lowercase or
- // capital digits in the output.
- //
- // Whew. Straight forward Hex formatting, however only
- // go 8 places max when dealing with an int (not counting
- // precision padding) and 16 when dealing with a long. This
- // is to cut off the loop when dealing with negative values,
- // which will loop forever when you hit -1;
- //
-
- private static string FormatHexadecimal (byte value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxByteLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- ushort mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. Don't worry about negative
- do {
- buffy[--position] = table[(value & mask)];
- value = (byte)(value >> 4);
- } while (value != 0);
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (short value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxShortLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- short mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. If value is negavite stop after 4 F's
- do {
- buffy[--position] = table[(value & mask)];
- value = (short)(value >> 4);
- } while (value != 0 && position > (size - 4));
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (int value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxIntLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- int mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. If value is negavite stop after 8 F's
- do {
- buffy[--position] = table[(value & mask)];
- value = value >> 4;
- } while (value != 0 && position > (size - 8));
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (long value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxLongLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- long mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. If value is negavite stop after 16 F's
- do {
- buffy[--position] = table[(value & mask)];
- value = value >> 4;
- } while (value != 0 && position > (size - 16));
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (sbyte value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxByteLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- short mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. If value is negavite stop after 2 F's
- do {
- buffy[--position] = table[(value & mask)];
- value = (sbyte)(value >> 4);
- } while (value != 0 && position > (size - 2));
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (ushort value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxShortLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- int mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. Don't worry about negative
- do {
- buffy[--position] = table[(value & mask)];
- value = (ushort)(value >> 4);
- } while (value != 0);
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (uint value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxIntLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- uint mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. Don't worry about negative
- do {
- buffy[--position] = table[(value & mask)];
- value = value >> 4;
- } while (value != 0);
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (ulong value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxLongLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- ulong mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. Don't worry about negative
- do {
- buffy[--position] = table[value & mask];
- value = value >> 4;
- } while (value != 0);
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/InvalidCastException.cs b/mcs/class/corlib/System/InvalidCastException.cs
deleted file mode 100644
index 1556f840aa9..00000000000
--- a/mcs/class/corlib/System/InvalidCastException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.InvalidCastException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class InvalidCastException : SystemException {
- // Constructors
- public InvalidCastException ()
- : base (Locale.GetText ("Cannot cast from source type to destination type"))
- {
- }
-
- public InvalidCastException (string message)
- : base (message)
- {
- }
-
- public InvalidCastException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected InvalidCastException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/InvalidOperationException.cs b/mcs/class/corlib/System/InvalidOperationException.cs
deleted file mode 100644
index fddef520eb6..00000000000
--- a/mcs/class/corlib/System/InvalidOperationException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.InvalidOperationException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
- [Serializable]
- public class InvalidOperationException : SystemException {
- // Constructors
- public InvalidOperationException ()
- : base (Locale.GetText ("The requested operation cannot be performed"))
- {
- }
-
- public InvalidOperationException (string message)
- : base (message)
- {
- }
-
- public InvalidOperationException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected InvalidOperationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/InvalidProgramException.cs b/mcs/class/corlib/System/InvalidProgramException.cs
deleted file mode 100644
index af49aa64e45..00000000000
--- a/mcs/class/corlib/System/InvalidProgramException.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.InvalidProgramException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-namespace System {
-
- public sealed class InvalidProgramException : SystemException {
- // Constructors
- public InvalidProgramException ()
- : base (Locale.GetText ("Metadata is incorrect"))
- {
- }
-
- public InvalidProgramException (string message)
- : base (message)
- {
- }
-
- public InvalidProgramException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/LoaderOptimization.cs b/mcs/class/corlib/System/LoaderOptimization.cs
deleted file mode 100644
index 23b865a32e5..00000000000
--- a/mcs/class/corlib/System/LoaderOptimization.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.LoaderOptimization.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- public enum LoaderOptimization
- {
- NotSpecified = 0,
- SingleDomain = 1,
- MultiDomain = 2,
- MultiDomainHost = 3
- }
-}
diff --git a/mcs/class/corlib/System/LoaderOptimizationAttribute.cs b/mcs/class/corlib/System/LoaderOptimizationAttribute.cs
deleted file mode 100644
index 62783746da9..00000000000
--- a/mcs/class/corlib/System/LoaderOptimizationAttribute.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.LoaderOptimizationAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Method)]
- public class LoaderOptimizationAttribute : Attribute
- {
- private LoaderOptimization lo;
-
- // Constructors
- public LoaderOptimizationAttribute (byte value)
- {
- lo = (LoaderOptimization) value;
- }
-
- public LoaderOptimizationAttribute (LoaderOptimization value)
- {
- lo = value;
- }
-
- // Properties
- public LoaderOptimization Value
- {
- get { return lo; }
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/LocalDataStoreSlot.cs b/mcs/class/corlib/System/LocalDataStoreSlot.cs
deleted file mode 100755
index 721d3ca880e..00000000000
--- a/mcs/class/corlib/System/LocalDataStoreSlot.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.LocalDataStoreSlot.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace System
-{
- public sealed class LocalDataStoreSlot
- {
- }
-}
diff --git a/mcs/class/corlib/System/MTAThreadAttribute.cs b/mcs/class/corlib/System/MTAThreadAttribute.cs
deleted file mode 100644
index 6c44026c934..00000000000
--- a/mcs/class/corlib/System/MTAThreadAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.MTAThreadAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Method)]
- public class MTAThreadAttribute : Attribute
- {
- // Constructors
- public MTAThreadAttribute () : base ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/MarshalByRefObject.cs b/mcs/class/corlib/System/MarshalByRefObject.cs
deleted file mode 100644
index a4392626bc3..00000000000
--- a/mcs/class/corlib/System/MarshalByRefObject.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.MarshalByRefObject.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting;
-
-namespace System {
-
- public abstract class MarshalByRefObject {
-
- public virtual ObjRef CreateObjRef (Type type)
- {
- return null;
- }
-
- public object GetLifeTimeService ()
- {
- return null;
- }
-
- public virtual object InitializeLifeTimeService ()
- {
- return null;
- }
-
- protected MarshalByRefObject ()
- {
- }
-
- public override string ToString () {
- return "MarshalByRefObject";
- }
- }
-}
diff --git a/mcs/class/corlib/System/Math.cs b/mcs/class/corlib/System/Math.cs
deleted file mode 100644
index 4b9b5808487..00000000000
--- a/mcs/class/corlib/System/Math.cs
+++ /dev/null
@@ -1,344 +0,0 @@
-//
-// System.Math.cs
-//
-// Author:
-// Bob Smith (bob@thestuff.net)
-//
-// (C) 2001 Bob Smith. http://www.thestuff.net
-//
-
-using System;
-using System.PAL;
-using System.Globalization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- [CLSCompliant(false)]
- public sealed class Math
- {
- public const double E = 2.7182818284590452354;
- public const double PI = 3.14159265358979323846;
- public static decimal Abs(decimal value)
- {
- return (value < 0)? -value: value;
- }
- public static double Abs(double value)
- {
- return (value < 0)? -value: value;
- }
- public static float Abs(float value)
- {
- return (value < 0)? -value: value;
- }
- public static int Abs(int value)
- {
- if (value == Int32.MinValue)
- throw new OverflowException (Locale.GetText (Locale.GetText ("Value is too small")));
- return (value < 0)? -value: value;
- }
- public static long Abs(long value)
- {
- if (value == Int64.MinValue)
- throw new OverflowException(Locale.GetText ("Value is too small"));
- return (value < 0)? -value: value;
- }
- public static sbyte Abs(sbyte value)
- {
- if (value == SByte.MinValue)
- throw new OverflowException(Locale.GetText ("Value is too small"));
- return (sbyte)((value < 0)? -value: value);
- }
- public static short Abs(short value)
- {
- if (value == Int16.MinValue)
- throw new OverflowException(Locale.GetText ("Value is too small"));
- return (short)((value < 0)? -value: value);
- }
-
- public static double Acos(double d)
- {
- if (d < -1 || d > 1) return Double.NaN;
- return OpSys.Acos(d);
- }
-
- public static double Asin(double d)
- {
- if (d < -1 || d > 1) return Double.NaN;
- return OpSys.Asin(d);
- }
-
- public static double Atan(double d)
- {
- return OpSys.Atan(d);
- }
-
- public static double Atan2(double y, double x)
- {
- return OpSys.Atan2(y, x);
- }
-
- public static double Ceiling(double a)
- {
- double b = (double)((long)a);
- return (b < a)? b+1: b;
- }
-
- public static double Cos(double d)
- {
- return OpSys.Cos(d);
- }
-
- public static double Cosh(double value)
- {
- return OpSys.Cosh(value);
- }
-
- public static double Exp(double d)
- {
- return OpSys.Exp(d);
- }
-
- public static double Floor(double d) {
- return (double)((long)d) ;
- }
- public static double IEEERemainder(double x, double y)
- {
- double r;
- if (y == 0) return Double.NaN;
- r = x - (y * Math.Round(x/y));
- if (r != 0) return r;
- return (x > 0)? 0: -0;
- }
-
- public static double Log(double d)
- {
- if (d == 0) return Double.NegativeInfinity;
- else if (d < 0) return Double.NaN;
- return OpSys.Log(d);
- }
- public static double Log(double a, double newBase)
- {
- if (a == 0) return Double.NegativeInfinity;
- else if (a < 0) return Double.NaN;
- return OpSys.Log(a)/OpSys.Log(newBase);
- }
-
- public static double Log10(double d)
- {
- if (d == 0) return Double.NegativeInfinity;
- else if (d < 0) return Double.NaN;
- return OpSys.Log10(d);
- }
- public static byte Max(byte val1, byte val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static decimal Max(decimal val1, decimal val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static double Max(double val1, double val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static float Max(float val1, float val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static int Max(int val1, int val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static long Max(long val1, long val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static sbyte Max(sbyte val1, sbyte val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static short Max(short val1, short val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static uint Max(uint val1, uint val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static ulong Max(ulong val1, ulong val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static ushort Max(ushort val1, ushort val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static byte Min(byte val1, byte val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static decimal Min(decimal val1, decimal val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static double Min(double val1, double val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static float Min(float val1, float val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static int Min(int val1, int val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static long Min(long val1, long val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static sbyte Min(sbyte val1, sbyte val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static short Min(short val1, short val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static uint Min(uint val1, uint val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static ulong Min(ulong val1, ulong val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static ushort Min(ushort val1, ushort val2)
- {
- return (val1 < val2)? val1: val2;
- }
-
- public static double Pow(double x, double y)
- {
- return OpSys.Pow(x, y);
- }
-
- public static decimal Round(decimal d)
- {
- decimal r = (decimal)((long)d);
- decimal a = d-r;
- if (a > .5M) return ++r;
- else if (a <.5M) return r;
- else
- {
- if (r%2 == 0) return r;
- else return ++r;
- }
- }
- public static decimal Round(decimal d, int decimals)
- {
- long p = 10;
- int c;
- decimal retval = d;
- if (decimals < 0 || decimals > 15)
- throw new ArgumentOutOfRangeException(Locale.GetText (
- "Value is too small or too big."));
- else if (decimals == 0)
- return Math.Round(d);
- for (c=0; c<decimals; c++) p*=10;
- retval*=p;
- retval=Math.Round(retval);
- retval/=p;
- return retval;
- }
- public static double Round(double d)
- {
- double r = (double)((long)d);
- double a = d-r;
- if (a > .5) return ++r;
- else if (a <.5) return r;
- else
- {
- if (r%2 == 0) return r;
- else return ++r;
- }
- }
- public static double Round(double value, int digits) {
- long p = 10;
- int c;
- double retval = value;
- if (digits < 0 || digits > 15)
- throw new ArgumentOutOfRangeException(Locale.GetText (
- "Value is too small or too big."));
- else if (digits == 0)
- return Math.Round(value);
- for (c=0; c<digits; c++) p*=10;
- retval*=p;
- retval=Math.Round(retval);
- retval/=p;
- return retval;
- }
- public static int Sign(decimal value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(double value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(float value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(int value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(long value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(sbyte value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(short value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
-
- public static double Sin(double a)
- {
- return OpSys.Sin(a);
- }
-
- public static double Sinh(double value)
- {
- return OpSys.Sinh(value);
- }
-
- public static double Sqrt(double d)
- {
- if (d < 0) return Double.NaN;
- return OpSys.Sqrt(d);
- }
-
- public static double Tan(double a)
- {
- return OpSys.Tan(a);
- }
-
- public static double Tanh(double value)
- {
- return OpSys.Tanh(value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/MemberAccessException.cs b/mcs/class/corlib/System/MemberAccessException.cs
deleted file mode 100644
index 97a556fb7e4..00000000000
--- a/mcs/class/corlib/System/MemberAccessException.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class MemberAccessException : SystemException {
-
- public MemberAccessException ()
- : base (Locale.GetText ("A member access exception has occurred."))
- {
- }
-
- public MemberAccessException (string message)
- : base (message)
- {
- }
-
- protected MemberAccessException (SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public MemberAccessException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/MethodAccessException.cs b/mcs/class/corlib/System/MethodAccessException.cs
deleted file mode 100644
index a0045a24705..00000000000
--- a/mcs/class/corlib/System/MethodAccessException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.MethodAccessException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class MethodAccessException : SystemException
- {
- // Constructors
- public MethodAccessException ()
- : base (Locale.GetText ("Attempt to access a private/protected method failed."))
- {
- }
-
- public MethodAccessException (string message)
- : base (message)
- {
- }
-
- public MethodAccessException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public MethodAccessException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/MissingFieldException.cs b/mcs/class/corlib/System/MissingFieldException.cs
deleted file mode 100644
index d53b65bd976..00000000000
--- a/mcs/class/corlib/System/MissingFieldException.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.MissingFieldException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class MissingFieldException : MissingMemberException
- {
- // Constructors
- public MissingFieldException ()
- : base (Locale.GetText ("Field does not exist."))
- {
- }
-
- public MissingFieldException (string message)
- : base (message)
- {
- }
-
- protected MissingFieldException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public MissingFieldException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- public MissingFieldException (string className, string fieldName)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/MissingMemberException.cs b/mcs/class/corlib/System/MissingMemberException.cs
deleted file mode 100644
index 5f1f72d9d7a..00000000000
--- a/mcs/class/corlib/System/MissingMemberException.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.MissingMemberException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class MissingMemberException : MemberAccessException {
-
- // Fields
- protected string ClassName;
- protected string MemberName;
- protected byte[] Signature;
- private string msg;
-
- // Constructors
- public MissingMemberException ()
- : base (Locale.GetText ("A missing member exception has occurred."))
- {
- msg = Locale.GetText ("A missing member exception has occured.");
- }
-
- public MissingMemberException (string message)
- : base (message)
- {
- msg = message;
- }
-
- protected MissingMemberException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- ClassName = info.GetString ("MMClassName");
- MemberName = info.GetString ("MMMemberName");
- Signature = (byte[]) info.GetValue ("MMSignature", Signature.GetType ());
- }
-
- public MissingMemberException (string message, Exception inner)
- : base (message, inner)
- {
- msg = message;
- }
-
- public MissingMemberException (string className, string memberName)
- {
- ClassName = className;
- MemberName = memberName;
- }
-
- // Properties
- public override string Message
- {
- get { return msg; }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("MMClassName", ClassName);
- info.AddValue ("MMMemberName", MemberName);
- info.AddValue ("MMSignature", Signature);
-
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/MissingMethodException.cs b/mcs/class/corlib/System/MissingMethodException.cs
deleted file mode 100644
index ea246fc3869..00000000000
--- a/mcs/class/corlib/System/MissingMethodException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-using System.Runtime.Serialization;
-using System.Globalization;
-
-
-namespace System
-{
- [Serializable]
- public class MissingMethodException : MissingMemberException
- {
- public MissingMethodException ()
- : base (Locale.GetText ("A missing method exception has occurred."))
- {
- }
-
- public MissingMethodException (string message)
- : base (message)
- {
- }
-
- protected MissingMethodException (SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public MissingMethodException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
-
-
diff --git a/mcs/class/corlib/System/MonoCustomAttrs.cs b/mcs/class/corlib/System/MonoCustomAttrs.cs
deleted file mode 100755
index 3ed54c9e34c..00000000000
--- a/mcs/class/corlib/System/MonoCustomAttrs.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// System.MonoCustomAttrs.cs
-// Hooks into the runtime to get custom attributes for reflection handles
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (c) 2002 Ximian, Inc.
-
-using System;
-using System.Reflection;
-using System.Collections;
-using System.Runtime.CompilerServices;
-
-namespace System {
- internal class MonoCustomAttrs {
-
- static Hashtable handle_to_attrs = new Hashtable ();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern object[] GetCustomAttributes (ICustomAttributeProvider obj);
-
- private static object[] from_cache (ICustomAttributeProvider obj) {
- object[] res = (object[])handle_to_attrs [obj];
- if (res != null)
- return res;
- res = GetCustomAttributes (obj);
- handle_to_attrs.Add (obj, res);
- return res;
- }
-
- internal static object[] GetCustomAttributes (ICustomAttributeProvider obj, Type attributeType, bool inherit) {
- // handle inherit
- object[] res = from_cache (obj);
- // shortcut
- if (res.Length == 1 && res[0].GetType () == attributeType)
- return res;
- ArrayList a = new ArrayList ();
- foreach (object attr in res) {
- if (attributeType.Equals (attr.GetType ()))
- a.Add (attr);
- }
- return a.ToArray ();
- }
-
- internal static object[] GetCustomAttributes (ICustomAttributeProvider obj, bool inherit) {
- // handle inherit
- return from_cache (obj);
- }
- internal static bool IsDefined (ICustomAttributeProvider obj, Type attributeType, bool inherit) {
- // handle inherit
- object[] res = from_cache (obj);
- foreach (object attr in res) {
- if (attributeType.Equals (attr.GetType ()))
- return true;
- }
- return false;
- }
- }
-}
diff --git a/mcs/class/corlib/System/MonoDummy.cs b/mcs/class/corlib/System/MonoDummy.cs
deleted file mode 100644
index 6d79023ee44..00000000000
--- a/mcs/class/corlib/System/MonoDummy.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.MonoDummy.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public class MonoDummy {
-
- public MonoDummy ()
- {
- throw new ExecutionEngineException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/MonoType.cs b/mcs/class/corlib/System/MonoType.cs
deleted file mode 100644
index e025d2582a9..00000000000
--- a/mcs/class/corlib/System/MonoType.cs
+++ /dev/null
@@ -1,268 +0,0 @@
-// System.MonoType
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Globalization;
-
-namespace System
-{
- internal struct MonoTypeInfo {
- public string name;
- public string name_space;
- public Type parent;
- public Type etype;
- public Type[] interfaces;
- public Assembly assembly;
- public TypeAttributes attrs;
- public int rank;
- }
-
- internal class MonoType : Type
- {
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void type_from_obj (MonoType type, Object obj);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void get_type_info (RuntimeTypeHandle type, out MonoTypeInfo info);
-
- internal MonoType (Object obj) {
- // this should not be used - lupus
- type_from_obj (this, obj);
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern TypeAttributes get_attributes (Type type);
-
- protected override TypeAttributes GetAttributeFlagsImpl () {
- return get_attributes (this);
- }
-
- protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- }
-
- public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr) {
- throw new NotImplementedException ();
- }
-
- public override EventInfo GetEvent (string name, BindingFlags bindingAttr) {
- throw new NotImplementedException ();
- }
-
- public override EventInfo[] GetEvents (BindingFlags bindingAttr) {
- throw new NotImplementedException ();
- }
-
- public override FieldInfo GetField( string name, BindingFlags bindingAttr) {
- //FIXME
- return null;
- }
-
- public override FieldInfo[] GetFields (BindingFlags bindingAttr) {
- //FIXME
- return null;
- }
-
- public override Type GetInterface (string name, bool ignoreCase) {
- throw new NotImplementedException ();
- }
-
- public override Type[] GetInterfaces()
- {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.interfaces;
- }
-
- public override MemberInfo[] GetMembers( BindingFlags bindingAttr) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public override MethodInfo[] GetMethods (BindingFlags bindingAttr) {
- MemberInfo[] m = FindMembers (MemberTypes.Method, bindingAttr, null, null);
- MethodInfo[] res = new MethodInfo [m.Length];
- int i;
- for (i = 0; i < m.Length; ++i)
- res [i] = (MethodInfo) m [i];
- return res;
- }
-
- protected override MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- return null;
- }
-
- public override Type GetNestedType( string name, BindingFlags bindingAttr) {
- // FIXME
- return null;
- }
-
- public override Type[] GetNestedTypes (BindingFlags bindingAttr) {
- // FIXME
- return null;
- }
-
- public override PropertyInfo[] GetProperties( BindingFlags bindingAttr) {
- // FIXME
- return null;
- }
-
- protected override PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- return null;
- }
-
- protected override bool HasElementTypeImpl () {
- return IsArrayImpl() || IsByRefImpl() || IsPointerImpl ();
- }
-
- protected override bool IsArrayImpl () {
- return type_is_subtype_of (this, typeof (System.Array), false);
- }
- protected override bool IsByRefImpl () {
- // FIXME
- return false;
- }
- protected override bool IsCOMObjectImpl () {
- return false;
- }
- protected override bool IsPointerImpl () {
- // FIXME
- return false;
- }
- protected override bool IsPrimitiveImpl () {
- // FIXME
- return false;
- }
- protected override bool IsValueTypeImpl () {
- return type_is_subtype_of (this, typeof (System.ValueType), false) &&
- this != typeof (System.ValueType) &&
- this != typeof (System.Enum);
- }
-
- public override object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
- // FIXME
- return null;
- }
-
- public override Type GetElementType()
- {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.etype;
- }
-
- public override Type UnderlyingSystemType {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.etype;
- }
- }
-
- public override Assembly Assembly {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.assembly;
- }
- }
-
- public override string AssemblyQualifiedName {
- get {
- return assQualifiedName ();
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern string assQualifiedName();
-
- public override Type BaseType {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.parent;
- }
- }
-
- public override string FullName {
- get {
- string str = assQualifiedName ();
- return str.Split(',')[0];
- }
- }
-
- public override Guid GUID {
- get {return Guid.Empty;}
- }
-
- public override bool IsDefined (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes (bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
-
- public override object[] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public override MemberTypes MemberType {
- get {
- return MemberTypes.All;
- }
- }
-
- public override string Name {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.name;
- }
- }
-
- public override string Namespace {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.name_space;
- }
- }
-
- public override Module Module {
- get {
- return null;
- }
- }
-
- public override Type ReflectedType {
- get {
- return null;
- }
- }
-
- public override RuntimeTypeHandle TypeHandle {
- get {
- return _impl;
- }
- }
-
- public override int GetArrayRank () {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.rank;
- }
- }
-}
diff --git a/mcs/class/corlib/System/MulticastDelegate.cs b/mcs/class/corlib/System/MulticastDelegate.cs
deleted file mode 100644
index 9ec68fd1d8c..00000000000
--- a/mcs/class/corlib/System/MulticastDelegate.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// System.MultiCastDelegate.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-using System.Globalization;
-namespace System {
-
- public abstract class MulticastDelegate : Delegate {
-
- Delegate [] invocation_list;
-
- protected MulticastDelegate (object target, string method)
- : base (target, method)
- {
- invocation_list = null;
- }
-
- protected MulticastDelegate (Type target_type, string method)
- : base (target_type, method)
- {
- invocation_list = null;
- }
-
- private MulticastDelegate (Type target_type, string method, Delegate [] list)
- : base (target_type, method)
- {
- invocation_list = list;
- }
-
-#if NOTYET
- public MethodInfo Method {
- get {
- return null;
- }
- }
-#endif
-
- // <remarks>
- // Equals: two multicast delegates are equal if their base is equal
- // and their invocations list is equal.
- // </remarks>
- public override bool Equals (object o)
- {
- if (!(o is System.MulticastDelegate))
- return false;
-
- if (!base.Equals (o))
- return false;
-
- MulticastDelegate d = (MulticastDelegate) o;
-
- if (d.invocation_list == null){
- if (invocation_list == null)
- return true;
- return false;
- } else if (invocation_list == null)
- return false;
-
- int i = 0;
- foreach (Delegate del in invocation_list){
- if (del != d.invocation_list [i++])
- return false;
- }
-
- return true;
- }
-
- //
- // FIXME: This could use some improvements.
- //
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- // <summary>
- // Combines this MulticastDelegate with the Delegate `follow'.
- // This can combine MulticastDelegates and Delegates
- // </summary>
- [MonoTODO]
- protected override Delegate CombineImpl (Delegate follow)
- {
-
- throw new NotImplementedException ();
-
- // FIXME: Implement me.
- // This is not as simple to implement, as we can
- // not create an instance of MulticastDelegate.
- //
- // Got to think more about this.
- }
-
- [MonoTODO]
- public static bool operator == (MulticastDelegate a, MulticastDelegate b) {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static bool operator != (MulticastDelegate a, MulticastDelegate b) {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/corlib/System/MulticastNotSupportedException.cs b/mcs/class/corlib/System/MulticastNotSupportedException.cs
deleted file mode 100644
index 0e1606f3a91..00000000000
--- a/mcs/class/corlib/System/MulticastNotSupportedException.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.MulticastNotSupportedException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-namespace System {
-
- public sealed class MulticastNotSupportedException : SystemException {
- // Constructors
- public MulticastNotSupportedException ()
- : base (Locale.GetText ("This operation cannot be performed with the specified delagates"))
- {
- }
-
- public MulticastNotSupportedException (string message)
- : base (message)
- {
- }
-
- public MulticastNotSupportedException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/NonSerializedAttribute.cs b/mcs/class/corlib/System/NonSerializedAttribute.cs
deleted file mode 100755
index 7ac82dfe67a..00000000000
--- a/mcs/class/corlib/System/NonSerializedAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-
-//
-// System/NonSerializedAttribute.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
- public sealed class NonSerializedAttribute : Attribute {
- public NonSerializedAttribute() {
- }
- }
-}
diff --git a/mcs/class/corlib/System/NotFiniteNumberException.cs b/mcs/class/corlib/System/NotFiniteNumberException.cs
deleted file mode 100644
index 26bbc34fddc..00000000000
--- a/mcs/class/corlib/System/NotFiniteNumberException.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.NotFiniteNumberException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class NotFiniteNumberException : ArithmeticException {
- double offending_number;
-
- // Constructors
- public NotFiniteNumberException ()
- : base (Locale.GetText ("The number encountered was not a finite quantity"))
- {
- }
-
- public NotFiniteNumberException (double offending_number)
- {
- this.offending_number = offending_number;
- }
-
- public NotFiniteNumberException (string message)
- : base (message)
- {
- }
-
- public NotFiniteNumberException (string message, double offending_number)
- {
- this.offending_number = offending_number;
- }
-
- public NotFiniteNumberException (string message, double offending_number, Exception inner)
- : base (message, inner)
- {
- this.offending_number = offending_number;
- }
-
- protected NotFiniteNumberException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- offending_number = info.GetDouble ("OffendingNumber");
- }
-
- // Properties
- public virtual double OffendingNumber {
- get {
- return offending_number;
- }
- }
-
- // Method
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("OffendingNumber", offending_number);
- }
- }
-}
diff --git a/mcs/class/corlib/System/NotImplementedException.cs b/mcs/class/corlib/System/NotImplementedException.cs
deleted file mode 100755
index 3c201d1587e..00000000000
--- a/mcs/class/corlib/System/NotImplementedException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.NotImplementedException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class NotImplementedException : SystemException {
- // Constructors
- public NotImplementedException ()
- : base (Locale.GetText ("The requested feature is not yet implemented"))
- {
- }
-
- public NotImplementedException (string message)
- : base (message)
- {
- }
-
- public NotImplementedException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected NotImplementedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/NotSupportedException.cs b/mcs/class/corlib/System/NotSupportedException.cs
deleted file mode 100644
index 2419d8e0b8f..00000000000
--- a/mcs/class/corlib/System/NotSupportedException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.NotSupportedException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class NotSupportedException : SystemException {
- // Constructors
- public NotSupportedException ()
- : base (Locale.GetText ("Operation is not supported"))
- {
- }
-
- public NotSupportedException (string message)
- : base (message)
- {
- }
-
- public NotSupportedException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected NotSupportedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/NullReferenceException.cs b/mcs/class/corlib/System/NullReferenceException.cs
deleted file mode 100644
index 76947bae47e..00000000000
--- a/mcs/class/corlib/System/NullReferenceException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.NullReferenceException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class NullReferenceException : SystemException {
- // Constructors
- public NullReferenceException ()
- : base (Locale.GetText ("A null value was found where an object instance was required"))
- {
- }
-
- public NullReferenceException (string message)
- : base (message)
- {
- }
-
- public NullReferenceException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected NullReferenceException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/Object.cs b/mcs/class/corlib/System/Object.cs
deleted file mode 100644
index 00ae5a4f787..00000000000
--- a/mcs/class/corlib/System/Object.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// System.Object.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// This should probably be implemented in IL instead of C#, to
-// use internalcalls to get its hands on the underlying Type
-// of an object.
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- public class Object {
-
- // <summary>
- // Compares this object to the specified object.
- // Returns true if they are equal, false otherwise.
- // </summary>
- public virtual bool Equals (object o)
- {
- return this == o;
- }
-
- // <summary>
- // Compares two objects for equality
- // </summary>
- public static bool Equals (object a, object b)
- {
- if (a == b)
- return true;
-
- if (a == null) {
- if (b == null)
- return true;
- return false;
- } else {
- if (b == null)
- return false;
- return a.Equals (b);
- }
- }
-
- // <summary>
- // Initializes a new instance of the object class.
- // </summary>
- public Object ()
- {
- }
-
- // <summary>
- // Object destructor.
- // </summary>
- ~Object ()
- {
- }
-
- // <summary>
- // Returns a hashcode for this object. Each derived
- // class should return a hash code that makes sense
- // for that particular implementation of the object.
- // </summary>
- public virtual int GetHashCode ()
- {
- return 0;
- }
-
- // <summary>
- // Returns the Type associated with the object.
- // </summary>
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern Type GetType ();
-
- // <summary>
- // Shallow copy of the object.
- // </summary>
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- protected extern object MemberwiseClone ();
-
- // <summary>
- // Returns a stringified representation of the object.
- // This is not supposed to be used for user presentation,
- // use Format() for that and IFormattable.
- //
- // ToString is mostly used for debugging purposes.
- // </summary>
- public virtual string ToString ()
- {
- return GetType().FullName;
- }
-
- // <summary>
- // Tests whether a is equal to b.
- // Can not figure out why this even exists
- // </summary>
- public static bool ReferenceEquals (object a, object b)
- {
- return (a == b);
- }
- }
-}
diff --git a/mcs/class/corlib/System/ObjectDisposedException.cs b/mcs/class/corlib/System/ObjectDisposedException.cs
deleted file mode 100755
index b1e390aa5be..00000000000
--- a/mcs/class/corlib/System/ObjectDisposedException.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.ObjectDisposedException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class ObjectDisposedException : InvalidOperationException {
- private string obj_name;
- private string msg;
-
- // Constructors
- public ObjectDisposedException (string objectName)
- : base (Locale.GetText ("The object was used after being disposed"))
- {
- obj_name = objectName;
- msg = Locale.GetText ("The object was used after being disposed");
- }
-
- public ObjectDisposedException (string objectName, string message)
- : base (message)
- {
- obj_name = objectName;
- msg = message;
- }
-
- protected ObjectDisposedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- obj_name = info.GetString ("ObjectName");
- }
-
- // Properties
- public override string Message
- {
- get { return msg; }
- }
-
- public string ObjectName
- {
- get { return obj_name; }
- }
-
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("ObjectName", obj_name);
- }
- }
-}
diff --git a/mcs/class/corlib/System/ObsoleteAttribute.cs b/mcs/class/corlib/System/ObsoleteAttribute.cs
deleted file mode 100644
index 27624a2d642..00000000000
--- a/mcs/class/corlib/System/ObsoleteAttribute.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ObsoleteAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Enum | AttributeTargets.Constructor |
- AttributeTargets.Method | AttributeTargets.Property |
- AttributeTargets.Field | AttributeTargets.Event |
- AttributeTargets.Interface | AttributeTargets.Delegate)]
- [Serializable]
- public class ObsoleteAttribute : Attribute
- {
- private string Message;
- private bool IsError = false;
-
- // Constructors
- public ObsoleteAttribute () : base ()
- {
- }
-
- public ObsoleteAttribute (string message)
- {
- Message = message;
- }
-
- public ObsoleteAttribute (string message, bool error)
- {
- Message = message;
- IsError = error;
- }
- }
-}
diff --git a/mcs/class/corlib/System/OperatingSystem.cs b/mcs/class/corlib/System/OperatingSystem.cs
deleted file mode 100644
index cd614ef027e..00000000000
--- a/mcs/class/corlib/System/OperatingSystem.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.OperatingSystem.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Saturday, August 11, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Globalization;
-
-namespace System
-{
- /// <summary>
- /// Class representing a specific operating system version for a specific platform
- /// </summary>
- public sealed class OperatingSystem : ICloneable
- {
- private System.PlatformID itsPlatform;
- private Version itsVersion;
-
- public OperatingSystem(PlatformID platform, Version version)
- {
- if(version == null)
- {
- throw new ArgumentNullException();
- }
-
- itsPlatform = platform;
- itsVersion = version;
- }
-
- /// <summary>
- /// Get the PlatformID
- /// </summary>
- public PlatformID Platform
- {
- get
- {
- return itsPlatform;
- }
- }
-
- /// <summary>
- /// Gets the version object
- /// </summary>
- public Version Version
- {
- get
- {
- return itsVersion;
- }
- }
-
- /// <summary>
- /// Return a clone of this object
- /// </summary>
- public object Clone()
- {
- return new OperatingSystem(itsPlatform, itsVersion);
- }
-
- /// <summary>
- /// Return true if obj equals this object
- /// </summary>
- public override bool Equals(object obj)
- {
- //Check for null and compare run-time types.
- if (obj == null || GetType() != obj.GetType()) return false;
- OperatingSystem os = (OperatingSystem)obj;
- return (itsPlatform == os.itsPlatform) &&
- (os.itsVersion.Equals(itsVersion));
- }
-
- /// <summary>
- /// Return hash code
- /// </summary>
- public override int GetHashCode()
- { // this leave us enuf for 256 unique platforms which should suffice for a good while
- return ((int)itsPlatform << 24) | itsVersion.GetHashCode() >> 8;
- }
-
- /// <summary>
- /// Return a string reprentation of this instance
- /// </summary>
- public override string ToString()
- {
- string str;
-
- switch(itsPlatform)
- {
- case System.PlatformID.Win32NT: str = "Microsoft Windows NT"; break;
- case System.PlatformID.Win32S: str = "Microsoft Win32S"; break;
- case System.PlatformID.Win32Windows: str = "Microsoft Windows 98"; break;
- case System.PlatformID.Unix: str = "Unix"; break;
- default: str = Locale.GetText ("<unknown>"); break;
- }
-
- return str + " " + itsVersion.ToString();
- }
- }
-}
diff --git a/mcs/class/corlib/System/OutOfMemoryException.cs b/mcs/class/corlib/System/OutOfMemoryException.cs
deleted file mode 100644
index ffaf5851d10..00000000000
--- a/mcs/class/corlib/System/OutOfMemoryException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.OutOfMemoryException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class OutOfMemoryException : SystemException {
- // Constructors
- public OutOfMemoryException ()
- : base (Locale.GetText ("There is insufficient memory to continue execution"))
- {
- }
-
- public OutOfMemoryException (string message)
- : base (message)
- {
- }
-
- public OutOfMemoryException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected OutOfMemoryException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/OverflowException.cs b/mcs/class/corlib/System/OverflowException.cs
deleted file mode 100644
index 4fc747d24e0..00000000000
--- a/mcs/class/corlib/System/OverflowException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.OverflowExceptionException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class OverflowException : ArithmeticException {
- // Constructors
- public OverflowException ()
- : base (Locale.GetText ("Number overflow"))
- {
- }
-
- public OverflowException (string message)
- : base (message)
- {
- }
-
- public OverflowException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected OverflowException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ParamArrayAttribute.cs b/mcs/class/corlib/System/ParamArrayAttribute.cs
deleted file mode 100644
index 322def26b8b..00000000000
--- a/mcs/class/corlib/System/ParamArrayAttribute.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.ParamArrayAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// Used to flag that the method will take a variable number
- /// of arguments
- /// </summary>
- [AttributeUsage(AttributeTargets.Parameter)]
- public sealed class ParamArrayAttribute : Attribute {
-
- public ParamArrayAttribute ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/PlatformID.cs b/mcs/class/corlib/System/PlatformID.cs
deleted file mode 100644
index 56d2299e9fb..00000000000
--- a/mcs/class/corlib/System/PlatformID.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// PlatformID.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:35:29 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- public enum PlatformID {
-
- /// <summary>
- /// </summary>
- Win32S = 0,
-
- /// <summary>
- /// </summary>
- Win32Windows = 1,
-
- /// <summary>
- /// </summary>
- Win32NT = 2,
-
- /// <summary>
- /// </summary>
- Unix = 128
- } // PlatformID
-
-} // System
diff --git a/mcs/class/corlib/System/PlatformNotSupportedException.cs b/mcs/class/corlib/System/PlatformNotSupportedException.cs
deleted file mode 100644
index b430afce584..00000000000
--- a/mcs/class/corlib/System/PlatformNotSupportedException.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.PlatformNotSupportedException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class PlatformNotSupportedException : SystemException
- {
- // Constructors
- public PlatformNotSupportedException ()
- : base (Locale.GetText ("This platform is not supported."))
- {
- }
-
- public PlatformNotSupportedException (string message)
- : base (message)
- {
- }
-
- public PlatformNotSupportedException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public PlatformNotSupportedException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/Random.cs b/mcs/class/corlib/System/Random.cs
deleted file mode 100644
index cadcf1efd09..00000000000
--- a/mcs/class/corlib/System/Random.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// System.Random.cs
-//
-// Author:
-// Bob Smith (bob@thestuff.net)
-//
-// (C) 2001 Bob Smith. http://www.thestuff.net
-//
-
-using System;
-using System.Globalization;
-
-namespace System
-{
- public class Random
- {
- private int S = 1;
- private const int A = 16807;
- private const int M = 2147483647;
- private const int Q = 127773;
- private const int R = 2836;
-
- public Random()
- {
- S = (int)(DateTime.Now.Ticks);
- }
-
- public Random(int Seed)
- {
- S = Seed;
- }
-
- public virtual int Next()
- {
- return (int)(this.Sample()*Int32.MaxValue);
- }
-
- public virtual int Next(int maxValue)
- {
- if (maxValue < 0)
- throw new ArgumentOutOfRangeException(Locale.GetText (
- "Max value is less then min value."));
- else if (maxValue == 0)
- return 0;
- return (int)(this.Sample()*maxValue);
- }
-
- public virtual int Next(int minValue, int maxValue)
- {
- if (minValue > maxValue)
- throw new ArgumentOutOfRangeException(Locale.GetText (
- "Min value is greater then max value."));
- else if (minValue == maxValue)
- return minValue;
- return (int)(this.Sample()*maxValue)+minValue;
- }
- public virtual void NextBytes(byte[] buffer)
- {
- int i, l;
- if (buffer == null)
- throw new ArgumentNullException();
- l = buffer.GetUpperBound(0);
- for (i = buffer.GetLowerBound(0); i < l; i++)
- {
- buffer[i] = (byte)(this.Sample()*Byte.MaxValue);
- }
- }
-
- public virtual double NextDouble ()
- {
- return this.Sample();
- }
-
- protected virtual double Sample ()
- {
- S = A*(S%Q)-R*(S/Q);
- if (S < 0)
- S+=M;
- return S/(double)Int32.MaxValue;
- }
- }
-}
diff --git a/mcs/class/corlib/System/RankException.cs b/mcs/class/corlib/System/RankException.cs
deleted file mode 100644
index 67b8b5f07df..00000000000
--- a/mcs/class/corlib/System/RankException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.RankException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class RankException : SystemException {
- // Constructors
- public RankException ()
- : base (Locale.GetText ("Two arrays must have the same number of dimensions"))
- {
- }
-
- public RankException (string message)
- : base (message)
- {
- }
-
- public RankException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected RankException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ResolveEventArgs.cs b/mcs/class/corlib/System/ResolveEventArgs.cs
deleted file mode 100644
index e0c10a65950..00000000000
--- a/mcs/class/corlib/System/ResolveEventArgs.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.ResolveEventArgs.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-06
-//
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace System {
-
- public class ResolveEventArgs : EventArgs
- {
- private string m_Name;
- public string Name {get{return m_Name;}}
-
- public ResolveEventArgs(string name){
- m_Name = name;
- }
-
- } // ResolveEventArgs
-
-} // System
-
-
diff --git a/mcs/class/corlib/System/ResolveEventHandler.cs b/mcs/class/corlib/System/ResolveEventHandler.cs
deleted file mode 100644
index 36471295a85..00000000000
--- a/mcs/class/corlib/System/ResolveEventHandler.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// System.ResolveEventHandler
-//
-// Sean MacIsaac
-//
-// (C) 2001 Ximian, Inc.
-
-namespace System
-{
- public delegate Reflection.Assembly ResolveEventHandler (object sender, ResolveEventArgs args);
-}
diff --git a/mcs/class/corlib/System/RuntimeArgumentHandle.cs b/mcs/class/corlib/System/RuntimeArgumentHandle.cs
deleted file mode 100644
index 790f3c1a24d..00000000000
--- a/mcs/class/corlib/System/RuntimeArgumentHandle.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.RuntimeArgumentHandle.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- public struct RuntimeArgumentHandle
- {
- // This class has no members, its only use is for supporting
- // va_args from C and C++.
- }
-}
diff --git a/mcs/class/corlib/System/RuntimeFieldHandle.cs b/mcs/class/corlib/System/RuntimeFieldHandle.cs
deleted file mode 100755
index 67a34d33876..00000000000
--- a/mcs/class/corlib/System/RuntimeFieldHandle.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.RuntimeFieldHandle.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- [MonoTODO]
- public struct RuntimeFieldHandle : ISerializable {
- IntPtr value;
-
- public IntPtr Value {
- get {
- return (IntPtr) value;
- }
- }
-
- RuntimeFieldHandle (SerializationInfo info, StreamingContext context)
- {
- Type t;
-
- if (info == null)
- throw new ArgumentNullException ("info");
-
- t = (Type) info.GetValue ("TypeObj", typeof (Type));
-
- value = t.TypeHandle.Value;
- if (value == (IntPtr) 0)
- throw new SerializationException (Locale.GetText ("Insufficient state"));
- }
-
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("TypeObj", value, value.GetType ());
- }
- }
-}
diff --git a/mcs/class/corlib/System/RuntimeMethodHandle.cs b/mcs/class/corlib/System/RuntimeMethodHandle.cs
deleted file mode 100755
index 21947c4f93f..00000000000
--- a/mcs/class/corlib/System/RuntimeMethodHandle.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.RuntimeMethodHandle.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- //[MonoTODO]
- public struct RuntimeMethodHandle : ISerializable {
- IntPtr value;
-
- public IntPtr Value {
- get {
- return (IntPtr) value;
- }
- }
-
- // This is from ISerializable
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/RuntimeTypeHandle.cs b/mcs/class/corlib/System/RuntimeTypeHandle.cs
deleted file mode 100644
index e0047b9715a..00000000000
--- a/mcs/class/corlib/System/RuntimeTypeHandle.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.RuntimeTypeHandle.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- //[MonoTODO]
- public struct RuntimeTypeHandle : ISerializable {
- IntPtr value;
-
- public IntPtr Value {
- get {
- return (IntPtr) value;
- }
- }
-
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/corlib/System/SByte.cs b/mcs/class/corlib/System/SByte.cs
deleted file mode 100644
index 23323ea676c..00000000000
--- a/mcs/class/corlib/System/SByte.cs
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// System.SByte.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- [CLSCompliant(false)]
- public struct SByte : IComparable, IFormattable { //, IConvertible {
-
- public const sbyte MinValue = -128;
- public const sbyte MaxValue = 127;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public sbyte value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.SByte))
- throw new ArgumentException (Locale.GetText ("Value is not a System.SByte"));
-
- sbyte xv = (sbyte) v;
- if (value == xv)
- return 0;
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.SByte))
- return false;
-
- return ((sbyte) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- public static sbyte Parse (string s)
- {
- sbyte val = 0;
- int len;
- int i;
- bool neg = false;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- c = s [i];
- if (c == '+')
- i++;
- else if (c == '-'){
- neg = true;
- i++;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- val = checked ((sbyte) (val * 10 + (c - '0')));
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- if (neg)
- val = checked ((sbyte) -val);
-
- return val;
- }
-
- public static sbyte Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static sbyte Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [MonoTODO]
- public static sbyte Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- // TODO: Implement me
- throw new NotImplementedException ();
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== ICovnertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Byte;
- }
- }
-}
diff --git a/mcs/class/corlib/System/STAThreadAttribute.cs b/mcs/class/corlib/System/STAThreadAttribute.cs
deleted file mode 100644
index 6224f9bfa38..00000000000
--- a/mcs/class/corlib/System/STAThreadAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.STAThreadAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Method)]
- public class STAThreadAttribute : Attribute
- {
- // Constructors
- public STAThreadAttribute () : base ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/SerializableAttribute.cs b/mcs/class/corlib/System/SerializableAttribute.cs
deleted file mode 100755
index e283d4afc39..00000000000
--- a/mcs/class/corlib/System/SerializableAttribute.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.SerializableAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// Serialization Attribute for classes.
- /// </summary>
-
- /// <remarks>
- /// Use SerializableAttribute to mark classes that do not implement
- /// the ISerializable interface but that want to be serialized.
- ///
- /// Failing to do so will cause the system to throw an exception.
- ///
- /// When a class is market with the SerializableAttribute, all the
- /// fields are automatically serialized with the exception of those
- /// that are tagged with the NonSerializedAttribute.
- ///
- /// SerializableAttribute should only be used for classes that contain
- /// simple data types that can be serialized and deserialized by the
- /// runtime (typically you would use NonSerializedAttribute on data
- /// that can be reconstructed at any point: like caches or precomputed
- /// tables).
- /// </remarks>
-
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct
- | AttributeTargets.Enum | AttributeTargets.Delegate,
- Inherited=false, AllowMultiple=false)]
- public sealed class SerializableAttribute : Attribute {
- }
-}
diff --git a/mcs/class/corlib/System/Single.cs b/mcs/class/corlib/System/Single.cs
deleted file mode 100644
index c33cf720261..00000000000
--- a/mcs/class/corlib/System/Single.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// System.Single.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- public struct Single : IComparable, IFormattable { //, IConvertible {
- public const float Epsilon = 1.4e-45f;
- public const float MaxValue = 3.40282346638528859e38f;
- public const float MinValue = -3.40282346638528859e38f;
- public const float NaN = 0.0f / 0.0f;
- public const float PositiveInfinity = 1.0f / 0.0f;
- public const float NegativeInfinity = -1.0f / 0.0f;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public float value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Single))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Single"));
-
- return (int) (value - ((float) v));
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Single))
- return false;
-
- return ((float) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int) value;
- }
-
- public static bool IsInfinity (float f)
- {
- return (f == PositiveInfinity || f == NegativeInfinity);
- }
-
- public static bool IsNaN (float f)
- {
- return (f != f);
- }
-
- public static bool IsNegativeInfinity (float f)
- {
- return (f < 0.0f && (f == NegativeInfinity || f == PositiveInfinity));
- }
-
- public static bool IsPositiveInfinity (float f)
- {
- return (f > 0.0f && (f == NegativeInfinity || f == PositiveInfinity));
- }
-
- public static float Parse (string s)
- {
- return Parse (s, (NumberStyles.Float | NumberStyles.AllowThousands), null);
- }
-
- public static float Parse (string s, IFormatProvider fp)
- {
- return Parse (s, (NumberStyles.Float | NumberStyles.AllowThousands), fp);
- }
-
- public static float Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [MonoTODO]
- public static float Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- // TODO: Implement me
- throw new NotImplementedException ();
- }
-
- public override string ToString ()
- {
- return ToString(null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString(null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString(format, null);
- }
-
- [MonoTODO]
- public string ToString (string format, IFormatProvider fp)
- {
- // TODO: Implement me.
- throw new NotImplementedException ();
- }
-
- // ============= IConvertible Methods ============ //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Single;
- }
- }
-}
diff --git a/mcs/class/corlib/System/StackOverflowException.cs b/mcs/class/corlib/System/StackOverflowException.cs
deleted file mode 100644
index e7710133a29..00000000000
--- a/mcs/class/corlib/System/StackOverflowException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.StackOverflowException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class StackOverflowException : SystemException {
- // Constructors
- public StackOverflowException ()
- : base (Locale.GetText ("The requested operation caused a stack overflow"))
- {
- }
-
- public StackOverflowException (string message)
- : base (message)
- {
- }
-
- public StackOverflowException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected StackOverflowException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/String.cs b/mcs/class/corlib/System/String.cs
deleted file mode 100644
index d04807ef055..00000000000
--- a/mcs/class/corlib/System/String.cs
+++ /dev/null
@@ -1,1801 +0,0 @@
-// -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.String.cs
-//
-// Authors:
-// Jeffrey Stedfast (fejj@ximian.com)
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-// FIXME: from what I gather from msdn, when a function is to return an empty string
-// we should be returning this.Empty - some methods do this and others don't.
-
-// FIXME: I didn't realise until later that `string' has a .Length method and so
-// I am missing some proper bounds-checking in some methods. Find these
-// instances and throw the ArgumentOutOfBoundsException at the programmer.
-// I like pelting programmers with ArgumentOutOfBoundsException's :-)
-
-// FIXME: The ToLower(), ToUpper(), and Compare(..., bool ignoreCase) methods
-// need to be made unicode aware.
-
-// FIXME: when you have a char carr[], does carr.Length include the terminating null char?
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- //[DefaultMemberName("Chars")]
- public sealed class String : IComparable, ICloneable, IConvertible, IEnumerable {
- public static readonly string Empty = "";
- private char[] c_str;
- private int length;
-
- // Constructors
-
- internal String (int storage)
- {
- if (storage < 0)
- throw new ArgumentOutOfRangeException ();
- length = storage;
- c_str = new char [storage];
- }
-
- [CLSCompliant(false)]
- unsafe public String (char *value)
- {
- int i;
-
- // FIXME: can I do value.Length here?
- if (value == null) {
- this.length = 0;
- } else {
- for (i = 0; *(value + i) != '\0'; i++);
- this.length = i;
- }
-
- this.c_str = new char [this.length + 1];
- for (i = 0; i < this.length; i++)
- this.c_str[i] = *(value + i);
- }
-
- public String (char[] value)
- {
- int i;
-
- // FIXME: value.Length includes the terminating null char?
- this.length = value != null ? strlen (value): 0;
- this.c_str = new char [this.length + 1];
- for (i = 0; i < this.length; i++)
- this.c_str[i] = value[i];
- }
-
- [CLSCompliant(false)]
- unsafe public String (sbyte *value)
- {
- // FIXME: consider unicode?
- int i;
-
- // FIXME: can I do value.Length here? */
- if (value == null) {
- this.length = 0;
- } else {
- for (i = 0; *(value + i) != '\0'; i++);
- this.length = i;
- }
-
- this.c_str = new char [this.length + 1];
- for (i = 0; i < this.length; i++)
- this.c_str[i] = (char) *(value + i);
- }
-
- public String (char c, int count)
- {
- int i;
-
- this.length = count;
- this.c_str = new char [count + 1];
- for (i = 0; i < count; i++)
- this.c_str[i] = c;
- }
-
- [CLSCompliant(false)]
- unsafe public String (char *value, int startIndex, int length)
- {
- int i;
-
- if (value == null && startIndex != 0 && length != 0)
- throw new ArgumentNullException ();
-
- if (startIndex < 0 || length < 0)
- throw new ArgumentOutOfRangeException ();
-
- this.length = length;
- this.c_str = new char [length + 1];
- for (i = 0; i < length; i++)
- this.c_str[i] = *(value + startIndex + i);
- }
-
- public String (char[] value, int startIndex, int length)
- {
- int i;
-
- if (value == null && startIndex != 0 && length != 0)
- throw new ArgumentNullException ();
-
- if (startIndex < 0 || length < 0)
- throw new ArgumentOutOfRangeException ();
-
- this.length = length;
- this.c_str = new char [length + 1];
- for (i = 0; i < length; i++)
- this.c_str[i] = value[startIndex + i];
- }
-
- [CLSCompliant(false)]
- unsafe public String (sbyte *value, int startIndex, int length)
- {
- // FIXME: consider unicode?
- int i;
-
- if (value == null && startIndex != 0 && length != 0)
- throw new ArgumentNullException ();
-
- if (startIndex < 0 || length < 0)
- throw new ArgumentOutOfRangeException ();
-
- this.length = length;
- this.c_str = new char [length + 1];
- for (i = 0; i < length; i++)
- this.c_str[i] = (char) *(value + startIndex + i);
- }
-
- [CLSCompliant(false)][MonoTODO]
- unsafe public String (sbyte *value, int startIndex, int length, Encoding enc)
- {
- // FIXME: implement me
- }
-
- ~String ()
- {
- // FIXME: is there anything we need to do here?
- /*base.Finalize ();*/
- }
-
- // Properties
- public int Length {
- get {
- return this.length;
- }
- }
-
- [IndexerName("Chars")]
- public char this [int index] {
- get {
- if (index >= this.length)
- throw new ArgumentOutOfRangeException ();
-
- return this.c_str[index];
- }
- }
-
- // Private helper methods
- private static int strlen (char[] str)
- {
- // FIXME: if str.Length includes terminating null char, then return (str.Length - 1)
- return str.Length;
- }
-
- [MonoTODO]
- private static char tolowerordinal (char c)
- {
- // FIXME: implement me
- return c;
- }
-
- private static bool is_lwsp (char c)
- {
- /* this comes from the msdn docs for String.Trim() */
- if ((c >= '\x9' && c <= '\xD') || c == '\x20' || c == '\xA0' ||
- (c >= '\x2000' && c <= '\x200B') || c == '\x3000' || c == '\xFEFF')
- return true;
- else
- return false;
- }
-
- private static int BoyerMoore (char[] haystack, string needle, int startIndex, int count)
- {
- /* (hopefully) Unicode-safe Boyer-Moore implementation */
- int[] skiptable = new int[65536]; /* our unicode-safe skip-table */
- int h, n, he, ne, hc, nc, i;
-
- if (haystack == null || needle == null)
- throw new ArgumentNullException ();
-
- /* if the search buffer is shorter than the pattern buffer, we can't match */
- if (count < needle.length)
- return -1;
-
- /* return an instant match if the pattern is 0-length */
- if (needle.length == 0)
- return startIndex;
-
- /* set a pointer at the end of each string */
- ne = needle.length - 1; /* position of char before '\0' */
- he = startIndex + count; /* position of last valid char */
-
- /* init the skip table with the pattern length */
- nc = needle.length;
- for (i = 0; i < 65536; i++)
- skiptable[i] = nc;
-
- /* set the skip value for the chars that *do* appear in the
- * pattern buffer (needle) to the distance from the index to
- * the end of the pattern buffer. */
- for (nc = 0; nc < ne; nc++)
- skiptable[(int) needle[nc]] = ne - nc;
-
- h = startIndex;
- while (count >= needle.length) {
- hc = h + needle.length - 1; /* set the haystack compare pointer */
- nc = ne; /* set the needle compare pointer */
-
- /* work our way backwards until they don't match */
- for (i = 0; nc > 0; nc--, hc--, i++)
- if (needle[nc] != haystack[hc])
- break;
-
- if (needle[nc] != haystack[hc]) {
- n = skiptable[(int) haystack[hc]] - i;
- h += n;
- count -= n;
- } else
- return h;
- }
-
- return -1;
- }
-
- // Methods
- [MonoTODO]
- public object Clone ()
- {
- // FIXME: implement me
- return null;
- }
-
- public static int Compare (string strA, string strB)
- {
- int min, i;
-
- if (strA == null) {
- if (strB == null)
- return 0;
- else
- return -1;
- } else if (strB == null)
- return 1;
-
- min = strA.length < strB.length ? strA.length : strB.length;
-
- for (i = 0; i < min; i++) {
- if (strA.c_str[i] != strB.c_str[i]) {
- return (int)strA.c_str[i] - (int)strB.c_str[i];
- }
- }
- if (strA.length == strB.length) {
- return 0;
- }
- if (strA.length > min) {
- return 1;
- } else {
- return -1;
- }
- }
-
- public static int Compare (string strA, string strB, bool ignoreCase)
- {
- int min, i;
-
- if (!ignoreCase)
- return Compare (strA, strB);
-
- /*
- * And here I thought Eazel developers were on crack...
- * if a string is null it should pelt the programmer with
- * ArgumentNullExceptions, damnit!
- */
- if (strA == null) {
- if (strB == null)
- return 0;
- else
- return -1;
- } else if (strB == null)
- return 1;
-
- min = strA.length < strB.length ? strA.length : strB.length;
-
- for (i = 0; i < min; i++) {
- if (Char.ToLower (strA.c_str[i]) != Char.ToLower (strB.c_str[i])) {
- return (int)strA.c_str[i] - (int)strB.c_str[i];
- }
- }
- if (strA.length == strB.length) {
- return 0;
- }
- if (strA.length > min) {
- return 1;
- } else {
- return -1;
- }
- }
-
- [MonoTODO]
- public static int Compare (string strA, string strB, bool ignoreCase, CultureInfo culture)
- {
- // FIXME: implement me
- return 0;
- }
-
- public static int Compare (string strA, int indexA, string strB, int indexB, int length)
- {
- int i;
-
- if (length < 0 || indexA < 0 || indexB < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (indexA > strA.Length || indexB > strB.Length)
- throw new ArgumentOutOfRangeException ();
-
- /* And again with the ("" > null) logic... lord have mercy! */
- if (strA == null) {
- if (strB == null)
- return 0;
- else
- return -1;
- } else if (strB == null)
- return 1;
-
- for (i = 0; i < length - 1; i++) {
- if (strA[indexA + i] != strB[indexB + i])
- break;
- }
-
- return ((int) (strA[indexA + i] - strB[indexB + i]));
- }
-
- public static int Compare (string strA, int indexA, string strB, int indexB,
- int length, bool ignoreCase)
- {
- int i;
-
- if (!ignoreCase)
- return Compare (strA, indexA, strB, indexB, length);
-
- if (length < 0 || indexA < 0 || indexB < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (indexA > strA.Length || indexB > strB.Length)
- throw new ArgumentOutOfRangeException ();
-
- /* When will the hurting stop!?!? */
- if (strA == null) {
- if (strB == null)
- return 0;
- else
- return -1;
- } else if (strB == null)
- return 1;
-
- for (i = 0; i < length - 1; i++) {
- if (Char.ToLower (strA[indexA + i]) != Char.ToLower (strB[indexB + i]))
- break;
- }
-
- return ((int) (strA[indexA + i] - strB[indexB + i]));
- }
-
- [MonoTODO]
- public static int Compare (string strA, int indexA, string strB, int indexB,
- int length, bool ignoreCase, CultureInfo culture)
- {
- if (culture == null)
- throw new ArgumentNullException ();
-
- if (length < 0 || indexA < 0 || indexB < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (indexA > strA.Length || indexB > strB.Length)
- throw new ArgumentOutOfRangeException ();
-
- /* I can't take it anymore! */
- if (strA == null) {
- if (strB == null)
- return 0;
- else
- return -1;
- } else if (strB == null)
- return 1;
-
- // FIXME: implement me
- return 0;
- }
-
- public static int CompareOrdinal (string strA, string strB)
- {
- int i;
-
- /* Please God, make it stop! */
- if (strA == null) {
- if (strB == null)
- return 0;
- else
- return -1;
- } else if (strB == null)
- return 1;
-
- for (i = 0; i < strA.Length && i < strB.Length; i++) {
- char cA, cB;
-
- cA = tolowerordinal (strA[i]);
- cB = tolowerordinal (strB[i]);
-
- if (cA != cB)
- break;
- }
-
- return ((int) (strA[i] - strB[i]));
- }
-
- public static int CompareOrdinal (string strA, int indexA, string strB, int indexB,
- int length)
- {
- int i;
-
- if (length < 0 || indexA < 0 || indexB < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (strA == null) {
- if (strB == null)
- return 0;
- else
- return -1;
- } else if (strB == null)
- return 1;
-
- for (i = 0; i < length; i++) {
- char cA, cB;
-
- cA = tolowerordinal (strA[indexA + i]);
- cB = tolowerordinal (strB[indexB + i]);
-
- if (cA != cB)
- break;
- }
-
- return ((int) (strA[indexA + i] - strB[indexB + i]));
- }
-
- public int CompareTo (object obj)
- {
- return Compare (this, obj == null ? null : obj.ToString ());
- }
-
- public int CompareTo (string str)
- {
- return Compare (this, str);
- }
-
- public static string Concat (object arg)
- {
- return arg != null ? arg.ToString () : String.Empty;
- }
-
- public static string Concat (params object[] args)
- {
- string[] strings;
- char[] str;
- int len, i;
-
- if (args == null)
- throw new ArgumentNullException ();
-
- strings = new string [args.Length];
- len = 0;
- i = 0;
- foreach (object arg in args) {
- /* use Empty for each null argument */
- if (arg == null)
- strings[i] = String.Empty;
- else
- strings[i] = arg.ToString ();
- len += strings[i].length;
- i++;
- }
-
- if (len == 0)
- return String.Empty;
-
- String res = new String (len);
- str = res.c_str;
- i = 0;
- for (int j = 0; j < strings.Length; j++)
- for (int k = 0; k < strings[j].length; k++)
- str[i++] = strings[j].c_str[k];
-
- return res;
- }
-
- public static string Concat (params string[] values)
- {
- int len, i;
- char[] str;
-
- if (values == null)
- throw new ArgumentNullException ();
-
- len = 0;
- foreach (string value in values)
- len += value != null ? value.Length : 0;
-
- if (len == 0)
- return String.Empty;
-
- String res = new String (len);
- str = res.c_str;
- i = 0;
- foreach (string value in values) {
- if (value == null)
- continue;
-
- for (int j = 0; j < value.length; j++)
- str[i++] = value.c_str[j];
- }
-
- return res;
- }
-
- public static string Concat (object arg0, object arg1)
- {
- string str0 = arg0 != null ? arg0.ToString () : String.Empty;
- string str1 = arg1 != null ? arg1.ToString () : String.Empty;
-
- return Concat (str0, str1);
- }
-
- public static string Concat (string str0, string str1)
- {
- char[] concat;
- int i, j, len;
-
- if (str0 == null)
- str0 = String.Empty;
- if (str1 == null)
- str1 = String.Empty;
-
- len = str0.length + str1.length;
- if (len == 0)
- return String.Empty;
-
- String res = new String (len);
-
- concat = res.c_str;
- for (i = 0; i < str0.length; i++)
- concat[i] = str0.c_str[i];
- for (j = 0 ; j < str1.length; j++)
- concat[i + j] = str1.c_str[j];
-
- return res;
- }
-
- public static string Concat (object arg0, object arg1, object arg2)
- {
- string str0 = arg0 != null ? arg0.ToString () : String.Empty;
- string str1 = arg1 != null ? arg1.ToString () : String.Empty;
- string str2 = arg2 != null ? arg2.ToString () : String.Empty;
-
- return Concat (str0, str1, str2);
- }
-
- public static string Concat (string str0, string str1, string str2)
- {
- char[] concat;
- int i, j, k, len;
-
- if (str0 == null)
- str0 = String.Empty;
- if (str1 == null)
- str1 = String.Empty;
- if (str2 == null)
- str2 = String.Empty;
-
- len = str0.length + str1.length + str2.length;
- if (len == 0)
- return String.Empty;
-
- String res = new String (len);
-
- concat = res.c_str;
- for (i = 0; i < str0.length; i++)
- concat[i] = str0.c_str[i];
- for (j = 0; j < str1.length; j++)
- concat[i + j] = str1.c_str[j];
- for (k = 0; k < str2.length; k++)
- concat[i + j + k] = str2.c_str[k];
-
- return res;
- }
-
- public static string Concat (string str0, string str1, string str2, string str3)
- {
- char[] concat;
- int i, j, k, l, len;
-
- if (str0 == null)
- str0 = String.Empty;
- if (str1 == null)
- str1 = String.Empty;
- if (str2 == null)
- str2 = String.Empty;
- if (str3 == null)
- str3 = String.Empty;
-
- len = str0.length + str1.length + str2.length + str3.length;
- if (len == 0)
- return String.Empty;
- String res = new String (len);
-
- concat = res.c_str;
- for (i = 0; i < str0.length; i++)
- concat[i] = str0.c_str[i];
- for (j = 0; j < str1.length; j++)
- concat[i + j] = str1.c_str[j];
- for (k = 0; k < str2.length; k++)
- concat[i + j + k] = str2.c_str[k];
- for (l = 0; l < str3.length; l++)
- concat[i + j + k + l] = str3.c_str[l];
-
- return res;
- }
-
- public static string Copy (string str)
- {
- // FIXME: how do I *copy* a string if I can only have 1 of each?
- if (str == null)
- throw new ArgumentNullException ();
-
- return str;
- }
-
- public void CopyTo (int sourceIndex, char[] destination, int destinationIndex, int count)
- {
- // LAMESPEC: should I null-terminate?
- int i;
-
- if (destination == null)
- throw new ArgumentNullException ();
-
- if (sourceIndex < 0 || destinationIndex < 0 || count < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (sourceIndex + count > this.length)
- throw new ArgumentOutOfRangeException ();
-
- if (destinationIndex + count > destination.Length)
- throw new ArgumentOutOfRangeException ();
-
- for (i = 0; i < count; i++)
- destination[destinationIndex + i] = this.c_str[sourceIndex + i];
- }
-
- public bool EndsWith (string value)
- {
- bool endswith = true;
- int start, i;
-
- if (value == null)
- throw new ArgumentNullException ();
-
- start = this.length - value.length;
- if (start < 0)
- return false;
-
- for (i = start; i < this.length && endswith; i++)
- endswith = this.c_str[i] == value.c_str[i - start];
-
- return endswith;
- }
-
- public override bool Equals (object obj)
- {
- if (!(obj is String))
- return false;
-
- return this == (String) obj;
- }
-
- public bool Equals (string value)
- {
- return this == value;
- }
-
- public static bool Equals (string a, string b)
- {
- return a == b;
- }
-
- public static string Format (string format, object arg0) {
- return Format (null, format, new object[] { arg0 });
- }
-
- public static string Format (string format, object arg0, object arg1) {
- return Format (null, format, new object[] { arg0, arg1 });
- }
-
- public static string Format (string format, object arg0, object arg1, object arg2) {
- return Format (null, format, new object[] { arg0, arg1, arg2 });
- }
-
- public static string Format (string format, params object[] args) {
- return Format (null, format, args);
- }
-
- public static string Format (IFormatProvider provider, string format, params object[] args) {
- if (format == null || args == null)
- throw new ArgumentNullException ();
-
- StringBuilder result = new StringBuilder ();
-
- int ptr = 0;
- int start = ptr;
- while (ptr < format.Length) {
- char c = format[ptr ++];
-
- if (c == '{') {
- result.Append (format, start, ptr - start - 1);
-
- // check for escaped open bracket
-
- if (format[ptr] == '{') {
- start = ptr ++;
- break;
- }
-
- // parse specifier
-
- int n, width;
- bool left_align;
- string arg_format;
-
- ParseFormatSpecifier (format, ref ptr, out n, out width, out left_align, out arg_format);
- if (n >= args.Length)
- throw new FormatException ("Index (zero based) must be greater than or equal to zero and less than the size of the argument list.");
-
- // format argument
-
- object arg = args[n];
-
- string str;
- if (arg == null)
- str = "";
- else if (arg is IFormattable)
- str = ((IFormattable)arg).ToString (arg_format, provider);
- else
- str = arg.ToString ();
-
- // pad formatted string and append to result
-
- if (width > str.Length) {
- string pad = new String (' ', width - str.Length);
-
- if (left_align) {
- result.Append (str);
- result.Append (pad);
- }
- else {
- result.Append (pad);
- result.Append (str);
- }
- }
- else
- result.Append (str);
-
- start = ptr;
- }
- else if (c == '}' && format[ptr] == '}') {
- result.Append (format, start, ptr - start - 1);
- start = ptr ++;
- }
- }
-
- if (start < format.Length)
- result.Append (format.Substring (start));
-
- return result.ToString ();
- }
-
- public CharEnumerator GetEnumerator ()
- {
- return new CharEnumerator (this);
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new CharEnumerator (this);
- }
-
- public override int GetHashCode ()
- {
- int h = 0;
- int i;
- for (i = 0; i < length; ++i)
- h = (h << 5) - h + c_str [i];
- return h;
- }
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.String;
- }
-
- public int IndexOf (char value)
- {
- return IndexOf (value, 0, this.length);
- }
-
- public int IndexOf (string value)
- {
- return IndexOf (value, 0, this.length);
- }
-
- public int IndexOf (char value, int startIndex)
- {
- return IndexOf (value, startIndex, this.length - startIndex);
- }
-
- public int IndexOf (string value, int startIndex)
- {
- return IndexOf (value, startIndex, this.length - startIndex);
- }
-
- public int IndexOf (char value, int startIndex, int count)
- {
- int i;
-
- if (startIndex < 0 || count < 0 || startIndex + count > this.length)
- throw new ArgumentOutOfRangeException ();
-
- for (i = startIndex; i - startIndex < count; i++)
- if (this.c_str[i] == value)
- return i;
-
- return -1;
- }
-
- public int IndexOf (string value, int startIndex, int count)
- {
- if (value == null)
- throw new ArgumentNullException ();
-
- if (startIndex < 0 || count < 0 || startIndex + count > this.length)
- throw new ArgumentOutOfRangeException ();
-
- return BoyerMoore (this.c_str, value, startIndex, count);
-#if XXX
- int i;
- for (i = startIndex; i - startIndex + value.Length <= count; ) {
- if (this.c_str[i] == value[0]) {
- bool equal = true;
- int j, nexti = 0;
-
- for (j = 1; equal && j < value.Length; j++) {
- equal = this.c_str[i + j] == value[j];
- if (this.c_str[i + j] == value[0] && nexti == 0)
- nexti = i + j;
- }
-
- if (equal)
- return i;
-
- if (nexti != 0)
- i = nexti;
- else
- i += j;
- } else
- i++;
- }
-
- return -1;
-#endif
- }
-
- public int IndexOfAny (char[] values)
- {
- return IndexOfAny (values, 0, this.length);
- }
-
- public int IndexOfAny (char[] values, int startIndex)
- {
- return IndexOfAny (values, startIndex, this.length - startIndex);
- }
-
- public int IndexOfAny (char[] values, int startIndex, int count)
- {
- if (values == null)
- throw new ArgumentNullException ();
-
- if (startIndex < 0 || count < 0 || startIndex + count > this.length)
- throw new ArgumentOutOfRangeException ();
-
- for (int i = startIndex; i < startIndex + count; i++) {
- for (int j = 0; j < strlen (values); j++) {
- if (this.c_str[i] == values[j])
- return i;
- }
- }
-
- return -1;
- }
-
- public string Insert (int startIndex, string value)
- {
- char[] str;
- int i, j;
-
- if (value == null)
- throw new ArgumentNullException ();
-
- if (startIndex < 0 || startIndex > this.length)
- throw new ArgumentOutOfRangeException ();
-
- String res = new String (value.length + this.length);
-
- str = res.c_str;
- for (i = 0; i < startIndex; i++)
- str[i] = this.c_str[i];
- for (j = 0; j < value.length; j++)
- str[i + j] = value.c_str[j];
- for ( ; i < this.length; i++)
- str[i + j] = this.c_str[i];
-
- return res;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static string Intern (string str);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static string IsInterned (string str);
-
- public static string Join (string separator, string[] value)
- {
- return Join (separator, value, 0, value.Length);
- }
-
- public static string Join (string separator, string[] value, int startIndex, int count)
- {
- // LAMESPEC: msdn doesn't specify what happens when separator is null
- int len, i, j, used;
- char[] str;
-
- if (separator == null || value == null)
- throw new ArgumentNullException ();
-
- if (startIndex + count > value.Length)
- throw new ArgumentOutOfRangeException ();
-
- len = 0;
- for (i = startIndex, used = 0; used < count; i++, used++) {
- if (i != startIndex)
- len += separator.length;
-
- len += value[i].length;
- }
-
- // We have no elements to join?
- if (i == startIndex)
- return String.Empty;
-
- String res = new String (len);
-
- str = res.c_str;
- for (i = 0; i < value[startIndex].length; i++)
- str[i] = value[startIndex][i];
-
- used = 1;
- for (j = startIndex + 1; used < count; j++, used++) {
- int k;
-
- for (k = 0; k < separator.length; k++)
- str[i++] = separator.c_str[k];
- for (k = 0; k < value[j].length; k++)
- str[i++] = value[j].c_str[k];
- }
-
- return res;
- }
-
- public int LastIndexOf (char value)
- {
- int i = this.length;
- if (i == 0)
- return -1;
- --i;
- for (; i >= 0; i--) {
- if (this.c_str[i] == value)
- return i;
- }
-
- return -1;
- }
-
- public int LastIndexOf (string value)
- {
- return LastIndexOf (value, this.length - 1, this.length);
- }
-
- public int LastIndexOf (char value, int startIndex)
- {
- if (startIndex < 0 || startIndex >= this.length)
- throw new ArgumentOutOfRangeException ();
-
- for (int i = startIndex; i >= 0; i--) {
- if (this.c_str[i] == value)
- return i;
- }
-
- return -1;
- }
-
- public int LastIndexOf (string value, int startIndex)
- {
- return LastIndexOf (value, startIndex, startIndex + 1);
- }
-
- public int LastIndexOf (char value, int startIndex, int count)
- {
- if (startIndex < 0 || count < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (startIndex >= this.length || startIndex - count + 1 < 0)
- throw new ArgumentOutOfRangeException ();
-
- for (int i = startIndex; i > startIndex - count; i--) {
- if (this.c_str[i] == value)
- return i;
- }
-
- return -1;
- }
-
- public int LastIndexOf (string value, int startIndex, int count)
- {
- // LAMESPEC: currently I'm using startIndex as the 0-position in the comparison,
- // but maybe it's the end-position in MS's implementation?
- // msdn is unclear on this point. I think this is correct though.
- int i, len;
-
- if (value == null)
- throw new ArgumentNullException ();
-
- if (startIndex < 0 || startIndex >= this.length)
- throw new ArgumentOutOfRangeException ();
-
- if (count < 0 || startIndex - count + 1 < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (value == String.Empty)
- return startIndex;
-
- if (startIndex + value.length > this.length) {
- /* just a little optimization */
- int start;
-
- start = this.length - value.length;
- count -= startIndex - start;
- startIndex = start;
- }
-
- // FIXME: use a reversed-unicode-safe-Boyer-Moore?
- len = value.length - 1;
- for (i = startIndex; i > startIndex - count; i--) {
- if (this.c_str[i + len] == value.c_str[len]) {
- bool equal = true;
- int j;
-
- for (j = len - 1; equal && j >= 0; j--)
- equal = this.c_str[i + j] == value.c_str[j];
-
- if (equal)
- return i;
- }
- }
-
- return -1;
- }
-
- public int LastIndexOfAny (char[] values)
- {
- return LastIndexOfAny (values, this.length - 1, this.length);
- }
-
- public int LastIndexOfAny (char[] values, int startIndex)
- {
- return LastIndexOfAny (values, startIndex, startIndex + 1);
- }
-
- public int LastIndexOfAny (char[] values, int startIndex, int count)
- {
- int i;
-
- if (values == null)
- throw new ArgumentNullException ();
-
- if (startIndex < 0 || count < 0 || startIndex - count + 1 < 0)
- throw new ArgumentOutOfRangeException ();
-
- for (i = startIndex; i > startIndex - count; i--) {
- for (int j = 0; j < strlen (values); j++) {
- if (this.c_str[i] == values[j])
- return i;
- }
- }
-
- return -1;
- }
-
- public string PadLeft (int totalWidth)
- {
- return PadLeft (totalWidth, ' ');
- }
-
- public string PadLeft (int totalWidth, char padChar)
- {
- char[] str;
- int i, j;
-
- if (totalWidth < 0)
- throw new ArgumentException ();
-
- str = new char [totalWidth > this.length ? totalWidth : this.length];
- for (i = 0; i < totalWidth - this.length; i++)
- str[i] = padChar;
-
- for (j = 0; j < this.length; i++, j++)
- str[i] = this.c_str[j];
-
- return new String (str);
- }
-
- public string PadRight (int totalWidth)
- {
- return PadRight (totalWidth, ' ');
- }
-
- public string PadRight (int totalWidth, char padChar)
- {
- char[] str;
- int i;
-
- if (totalWidth < 0)
- throw new ArgumentException ();
-
- str = new char [totalWidth > this.length ? totalWidth : this.length];
- for (i = 0; i < this.length; i++)
- str[i] = this.c_str[i];
-
- for ( ; i < str.Length; i++)
- str[i] = padChar;
-
- return new String (str);
- }
-
- public string Remove (int startIndex, int count)
- {
- char[] str;
- int i, j, len;
-
- if (startIndex < 0 || count < 0 || startIndex + count > this.length)
- throw new ArgumentOutOfRangeException ();
-
- len = this.length - count;
- if (len == 0)
- return String.Empty;
-
- String res = new String (len);
- str = res.c_str;
- for (i = 0; i < startIndex; i++)
- str[i] = this.c_str[i];
- for (j = i + count; j < this.length; j++)
- str[i++] = this.c_str[j];
-
- return res;
- }
-
- public string Replace (char oldChar, char newChar)
- {
- char[] str;
- int i;
-
- String res = new String (length);
- str = res.c_str;
- for (i = 0; i < this.length; i++) {
- if (this.c_str[i] == oldChar)
- str[i] = newChar;
- else
- str[i] = this.c_str[i];
- }
-
- return res;
- }
-
- public string Replace (string oldValue, string newValue)
- {
- // LAMESPEC: msdn doesn't specify what to do if either args is null
- int index, len, i, j;
- char[] str;
-
- if (oldValue == null || newValue == null)
- throw new ArgumentNullException ();
-
- // Use IndexOf in case I later rewrite it to use Boyer-Moore
- index = IndexOf (oldValue, 0);
- if (index == -1) {
- // This is the easy one ;-)
- return Substring (0, this.length);
- }
-
- len = this.length - oldValue.length + newValue.length;
- if (len == 0)
- return String.Empty;
-
- String res = new String (len);
- str = res.c_str;
- for (i = 0; i < index; i++)
- str[i] = this.c_str[i];
- for (j = 0; j < newValue.length; j++)
- str[i++] = newValue[j];
- for (j = index + oldValue.length; j < this.length; j++)
- str[i++] = this.c_str[j];
-
- return res;
- }
-
- private int splitme (char[] separators, int startIndex)
- {
- /* this is basically a customized IndexOfAny() for the Split() methods */
- for (int i = startIndex; i < this.length; i++) {
- if (separators != null) {
- foreach (char sep in separators) {
- if (this.c_str[i] == sep)
- return i - startIndex;
- }
- } else if (is_lwsp (this.c_str[i])) {
- return i - startIndex;
- }
- }
-
- return -1;
- }
-
- public string[] Split (params char[] separator)
- {
- /**
- * split:
- * @separator: delimiting chars or null to split on whtspc
- *
- * Returns: 1. An array consisting of a single
- * element (@this) if none of the delimiting
- * chars appear in @this. 2. An array of
- * substrings which are delimited by one of
- * the separator chars. 3. An array of
- * substrings separated by whitespace if
- * @separator is null. The Empty string should
- * be returned wherever 2 delimiting chars are
- * adjacent.
- **/
- // FIXME: would using a Queue be better?
- string[] strings;
- ArrayList list;
- int index, len;
-
- list = new ArrayList ();
- for (index = 0, len = 0; index < this.length; index += len + 1) {
- len = splitme (separator, index);
- len = len > -1 ? len : this.length - index;
- if (len == 0) {
- list.Add (String.Empty);
- } else {
- char[] str;
- int i;
-
- str = new char [len];
- for (i = 0; i < len; i++)
- str[i] = this.c_str[index + i];
-
- list.Add (new String (str));
- }
- }
-
- strings = new string [list.Count];
- if (list.Count == 1) {
- /* special case for an array holding @this */
- strings[0] = this;
- } else {
- for (index = 0; index < list.Count; index++)
- strings[index] = (string) list[index];
- }
-
- return strings;
- }
-
- public string[] Split (char[] separator, int maxCount)
- {
- // FIXME: what to do if maxCount <= 0?
- // FIXME: would using Queue be better than ArrayList?
- string[] strings;
- ArrayList list;
- int index, len, used;
-
- used = 0;
- list = new ArrayList ();
- for (index = 0, len = 0; index < this.length && used < maxCount; index += len + 1) {
- len = splitme (separator, index);
- len = len > -1 ? len : this.length - index;
- if (len == 0) {
- list.Add (String.Empty);
- } else {
- char[] str;
- int i;
-
- str = new char [len];
- for (i = 0; i < len; i++)
- str[i] = this.c_str[index + i];
-
- list.Add (new String (str));
- }
- used++;
- }
-
- /* fit the remaining chunk of the @this into it's own element */
- if (index < this.length - 1) {
- char[] str;
- int i;
-
- str = new char [this.length - index];
- for (i = index; i < this.length; i++)
- str[i - index] = this.c_str[i];
-
- list.Add (new String (str));
- }
-
- strings = new string [list.Count];
- if (list.Count == 1) {
- /* special case for an array holding @this */
- strings[0] = this;
- } else {
- for (index = 0; index < list.Count; index++)
- strings[index] = (string) list[index];
- }
-
- return strings;
- }
-
- public bool StartsWith (string value)
- {
- bool startswith = true;
- int i;
-
- if (value == null)
- throw new ArgumentNullException ();
-
- if (value.length > this.length)
- return false;
-
- for (i = 0; i < value.length && startswith; i++)
- startswith = startswith && value.c_str[i] == this.c_str[i];
-
- return startswith;
- }
-
- public string Substring (int startIndex)
- {
- char[] str;
- int i, len;
-
- if (startIndex < 0 || startIndex > this.length)
- throw new ArgumentOutOfRangeException ();
-
- len = this.length - startIndex;
- if (len == 0)
- return String.Empty;
- String res = new String (len);
- str = res.c_str;
- for (i = startIndex; i < this.length; i++)
- str[i - startIndex] = this.c_str[i];
-
- return res;
- }
-
- public string Substring (int startIndex, int length)
- {
- char[] str;
- int i;
-
- if (startIndex < 0 || length < 0 || startIndex + length > this.length)
- throw new ArgumentOutOfRangeException ();
-
- if (length == 0)
- return String.Empty;
-
- String res = new String (length);
- str = res.c_str;
- for (i = startIndex; i < startIndex + length; i++)
- str[i - startIndex] = this.c_str[i];
-
- return res;
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return Convert.ToBoolean (this);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return Convert.ToByte (this);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return Convert.ToChar (this);
- }
-
- public char[] ToCharArray ()
- {
- return ToCharArray (0, this.length);
- }
-
- public char[] ToCharArray (int startIndex, int length)
- {
- char[] chars;
- int i;
-
- if (startIndex < 0 || length < 0 || startIndex + length > this.length)
- throw new ArgumentOutOfRangeException ();
-
- chars = new char [length];
- for (i = startIndex; i < length; i++)
- chars[i - startIndex] = this.c_str[i];
-
- return chars;
- }
-
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return Convert.ToDateTime (this);
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return Convert.ToDecimal (this);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return Convert.ToDouble (this);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return Convert.ToInt16 (this);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return Convert.ToInt32 (this);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return Convert.ToInt64 (this);
- }
-
- public string ToLower ()
- {
- char[] str;
- int i;
-
- String res = new String (length);
- str = res.c_str;
- for (i = 0; i < this.length; i++)
- str[i] = Char.ToLower (this.c_str[i]);
-
- return res;
- }
-
- [MonoTODO]
- public string ToLower (CultureInfo culture)
- {
- // FIXME: implement me
- throw new NotImplementedException ();
-
- }
-
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return Convert.ToSByte (this);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return Convert.ToSingle (this);
- }
-
- public override string ToString ()
- {
- return this;
- }
-
- string IConvertible.ToString (IFormatProvider format)
- {
- return this;
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return Convert.ToType (this, conversionType, provider);
- }
-
- [CLSCompliant(false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return Convert.ToUInt16 (this);
- }
-
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return Convert.ToUInt32 (this);
- }
-
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return Convert.ToUInt64 (this);
- }
-
- public string ToUpper ()
- {
- char[] str;
- int i;
-
- String res = new String (length);
- str = res.c_str;
- for (i = 0; i < this.length; i++)
- str[i] = Char.ToUpper (this.c_str[i]);
-
- return res;
- }
-
- [MonoTODO]
- public string ToUpper (CultureInfo culture)
- {
- // FIXME: implement me
- throw new NotImplementedException ();
- }
-
- public string Trim ()
- {
- return Trim (null);
- }
-
- public string Trim (params char[] trimChars)
- {
- int begin, end;
- bool matches = false;
-
- for (begin = 0; begin < this.length; begin++) {
- if (trimChars != null) {
- matches = false;
- foreach (char c in trimChars) {
- matches = this.c_str[begin] == c;
- if (matches)
- break;
- }
- if (matches)
- continue;
- } else {
- matches = is_lwsp (this.c_str[begin]);
- if (matches)
- continue;
- }
- break;
- }
-
- for (end = this.length - 1; end > begin; end--) {
- if (trimChars != null) {
- matches = false;
- foreach (char c in trimChars) {
- matches = this.c_str[end] == c;
- if (matches)
- break;
- }
- if (matches)
- continue;
- } else {
- matches = is_lwsp (this.c_str[end]);
- if (matches)
- continue;
- }
- break;
- }
- end++;
-
- if (begin >= end)
- return String.Empty;
-
- return Substring (begin, end - begin);
- }
-
- public string TrimEnd (params char[] trimChars)
- {
- bool matches = true;
- int end;
-
- for (end = this.length - 1; matches && end > 0; end--) {
-
- if (trimChars != null) {
- matches = false;
- foreach (char c in trimChars) {
- matches = this.c_str[end] == c;
- if (matches)
- break;
- }
- } else {
- matches = is_lwsp (this.c_str[end]);
- }
-
- if (!matches)
- return Substring (0, end+1);
- }
-
- if (end == 0)
- return String.Empty;
-
- return Substring (0, end);
- }
-
- public string TrimStart (params char[] trimChars)
- {
- bool matches = true;
- int begin;
-
- for (begin = 0; matches && begin < this.length; begin++) {
- if (trimChars != null) {
- matches = false;
- foreach (char c in trimChars) {
- matches = this.c_str[begin] == c;
- if (matches)
- break;
- }
- } else {
- matches = is_lwsp (this.c_str[begin]);
- }
-
- if (!matches)
- return Substring (begin, this.length - begin);
- }
-
- if (begin == this.length)
- return String.Empty;
-
- throw new FormatException ();
-
- return Substring (begin, this.length - begin);
- }
-
- // Operators
- public static bool operator ==(string a, string b)
- {
- if ((object)a == null) {
- if ((object)b == null)
- return true;
- return false;
- }
- if ((object)b == null)
- return false;
-
- if (a.length != b.length)
- return false;
-
- int l = a.length;
- for (int i = 0; i < l; i++)
- if (a.c_str[i] != b.c_str[i])
- return false;
-
- return true;
- }
-
- public static bool operator !=(string a, string b)
- {
- return !(a == b);
- }
-
- // private
-
- private static void ParseFormatSpecifier (string str, ref int ptr, out int n, out int width, out bool left_align, out string format) {
- // parses format specifier of form:
- // N,[[-]M][:F]}
- //
- // where:
-
- try {
- // N = argument number (non-negative integer)
-
- n = ParseDecimal (str, ref ptr);
- if (n < 0)
- throw new FormatException ("Input string was not in correct format.");
-
- // M = width (non-negative integer)
-
- if (str[ptr] == ',') {
- left_align = (str[++ ptr] == '-');
- if (left_align)
- ++ ptr;
-
- width = ParseDecimal (str, ref ptr);
- if (width < 0)
- throw new FormatException ("Input string was not in correct format.");
- }
- else {
- width = 0;
- left_align = false;
- }
-
- // F = argument format (string)
-
- if (str[ptr] == ':') {
- int start = ++ ptr;
- while (str[ptr] != '}')
- ++ ptr;
-
- format = str.Substring (start, ptr - start);
- }
- else
- format = null;
-
- if (str[ptr ++] != '}')
- throw new FormatException ("Input string was not in correct format.");
- }
- catch (IndexOutOfRangeException) {
- throw new FormatException ("Input string was not in correct format.");
- }
- }
-
- private static int ParseDecimal (string str, ref int ptr) {
- int p = ptr;
- int n = 0;
- while (true) {
- char c = str[p];
- if (c < '0' || '9' < c)
- break;
-
- n = n * 10 + c - '0';
- ++ p;
- }
-
- if (p == ptr)
- return -1;
-
- ptr = p;
- return n;
- }
- }
-}
diff --git a/mcs/class/corlib/System/SystemException.cs b/mcs/class/corlib/System/SystemException.cs
deleted file mode 100644
index 7e41953645f..00000000000
--- a/mcs/class/corlib/System/SystemException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.SystemException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System;
-using System.Globalization;
-
-namespace System {
-
- [Serializable]
- public class SystemException : Exception {
- // Constructors
- public SystemException ()
- : base (Locale.GetText ("A system exception has occurred."))
- {
- }
-
- public SystemException (string message)
- : base (message)
- {
- }
-
- protected SystemException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public SystemException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/TODO b/mcs/class/corlib/System/TODO
deleted file mode 100644
index 065809deedb..00000000000
--- a/mcs/class/corlib/System/TODO
+++ /dev/null
@@ -1,22 +0,0 @@
-System.Object:
- Need a mechanism for getting an object underlying type.
-
-System.ValueType:
- Need to lock memory and "scan" the actual contents to compute
- hash code and do comparissions. Should be simple to do with
- C#, the problem is figuring out the size of the object.
-
-System.String:
- Need to implement the Format() and CompareOrdinal() methods
- as we all implement all of the methods that take into account
- CultureInfo or Encoding stuff.
-
-System.Array:
- It's not possible to test to see if the whole thing works, as
- GetValue() and SetValue() make calls into the runtime. However,
- I've tried my implementations of things like BinarySearch() and
- Sort() on the MS-provided System.Array and they seem to work fine.
- According to the spec, System.Array implements the IList interface.
- The spec doesn't have the methods for those interfaces, however,
- the class doesn't (yet) implement that interface and those methods
- are not (yet) written.
diff --git a/mcs/class/corlib/System/TODOAttribute.cs b/mcs/class/corlib/System/TODOAttribute.cs
deleted file mode 100644
index 0920ce8f92d..00000000000
--- a/mcs/class/corlib/System/TODOAttribute.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
- public class MonoTODOAttribute : Attribute {
-
- private string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment
- {
- get { return comment; }
- }
- }
-}
diff --git a/mcs/class/corlib/System/ThreadStaticAttribute.cs b/mcs/class/corlib/System/ThreadStaticAttribute.cs
deleted file mode 100644
index a5270e8e6a8..00000000000
--- a/mcs/class/corlib/System/ThreadStaticAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.ThreadStaticAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Field)]
- public class ThreadStaticAttribute : Attribute
- {
- // Constructors
- public ThreadStaticAttribute () : base ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/TimeSpan.cs b/mcs/class/corlib/System/TimeSpan.cs
deleted file mode 100644
index eea8266e5b1..00000000000
--- a/mcs/class/corlib/System/TimeSpan.cs
+++ /dev/null
@@ -1,556 +0,0 @@
-//
-// System.TimeSpan.cs
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2001 Duco Fijma
-//
-// version: 07312001
-
-using System.Globalization;
-
-namespace System {
-
- public struct TimeSpan : IComparable {
- private long _ticks;
-
- // Ctors
-
- public TimeSpan (long value) { _ticks = value; }
- public TimeSpan (int hours, int minutes, int seconds)
- : this(false, 0, hours, minutes, seconds, 0, 0) {}
- public TimeSpan (int days, int hours, int minutes, int seconds)
- : this(false, days, hours, minutes, seconds, 0, 0) {}
- public TimeSpan (int days, int hours, int minutes, int seconds, int milliseconds)
- : this(false, days, hours, minutes, seconds, milliseconds, 0) {}
-
- internal TimeSpan (bool sign, int days, int hours, int minutes, int seconds, int milliseconds, long ticks)
- {
- checked {
- _ticks = TicksPerDay * days +
- TicksPerHour * hours +
- TicksPerMinute * minutes +
- TicksPerSecond * seconds +
- TicksPerMillisecond * milliseconds +
- ticks;
- if ( sign ) {
- _ticks = -_ticks;
- }
- }
- }
-
- // Fields
-
- public static readonly TimeSpan MaxValue = new TimeSpan (long.MaxValue);
- public static readonly TimeSpan MinValue = new TimeSpan (long.MinValue);
- public const long TicksPerDay = 864000000000L;
- public const long TicksPerHour = 36000000000L;
- public const long TicksPerMillisecond = 10000L;
- public const long TicksPerMinute = 600000000L;
- public const long TicksPerSecond = 10000000L;
- public static readonly TimeSpan Zero = new TimeSpan (0L);
-
- // Properties
-
- public int Days
- {
- get {
- return (int) TotalDays;
- }
- }
-
- public int Hours
- {
- get {
- return (int) (_ticks % TicksPerDay / TicksPerHour);
- }
- }
-
- public int Milliseconds
- {
- get
- {
- return (int) (_ticks % TicksPerSecond / TicksPerMillisecond);
- }
- }
-
- public int Minutes
- {
- get
- {
- return (int) (_ticks % TicksPerHour / TicksPerMinute);
- }
- }
-
- public int Seconds
- {
- get
- {
- return (int) (_ticks % TicksPerMinute / TicksPerSecond);
- }
- }
-
- public long Ticks
- {
- get
- {
- return _ticks;
- }
- }
-
- public double TotalDays
- {
- get
- {
- return (double) _ticks / TicksPerDay;
- }
- }
-
- public double TotalHours
- {
- get
- {
- return (double) _ticks / TicksPerHour;
- }
- }
-
- public double TotalMilliseconds
- {
- get
- {
- return (double) _ticks / TicksPerMillisecond;
- }
- }
-
- public double TotalMinutes
- {
- get {
- return (double) _ticks / TicksPerMinute;
- }
- }
-
- public double TotalSeconds
- {
- get {
- return (double) _ticks / TicksPerSecond;
- }
- }
-
- // Methods
-
- public TimeSpan Add (TimeSpan ts)
- {
- checked {
- return new TimeSpan (_ticks + ts.Ticks);
- }
- }
-
- public static int Compare (TimeSpan t1, TimeSpan t2)
- {
- if (t1._ticks < t2._ticks) {
- return -1;
- }
- else if (t1._ticks > t2._ticks) {
- return 1;
- }
- else {
- return 0;
- }
- }
-
- public int CompareTo (object value)
- {
- if (value == null )
- return 1;
-
- if (!(value is TimeSpan)) {
- throw new ArgumentException (Locale.GetText (
- "Argument of System.TimeSpan.CompareTo should be a TimeSpan"));
- }
-
- return Compare(this, (TimeSpan) value);
- }
-
- public TimeSpan Duration ()
- {
- checked {
- return new TimeSpan (Math.Abs (_ticks));
- }
- }
-
- public override bool Equals (object value)
- {
- if (!(value is TimeSpan)) {
- return false;
- }
- return Equals (this, (TimeSpan) value);
- }
-
- public static bool Equals (TimeSpan t1, TimeSpan t2)
- {
- return t1._ticks == t2._ticks;
- }
-
- // Implementing FromDays -> FromHours -> FromMinutes -> FromSeconds ->
- // FromMilliseconds as done here is probably not the most efficient
- // way.
- public static TimeSpan FromDays (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan ((int) value,0,0,0,0) + FromHours ((value - ((int) value)) * 24);
- }
-
- public static TimeSpan FromHours (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan ((int) value,0,0) + FromMinutes ((value - ((int) value)) * 60);
- }
-
- public static TimeSpan FromMinutes (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan (0, (int) value, 0) + FromSeconds((value - ((int) value)) * 60);
- }
-
- public static TimeSpan FromSeconds (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan (0, 0, 0, (int) value) + FromMilliseconds((value - ((int) value)) * 1000);
-
- }
-
- public static TimeSpan FromMilliseconds (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan (0, 0, 0, 0, (int) value);
- }
-
- public static TimeSpan FromTicks (long value)
- {
- return new TimeSpan (value);
- }
-
- public override int GetHashCode ()
- {
- return _ticks.GetHashCode ();
- }
-
- public TimeSpan Negate ()
- {
- checked {
- return new TimeSpan (-_ticks);
- }
- }
-
- public static TimeSpan Parse (string s)
- {
- if (s == null) {
- throw new ArgumentNullException (
- Locale.GetText ("null reference passed to TimeSpan.Parse"));
- }
-
- Parser p = new Parser (s);
- return p.Execute ();
- }
-
- public TimeSpan Subtract (TimeSpan ts)
- {
- checked {
- return new TimeSpan (_ticks - ts.Ticks);
- }
- }
-
- public override string ToString ()
- {
- string res = "";
-
- if (_ticks < 0) {
- res += "-";
- }
-
- // We need to take absolute values of all components.
- // Can't handle negative timespans by negating the TimeSpan
- // as a whole. This would lead to an overflow for the
- // degenerate case "TimeSpan.MinValue.ToString()".
- if (Days != 0) {
- res += Math.Abs (Days) + "." ;
- }
-
- res += string.Format ("{0:00}:{1:00}:{2:00}", Math.Abs(Hours), Math.Abs(Minutes), Math.Abs(Seconds));
-
- int fractional = (int) Math.Abs (_ticks % TicksPerSecond);
- if (fractional != 0) {
- res += string.Format (".{0:0000000}", fractional);
- }
-
- return res;
- }
-
- public static TimeSpan operator + (TimeSpan t1, TimeSpan t2)
- {
- return t1.Add (t2);
- }
-
- public static bool operator == (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) == 0;
- }
-
- public static bool operator > (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) == 1;
- }
-
- public static bool operator >= (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) != -1;
- }
-
- public static bool operator != (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) != 0;
- }
-
- public static bool operator < (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) == -1;
- }
-
- public static bool operator <= (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) != 1;
- }
-
- public static TimeSpan operator - (TimeSpan t1, TimeSpan t2)
- {
- return t1.Subtract (t2);
- }
-
- public static TimeSpan operator - (TimeSpan t)
- {
- return t.Negate ();
- }
-
- public static TimeSpan operator + (TimeSpan t)
- {
- return t;
- }
- }
-
- // Class Parser implements simple parser for TimeSpan::Parse
- internal class Parser {
-
- private string _src;
- private int _cur;
- private int _length;
-
- public Parser (string src)
- {
- _src = src;
- Reset ();
- }
-
- public void Reset ()
- {
- _cur = 0;
- _length = _src.Length;
- }
-
- public bool AtEnd
- {
- get {
- return _cur >= _length;
- }
- }
-
- private void ThrowFormatException()
- {
- throw new FormatException (Locale.GetText ("Invalid format for TimeSpan.Parse"));
- }
-
- // All "Parse" functions throw a FormatException on syntax error.
- // Their return value is semantic value of the item parsed.
-
- // Range checking is spread over three different places:
- // 1) When parsing "int" values, an exception is thrown immediately
- // when the value parsed exceeds the maximum value for an int.
- // 2) An explicit check is built in that checks for hours > 23 and
- // for minutes and seconds > 59.
- // 3) Throwing an exceptions for a final TimeSpan value > MaxValue
- // or < MinValue is left to the TimeSpan constructor called.
-
- // Parse zero or more whitespace chars.
- private void ParseWhiteSpace ()
- {
- while (!AtEnd && Char.IsWhiteSpace (_src, _cur)) {
- _cur++;
- }
- }
-
- // Parse optional sign character.
- private bool ParseSign ()
- {
- bool res = false;
-
- if (!AtEnd && _src[_cur] == '-') {
- res = true;
- _cur++;
- }
-
- return res;
- }
-
- // Parse simple int value
- private int ParseInt ()
- {
- int res = 0;
- int count = 0;
-
- while (!AtEnd && Char.IsDigit (_src, _cur)) {
- checked {
- res = res*10 + _src[_cur] - '0';
- }
- _cur++;
- count++;
- }
-
- if (count == 0) {
- ThrowFormatException ();
- }
-
- return res;
- }
-
- // Parse optional dot
- private bool ParseOptDot ()
- {
- if (AtEnd) {
- return false;
- }
-
- if (_src[_cur] == '.') {
- _cur++;
- return true;
- }
- else {
- return false;
- }
- }
-
- // Parse NON-optional colon
- private void ParseColon ()
- {
- if (!AtEnd && _src[_cur] == ':') {
- _cur++;
- }
- else {
- ThrowFormatException ();
- }
- }
-
- // Parse [1..7] digits, representing fractional seconds (ticks)
- private long ParseTicks ()
- {
- long mag = 1000000;
- long res = 0;
- bool digitseen = false;
-
- while ( mag > 0 && !AtEnd && Char.IsDigit (_src, _cur) ) {
- res = res + (_src[_cur] - '0') * mag;
- _cur++;
- mag = mag / 10;
- digitseen = true;
- }
-
- if (!digitseen) {
- ThrowFormatException ();
- }
-
- return res;
- }
-
- public TimeSpan Execute ()
- {
- bool sign;
- int days;
- int hours;
- int minutes;
- int seconds;
- long ticks;
-
- // Parse [ws][dd.]hh:mm:ss[.ff][ws]
- ParseWhiteSpace ();
- sign = ParseSign ();
- days = ParseInt ();
- if (ParseOptDot ()) {
- hours = ParseInt ();
- }
- else {
- hours = days;
- days = 0;
- }
- ParseColon();
- minutes = ParseInt ();
- ParseColon();
- seconds = ParseInt ();
- if ( ParseOptDot () ) {
- ticks = ParseTicks ();
- }
- else {
- ticks = 0;
- }
- ParseWhiteSpace ();
-
- if ( !AtEnd ) {
- ThrowFormatException ();
- }
-
- if ( hours > 23 || minutes > 59 || seconds > 59 ) {
- throw new OverflowException (Locale.GetText (
- "Value outside range in TimeSpan.Parse" ));
- }
-
- TimeSpan ts = new TimeSpan (sign, days, hours, minutes, seconds, 0, ticks);
-
- return ts;
- }
- }
-}
-
-
diff --git a/mcs/class/corlib/System/TimeZone.cs b/mcs/class/corlib/System/TimeZone.cs
deleted file mode 100644
index 0a2908efe1e..00000000000
--- a/mcs/class/corlib/System/TimeZone.cs
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-// System.TimeZone.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-// Ajay Kumar Dwivedi (adwiv@yahoo.com)
-// Martin Baulig (martin@gnome.org)
-//
-// (C) Ximian, Inc.
-//
-
-using System.Collections;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- [Serializable]
- public abstract class TimeZone
- {
- // Fields
- private static TimeZone currentTimeZone;
-
- // Constructor
- protected TimeZone ()
- {
- }
-
- // Properties
- public static TimeZone CurrentTimeZone
- {
- get {
- if (currentTimeZone == null)
- currentTimeZone = new CurrentTimeZone ();
-
- return currentTimeZone;
- }
- }
-
- public abstract string DaylightName
- {
- get;
- }
-
- public abstract string StandardName
- {
- get;
- }
-
- // Methods
- public abstract DaylightTime GetDaylightChanges (int year);
-
- public abstract TimeSpan GetUtcOffset (DateTime time);
-
- public virtual bool IsDaylightSavingTime (DateTime time)
- {
- return IsDaylightSavingTime (time, GetDaylightChanges (time.Year));
- }
-
- public static bool IsDaylightSavingTime (DateTime time, DaylightTime daylightTimes)
- {
- if (daylightTimes == null)
- throw new ArgumentNullException ("daylightTimes");
-
- // If Start == End, then DST is off
- if (daylightTimes.Start.Ticks == daylightTimes.End.Ticks)
- return false;
-
- //We are in the northern hemisphere.
- if (daylightTimes.Start.Ticks < daylightTimes.End.Ticks) {
- if (daylightTimes.Start.Ticks < time.Ticks
- && daylightTimes.End.Ticks > time.Ticks)
- return true; // time lies between Start and End
-
- } else { // We are in the southern hemisphere.
- if (time.Year == daylightTimes.Start.Year && time.Year == daylightTimes.End.Year)
- if (time.Ticks < daylightTimes.End.Ticks
- || time.Ticks > daylightTimes.Start.Ticks)
- return true; // time is less than End OR more than Start
- }
-
- return false;
- }
-
- public virtual DateTime ToLocalTime (DateTime time)
- {
- return time + GetUtcOffset (time);
- }
-
- public virtual DateTime ToUniversalTime (DateTime time)
- {
- return time - GetUtcOffset (time);
- }
- }
-
- internal class CurrentTimeZone : TimeZone
- {
- // Fields
- private static string daylightName;
- private static string standardName;
-
- // A yearwise cache of DaylightTime.
- private static Hashtable daylightCache = new Hashtable (1);
-
- // the offset when daylightsaving is not on.
- private static TimeSpan utcOffsetWithOutDLS;
-
- // the offset when daylightsaving is on.
- private static TimeSpan utcOffsetWithDLS;
-
- internal enum TimeZoneData {
- DaylightSavingStartIdx,
- DaylightSavingEndIdx,
- UtcOffsetIdx,
- AdditionalDaylightOffsetIdx
- };
-
- internal enum TimeZoneNames {
- StandardNameIdx,
- DaylightNameIdx
- };
-
- // Internal method to get timezone data.
- // data[0]: start of daylight saving time (in DateTime ticks).
- // data[1]: end of daylight saving time (in DateTime ticks).
- // data[2]: utcoffset (in TimeSpan ticks).
- // data[3]: additional offset when daylight saving (in TimeSpan ticks).
- // name[0]: name of this timezone when not daylight saving.
- // name[1]: name of this timezone when daylight saving.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern bool GetTimeZoneData (int year,
- out Int64[] data,
- out string[] names);
-
- // Constructor
- internal CurrentTimeZone ()
- : base ()
- {
- Int64[] data;
- string[] names;
-
- if (!GetTimeZoneData (2002, out data, out names))
- throw new NotSupportedException (Locale.GetText ("Can't get timezone name"));
-
- standardName = Locale.GetText (names[(int)TimeZoneNames.StandardNameIdx]);
- daylightName = Locale.GetText (names[(int)TimeZoneNames.DaylightNameIdx]);
-
- utcOffsetWithOutDLS = new TimeSpan (data[(int)TimeZoneData.UtcOffsetIdx]);
- utcOffsetWithDLS = new TimeSpan (data[(int)TimeZoneData.UtcOffsetIdx] + data[(int)TimeZoneData.AdditionalDaylightOffsetIdx]);
- }
-
- // Properties
- public override string DaylightName
- {
- get { return daylightName; }
- }
-
- public override string StandardName
- {
- get { return standardName; }
- }
-
- // Methods
- [MonoTODO]
- public override DaylightTime GetDaylightChanges (int year)
- {
- if (year < 1 || year > 9999)
- throw new ArgumentOutOfRangeException (year + " is not in a range between 1 and 9999.");
-
- if (daylightCache [year] == null) {
- Int64[] data;
- string[] names;
-
- if (!GetTimeZoneData (year, out data, out names))
- throw new ArgumentException (Locale.GetText ("Can't get timezone data for " + year));
-
- DaylightTime dlt = new DaylightTime (new DateTime (data[(int)TimeZoneData.DaylightSavingStartIdx]),
- new DateTime (data[(int)TimeZoneData.DaylightSavingEndIdx]),
- new TimeSpan (data[(int)TimeZoneData.AdditionalDaylightOffsetIdx]));
- daylightCache.Add (year, dlt);
- }
-
- return (DaylightTime) daylightCache [year];
- }
-
- public override TimeSpan GetUtcOffset (DateTime time)
- {
- if (IsDaylightSavingTime (time))
- return utcOffsetWithDLS;
-
- return utcOffsetWithOutDLS;
- }
- }
-}
diff --git a/mcs/class/corlib/System/Type.cs b/mcs/class/corlib/System/Type.cs
deleted file mode 100644
index 57545d6a9fc..00000000000
--- a/mcs/class/corlib/System/Type.cs
+++ /dev/null
@@ -1,720 +0,0 @@
-//
-// System.Type.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-using System.Reflection;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Globalization;
-
-namespace System {
-
- //
- // FIXME: Implement the various IReflect dependencies
- //
-
- [MonoTODO]
- public abstract class Type : MemberInfo, IReflect {
-
- internal RuntimeTypeHandle _impl;
-
- public static readonly char Delimiter = '.';
- public static readonly Type[] EmptyTypes = {};
- public static readonly MemberFilter FilterAttribute = new MemberFilter (FilterAttribute_impl);
- public static readonly MemberFilter FilterName = new MemberFilter (FilterName_impl);
- public static readonly MemberFilter FilterNameIgnoreCase = new MemberFilter (FilterNameIgnoreCase_impl);
- public static readonly object Missing;
-
- /* implementation of the delegates for MemberFilter */
- static bool FilterName_impl (MemberInfo m, object filterCriteria) {
- string name = (string) filterCriteria;
- return name.Equals (m.Name);
- }
-
- static bool FilterNameIgnoreCase_impl (MemberInfo m, object filterCriteria) {
- string name = (string) filterCriteria;
- return String.Compare (name, m.Name, true) == 0;
- }
-
- static bool FilterAttribute_impl (MemberInfo m, object filterCriteria) {
- throw new NotImplementedException ("FilterAttribute_impl");
- }
-
- protected Type () {
- }
-
- /// <summary>
- /// The assembly where the type is defined.
- /// </summary>
- public abstract Assembly Assembly {
- get;
- }
-
- /// <summary>
- /// Gets the fully qualified name for the type including the
- /// assembly name where the type is defined.
- /// </summary>
- public abstract string AssemblyQualifiedName {
- get;
- }
-
- /// <summary>
- /// Returns the Attributes associated with the type.
- /// </summary>
- public TypeAttributes Attributes {
- get {
- return GetAttributeFlagsImpl ();
- }
- }
-
- /// <summary>
- /// Returns the basetype for this type
- /// </summary>
- public abstract Type BaseType {
- get;
- }
-
- /// <summary>
- /// Returns the class that declares the member.
- /// </summary>
- public override Type DeclaringType {
- get {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- public static Binder DefaultBinder {
- get {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// The full name of the type including its namespace
- /// </summary>
- public abstract string FullName {
- get;
- }
-
- public abstract Guid GUID {
- get;
- }
-
- public bool HasEmelentType {
- get {return false;} // FIXME
- }
-
- public bool IsAbstract {
- get {
- return (Attributes & TypeAttributes.Abstract) != 0;
- }
- }
-
- public bool IsAnsiClass {
- get {
- return (Attributes & TypeAttributes.StringFormatMask) == TypeAttributes.AnsiClass;
- }
- }
-
- public bool IsArray {
- get {
- return IsArrayImpl ();
- }
- }
-
- public bool IsAuto {
- get {
- return (Attributes & TypeAttributes.StringFormatMask) == TypeAttributes.AutoClass;
- }
- }
-
- public bool IsAutoLayout {
- get {
- return (Attributes & TypeAttributes.LayoutMask) == TypeAttributes.AutoLayout;
- }
- }
-
- public bool IsByRef {
- get {
- return IsByRefImpl ();
- }
- }
-
- public bool IsClass {
- get {
- if (this == typeof (System.Enum) || this == typeof (System.ValueType))
- return true;
- return !type_is_subtype_of (this, typeof (System.ValueType), false);
- }
- }
-
- public bool IsCOMObject {
- get {
- return IsCOMObjectImpl ();
- }
- }
-
- public bool IsContextful {
- get {
- return IsContextfulImpl ();
- }
- }
-
- public bool IsEnum {
- get {
- return type_is_subtype_of (this, typeof (System.Enum), false) &&
- this != typeof (System.Enum);
- }
- }
-
- public bool IsExplicitLayout {
- get {
- return (Attributes & TypeAttributes.LayoutMask) == TypeAttributes.ExplicitLayout;
- }
- }
-
- public bool IsImport {
- get {
- return (Attributes & TypeAttributes.Import) != 0;
- }
- }
-
- public bool IsInterface {
- get {
- return (Attributes & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface;
- }
- }
-
- public bool IsLayoutSequential {
- get {
- return (Attributes & TypeAttributes.LayoutMask) == TypeAttributes.LayoutSequential;
- }
- }
-
- public bool IsMarshalByRef {
- get {
- return IsMarshalByRefImpl ();
- }
- }
-
- public bool IsNestedAssembly {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedAssembly;
- }
- }
-
- public bool IsNestedFamANDAssem {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedFamANDAssem;
- }
- }
-
- public bool IsNestedFamily {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedFamily;
- }
- }
-
- public bool IsNestedFamORAssem {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedFamORAssem;
- }
- }
-
- public bool IsNestedPrivate {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPrivate;
- }
- }
-
- public bool IsNestedPublic {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPublic;
- }
- }
-
- public bool IsNotPublic {
- get {
- return !IsPublic;
- }
- }
-
- public bool IsPointer {
- get {
- return IsPointerImpl ();
- }
- }
-
- public bool IsPrimitive {
- get {
- return IsPrimitiveImpl ();
- }
- }
-
- [MonoTODO]
- public bool IsPublic {
- get {
- // FIXME: handle nestedpublic, too?
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public;
- }
- }
-
- public bool IsSealed {
- get {
- return (Attributes & TypeAttributes.Sealed) != 0;
- }
- }
-
- public bool IsSerializable {
- get {
- return (Attributes & TypeAttributes.Serializable) != 0;
- }
- }
-
- public bool IsSpecialName {
- get {
- return (Attributes & TypeAttributes.SpecialName) != 0;
- }
- }
-
- public bool IsUnicodeClass {
- get {
- return (Attributes & TypeAttributes.StringFormatMask) == TypeAttributes.UnicodeClass;
- }
- }
-
- public bool IsValueType {
- get {
- return IsValueTypeImpl ();
- }
- }
-
- public override MemberTypes MemberType {
- get {return MemberTypes.TypeInfo;} // FIXME
- }
-
- public abstract Module Module {get;}
-
- public abstract string Namespace {get;}
-
- public override Type ReflectedType {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public abstract RuntimeTypeHandle TypeHandle {get;}
-
- public ConstructorInfo TypeInitializer {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public abstract Type UnderlyingSystemType {get;}
-
- public override bool Equals (object o) {
- if (o == null)
- return false;
- Type cmp = o as Type;
- if (cmp == null)
- return false;
- return Equals (cmp);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern bool Equals (Type type);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern Type internal_from_handle (RuntimeTypeHandle handle);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern Type internal_from_name (string name);
-
- public static Type GetType(string typeName)
- {
- return internal_from_name (typeName);
- }
-
- public static Type GetType(string typeName, bool throwOnError)
- {
- // LAMESPEC: what kinds of errors cause exception to be thrown?
- return internal_from_name (typeName);
- }
-
- public static Type GetType(string typeName, bool throwOnError, bool ignoreCase)
- {
- throw new NotImplementedException ();
- }
-
- public static Type[] GetTypeArray (object[] args) {
- Type[] ret;
-
- ret = new Type [args.Length];
- for (int i = 0; i < args.Length; ++i)
- ret [i] = args[i].GetType ();
- return ret;
- }
-
- public static TypeCode GetTypeCode( Type type)
- {
- // FIXME
- return TypeCode.Empty;
- }
-
- public static Type GetTypeFromCLSID (Guid clsid) {
- throw new NotImplementedException ();
- }
-
- public static Type GetTypeFromCLSID (Guid clsid, bool throwOnError) {
- throw new NotImplementedException ();
- }
-
- public static Type GetTypeFromCLSID (Guid clsid, string server) {
- throw new NotImplementedException ();
- }
-
- public static Type GetTypeFromCLSID (Guid clsid, string server, bool throwOnError) {
- throw new NotImplementedException ();
- }
-
- public static Type GetTypeFromHandle (RuntimeTypeHandle handle)
- {
- return internal_from_handle (handle);
- }
-
- public static Type GetTypeFromProgID (string progID) {
- throw new NotImplementedException ();
- }
-
- public static Type GetTypeFromProgID (string progID, bool throwOnError) {
- throw new NotImplementedException ();
- }
-
- public static Type GetTypeFromProgID (string progID, string server) {
- throw new NotImplementedException ();
- }
-
- public static Type GetTypeFromProgID (string progID, string server, bool throwOnError) {
- throw new NotImplementedException ();
- }
-
- public static RuntimeTypeHandle GetTypeHandle (object o) {
- return o.GetType().TypeHandle;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- protected static extern bool type_is_subtype_of (Type a, Type b, bool check_interfaces);
-
- public bool IsSubclassOf (Type c)
- {
- return type_is_subtype_of (this, c, false);
- }
-
- [MonoTODO]
- public virtual Type[] FindInterfaces (TypeFilter filter, object filterCriteria)
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public Type GetInterface (string name) {
- return GetInterface (name, false);
- }
-
- public abstract Type GetInterface (string name, bool ignoreCase);
-
- public virtual InterfaceMapping GetInterfaceMap (Type interfaceType) {
- throw new NotImplementedException ();
- }
-
- public abstract Type[] GetInterfaces ();
-
- [MonoTODO]
- public virtual bool IsAssignableFrom (Type c)
- {
- // FIXME
- return type_is_subtype_of (c, this, true);
- }
-
- public virtual bool IsInstanceOfType (object o) {
- if (o != null) {
- return o.GetType().IsSubclassOf (this);
- }
- return false;
- }
-
- [MonoTODO]
- public virtual int GetArrayRank ()
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public abstract Type GetElementType ();
-
- public EventInfo GetEvent (string name) {
- throw new NotImplementedException ();
- }
-
- public abstract EventInfo GetEvent (string name, BindingFlags bindingAttr);
-
- public virtual EventInfo[] GetEvents () {
- return GetEvents (BindingFlags.Public);
- }
-
- public abstract EventInfo[] GetEvents (BindingFlags bindingAttr);
-
- public FieldInfo GetField( string name) {
- return GetField (name, BindingFlags.Public);
- }
-
- public abstract FieldInfo GetField( string name, BindingFlags bindingAttr);
-
- public FieldInfo[] GetFields ()
- {
- return GetFields (BindingFlags.Public);
- }
-
- public abstract FieldInfo[] GetFields (BindingFlags bindingAttr);
-
- /*public FieldInfo[] GetFields (BindingFlags bindingAttr)
- {
- MemberInfo[] m = FindMembers (MemberTypes.Field, bindingAttr, null, null);
- FieldInfo[] res = new FieldInfo [m.Length];
- int i;
- for (i = 0; i < m.Length; ++i)
- res [i] = (FieldInfo) m [i];
- return res;
- }*/
-
- public override int GetHashCode() {
- return (int)_impl.Value;
- }
-
- public MemberInfo[] GetMember( string name) {
- return GetMember (name, BindingFlags.Public);
- }
-
- public virtual MemberInfo[] GetMember( string name, BindingFlags bindingAttr) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public virtual MemberInfo[] GetMember( string name, MemberTypes type, BindingFlags bindingAttr) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public MemberInfo[] GetMembers() {
- return GetMembers (BindingFlags.Public);
- }
-
- public abstract MemberInfo[] GetMembers( BindingFlags bindingAttr);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern MethodInfo get_method (Type type, string name, Type[] types);
-
- public MethodInfo GetMethod( string name) {
- return GetMethod (name, BindingFlags.Public);
- }
-
- public MethodInfo GetMethod( string name, BindingFlags bindingAttr) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public MethodInfo GetMethod (string name, Type[] types)
- {
- return get_method (this, name, types);
- }
-
- public MethodInfo GetMethod( string name, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public MethodInfo GetMethod( string name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public MethodInfo GetMethod( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- protected abstract MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers);
-
- public MethodInfo[] GetMethods ()
- {
- return GetMethods (BindingFlags.Public|BindingFlags.Instance|BindingFlags.Static);
- }
-
- public abstract MethodInfo[] GetMethods (BindingFlags bindingAttr);
-
- public Type GetNestedType( string name) {
- return GetNestedType (name, BindingFlags.Public);
- }
-
- public abstract Type GetNestedType( string name, BindingFlags bindingAttr);
-
- public Type[] GetNestedTypes () {
- return GetNestedTypes (BindingFlags.Public);
- }
-
- public abstract Type[] GetNestedTypes (BindingFlags bindingAttr);
-
- public PropertyInfo[] GetProperties ()
- {
- return GetProperties (BindingFlags.Public);
- }
-
- public abstract PropertyInfo[] GetProperties( BindingFlags bindingAttr);
-
- /*public PropertyInfo[] GetProperties (BindingFlags bindingAttr)
- {
- MemberInfo[] m = FindMembers (MemberTypes.Property, bindingAttr, null, null);
- PropertyInfo[] res = new PropertyInfo [m.Length];
- int i;
- for (i = 0; i < m.Length; ++i)
- res [i] = (PropertyInfo) m [i];
- return res;
- }*/
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern PropertyInfo get_property (Type type, string name, Type[] types);
-
- public PropertyInfo GetProperty (string name)
- {
- return GetProperty (name, BindingFlags.Public);
- }
-
- public PropertyInfo GetProperty( string name, BindingFlags bindingAttr) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public PropertyInfo GetProperty( string name, Type returnType) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public PropertyInfo GetProperty (string name, Type[] types)
- {
- return get_property (this, name, types);
- }
-
- public PropertyInfo GetProperty (string name, Type returnType, Type[] types)
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public PropertyInfo GetProperty( string name, Type returnType, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public PropertyInfo GetProperty( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- protected abstract PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern ConstructorInfo get_constructor (Type type, Type[] types);
-
- protected abstract ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers);
-
- protected abstract TypeAttributes GetAttributeFlagsImpl ();
- protected abstract bool HasElementTypeImpl ();
- protected abstract bool IsArrayImpl ();
- protected abstract bool IsByRefImpl ();
- protected abstract bool IsCOMObjectImpl ();
- protected virtual bool IsContextfulImpl () {
- return typeof (ContextBoundObject).IsAssignableFrom (this);
- }
- protected virtual bool IsMarshalByRefImpl () {
- // FIXME
- return false;
- }
- protected abstract bool IsPointerImpl ();
- protected abstract bool IsPrimitiveImpl ();
- protected abstract bool IsValueTypeImpl ();
-
- public ConstructorInfo GetConstructor (Type[] types)
- {
- return get_constructor (this, types);
- }
-
- public ConstructorInfo GetConstructor (BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- }
- public ConstructorInfo GetConstructor( BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- }
-
- public ConstructorInfo[] GetConstructors () {
- return GetConstructors (BindingFlags.Public);
- }
-
- public abstract ConstructorInfo[] GetConstructors (BindingFlags bindingAttr);
-
- public virtual MemberInfo[] GetDefaultMembers () {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern MemberInfo[] FindMembers( MemberTypes memberType, BindingFlags bindingAttr);
-
- public virtual MemberInfo[] FindMembers( MemberTypes memberType, BindingFlags bindingAttr,
- MemberFilter filter, object filterCriteria) {
- MemberInfo[] result = FindMembers(memberType, bindingAttr);
- if (filter == null)
- return result;
- ArrayList l = new ArrayList (result.Length);
- foreach (MemberInfo m in result) {
- if (filter (m, filterCriteria))
- l.Add (m);
- }
- result = new MemberInfo [l.Count];
- l.CopyTo (result);
- return result;
- }
-
- public object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args) {
- // FIXME
- return null;
- }
-
- public object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, CultureInfo culture) {
- // FIXME
- return null;
- }
-
- public abstract object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters);
-
- public override string ToString()
- {
- string res = FullName;
- if (IsArray)
- res = res + "[]";
- if (IsByRef)
- res = res + "&";
- if (IsPointer)
- res = res + "*";
- return res;
- }
- }
-}
diff --git a/mcs/class/corlib/System/TypeCode.cs b/mcs/class/corlib/System/TypeCode.cs
deleted file mode 100644
index e2ef3f4a746..00000000000
--- a/mcs/class/corlib/System/TypeCode.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// TypeCode.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Created: Wed, 5 Sep 2001 06:34:09 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- public enum TypeCode {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Object = 1,
-
- /// <summary>
- /// </summary>
- DBNull = 2,
-
- /// <summary>
- /// </summary>
- Boolean = 3,
-
- /// <summary>
- /// </summary>
- Char = 4,
-
- /// <summary>
- /// </summary>
- SByte = 5,
-
- /// <summary>
- /// </summary>
- Byte = 6,
-
- /// <summary>
- /// </summary>
- Int16 = 7,
-
- /// <summary>
- /// </summary>
- UInt16 = 8,
-
- /// <summary>
- /// </summary>
- Int32 = 9,
-
- /// <summary>
- /// </summary>
- UInt32 = 10,
-
- /// <summary>
- /// </summary>
- Int64 = 11,
-
- /// <summary>
- /// </summary>
- UInt64 = 12,
-
- /// <summary>
- /// </summary>
- Single = 13,
-
- /// <summary>
- /// </summary>
- Double = 14,
-
- /// <summary>
- /// </summary>
- Decimal = 15,
-
- /// <summary>
- /// </summary>
- DateTime = 16,
-
- /// <summary>
- /// </summary>
- String = 18,
- } // TypeCode
-
-} // System
diff --git a/mcs/class/corlib/System/TypeInitializationException.cs b/mcs/class/corlib/System/TypeInitializationException.cs
deleted file mode 100644
index 5292b3946d4..00000000000
--- a/mcs/class/corlib/System/TypeInitializationException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.TypeInitializationException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Globalization;
-using System.Runtime.Serialization;
-namespace System {
-
- public class TypeInitializationException : SystemException {
- string type_name;
-
- // Constructors
- public TypeInitializationException (string type_name, Exception inner)
- : base (Locale.GetText ("An exception was thrown by the type initializer for ") + type_name, inner)
- {
- this.type_name = type_name;
- }
-
- // Properties
- public string TypeName {
- get {
- return type_name;
- }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("TypeName", type_name);
- }
- }
-
-}
diff --git a/mcs/class/corlib/System/TypeLoadException.cs b/mcs/class/corlib/System/TypeLoadException.cs
deleted file mode 100644
index 499b3ff798c..00000000000
--- a/mcs/class/corlib/System/TypeLoadException.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.TypeLoadException
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class TypeLoadException : SystemException {
-
- // Fields
- private string msg;
- private string type;
-
- // Constructors
- public TypeLoadException ()
- : base (Locale.GetText ("A type load exception has occurred."))
- {
- msg = Locale.GetText ("A type load exception has occured.");
- }
-
- public TypeLoadException (string message)
- : base (message)
- {
- msg = message;
- }
-
- public TypeLoadException (string message, Exception inner)
- : base (message, inner)
- {
- msg = message;
- }
-
- public TypeLoadException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- // Properties
- public override string Message
- {
- get { return msg; }
- }
-
- public string TypeName
- {
- get { return type; }
- }
-
- // Methods
- //
- // It seems like this object serializes more fields than those described.
- // Those fields are TypeLoadClassName, TypeLoadAssemblyName,
- // TypeLoadMessageArg and TypeLoadResourceID.
- //
- [MonoTODO]
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info is null.");
- base.GetObjectData (info, context);
- }
- }
-}
diff --git a/mcs/class/corlib/System/TypeUnloadedException.cs b/mcs/class/corlib/System/TypeUnloadedException.cs
deleted file mode 100644
index e4fa88c22cf..00000000000
--- a/mcs/class/corlib/System/TypeUnloadedException.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.TypeUnloadedException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class TypeUnloadedException : SystemException
- {
- // Constructors
- public TypeUnloadedException ()
- : base (Locale.GetText ("Cannot access an unloaded class."))
- {
- }
-
- public TypeUnloadedException (string message)
- : base (message)
- {
- }
-
- public TypeUnloadedException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public TypeUnloadedException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
-
diff --git a/mcs/class/corlib/System/UInt16.cs b/mcs/class/corlib/System/UInt16.cs
deleted file mode 100644
index c3ee009dc76..00000000000
--- a/mcs/class/corlib/System/UInt16.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-//
-// System.UInt16.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- [CLSCompliant(false)]
- public struct UInt16 : IComparable, IFormattable { //, IConvertible {
-
- public const ushort MaxValue = 0xffff;
- public const ushort MinValue = 0;
-
- public ushort value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if(!(v is System.UInt16))
- throw new ArgumentException (Locale.GetText ("Value is not a System.UInt16"));
-
- return value - ((ushort) v);
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.UInt16))
- return false;
-
- return ((ushort) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- public static ushort Parse (string s)
- {
- ushort val = 0;
- int len;
- int i;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- if (s [i] == '+')
- i++;
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- ushort d = (ushort) (c - '0');
-
- val = checked ((ushort) (val * 10 + d));
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- return val;
-
- }
-
- public static ushort Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static ushort Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [MonoTODO]
- public static ushort Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- // TODO: Implement me
- throw new NotImplementedException ();
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.UInt16;
- }
- }
-}
diff --git a/mcs/class/corlib/System/UInt32.cs b/mcs/class/corlib/System/UInt32.cs
deleted file mode 100644
index a188e24afdb..00000000000
--- a/mcs/class/corlib/System/UInt32.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// System.UInt32.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- [CLSCompliant(false)]
- public struct UInt32 : IComparable, IFormattable { //, IConvertible {
-
- public const uint MaxValue = 0xffffffff;
- public const uint MinValue = 0;
-
- public uint value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.UInt32))
- throw new ArgumentException (Locale.GetText ("Value is not a System.UInt32"));
-
- if (value == (uint) v)
- return 0;
-
- if (value < (uint) v)
- return -1;
-
- return 1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.UInt32))
- return false;
-
- return ((uint) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int) value;
- }
-
- public static uint Parse (string s)
- {
- uint val = 0;
- int len;
- int i;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- if (s [i] == '+')
- i++;
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- uint d = (uint) (c - '0');
-
- val = checked (val * 10 + d);
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- return val;
-
- }
-
- public static uint Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static uint Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [MonoTODO]
- public static uint Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- // TODO: Implement me
- throw new NotImplementedException ();
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.UInt32;
- }
- }
-}
diff --git a/mcs/class/corlib/System/UInt64.cs b/mcs/class/corlib/System/UInt64.cs
deleted file mode 100644
index c2daf8a48e9..00000000000
--- a/mcs/class/corlib/System/UInt64.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// System.UInt64.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- [CLSCompliant(false)]
- public struct UInt64 : IComparable, IFormattable { //, IConvertible {
- public const ulong MaxValue = 0xffffffffffffffff;
- public const ulong MinValue = 0;
-
- public ulong value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.UInt64))
- throw new ArgumentException (Locale.GetText ("Value is not a System.UInt64"));
-
- if (value == (ulong) v)
- return 0;
-
- if (value < (ulong) v)
- return -1;
-
- return 1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.UInt64))
- return false;
-
- return ((ulong) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int)(value & 0xffffffff) ^ (int)(value >> 32);
- }
-
- public static ulong Parse (string s)
- {
- return Parse (s, NumberStyles.Integer, null);
- }
-
- public static ulong Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static ulong Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- public static ulong Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- ulong val = 0;
- int len;
- int i;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- i = 0;
- if ((style & NumberStyles.AllowLeadingWhite) != 0)
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- if ((style & NumberStyles.AllowLeadingSign) != 0 && (s [i] == '+'))
- i++;
-
- for (; i < len; i++){
- c = s [i];
-
- if ((style & NumberStyles.AllowHexSpecifier) != 0) {
- if (c >= '0' && c <= '9') {
- uint d = (uint) (c - '0');
- val = checked (val * 16 + d);
- digits_seen = true;
- } else if (c >= 'a' && c <= 'f') {
- uint d = (uint) (c - 'a');
- val = checked (val * 16 + 10 + d);
- digits_seen = true;
- } else if (c >= 'A' && c <= 'F') {
- uint d = (uint) (c - 'A');
- val = checked (val * 16 + 10 + d);
- digits_seen = true;
- } else
- break;
- } else if (c >= '0' && c <= '9'){
- uint d = (uint) (c - '0');
-
- val = checked (val * 10 + d);
- digits_seen = true;
- } else {
- break;
- }
- }
- if (!digits_seen)
- throw new FormatException ();
- if (i < len) {
- if ((style & NumberStyles.AllowTrailingWhite) != 0 && Char.IsWhiteSpace (s [i])){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- } else
- throw new FormatException ();
- }
-
- return val;
-
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.UInt64;
- }
- }
-}
diff --git a/mcs/class/corlib/System/UIntPtr.cs b/mcs/class/corlib/System/UIntPtr.cs
deleted file mode 100644
index e19b2d40211..00000000000
--- a/mcs/class/corlib/System/UIntPtr.cs
+++ /dev/null
@@ -1,179 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.UIntPtr.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Thu 07/31/2001
-//
-// Remarks: Requires '/unsafe' compiler option. This class uses void*,
-// ulong, and uint in overloaded constructors, conversion, and
-// cast members in the public interface. Using pointers is not
-// valid CLS and the methods in question have been marked with
-// the CLSCompliant attribute that avoid compiler warnings.
-//
-//------------------------------------------------------------------------------
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-
-namespace System
-{
-
-[
- StructLayout(LayoutKind.Auto),
- CLSCompliant(false)
-]
-public unsafe struct UIntPtr : ISerializable
-{
- public static readonly UIntPtr Zero = new UIntPtr(0);
- private void* _pointer;
-
- [
- CLSCompliant(false)
- ]
- public UIntPtr(ulong value)
- {
- _pointer = (void*) value;
- }
-
- [
- CLSCompliant(false)
- ]
- public UIntPtr(uint value)
- {
- _pointer = (void*)value;
- }
-
- [
- CLSCompliant(false)
- ]
- public unsafe UIntPtr(void* value)
- {
- _pointer = value;
- }
-
- public override bool Equals(object obj)
- {
- if( obj is UIntPtr )
- {
- UIntPtr obj2 = (UIntPtr)obj;
- return this._pointer == obj2._pointer;
- }
-
- return false;
- }
- public override int GetHashCode()
- {
- return (int)_pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public uint ToUInt32()
- {
- return (uint) _pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public ulong ToUInt64()
- {
- return (ulong) _pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public unsafe void* ToPointer()
- {
- return _pointer;
- }
- public override string ToString()
- {
- return ((uint) _pointer).ToString();
- }
-
- // Interface ISerializable
- void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
- {
- if( info == null )
- throw new ArgumentNullException( "info" );
- // if( context == null ) -- context is struct can't be null.
- // throw new ArgumentNullException( "context" );
-
- info.AddValue("pointer", (ulong)_pointer);
- }
-
- public static bool operator ==(UIntPtr value1, UIntPtr value2)
- {
- return value1._pointer == value2._pointer;
- }
- public static bool operator !=(UIntPtr value1, UIntPtr value2)
- {
- return value1._pointer != value2._pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public static explicit operator ulong(UIntPtr value)
- {
- return (ulong)value._pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public static explicit operator uint(UIntPtr value)
- {
- return (uint)value._pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public static explicit operator UIntPtr(ulong value)
- {
- return new UIntPtr(value);
- }
-
- [
- CLSCompliant(false)
- ]
- public unsafe static explicit operator UIntPtr(void* value)
- {
- return new UIntPtr(value);
- }
-
- [
- CLSCompliant(false)
- ]
- public unsafe static explicit operator void*(UIntPtr value)
- {
- return value.ToPointer();
- }
-
- [
- CLSCompliant(false)
- ]
- public static explicit operator UIntPtr(uint value)
- {
- return new UIntPtr(value);
- }
-
- public static int Size
- {
- get
- {
- return sizeof(void*);
- }
- }
-}
-
-} // Namespace
-
diff --git a/mcs/class/corlib/System/UnauthorizedAccessException.cs b/mcs/class/corlib/System/UnauthorizedAccessException.cs
deleted file mode 100755
index 9ac213779d4..00000000000
--- a/mcs/class/corlib/System/UnauthorizedAccessException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.UnauthorizedAccessException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- public class UnauthorizedAccessException : SystemException {
- // Constructors
- public UnauthorizedAccessException ()
- : base (Locale.GetText ("Access to the requested resource is not authorized"))
- {
- }
-
- public UnauthorizedAccessException (string message)
- : base (message)
- {
- }
-
- public UnauthorizedAccessException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected UnauthorizedAccessException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/UnhandledExceptionEventArgs.cs b/mcs/class/corlib/System/UnhandledExceptionEventArgs.cs
deleted file mode 100755
index d8226e92f5a..00000000000
--- a/mcs/class/corlib/System/UnhandledExceptionEventArgs.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.UnhandledExceptionEventArgs.cs
-//
-// Author:
-// Chris Hynes (chrish@assistedsolutions.com)
-//
-// (C) 2001 Chris Hynes
-//
-
-using System;
-using System.Reflection;
-
-namespace System
-{
- public class UnhandledExceptionEventArgs: EventArgs
- {
- protected object exception;
- protected bool m_isTerminating;
-
- public UnhandledExceptionEventArgs(object exception, bool isTerminating)
- {
- this.exception = exception;
- this.m_isTerminating = isTerminating;
- }
-
- public object ExceptionObject
- {
- get
- {
- return exception;
- }
- }
-
- public bool IsTerminating
- {
- get
- {
- return m_isTerminating;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System/UnhandledExceptionEventHandler.cs b/mcs/class/corlib/System/UnhandledExceptionEventHandler.cs
deleted file mode 100755
index 710af2b4713..00000000000
--- a/mcs/class/corlib/System/UnhandledExceptionEventHandler.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// System.UnhandledExceptionEventHandler.cs
-//
-// Paolo Molaro
-//
-// (C) 2002 Ximian, Inc.
-
-namespace System
-{
- public delegate void UnhandledExceptionEventHandler (object sender, UnhandledExceptionEventArgs args);
-}
diff --git a/mcs/class/corlib/System/ValueType.cs b/mcs/class/corlib/System/ValueType.cs
deleted file mode 100644
index 3a1d48659b9..00000000000
--- a/mcs/class/corlib/System/ValueType.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// System.ValueType.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public abstract class ValueType {
-
- // <summary>
- // ValueType constructor
- // </summary>
- protected ValueType ()
- {
- }
-
- // <summary>
- // True if this instance and o represent the same type
- // and have the same value.
- // </summary>
- [MonoTODO]
- public override bool Equals (object o)
- {
- if (o == null)
- throw new ArgumentNullException ();
-
- if (o.GetType() != this.GetType())
- return false;
-
- // TODO:
- // Now implement bit compare here.
-
- // TODO: Implement me!
- return false;
- }
-
- // <summary>
- // Gets a hashcode for this value type using the
- // bits in the structure
- // </summary>
- [MonoTODO]
- public override int GetHashCode ()
- {
- if (this == null)
- return 0;
-
- // TODO: compute a hashcode based on the actual
- // contents.
-
- return 0;
- }
-
- // <summary>
- // Stringified representation of this ValueType.
- // Must be overriden for better results, by default
- // it just returns the Type name.
- // </summary>
- public override string ToString ()
- {
- return GetType().FullName;
- }
- }
-}
diff --git a/mcs/class/corlib/System/Version.cs b/mcs/class/corlib/System/Version.cs
deleted file mode 100644
index 61458d1bfa5..00000000000
--- a/mcs/class/corlib/System/Version.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// System.Version.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- public sealed class Version : ICloneable, IComparable {
- int major, minor, build, revision;
-
- const int MAXINT = int.MaxValue;
-
- public Version (string version)
- {
- int n;
- string [] vals = version.Split (new Char [] {'.'});
-
- n = vals.Length;
- if (n > 0)
- major = int.Parse (vals [0]);
- if (n > 1)
- minor = int.Parse (vals [1]);
- if (n > 2)
- build = int.Parse (vals [2]);
- if (n > 3)
- revision = int.Parse (vals [3]);
- }
-
- public Version (int major, int minor)
- {
- this.major = major;
- this.minor = minor;
- this.build = MAXINT;
- this.revision = MAXINT;
- }
-
- public Version (int major, int minor, int build)
- {
- this.major = major;
- this.minor = minor;
- this.build = build;
- this.revision = MAXINT;
- }
-
- public Version (int major, int minor, int build, int revision)
- {
- this.major = major;
- this.minor = minor;
- this.build = build;
- this.revision = revision;
- }
-
- public int Build {
- get {
- return build;
- }
- }
-
- public int Major {
- get {
- return major;
- }
- }
-
- public int Minor {
- get {
- return minor;
- }
- }
-
- public int Revision {
- get {
- return revision;
- }
- }
-
- public object Clone ()
- {
- return new Version (major, minor, build, revision);
- }
-
- public int CompareTo (object version)
- {
- Version v;
-
- if (version == null)
- return 1;
-
- if (! (version is Version))
- throw new ArgumentException ("version");
-
- v = version as Version;
-
- if (this.major > v.major)
- return 1;
- else if (this.major < v.major)
- return -1;
-
- if (this.minor > v.minor)
- return 1;
- else if (this.minor < this.minor)
- return -1;
-
- if (this.build > v.build)
- return 1;
- else if (this.build < this.build)
- return -1;
-
- // FIXME: Compare revision or build first?
- if (this.revision > v.revision)
- return 1;
- else if (this.revision < v.revision)
- return -1;
-
- return 0;
- }
-
- public override bool Equals (object obj)
- {
- Version x;
-
- if (obj == null)
- throw new ArgumentNullException ("obj");
- if (!(obj is Version))
- return false;
-
- x = (Version) obj;
-
- if ((x.major == major) &&
- (x.minor == minor) &&
- (x.build == build) &&
- (x.revision == revision))
- return true;
- return false;
- }
-
- public override int GetHashCode ()
- {
- return (revision << 24) | (build << 16) | (minor << 8) | major;
- }
-
- // <summary>
- // Returns a stringified representation of the version, format:
- // major.minor[.build[.revision]]
- // </summary>
- public override string ToString ()
- {
- string mm = major.ToString () + "." + minor.ToString ();
-
- if (build != MAXINT)
- mm = mm + "." + build.ToString ();
- if (revision != MAXINT)
- mm = mm + "." + revision.ToString ();
-
- return mm;
- }
-
- // <summary>
- // LAME: This API is lame, since there is no way of knowing
- // how many fields a Version object has, it is unfair to throw
- // an ArgumentException, but this is what the spec claims.
- //
- // ie, Version a = new Version (1, 2); a.ToString (3) should
- // throw the expcetion.
- // </summary>
- public string ToString (int fields)
- {
- if (fields == 0)
- return "";
- if (fields == 1)
- return major.ToString ();
- if (fields == 2)
- return major.ToString () + "." + minor.ToString ();
- if (fields == 3){
- if (build == MAXINT)
- throw new ArgumentException (Locale.GetText ("fields is larger than the number of components defined in this instance"));
- return major.ToString () + "." + minor.ToString () + "." +
- build.ToString ();
- }
- if (fields == 4){
- if (build == MAXINT || revision == MAXINT)
- throw new ArgumentException (Locale.GetText ("fields is larger than the number of components defined in this instance"));
- return major.ToString () + "." + minor.ToString () + "." +
- build.ToString () + "." + revision.ToString ();
- }
- throw new ArgumentException (Locale.GetText ("Invalid fields parameter: ") + fields.ToString());
- }
- }
-}
-
-
-
diff --git a/mcs/class/corlib/System/Void.cs b/mcs/class/corlib/System/Void.cs
deleted file mode 100644
index 1ad4e1c5b2c..00000000000
--- a/mcs/class/corlib/System/Void.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Void.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public struct Void {
- }
-}
diff --git a/mcs/class/corlib/System/WeakReference.cs b/mcs/class/corlib/System/WeakReference.cs
deleted file mode 100755
index 12541ac7c6f..00000000000
--- a/mcs/class/corlib/System/WeakReference.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// System.WeakReference.cs
-//
-// Author:
-// Ajay kumar Dwivedi (adwiv@yahoo.com)
-//
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- /// <summary>
- /// Summary description for WeakReference.
- /// </summary>
- [Serializable]
- public class WeakReference : ISerializable
- {
- //Fields
- private bool isLongReference;
- private GCHandle gcHandle;
-
- // Helper method for constructors
- //Should not be called from any other method.
- private void AllocateHandle(Object target)
- {
- if(this.isLongReference)
- {
- this.gcHandle = GCHandle.Alloc(target, GCHandleType.WeakTrackResurrection);
- }
- else
- {
- this.gcHandle = GCHandle.Alloc(target, GCHandleType.Weak);
- }
- }
-
-
- //Constructors
- public WeakReference(object target)
- : this(target,false)
- {}
-
-
- public WeakReference(object target, bool trackResurrection)
- {
- this.isLongReference = trackResurrection;
- AllocateHandle(target);
- }
-
-
- protected WeakReference(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- this.isLongReference = info.GetBoolean("IsLongReference");
- //TODO: How to load the exact type?
- //Does that matter? No idea :(
- Object target = info.GetValue("TargetObject",typeof(System.Object));
-
- AllocateHandle(target);
- }
-
-
- // Properties
- public virtual bool IsAlive
- {
- get
- {
- //Target property takes care of the exception
- return (Target != null);
- }
- }
-
- public virtual object Target
- {
- get
- {
- //Exception is thrown by gcHandle's Target
- return this.gcHandle.Target;
- }
- set
- {
- this.gcHandle.Target = value;
- }
- }
-
- public virtual bool TrackResurrection
- {
- get
- {
- return this.isLongReference;
- }
- }
-
- //Methods
- ~WeakReference()
- {
- gcHandle.Free();
- }
-
- //TODO
- public virtual void GetObjectData(SerializationInfo info,StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- info.AddValue("IsLongReference",this.isLongReference);
- try
- {
- info.AddValue("TargetObject",Target);
- }
- catch(Exception)
- {
- info.AddValue("TargetObject",null);
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System/_AppDomain.cs b/mcs/class/corlib/System/_AppDomain.cs
deleted file mode 100755
index 65dd18fdaf3..00000000000
--- a/mcs/class/corlib/System/_AppDomain.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// System._AppDomain
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-
-using System.Security;
-using System.Security.Policy;
-using System.Security.Principal;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.Remoting;
-
-namespace System
-{
-
-[CLSCompliant(false)]
-public interface _AppDomain {
-
- string BaseDirectory {get; }
- string DynamicDirectory {get; }
- Evidence Evidence {get; }
- string FriendlyName {get; }
- string RelativeSearchPath {get; }
- bool ShadowCopyFiles {get; }
-
- void AppendPrivatePath (string path);
- void ClearPrivatePath ();
- void ClearShadowCopyPath ();
-
- ObjectHandle CreateInstance (string assemblyName, string typeName);
- ObjectHandle CreateInstance (
- string assemblyName,
- string typeName,
- object[] activationAttributes);
- ObjectHandle CreateInstance (
- string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes,
- Evidence securityAttribtutes);
-
- ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
- ObjectHandle CreateInstanceFrom (
- string assemblyName, string typeName,
- object[] activationAttributes);
- ObjectHandle CreateInstanceFrom (string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes,
- Evidence securityAttribtutes);
-
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- Evidence evidence);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access, string dir);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions,
- bool isSynchronized);
-
- void DoCallBack (CrossAppDomainDelegate theDelegate);
- bool Equals (object other);
-
- int ExecuteAssembly (string assemblyFile);
- int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
- int ExecuteAssembly (
- string assemblyFile,
- Evidence assemblySecurity,
- string[] args);
-
- Assembly[] GetAssemblies ();
- object GetDate (string name);
- int GetHashCode();
- object GetLifetimeService ();
- Type GetType ();
- object InitializeLifetimeService ();
-
- Assembly Load (AssemblyName assemblyRef);
- Assembly Load (byte[] rawAssembly);
- Assembly Load (string assemblyString);
- Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
- Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
- Assembly Load (string assemblyString, Evidence assemblySecurity);
- Assembly Load (
- byte[] rawAssembly,
- byte[] rawSymbolStore,
- Evidence securityEvidence);
-
- void SetAppDomainPolicy (PolicyLevel domainPolicy);
- void SetCachePath (string s);
- void SetData (string name, object data);
- void SetPrincipalPolicy (PrincipalPolicy policy);
- void SetShadowCopyPath (string s);
- void SetThreadPrincipal (IPrincipal principal);
- //string ToString ();
-
- event AssemblyLoadEventHandler AssemblyLoad;
- event ResolveEventHandler AssemblyResolve;
- event EventHandler DomainUnload;
- event EventHandler ProcessExit;
- event ResolveEventHandler ResourceResolve;
- event ResolveEventHandler TypeResolve;
- event UnhandledExceptionEventHandler UnhandledException;
-}
-
-}
diff --git a/mcs/class/corlib/Test/.cvsignore b/mcs/class/corlib/Test/.cvsignore
deleted file mode 100644
index 335c71fd7fa..00000000000
--- a/mcs/class/corlib/Test/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.dll
-*.pdb
diff --git a/mcs/class/corlib/Test/AllTests.cs b/mcs/class/corlib/Test/AllTests.cs
deleted file mode 100644
index 49240b58c7d..00000000000
--- a/mcs/class/corlib/Test/AllTests.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// Mono.Tests.AllTests.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(System.AllTests.Suite);
- suite.AddTest(System.Collections.AllTests.Suite);
- suite.AddTest(System.Security.Cryptography.AllTests.Suite);
- suite.AddTest(System.IO.AllTests.Suite);
- suite.AddTest(System.Text.AllTests.Suite);
- suite.AddTest(System.Security.Permissions.AllTests.Suite);
- suite.AddTest(System.Resources.AllTests.Suite);
-// suite.AddTest(System.Security.Policy.AllTests.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/ChangeLog b/mcs/class/corlib/Test/ChangeLog
deleted file mode 100644
index 9e451091331..00000000000
--- a/mcs/class/corlib/Test/ChangeLog
+++ /dev/null
@@ -1,99 +0,0 @@
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: New file. This contains all the tests which already
- work on Linux.
-
- * RunTests.cs: A small custom testrunner to run the tests on Linux.
-
- * scan-tests.pl: Call this perl script with either MartinTests.cs or
- AllTests.cs as argument and redirect the output the TheTests.cs - it'll
- create a file which calls all the tests.
-
- * TheTests.cs: This is automatically generated from scan-tests.pl but
- needs some manual editing, so it's in CVS.
-
- * corlib_test.build: In addition to the libraries, create an executable
- called RunTests.exe which contains all the tests and the custom test
- runner. You can run this executable on Windows to test things with
- mscorlib or on Linux using the mono runtime.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * */*.cs: added zero-args constructors for all the test classes.
-
-2002-02-21 Mark Crichton <crichton@gimp.org>
-
- * System.Security.Cryptography.RNGCryptoServiceProviderTest.cs:
- Fixed typo
-
-2002-02-21 Mark Crichton <crichton@gimp.org>
-
- * Addded System.Security.Cryptography.RNGCryptoServiceProviderTest.cs
- * System.Security.Cryptography/AllTests.cs: Added
- RNGCryptoServiceProviderTest.
-
-2002-02-17 Duco Fijma <duco@lorentz.xs4all.nl>
- * Added System/GuidTest.cs
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Remove duplicate excludes for
- * AllTests.cs: Add System.Security.Policy tests. However, commented
- this out because NUnit is throwing an exception. Need to figure
- that out first.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: compile with mscorlib to test the tests. This
- will be our "reference" check to make sure the tests work.
-
-2002-01-25 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add System.Resources.AllTests.Suite
-
-2002-01-14 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add System.Security.Permissions.AllTests.Suite
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * .cvsignore: ignore the debug files *.pdb
-
-2002-01-04 Duco Fijma <duco@lorentz.xs4all.nl>
- * Added System/TimeSpanTest.cs
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added DebugTest to System.Diagnostics tests.
-2001-11-08 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Include test for Queue in the dll
-
-2001-10-15 Martin Weindel <martin.weindel@t-online.de>
-
- * added System/DecimalTest.cs and System/DecimalTest2.cs
-
-2001-10-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * System/StringTest.cs: Added.
-
-2001-10-10 Thomas Neidhart <tome@sbox.tugraz.at>
-
- * added directory System.Security.Cryptography
- * added TestSuite for all Crypto classes
- * added tests for System.Security.Cryptography.AsymmetricAlgorithm
- and System.Security.Cryptography.SymmetricAlgorithm
-
-2001-10-02 Martin Weindel <martin.weindel@t-online.de>
-
- * added directory System
- * added tests for System.Int64
-
-2001-08-29 Alexander Klyubin <klyubin@aqris.com>
-
- * Added tests for System.Diagnostics.StackFrame and
- System.Diagnostics.StackTrace. The tests only run against
- Microsoft's implementation as StackTrace and StackFrame classes in
- Mono are not yet properly implemented.
-
- Note that StackFrameTest runs properly only if compiled with
- /debug switch.
diff --git a/mcs/class/corlib/Test/MartinTests.cs b/mcs/class/corlib/Test/MartinTests.cs
deleted file mode 100755
index 803abe4043d..00000000000
--- a/mcs/class/corlib/Test/MartinTests.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// Mono.Tests.MartinTests.cs
-//
-// Author:
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Martin Baulig
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class MartinTests : TestCase {
- public MartinTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(System.MartinTests.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/RunTests.cs b/mcs/class/corlib/Test/RunTests.cs
deleted file mode 100755
index f6be1817c5c..00000000000
--- a/mcs/class/corlib/Test/RunTests.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-using System;
-using System.IO;
-using System.Threading;
-using System.Globalization;
-
-using NUnit.Framework;
-
-namespace MonoTests {
-
-class MyTestRunner {
-
- static TextWriter fWriter = Console.Out;
-
- protected static TextWriter Writer {
- get { return fWriter; }
- }
-
- public static void Print(TestResult result) {
- PrintErrors(result);
- PrintFailures(result);
- PrintHeader(result);
- }
-
- /// <summary>Prints the errors to the standard output.</summary>
- public static void PrintErrors(TestResult result) {
- if (result.ErrorCount != 0) {
- if (result.ErrorCount == 1)
- Writer.WriteLine("There was "+result.ErrorCount+" error:");
- else
- Writer.WriteLine("There were "+result.ErrorCount+" errors:");
-
- int i= 1;
- foreach (TestFailure failure in result.Errors) {
- Writer.WriteLine(i++ + ") "+failure+"("+failure.ThrownException.GetType().ToString()+")");
- Writer.Write(failure.ThrownException);
- }
- }
- }
-
- /// <summary>Prints failures to the standard output.</summary>
- public static void PrintFailures(TestResult result) {
- if (result.FailureCount != 0) {
- if (result.FailureCount == 1)
- Writer.WriteLine("There was " + result.FailureCount + " failure:");
- else
- Writer.WriteLine("There were " + result.FailureCount + " failures:");
- int i = 1;
- foreach (TestFailure failure in result.Failures) {
- Writer.Write(i++ + ") " + failure.FailedTest);
- Exception t= failure.ThrownException;
- if (t.Message != "")
- Writer.WriteLine(" \"" + t.Message + "\"");
- else {
- Writer.WriteLine();
- Writer.Write(failure.ThrownException);
- }
- }
- }
- }
-
- /// <summary>Prints the header of the report.</summary>
- public static void PrintHeader(TestResult result) {
- if (result.WasSuccessful) {
- Writer.WriteLine();
- Writer.Write("OK");
- Writer.WriteLine (" (" + result.RunCount + " tests)");
-
- } else {
- Writer.WriteLine();
- Writer.WriteLine("FAILURES!!!");
- Writer.WriteLine("Tests Run: "+result.RunCount+
- ", Failures: "+result.FailureCount+
- ", Errors: "+result.ErrorCount);
- }
- }
-
-}
-
-}
-
-class MainApp {
-
- public static void Main() {
-
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
-
- TestResult result = new TestResult ();
- TestSuite suite = new TestSuite ();
- MonoTests.RunAllTests.AddAllTests (suite);
- suite.Run (result);
- MonoTests.MyTestRunner.Print (result);
- }
-}
diff --git a/mcs/class/corlib/Test/System.Collections/AllTests.cs b/mcs/class/corlib/Test/System.Collections/AllTests.cs
deleted file mode 100644
index fbad2eead56..00000000000
--- a/mcs/class/corlib/Test/System.Collections/AllTests.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(HashtableTest.Suite);
- suite.AddTest(CaseInsensitiveComparerTest.Suite);
- suite.AddTest(CaseInsensitiveHashCodeProviderTest.Suite);
- suite.AddTest(ArrayListTest.Suite);
- suite.AddTest(BitArrayTest.Suite);
- suite.AddTest(CollectionBaseTest.Suite);
- suite.AddTest(ReadOnlyCollectionBaseTest.Suite);
- suite.AddTest(ComparerTest.Suite);
- suite.AddTest(StackTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Collections/ArrayListTest.cs b/mcs/class/corlib/Test/System.Collections/ArrayListTest.cs
deleted file mode 100644
index 816b89712ef..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ArrayListTest.cs
+++ /dev/null
@@ -1,1376 +0,0 @@
-// ArrayListTest.cs - NUnit Test Cases for the System.Collections.ArrayList class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
-/// <summary>ArrayList test.</summary>
-public class ArrayListTest : TestCase {
- public ArrayListTest() : base ("MonoTests.System.ArrayListTest testsuite") {}
- public ArrayListTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ArrayListTest));
- }
- }
-
- public void TestCtor() {
- {
- ArrayList al1 = new ArrayList();
- AssertNotNull("no basic ArrayList", al1);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null icollection error not thrown",
- errorThrown);
- }
- {
- // what can I say? I like chars. [--DB]
- char[] coll = {'a', 'b', 'c', 'd'};
- ArrayList al1 = new ArrayList(coll);
- AssertNotNull("no icollection ArrayList", al1);
- for (int i = 0; i < coll.Length; i++) {
- AssertEquals(i + " not ctor'ed properly.",
- coll[i], al1[i]);
- }
- }
- // TODO - multi-dim ICollection ctor?
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative capacity error not thrown",
- errorThrown);
- }
- }
-
- public void TestCapacity() {
- for (int i = 0; i < 100; i++) {
- ArrayList al1 = new ArrayList(i);
- AssertEquals("Bad capacity of " + i,
- i, al1.Capacity);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("Bad default capacity",
- 16, al1.Capacity);
- }
- }
-
- public void TestCount() {
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("Bad initial count",
- 0, al1.Count);
- for (int i = 1; i <= 100; i++) {
- al1.Add(i);
- AssertEquals("Bad count " + i,
- i, al1.Count);
- }
- }
- for (int i = 0; i < 100; i++) {
- char[] coll = new Char[i];
- ArrayList al1 = new ArrayList(coll);
- AssertEquals("Bad count for " + i,
- i, al1.Count);
- }
- }
-
- public void TestIsFixed() {
- ArrayList al1 = new ArrayList();
- Assert("should not be fixed by default", !al1.IsFixedSize);
- ArrayList al2 = ArrayList.FixedSize(al1);
- Assert("fixed-size wrapper not working", al2.IsFixedSize);
- }
-
- public void TestIsReadOnly() {
- ArrayList al1 = new ArrayList();
- Assert("should not be ReadOnly by default", !al1.IsReadOnly);
- ArrayList al2 = ArrayList.ReadOnly(al1);
- Assert("read-only wrapper not working", al2.IsReadOnly);
- }
-
- public void TestIsSynchronized() {
- ArrayList al1 = new ArrayList();
- Assert("should not be synchronized by default",
- !al1.IsSynchronized);
- ArrayList al2 = ArrayList.Synchronized(al1);
- Assert("synchronized wrapper not working", al2.IsSynchronized);
- }
-
- public void TestItem() {
- ArrayList al1 = new ArrayList();
- {
- bool errorThrown = false;
- try {
- object o = al1[-1];
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative item error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- object o = al1[1];
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end item error not thrown",
- errorThrown);
- }
- for (int i = 0; i <= 100; i++) {
- al1.Add(i);
- }
- for (int i = 0; i <= 100; i++) {
- AssertEquals("item not fetched for " + i,
- i, al1[i]);
- }
- }
-
- public void TestAdapter() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.Adapter(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null adapter error not thrown",
- errorThrown);
- }
- {
- char[] list = {'a', 'b', 'c', 'd'};
- ArrayList al1 = ArrayList.Adapter(list);
- AssertNotNull("Couldn't get an adapter", al1);
- for (int i = 0; i < list.Length; i++) {
- AssertEquals("adapter not adapting", list[i], al1[i]);
- }
- list[0] = 'z';
- for (int i = 0; i < list.Length; i++) {
- AssertEquals("adapter not adapting", list[i], al1[i]);
- }
- }
- // TODO - test other adapter types?
- }
-
- public void TestAdd() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- al1.Add("Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Add("Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- for (int i = 1; i <= 100; i++) {
- al1.Add(i);
- AssertEquals("add failed " + i,
- i, al1.Count);
- AssertEquals("add failed " + i,
- i, al1[i-1]);
-
- }
- }
- }
-
- public void TestAddRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- String[] s1 = {"Hi!"};
- al1.AddRange(s1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- String[] s1 = {"Hi!"};
- al1.AddRange(s1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList();
- al1.AddRange(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
-
- {
- ArrayList a1 = new ArrayList();
- AssertEquals("ArrayList should start empty",
- 0, a1.Count);
- char[] coll = {'a', 'b', 'c'};
- a1.AddRange(coll);
- AssertEquals("ArrayList has wrong elements",
- 3, a1.Count);
- a1.AddRange(coll);
- AssertEquals("ArrayList has wrong elements",
- 6, a1.Count);
- }
- }
-
- public void TestBinarySearch() {
- //{
- //bool errorThrown = false;
- //try {
- // ArrayList al1 = new ArrayList();
- // String[] s1 = {"This", "is", "a", "test"};
- // al1.AddRange(s1);
- // al1.BinarySearch(42);
- //} catch (ArgumentException) {
- // errorThrown = true;
- //}
- //Assert("search-for-wrong-type error not thrown",
- // errorThrown);
- //}
-
- {
- char[] bad = {'d', 'a', 'd', 'a', 'c', 'a'};
- ArrayList al1 = new ArrayList(bad);
- AssertEquals("shouldn't find elem in badly-sorted array", -1, al1.BinarySearch('c'));
- }
- {
- char[] bad = {'a', 'd', 'a', 'd', 'a', 'c', 'a'};
- ArrayList al1 = new ArrayList(bad);
- AssertEquals("shouldn't find elem in badly-sorted array", -2, al1.BinarySearch('c'));
- }
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- ArrayList al1 = new ArrayList(arr);
- Assert("couldn't find elem",
- al1.BinarySearch('c') >= 3);
- Assert("couldn't find elem",
- al1.BinarySearch('c') < 6);
- }
- {
- char[] arr = {'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e'};
- ArrayList al1 = new ArrayList(arr);
- AssertEquals("couldn't find next-higher elem",
- -4, al1.BinarySearch('c'));
- }
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- ArrayList al1 = new ArrayList(arr);
- AssertEquals("couldn't find end",
- -9, al1.BinarySearch('e'));
- }
-
- }
-
- // TODO - BinarySearch with IComparer
-
- public void TestClear() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- al1.Clear();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Clear();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- al1.Add('c');
- AssertEquals("should have one element",
- 1, al1.Count);
- al1.Clear();
- AssertEquals("should be empty",
- 0, al1.Count);
- }
- {
- int[] i1 = {1,2,3,4};
- ArrayList al1 = new ArrayList(i1);
- AssertEquals("should have elements",
- i1.Length, al1.Count);
- al1.Clear();
- AssertEquals("should be empty again",
- 0, al1.Count);
- }
- }
-
- public void TestClone() {
- {
- char[] c1 = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(c1);
- ArrayList al2 = (ArrayList)al1.Clone();
- AssertEquals("ArrayList match", al1[0], al2[0]);
- AssertEquals("ArrayList match", al1[1], al2[1]);
- AssertEquals("ArrayList match", al1[2], al2[2]);
- }
- {
- char[] d10 = {'a', 'b'};
- char[] d11 = {'a', 'c'};
- char[] d12 = {'b', 'c'};
- char[][] d1 = {d10, d11, d12};
- ArrayList al1 = new ArrayList(d1);
- ArrayList al2 = (ArrayList)al1.Clone();
- AssertEquals("Array match", al1[0], al2[0]);
- AssertEquals("Array match", al1[1], al2[1]);
- AssertEquals("Array match", al1[2], al2[2]);
-
- ((char[])al1[0])[0] = 'z';
- AssertEquals("shallow copy", al1[0], al2[0]);
- }
- }
-
- public void TestContains() {
- char[] c1 = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(c1);
- Assert("never find a null", !al1.Contains(null));
- Assert("can't find value", al1.Contains('b'));
- Assert("shouldn't find value", !al1.Contains('?'));
- }
-
- public void TestCopyTo() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- al1.CopyTo(null, 2);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[,] c2 = new Char[2,2];
- al1.CopyTo(c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[,] c1 = new Char[2,2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 2);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String[] c1 = new String[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- Char[] orig = {'a', 'b', 'c', 'd'};
- ArrayList al = new ArrayList(orig);
- Char[] copy = new Char[10];
- Array.Clear(copy, 0, copy.Length);
- al.CopyTo(copy, 3);
- AssertEquals("Wrong CopyTo 0", (char)0, copy[0]);
- AssertEquals("Wrong CopyTo 1", (char)0, copy[1]);
- AssertEquals("Wrong CopyTo 2", (char)0, copy[2]);
- AssertEquals("Wrong CopyTo 3", orig[0], copy[3]);
- AssertEquals("Wrong CopyTo 4", orig[1], copy[4]);
- AssertEquals("Wrong CopyTo 5", orig[2], copy[5]);
- AssertEquals("Wrong CopyTo 6", orig[3], copy[6]);
- AssertEquals("Wrong CopyTo 7", (char)0, copy[7]);
- AssertEquals("Wrong CopyTo 8", (char)0, copy[8]);
- AssertEquals("Wrong CopyTo 9", (char)0, copy[9]);
- }
-
- public void TestFixedSize() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.FixedSize(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error not thrown", errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("arrays start un-fixed.",
- false, al1.IsFixedSize);
- ArrayList al2 = ArrayList.FixedSize(al1);
- AssertEquals("should be fixed.",
- true, al2.IsFixedSize);
- }
- }
-
- public void TestGetEnumerator() {
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- IEnumerator en = a.GetEnumerator(-1,1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- IEnumerator en = a.GetEnumerator(1,-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- IEnumerator en = a.GetEnumerator(1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("out-of-range index error not thrown",
- errorThrown);
- }
- {
- String[] s1 = {"this", "is", "a", "test"};
- ArrayList al1 = new ArrayList(s1);
- IEnumerator en = al1.GetEnumerator();
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- AssertEquals("Not enumerating",
- al1[i], en.Current);
- }
- }
- {
- String[] s1 = {"this", "is", "a", "test"};
- ArrayList al1 = new ArrayList(s1);
- IEnumerator en = al1.GetEnumerator(1,2);
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < 2; i++) {
- en.MoveNext();
- AssertEquals("Not enumerating",
- al1[i+1], en.Current);
- }
- }
- }
-
- public void TestGetRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- ArrayList b = a.GetRange(-1,1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- ArrayList b = a.GetRange(1,-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- ArrayList b = a.GetRange(1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("out-of-range index error not thrown",
- errorThrown);
- }
- {
- char[] chars = {'a', 'b', 'c', 'd', 'e', 'f'};
- ArrayList a = new ArrayList(chars);
- ArrayList b = a.GetRange(1, 3);
- AssertEquals("GetRange returned wrong size ArrayList", 3, b.Count);
- for (int i = 0; i < b.Count; i++) {
- AssertEquals("range didn't work",
- chars[i+1], b[i]);
- }
-
- a[2] = '?'; // should screw up ArrayList b.
- bool errorThrown = false;
- try {
- int i = b.Count;
- } catch (InvalidOperationException) {
- errorThrown = true;
- }
- AssertEquals("Munging 'a' should mess up 'b'",
- true, errorThrown);
- }
- }
-
- public void TestIndexOf() {
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', 0, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', 0, 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(2);
- int i = a.IndexOf('a', 1, 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end indexof error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c', 'd', 'e'};
- ArrayList a = new ArrayList(c);
- AssertEquals("never find null",
- -1, a.IndexOf(null));
- AssertEquals("never find null",
- -1, a.IndexOf(null, 0));
- AssertEquals("never find null",
- -1, a.IndexOf(null, 0, 5));
- AssertEquals("can't find elem",
- 2, a.IndexOf('c'));
- AssertEquals("can't find elem",
- 2, a.IndexOf('c', 2));
- AssertEquals("can't find elem",
- 2, a.IndexOf('c', 2, 2));
- AssertEquals("shouldn't find elem",
- -1, a.IndexOf('c', 3, 2));
- AssertEquals("shouldn't find", -1, a.IndexOf('?'));
- AssertEquals("shouldn't find", -1, a.IndexOf(3));
- }
- }
-
- public void TestInsert() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- al1.Insert(0, "Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Insert(0, "Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.Insert(-1, "Hi!");
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.Insert(4, "Hi!");
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("arraylist starts empty", 0, al1.Count);
- al1.Insert(0, 'a');
- al1.Insert(1, 'b');
- al1.Insert(0, 'c');
- AssertEquals("arraylist needs stuff", 3, al1.Count);
- AssertEquals("arraylist got stuff", 'c', al1[0]);
- AssertEquals("arraylist got stuff", 'a', al1[1]);
- AssertEquals("arraylist got stuff", 'b', al1[2]);
- }
- }
-
- public void TestInsertRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- string[] s = {"Hi!"};
- al1.InsertRange(0, s);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- string[] s = {"Hi!"};
- al1.InsertRange(0, s);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- string[] s = {"Hi!"};
- al1.InsertRange(-1, s);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index insert error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- string[] s = {"Hi!"};
- al1.InsertRange(4, s);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out-of-range insert error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.InsertRange(0, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null insert error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c'};
- ArrayList a = new ArrayList(c);
- a.InsertRange(1, c);
- AssertEquals("bad insert", 'a', a[0]);
- AssertEquals("bad insert", 'a', a[1]);
- AssertEquals("bad insert", 'b', a[2]);
- AssertEquals("bad insert", 'c', a[3]);
- AssertEquals("bad insert", 'b', a[4]);
- AssertEquals("bad insert", 'c', a[5]);
- }
- }
-
- public void TestLastIndexOf() {
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(1);
- //int i = a.LastIndexOf('a', -1);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("first negative lastindexof error not thrown",
- //errorThrown);
- //}
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.LastIndexOf('a', 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end lastindexof error not thrown",
- errorThrown);
- }
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(1);
- //int i = a.LastIndexOf('a', 0, -1);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("second negative lastindexof error not thrown",
- //errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(1);
- //int i = a.LastIndexOf('a', 0, 2);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("past-end lastindexof error not thrown",
- //errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(2);
- //int i = a.LastIndexOf('a', 0, 2);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("past-end lastindexof error not thrown",
- //errorThrown);
- //}
- {
- char[] c = {'a', 'b', 'c', 'd', 'e'};
- ArrayList a = new ArrayList(c);
- AssertEquals("never find null",
- -1, a.LastIndexOf(null));
- AssertEquals("never find null",
- -1, a.LastIndexOf(null, 4));
- AssertEquals("never find null",
- -1, a.LastIndexOf(null, 4, 5));
- AssertEquals("can't find elem",
- 2, a.LastIndexOf('c'));
- AssertEquals("can't find elem",
- 2, a.LastIndexOf('c', 4));
- AssertEquals("can't find elem",
- 2, a.LastIndexOf('c', 3, 2));
- AssertEquals("shouldn't find elem",
- -1, a.LastIndexOf('c', 4, 2));
- AssertEquals("shouldn't find", -1, a.LastIndexOf('?'));
- AssertEquals("shouldn't find", -1, a.LastIndexOf(1));
- }
- }
-
- public void TestReadOnly() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.ReadOnly(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error not thrown", errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("arrays start writeable.",
- false, al1.IsReadOnly);
- ArrayList al2 = ArrayList.ReadOnly(al1);
- AssertEquals("should be readonly.",
- true, al2.IsReadOnly);
- }
- }
-
- public void TestRemove() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList(3));
- al1.Remove(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.Remove(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove read only error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a','b','c'};
- ArrayList a = new ArrayList(c);
- a.Remove(1);
- a.Remove('?');
- AssertEquals("should be unchanged", c.Length, a.Count);
- a.Remove('a');
- AssertEquals("should be changed", 2, a.Count);
- AssertEquals("should have shifted", 'b', a[0]);
- AssertEquals("should have shifted", 'c', a[1]);
- }
- }
-
- public void TestRemoveAt() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList(3));
- al1.RemoveAt(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove from fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.RemoveAt(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove from read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveAt(-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("remove at negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveAt(4);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("remove at out-of-range index error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a','b','c'};
- ArrayList a = new ArrayList(c);
- a.RemoveAt(0);
- AssertEquals("should be changed", 2, a.Count);
- AssertEquals("should have shifted", 'b', a[0]);
- AssertEquals("should have shifted", 'c', a[1]);
- }
- }
-
- public void TestRemoveRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList(3));
- al1.RemoveRange(0, 1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("removerange from fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.RemoveRange(0, 1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("removerange from read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveRange(-1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("removerange at negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveRange(0, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("removerange at negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveRange(2, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("removerange at bad range error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a','b','c'};
- ArrayList a = new ArrayList(c);
- a.RemoveRange(1,2);
- AssertEquals("should be changed", 1, a.Count);
- AssertEquals("should have shifted", 'a', a[0]);
- }
- }
-
- public void TestRepeat() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.Repeat('c', -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("repeat negative copies error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = ArrayList.Repeat("huh?", 0);
- AssertEquals("should be nothing in array",
- 0, al1.Count);
- }
- {
- ArrayList al1 = ArrayList.Repeat("huh?", 3);
- AssertEquals("should be something in array",
- 3, al1.Count);
- AssertEquals("array elem doesn't check",
- "huh?", al1[0]);
- AssertEquals("array elem doesn't check",
- "huh?", al1[1]);
- AssertEquals("array elem doesn't check",
- "huh?", al1[2]);
- }
- }
-
- public void TestReverse() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Reverse();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("reverse on read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- ArrayList al1 = new ArrayList(c);
- al1.Reverse(0, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- ArrayList al1 = new ArrayList(c);
- al1.Reverse(3, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c', 'd', 'e'};
- ArrayList al1 = new ArrayList(c);
- al1.Reverse(2,1);
- for (int i = 0; i < al1.Count; i++) {
- AssertEquals("Should be no change yet",
- c[i], al1[i]);
- }
- al1.Reverse();
- for (int i = 0; i < al1.Count; i++) {
- AssertEquals("Should be reversed",
- c[i], al1[4-i]);
- }
- al1.Reverse();
- for (int i = 0; i < al1.Count; i++) {
- AssertEquals("Should be back to normal",
- c[i], al1[i]);
- }
- al1.Reverse(1,3);
- AssertEquals("Should be back to normal", c[0], al1[0]);
- AssertEquals("Should be back to normal", c[3], al1[1]);
- AssertEquals("Should be back to normal", c[2], al1[2]);
- AssertEquals("Should be back to normal", c[1], al1[3]);
- AssertEquals("Should be back to normal", c[4], al1[4]);
- }
- }
-
- public void TestSetRange() {
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.SetRange(0, c);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("setrange on read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.SetRange(0, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("setrange with null error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(3);
- al1.SetRange(-1, c);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("setrange with negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(3);
- al1.SetRange(2, c);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("setrange with too much error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 = ArrayList.Repeat('?', 3);
- Assert("no match yet", c[0] != (char)al1[0]);
- Assert("no match yet", c[1] != (char)al1[1]);
- Assert("no match yet", c[2] != (char)al1[2]);
- al1.SetRange(0, c);
- AssertEquals("should match", c[0], al1[0]);
- AssertEquals("should match", c[1], al1[1]);
- AssertEquals("should match", c[2], al1[2]);
- }
- }
-
- public void TestSort() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Sort();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("sort on read only error not thrown",
- errorThrown);
- }
- {
- char[] starter = {'d', 'b', 'f', 'e', 'a', 'c'};
- ArrayList al1 = new ArrayList(starter);
- al1.Sort();
- AssertEquals("Should be sorted", 'a', al1[0]);
- AssertEquals("Should be sorted", 'b', al1[1]);
- AssertEquals("Should be sorted", 'c', al1[2]);
- AssertEquals("Should be sorted", 'd', al1[3]);
- AssertEquals("Should be sorted", 'e', al1[4]);
- AssertEquals("Should be sorted", 'f', al1[5]);
- }
- }
-
- // TODO - Sort with IComparers
-
- // TODO - Synchronize
-
- public void TestToArray() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.ToArray(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("toarray with null error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- string s = "huh?";
- ArrayList al1 = new ArrayList(c);
- al1.ToArray(s.GetType());
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("toarray with bad type error not thrown",
- errorThrown);
- }
- {
- char[] c1 = {'a', 'b', 'c', 'd', 'e'};
- ArrayList al1 = new ArrayList(c1);
- object[] o2 = al1.ToArray();
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("should be copy", c1[i], o2[i]);
- }
- Array c2 = al1.ToArray(c1[0].GetType());
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("should be copy",
- c1[i], c2.GetValue(i));
- }
- }
- }
-
- public void TestTrimToSize() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.TrimToSize();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("trim read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- int capacity = al1.Capacity;
- while (al1.Capacity <= capacity) {
- al1.Add('?');
- }
- al1.RemoveAt(0);
- AssertEquals("size not good", capacity, al1.Count);
- Assert("capacity not good", al1.Capacity > capacity);
- al1.TrimToSize();
- AssertEquals("no capacity match",
- capacity, al1.Capacity);
-
- al1.Clear();
- al1.TrimToSize();
- AssertEquals("no default capacity",
- capacity, al1.Capacity);
- }
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/BitArrayTest.cs b/mcs/class/corlib/Test/System.Collections/BitArrayTest.cs
deleted file mode 100644
index 7d29eb44911..00000000000
--- a/mcs/class/corlib/Test/System.Collections/BitArrayTest.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-//
-// BitArrayTest.cs - NUnit Test Cases for the System.Collections.BitArray class
-//
-// Author: David Menestrina (dmenest@yahoo.com)
-//
-
-using NUnit.Framework;
-using System.Collections;
-using System;
-
-namespace MonoTests.System.Collections
-{
-
-public class BitArrayTest : TestCase
-{
- private BitArray testBa;
- private bool [] testPattern;
- private BitArray op1;
- private BitArray op2;
-
- public static ITest Suite
- {
- get {
- return new TestSuite(typeof(BitArrayTest));
- }
- }
-
- private void verifyPattern(BitArray ba, bool[] pattern)
- {
- AssertEquals(ba.Length, pattern.Length);
- for (int i = 0; i < pattern.Length; i++)
- AssertEquals(ba[i], pattern[i]);
- }
-
- public BitArrayTest() : base ("MonoTests.System.Collections.BitArrayTest testcase") {}
- public BitArrayTest( string name ) : base(name) { }
-
- protected override void SetUp()
- {
- testPattern = new bool[70];
-
- int i;
- for(i = 0; i < testPattern.Length/2; i++)
- testPattern[i] = ((i % 2) == 0);
- for(; i < testPattern.Length; i++)
- testPattern[i] = ((i % 2) != 0);
-
- testBa = new BitArray(70);
- for(i = 0; i < testBa.Length/2; i++)
- testBa[i] = ((i % 2) == 0);
- for(; i < testBa.Length; i++)
- testBa[i] = ((i % 2) != 0);
-
- // for TestAnd, TestOr, TestNot, TestXor
- op1 = new BitArray(new int[] { 0x33333333, 0x33333333 });
- op2 = new BitArray(new int[] { 0x66666666, 0x66666666 });
- }
-
- public void TestBoolConstructor()
- {
- BitArray ba = new BitArray(testPattern);
- verifyPattern(ba, testPattern);
- }
-
- public void TestCopyConstructor()
- {
- BitArray ba = new BitArray(testBa);
-
- verifyPattern(ba, testPattern);
- }
-
- public void TestByteConstructor()
- {
- byte [] byteArr = new byte[] { 0xaa, 0x55, 0xaa, 0x55, 0x80 };
- BitArray ba = new BitArray(byteArr);
-
- AssertEquals("Lengths not equal", ba.Length, byteArr.Length * 8);
-
- // spot check
- Assert("7 not true", ba[7]);
- Assert("6 not false", !ba[6]);
- Assert("15 not false", !ba[15]);
- Assert("14 not true", ba[14]);
- Assert("39 not true", ba[39]);
- Assert("35 not false", !ba[35]);
-
- }
-
- public void TestIntConstructor()
- {
- int [] intArr = new int[] { ~0x55555555, 0x55555551 };
- BitArray ba = new BitArray(intArr);
-
- AssertEquals(ba.Length, intArr.Length * 32);
-
- // spot check
-
- Assert(ba[31]);
- Assert(!ba[30]);
- Assert(!ba[63]);
- Assert(ba[62]);
- Assert(ba[32]);
- Assert(!ba[35]);
- }
-
- public void TestValConstructor()
- {
- BitArray ba = new BitArray(64, false);
-
- AssertEquals(ba.Length, 64);
- foreach (bool b in ba)
- Assert(!b);
-
- ba = new BitArray(64, true);
-
- AssertEquals(ba.Length, 64);
- foreach (bool b in ba)
- Assert(b);
- }
-
- public void TestClone()
- {
- BitArray ba = (BitArray)testBa.Clone();
-
- verifyPattern(ba, testPattern);
-
- // ensure that changes in ba don't get propagated to testBa
- ba[0] = false;
- ba[1] = false;
- ba[2] = false;
-
- verifyPattern(testBa, testPattern);
- }
-
- public void TestSetLength()
- {
- int origLen = testBa.Length;
- testBa.Length += 33;
-
- AssertEquals(origLen + 33, testBa.Length);
- for (int i = origLen; i < testBa.Length; i++)
- testBa[i] = true;
-
- testBa.Length -= 33;
- verifyPattern(testBa, testPattern);
- }
-
- public void TestAnd()
- {
- BitArray result = op1.And(op2);
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(!result[i++]);
- Assert(result[i++]);
- Assert(!result[i++]);
- Assert(!result[i++]);
- }
- }
-
- public void TestOr()
- {
- BitArray result = op1.Or(op2);
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(result[i++]);
- Assert(result[i++]);
- Assert(result[i++]);
- Assert(!result[i++]);
- }
- }
-
- public void TestNot()
- {
- BitArray result = op1.Not();
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(!result[i++]);
- Assert(!result[i++]);
- Assert(result[i++]);
- Assert(result[i++]);
- }
- }
-
- public void TestXor()
- {
- BitArray result = op1.Xor(op2);
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(result[i++]);
- Assert(!result[i++]);
- Assert(result[i++]);
- Assert(!result[i++]);
- }
- }
-
- public void TestSetAll()
- {
- testBa.SetAll(false);
- foreach(bool b in testBa)
- Assert(!b);
- testBa.SetAll(true);
- foreach(bool b in testBa)
- Assert(b);
- }
-
- public void TestCopyToBool()
- {
- try {
- bool[] barray = new bool[testBa.Length + 10];
-
- testBa.CopyTo(barray, 5);
-
- for (int i = 0; i < testBa.Length; i++)
- AssertEquals(testBa[i], barray[i+5]);
- }
- catch(Exception e){
- Fail("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestCopyToByte()
- {
- try {
- testBa.Length = 34;
- byte[] barray = new byte[5 + 10];
-
- testBa.CopyTo(barray, 5);
-
- for (int i = 5; i < 9; i++)
- AssertEquals(0x55, barray[i] & 0xff);
-
- // FIXME: MS fails on the next line. This is because
- // we truncated testBa.Length, and MS's internal array still
- // has the old bits set. CopyTo() doesn't say specifically
- // whether the "junk" bits (bits past Length, but within Length
- // rounded up to 32) will be copied as 0, or if those bits are
- // undefined.
- //AssertEquals(0x01, barray[9] & 0xff);
- }
- catch(Exception e){
- Fail("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestCopyToInt()
- {
- try {
- testBa.Length = 34;
- int[] iarray = new int[2 + 10];
-
- testBa.CopyTo(iarray, 5);
-
- AssertEquals(0x55555555, iarray[5]);
- // FIXME: Same thing here as in TestCopyToByte
- //AssertEquals(0x01, iarray[6]);
- }
- catch(Exception e){
- Fail("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestEnumerator()
- {
-
- try {
- IEnumerator e = testBa.GetEnumerator();
-
- for (int i = 0; e.MoveNext(); i++)
- AssertEquals(e.Current, testPattern[i]);
-
- Assert(!e.MoveNext());
- // read, to make sure reading isn't considered a write.
- bool b = testBa[0];
-
- e.Reset();
- for (int i = 0; e.MoveNext(); i++)
- AssertEquals(e.Current, testPattern[i]);
-
- try
- {
- e.Reset();
- testBa[0] = !testBa[0];
- e.MoveNext();
- Fail("IEnumerator.MoveNext() should throw when collection modified.");
- }
- catch (InvalidOperationException)
- {
- }
- }
- catch(Exception ex){
- Fail("Unexpected exception thrown: " + ex.ToString());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs b/mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs
deleted file mode 100644
index 9bd8ba35ec9..00000000000
--- a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// CaseInsensitiveComparerTest
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
- /// <summary>CaseInsensitiveComparer test suite.</summary>
- public class CaseInsensitiveComparerTest : TestCase {
- public static ITest Suite {
- get {
- return new TestSuite(typeof(CaseInsensitiveComparerTest));
- }
- }
-
- public CaseInsensitiveComparerTest() : base ("MonoTests.System.Collections.CaseInsensitiveComparerTest testcase") {}
-
- public CaseInsensitiveComparerTest(String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- public void TestDefaultInstance ()
- {
- // Make sure the instance returned by Default
- // is really a CaseInsensitiveComparer.
- Assert((CaseInsensitiveComparer.Default
- as CaseInsensitiveComparer) != null);
- }
-
- public void TestCompare () {
- CaseInsensitiveComparer cic = new CaseInsensitiveComparer ();
-
- Assert(cic.Compare ("WILD WEST", "Wild West") == 0);
- Assert(cic.Compare ("WILD WEST", "wild west") == 0);
- Assert(cic.Compare ("Zeus", "Mars") > 0);
- Assert(cic.Compare ("Earth", "Venus") < 0);
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs b/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs
deleted file mode 100644
index 86419a02ce4..00000000000
--- a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// CaseInsensitiveHashCodeProviderTest
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
- /// <summary>CaseInsensitiveHashCodeProvider test suite.</summary>
- public class CaseInsensitiveHashCodeProviderTest : TestCase {
- public CaseInsensitiveHashCodeProviderTest() : base ("MonoTests.System.Collections.CaseInsensitiveHashCodeProviderTest testcase") {}
-
- public CaseInsensitiveHashCodeProviderTest(String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite(typeof(CaseInsensitiveHashCodeProviderTest));
- }
- }
-
- public void TestDefaultInstance ()
- {
- // Make sure the instance returned by Default
- // is really a CaseInsensitiveHashCodeProvider.
- Assert((CaseInsensitiveHashCodeProvider.Default
- as CaseInsensitiveHashCodeProvider) != null);
- }
-
- public void TestHashCode () {
- CaseInsensitiveHashCodeProvider cih = new CaseInsensitiveHashCodeProvider ();
- int h1 = cih.GetHashCode ("Test String");
- int h2 = cih.GetHashCode ("test string");
- int h3 = cih.GetHashCode ("TEST STRING");
-
- Assert("Mixed Case != lower case", h1 == h2);
- Assert("Mixed Case != UPPER CASE", h1 == h3);
-
- h1 = cih.GetHashCode ("one");
- h2 = cih.GetHashCode ("another");
- // Actually this is quite possible.
- Assert(h1 != h2);
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/ChangeLog b/mcs/class/corlib/Test/System.Collections/ChangeLog
deleted file mode 100644
index 281a1b53f03..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ChangeLog
+++ /dev/null
@@ -1,18 +0,0 @@
-2002-02-20 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs: Add a small assert for a bug that I found and fixed
- in ArrayList. Make sure it doesn't come up again.
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * QueueTest.cs: Put in correct namespace.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * StackTest.cs: Removed test for IsReadonly. Doesn't exist in .NET 1.0
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * BitArrayTest.cs: wrapped try-catch blocks around several of the tests.
- NUnit doesn't properly catch exception here anymore. Must be something
- to do with upgrading to .NET.1.0. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs b/mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs
deleted file mode 100644
index 12ca737e391..00000000000
--- a/mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// System.Collections.CollectionBase
-// Test suite for System.Collections.CollectionBase
-//
-// Author:
-// Nick D. Drochak II
-//
-// (C) 2001 Nick D. Drochak II
-//
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections
-{
-
-public class CollectionBaseTest : TestCase
-{
- public CollectionBaseTest () : base ("System.Collection.CollectionBase testsuite") {}
- public CollectionBaseTest (String name) : base (name) {}
-
- // We need a concrete class to test the abstract base class
- public class ConcreteCollection : CollectionBase
- {
- // These fields are used as markers to test the On* hooks.
- public bool onClearFired;
- public bool onClearCompleteFired;
-
- public bool onInsertFired;
- public int onInsertIndex;
- public bool onInsertCompleteFired;
- public int onInsertCompleteIndex;
-
- public bool onRemoveFired;
- public int onRemoveIndex;
- public bool onRemoveCompleteFired;
- public int onRemoveCompleteIndex;
-
- public bool onSetFired;
- public int onSetOldValue;
- public int onSetNewValue;
- public bool onSetCompleteFired;
- public int onSetCompleteOldValue;
- public int onSetCompleteNewValue;
-
- // This constructor is used to test OnValid()
- public ConcreteCollection()
- {
- IList listObj;
- listObj = this;
- listObj.Add(null);
- }
-
- // This constructor puts consecutive integers into the list
- public ConcreteCollection(int i) {
- IList listObj;
- listObj = this;
-
- int j;
- for (j = 0; j< i; j++) {
- listObj.Add(j);
- }
- }
-
- // A helper method to look at a value in the list at a specific index
- public int PeekAt(int index)
- {
- IList listObj;
- listObj = this;
- return (int) listObj[index];
- }
-
- // Mark the flag if this hook is fired
- protected override void OnClear() {
- this.onClearFired = true;
- }
-
- // Mark the flag if this hook is fired
- protected override void OnClearComplete()
- {
- this.onClearCompleteFired = true;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsert(int index, object value)
- {
- this.onInsertFired = true;
- this.onInsertIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsertComplete(int index, object value)
- {
- this.onInsertCompleteFired = true;
- this.onInsertCompleteIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemove(int index, object value)
- {
- this.onRemoveFired = true;
- this.onRemoveIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemoveComplete(int index, object value)
- {
- this.onRemoveCompleteFired = true;
- this.onRemoveCompleteIndex = index;
- }
-
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSet(int index, object oldValue, object newValue)
- {
- this.onSetFired = true;
- this.onSetOldValue = (int) oldValue;
- this.onSetNewValue = (int) newValue;
- }
-
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSetComplete(int index, object oldValue, object newValue)
- {
- this.onSetCompleteFired = true;
- this.onSetCompleteOldValue = (int) oldValue;
- this.onSetCompleteNewValue = (int) newValue;
- }
- } // public class ConcreteCollection
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof(CollectionBaseTest));
- }
- }
-
- // Check the count property
- public void TestCount() {
- ConcreteCollection myCollection;
- myCollection = new ConcreteCollection(4);
- Assert(4 == myCollection.Count);
- }
-
- // Make sure GetEnumerator returns an object
- public void TestGetEnumerator() {
- ConcreteCollection myCollection;
- myCollection = new ConcreteCollection(4);
- Assert(null != myCollection.GetEnumerator());
- }
-
- // OnValid disallows nulls
- public void TestOnValid() {
- ConcreteCollection myCollection;
- try {
- myCollection = new ConcreteCollection();
- }
- catch (ArgumentNullException) {
- }
- }
-
- // Test various Insert paths
- public void TestInsert() {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- // The constructor inserts
- myCollection = new ConcreteCollection(numberOfItems);
- Assert(myCollection.onInsertFired);
- Assert(myCollection.onInsertCompleteFired);
-
- // Using the IList interface, check inserts in the middle
- IList listObj = myCollection;
- listObj.Insert(1, 9);
- Assert(myCollection.onInsertIndex == 1);
- Assert(myCollection.onInsertCompleteIndex == 1);
- Assert(myCollection.PeekAt(1) == 9);
- }
-
- // Test Clear and it's hooks
- public void TestClear()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 1;
- myCollection = new ConcreteCollection(numberOfItems);
- myCollection.Clear();
- Assert(myCollection.Count == 0);
- Assert(myCollection.onClearFired);
- Assert(myCollection.onClearCompleteFired);
- }
-
- // Test RemoveAt, other removes and the hooks
- public void TestRemove()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- // Set up a test collection
- myCollection = new ConcreteCollection(numberOfItems);
-
- // The list is 0-based. So if we remove the second one
- myCollection.RemoveAt(1);
-
- // We should see the original third one in it's place
- Assert(myCollection.PeekAt(1) == 2);
- Assert(myCollection.onRemoveFired);
- Assert(myCollection.onRemoveIndex == 1);
- Assert(myCollection.onRemoveCompleteFired);
- Assert(myCollection.onRemoveCompleteIndex == 1);
- IList listObj = myCollection;
- listObj.Remove(0);
- // Confirm parameters are being passed to the hooks
- Assert(myCollection.onRemoveIndex == 0);
- Assert(myCollection.onRemoveCompleteIndex == 0);
- }
-
- // Test the random access feature
- public void TestSet()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- myCollection = new ConcreteCollection(numberOfItems);
- IList listObj = myCollection;
- listObj[0] = 99;
- Assert((int) listObj[0] == 99);
- Assert(myCollection.onSetFired);
- Assert(myCollection.onSetCompleteFired);
- Assert(myCollection.onSetOldValue == 0);
- Assert(myCollection.onSetCompleteOldValue == 0);
- Assert(myCollection.onSetNewValue == 99);
- Assert(myCollection.onSetCompleteNewValue == 99);
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/ComparerTest.cs b/mcs/class/corlib/Test/System.Collections/ComparerTest.cs
deleted file mode 100644
index 38b78de39e7..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ComparerTest.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// ComparerTest
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
- /// <summary>Comparer test suite.</summary>
- public class ComparerTest : TestCase {
- public ComparerTest() : base ("MonoTests.System.Collections.ComparerTest testcase") {}
- public ComparerTest(String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite(typeof(ComparerTest));
- }
- }
-
- public void TestDefaultInstance ()
- {
- // Make sure the instance returned by Default
- // is really a Comparer.
- Assert((Comparer.Default as Comparer) != null);
- }
-
- public void TestCompare ()
- {
- Comparer c = Comparer.Default;
-
- bool thrown = false;
-
- try {
- c.Compare (new Object (), new Object ());
- } catch (ArgumentException) {
- thrown = true;
- }
-
- Assert("ArgumentException expected", thrown);
-
- Assert(c.Compare (1, 2) < 0);
- Assert(c.Compare (2, 2) == 0);
- Assert(c.Compare (3, 2) > 0);
-
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/HashtableTest.cs b/mcs/class/corlib/Test/System.Collections/HashtableTest.cs
deleted file mode 100644
index 04a807b0dac..00000000000
--- a/mcs/class/corlib/Test/System.Collections/HashtableTest.cs
+++ /dev/null
@@ -1,761 +0,0 @@
-// HashtableTest.cs - NUnit Test Cases for the System.Collections.Hashtable class
-//
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
-/// <summary>Hashtable test.</summary>
-public class HashtableTest : TestCase {
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite();
-
- suite.AddTest(new TestSuite(typeof(HashtableTest)));
- suite.AddTest(new TestSuite(typeof(HashtableTest2)));
- return suite;
- }
- }
-
- public void TestCtor1() {
- Hashtable h = new Hashtable();
- AssertNotNull("No hash table", h);
- }
- public void TestCtor2() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- string[] keys = {"this", "is", "a", "test"};
- char[] values = {'a', 'b', 'c', 'd'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values[i];
- }
- Hashtable h2 = new Hashtable(h1);
- for (int i = 0; i < keys.Length; i++) {
- AssertEquals("No match for key " + keys[i],
- values[i], h2[keys[i]]);
- }
- }
- }
- // TODO - Ctors for capacity and load (how to test? any access?)
- // TODO - Ctors with IComparer, IHashCodeProvider, Serialization
-
- public void TestCount() {
- Hashtable h = new Hashtable();
- AssertEquals("new table - count zero", 0, h.Count);
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h[i] = i;
- AssertEquals("Count wrong for " + i,
- i, h.Count);
- }
- for (int i = 1; i <= max; i++) {
- h[i] = i * 2;
- AssertEquals("Count shouldn't change at " + i,
- max, h.Count);
- }
- }
-
- public void TestIsFixedSize() {
- Hashtable h = new Hashtable();
- AssertEquals("hashtable not fixed by default",
- false, h.IsFixedSize);
- // TODO - any way to get a fixed-size hashtable?
- }
-
- public void TestIsReadOnly() {
- Hashtable h = new Hashtable();
- AssertEquals("hashtable not read-only by default",
- false, h.IsReadOnly);
- // TODO - any way to get a read-only hashtable?
- }
-
- public void TestIsSynchronized() {
- Hashtable h = new Hashtable();
- Assert("hashtable not synced by default", !h.IsSynchronized);
- Hashtable h2 = Hashtable.Synchronized(h);
- Assert("hashtable should by synced", h2.IsSynchronized);
- }
-
- public void TestItem() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- Object o = h[null];
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- // TODO - if read-only and/or fixed-size is possible,
- // test 'NotSupportedException' here
-
- {
- Hashtable h = new Hashtable();
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h[i] = i;
- AssertEquals("value wrong for " + i,
- i, h[i]);
- }
- }
- }
-
- public void TestKeys() {
- string[] keys = {"this", "is", "a", "test"};
- char[] values1 = {'a', 'b', 'c', 'd'};
- char[] values2 = {'e', 'f', 'g', 'h'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values1[i];
- }
- AssertEquals("keys wrong size",
- keys.Length, h1.Keys.Count);
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values2[i];
- }
- AssertEquals("keys wrong size 2",
- keys.Length, h1.Keys.Count);
- }
-
- // TODO - SyncRoot
-
- public void TestValues() {
- string[] keys = {"this", "is", "a", "test"};
- char[] values1 = {'a', 'b', 'c', 'd'};
- char[] values2 = {'e', 'f', 'g', 'h'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values1[i];
- }
- AssertEquals("values wrong size",
- keys.Length, h1.Values.Count);
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values2[i];
- }
- AssertEquals("values wrong size 2",
- keys.Length, h1.Values.Count);
- }
-
- public void TestAdd() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.Add(null, "huh?");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null add error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.Add('a', 1);
- h.Add('a', 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("re-add error not thrown",
- errorThrown);
- }
- // TODO - hit NotSupportedException
- {
- Hashtable h = new Hashtable();
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h.Add(i, i);
- AssertEquals("value wrong for " + i,
- i, h[i]);
- }
- }
- }
-
- public void TestClear() {
- // TODO - hit NotSupportedException
- Hashtable h = new Hashtable();
- AssertEquals("new table - count zero", 0, h.Count);
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h[i] = i;
- }
- Assert("table don't gots stuff", h.Count > 0);
- h.Clear();
- AssertEquals("Table should be cleared",
- 0, h.Count);
- }
-
- public void TestClone() {
- {
- char[] c1 = {'a', 'b', 'c'};
- char[] c2 = {'d', 'e', 'f'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < c1.Length; i++) {
- h1[c1[i]] = c2[i];
- }
- Hashtable h2 = (Hashtable)h1.Clone();
- AssertNotNull("got no clone!", h2);
- AssertNotNull("clone's got nothing!", h2[c1[0]]);
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("Hashtable match",
- h1[c1[i]], h2[c1[i]]);
- }
- }
- {
- char[] c1 = {'a', 'b', 'c'};
- char[] c20 = {'1', '2'};
- char[] c21 = {'3', '4'};
- char[] c22 = {'5', '6'};
- char[][] c2 = {c20, c21, c22};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < c1.Length; i++) {
- h1[c1[i]] = c2[i];
- }
- Hashtable h2 = (Hashtable)h1.Clone();
- AssertNotNull("got no clone!", h2);
- AssertNotNull("clone's got nothing!", h2[c1[0]]);
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("Hashtable match",
- h1[c1[i]], h2[c1[i]]);
- }
-
- ((char[])h1[c1[0]])[0] = 'z';
- AssertEquals("shallow copy", h1[c1[0]], h2[c1[0]]);
- }
- }
-
- public void TestContains() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- bool result = h.Contains(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null add error not thrown",
- errorThrown);
- }
- {
- Hashtable h = new Hashtable();
- h['a'] = "blue";
- Assert("'a'? it's in there!", h.Contains('a'));
- Assert("'b'? no way!", !h.Contains('b'));
- }
- }
-
- public void TestContainsKey() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- bool result = h.ContainsKey(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null add error not thrown",
- errorThrown);
- }
- {
- Hashtable h = new Hashtable();
- h['a'] = "blue";
- Assert("'a'? it's in there!", h.ContainsKey('a'));
- Assert("'b'? no way!", !h.ContainsKey('b'));
- }
- }
-
- public void TestContainsValue() {
- {
- Hashtable h = new Hashtable();
- h['a'] = "blue";
- Assert("blue? it's in there!",
- h.ContainsValue("blue"));
- Assert("green? no way!",
- !h.ContainsValue("green"));
- }
- }
-
- public void TestCopyTo() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.CopyTo(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- Object[] o = new Object[1];
- h.CopyTo(o, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- Object[,] o = new Object[1,1];
- h.CopyTo(o, 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("multi-dim array error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h['a'] = 1; // no error if table is empty
- Object[] o = new Object[5];
- h.CopyTo(o, 5);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("no room in array error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h['a'] = 1;
- h['b'] = 2;
- h['c'] = 2;
- Object[] o = new Object[2];
- h.CopyTo(o, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("table too big error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h["blue"] = 1;
- h["green"] = 2;
- h["red"] = 3;
- Char[] o = new Char[3];
- h.CopyTo(o, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("invalid cast error not thrown",
- errorThrown);
- }
-
- {
- Hashtable h = new Hashtable();
- h['a'] = 1;
- h['b'] = 2;
- DictionaryEntry[] o = new DictionaryEntry[2];
- h.CopyTo(o,0);
- AssertEquals("first copy fine.", 'a', o[0].Key);
- AssertEquals("first copy fine.", 1, o[0].Value);
- AssertEquals("second copy fine.", 'b', o[1].Key);
- AssertEquals("second copy fine.", 2, o[1].Value);
- }
- }
-
- public void TestGetEnumerator() {
- String[] s1 = {"this", "is", "a", "test"};
- Char[] c1 = {'a', 'b', 'c', 'd'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < s1.Length; i++) {
- h1[s1[i]] = c1[i];
- }
- IDictionaryEnumerator en = h1.GetEnumerator();
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- Assert("Not enumerating for " + en.Key,
- Array.IndexOf(s1, en.Key) >= 0);
- Assert("Not enumerating for " + en.Value,
- Array.IndexOf(c1, en.Value) >= 0);
- }
- }
-
- // TODO - GetObjectData
- // TODO - OnDeserialization
-
- public void TestRemove() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.Remove(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- string[] keys = {"this", "is", "a", "test"};
- char[] values = {'a', 'b', 'c', 'd'};
- Hashtable h = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h[keys[i]] = values[i];
- }
- AssertEquals("not enough in table",
- 4, h.Count);
- h.Remove("huh?");
- AssertEquals("not enough in table",
- 4, h.Count);
- h.Remove("this");
- AssertEquals("Wrong count in table",
- 3, h.Count);
- h.Remove("this");
- AssertEquals("Wrong count in table",
- 3, h.Count);
- }
- }
-
- public void TestSynchronized() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = Hashtable.Synchronized(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- Hashtable h = new Hashtable();
- Assert("hashtable not synced by default",
- !h.IsSynchronized);
- Hashtable h2 = Hashtable.Synchronized(h);
- Assert("hashtable should by synced",
- h2.IsSynchronized);
- }
- }
-
-
- protected Hashtable ht;
- private static Random rnd;
-
- public HashtableTest() : base ("MonoTests.System.Collections.HashtableTest testcase") {}
- public HashtableTest(String name) : base(name) {}
-
- protected override void SetUp() {
- ht=new Hashtable();
- rnd=new Random();
- }
-
- private void SetDefaultData() {
- ht.Clear();
- ht.Add("k1","another");
- ht.Add("k2","yet");
- ht.Add("k3","hashtable");
- }
-
-
- public void TestAddRemoveClear() {
- ht.Clear();
- Assert(ht.Count==0);
-
- SetDefaultData();
- Assert(ht.Count==3);
-
- bool thrown=false;
- try {
- ht.Add("k2","cool");
- } catch (ArgumentException) {thrown=true;}
- Assert("Must throw ArgumentException!",thrown);
-
- ht["k2"]="cool";
- Assert(ht.Count==3);
- Assert(ht["k2"].Equals("cool"));
-
- }
-
- public void TestCopyTo2() {
- SetDefaultData();
- Object[] entries=new Object[ht.Count];
- ht.CopyTo(entries,0);
- Assert("Not an entry.",entries[0] is DictionaryEntry);
- }
-
-
- public void TestUnderHeavyLoad() {
- ht.Clear();
- int max=100000;
- String[] cache=new String[max*2];
- int n=0;
-
- for (int i=0;i<max;i++) {
- int id=rnd.Next()&0xFFFF;
- String key=""+id+"-key-"+id;
- String val="value-"+id;
- if (ht[key]==null) {
- ht[key]=val;
- cache[n]=key;
- cache[n+max]=val;
- n++;
- }
- }
-
- Assert(ht.Count==n);
-
- for (int i=0;i<n;i++) {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
-
- int r1=(n/3);
- int r2=r1+(n/5);
-
- for (int i=r1;i<r2;i++) {
- ht.Remove(cache[i]);
- }
-
-
- for (int i=0;i<n;i++) {
- if (i>=r1 && i<r2) {
- Assert(ht[cache[i]]==null);
- } else {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
- }
-
- ICollection keys=ht.Keys;
- int nKeys=0;
- foreach (Object key in keys) {
- Assert((key as String) != null);
- nKeys++;
- }
- Assert(nKeys==ht.Count);
-
-
- ICollection vals=ht.Values;
- int nVals=0;
- foreach (Object val in vals) {
- Assert((val as String) != null);
- nVals++;
- }
- Assert(nVals==ht.Count);
-
- }
-
-
- private class HashtableTest2 : TestCase {
-
- protected Hashtable ht;
- private static Random rnd;
-
- public HashtableTest2 (String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- ht=new Hashtable ();
- rnd=new Random ();
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(HashtableTest2));
- }
- }
-
- private void SetDefaultData ()
- {
- ht.Clear ();
- ht.Add ("k1","another");
- ht.Add ("k2","yet");
- ht.Add ("k3","hashtable");
- }
-
-
- public void TestAddRemoveClear ()
- {
- ht.Clear ();
- Assert (ht.Count == 0);
-
- SetDefaultData ();
- Assert (ht.Count == 3);
-
- bool thrown=false;
- try {
- ht.Add ("k2","cool");
- } catch (ArgumentException) {thrown=true;}
- Assert("Must throw ArgumentException!",thrown);
-
- ht["k2"]="cool";
- Assert(ht.Count == 3);
- Assert(ht["k2"].Equals("cool"));
-
- }
-
- public void TestCopyTo ()
- {
- SetDefaultData ();
- Object[] entries=new Object[ht.Count];
- ht.CopyTo (entries,0);
- Assert("Not an entry.",entries[0] is DictionaryEntry);
- }
-
-
- public void TestUnderHeavyLoad ()
- {
- ht.Clear ();
-
- int max=100000;
- String[] cache=new String[max*2];
- int n=0;
-
- for (int i=0;i<max;i++) {
- int id=rnd.Next()&0xFFFF;
- String key=""+id+"-key-"+id;
- String val="value-"+id;
- if (ht[key]==null) {
- ht[key]=val;
- cache[n]=key;
- cache[n+max]=val;
- n++;
- }
- }
-
- Assert(ht.Count==n);
-
- for (int i=0;i<n;i++) {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
-
- int r1=(n/3);
- int r2=r1+(n/5);
-
- for (int i=r1;i<r2;i++) {
- ht.Remove(cache[i]);
- }
-
-
- for (int i=0;i<n;i++) {
- if (i>=r1 && i<r2) {
- Assert(ht[cache[i]]==null);
- } else {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
- }
-
- ICollection keys=ht.Keys;
- int nKeys=0;
- foreach (Object key in keys) {
- Assert((key as String) != null);
- nKeys++;
- }
- Assert(nKeys==ht.Count);
-
-
- ICollection vals=ht.Values;
- int nVals=0;
- foreach (Object val in vals) {
- Assert((val as String) != null);
- nVals++;
- }
- Assert(nVals==ht.Count);
-
- }
-
- /// <summary>
- /// Test hashtable with CaseInsensitiveHashCodeProvider
- /// and CaseInsensitive comparer.
- /// </summary>
- public void TestCaseInsensitive ()
- {
- // Not very meaningfull test, just to make
- // sure that hcp is set properly set.
- Hashtable ciHashtable = new Hashtable(11,1.0f,CaseInsensitiveHashCodeProvider.Default,CaseInsensitiveComparer.Default);
- ciHashtable ["key1"] = "value";
- ciHashtable ["key2"] = "VALUE";
- Assert(ciHashtable ["key1"].Equals ("value"));
- Assert(ciHashtable ["key2"].Equals ("VALUE"));
-
- ciHashtable ["KEY1"] = "new_value";
- Assert(ciHashtable ["key1"].Equals ("new_value"));
-
- }
-
-
- public void TestCopyConstructor ()
- {
- SetDefaultData ();
-
- Hashtable htCopy = new Hashtable (ht);
-
- Assert(ht.Count == htCopy.Count);
- }
-
-
- public void TestEnumerator ()
- {
- SetDefaultData ();
-
- IEnumerator e = ht.GetEnumerator ();
-
- while (e.MoveNext ()) {}
-
- Assert (!e.MoveNext ());
-
- }
-
-
- }
-
-
-}
-}
diff --git a/mcs/class/corlib/Test/System.Collections/QueueTest.cs b/mcs/class/corlib/Test/System.Collections/QueueTest.cs
deleted file mode 100644
index 2a50df18b95..00000000000
--- a/mcs/class/corlib/Test/System.Collections/QueueTest.cs
+++ /dev/null
@@ -1,179 +0,0 @@
-//
-// System.Collections.QueueTest
-// Test suite for System.Collections.Queue
-//
-// Author:
-// Ricardo Fernández Pascual
-//
-// (C) 2001 Ricardo Fernández Pascual
-//
-
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections {
-
- public class QueueTest : TestCase {
-
- public QueueTest ()
- : base ("System.Collection.Queue testsuite") {}
- public QueueTest (String name) : base (name) {}
-
- protected Queue q1;
- protected Queue q2;
- protected Queue emptyQueue;
-
- protected override void SetUp () {
- q1 = new Queue (10);
- for (int i = 0; i < 100; i++)
- q1.Enqueue (i);
-
- q2 = new Queue (50, 1.5f);
- for (int i = 50; i < 100; i++)
- q2.Enqueue (i);
-
- emptyQueue = new Queue ();
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (QueueTest));
- }
- }
-
- public void TestConstructors () {
- Assert (q1.Count == 100);
- Assert (q2.Count == 50);
- Assert (emptyQueue.Count == 0);
- // TODO: Test Queue (ICollection)
- }
-
- // TODO: should test all methods from ICollection,
- // but it should be done in ICollectionTest.cs... ??
-
- public void TestCopyTo () {
- int[] a1 = new int[100];
- int[] a2 = new int[60];
-
- q1.CopyTo (a1, 0);
- for (int i = 0; i < 100; i++)
- AssertEquals (i, a1[i]);
-
- // Remove some items from q2 and add other
- // items, to avoid having an "easy" just created
- // Queue
- for (int i = 50; i < 60; i++)
- Assert (i == (int) q2.Dequeue ());
- for (int i = 100; i < 110; i++)
- q2.Enqueue (i);
-
- q2.CopyTo (a2, 10);
- for (int i = 60; i < 110; i++)
- Assert (i == a2[i - 60 + 10]);
-
- // Copying an empty Queue should not modify the array
- emptyQueue.CopyTo (a2, 10);
- for (int i = 60; i < 110; i++)
- Assert (i == a2[i - 60 + 10]);
- }
-
- public void TestEnumerator () {
- int i;
- IEnumerator e;
- e = q1.GetEnumerator ();
- i = 0;
- while (e.MoveNext ()) {
- Assert (((int) e.Current) == i);
- i++;
- }
- e = q2.GetEnumerator ();
- i = 50;
- while (e.MoveNext ()) {
- Assert (((int) e.Current) == i++);
- i++;
- }
- e = emptyQueue.GetEnumerator ();
- while (e.MoveNext ()) {
- Fail ("Empty Queue enumerator returning elements!");
- }
- e = q1.GetEnumerator ();
- try {
- e.MoveNext ();
- q1.Enqueue (0);
- e.MoveNext ();
- Fail ("Should have thrown InvalidOperationException");
- } catch (InvalidOperationException) { }
- e = q1.GetEnumerator ();
- try {
- e.MoveNext ();
- q1.Enqueue (0);
- object o = e.Current;
- Fail ("Should have thrown InvalidOperationException");
- } catch (InvalidOperationException) { }
- }
-
- public void TestClone () {
- Queue q3 = (Queue) q2.Clone ();
- Assert (q3.Count == q2.Count);
- for (int i = 0; i < 50; i++)
- Assert (q2.Dequeue ().Equals (q3.Dequeue ()));
- Assert (q3.Count == 0);
- Assert (q2.Count == 0);
- }
-
- public void ClearTest () {
- q1.Clear ();
- Assert (q1.Count == 0);
- q2.Clear ();
- Assert (q2.Count == 0);
- emptyQueue.Clear ();
- Assert (emptyQueue.Count == 0);
- }
-
- public void ContainsTest () {
- for (int i = 0; i < 100; i++) {
- Assert (q1.Contains (i));
- Assert (!emptyQueue.Contains (i));
- if (i < 50)
- Assert (!q2.Contains (i));
- else
- Assert (q2.Contains (i));
- }
- }
-
- public void EnqueueDequeuePeekTest () {
- int q1size = q1.Count;
- int q2size = q2.Count;
- q2.Enqueue (null);
- Assert (q2.Count == ++q2size);
- for (int i = 0; i < 50; i++) {
- int k = (int) q1.Peek ();
- Assert (q1.Count == q1size);
- int j = (int) q1.Dequeue ();
- Assert (q1.Count == --q1size);
- Assert (i == j);
- Assert (j == k);
- q2.Enqueue (j);
- Assert (q2.Count == ++q2size);
- }
- for (int i = 50; i < 100; i++) {
- Assert (((int) q2.Dequeue ()) == i);
- Assert (q2.Count == --q2size);
- }
- Assert (q2.Peek () == null);
- Assert (q2.Dequeue () == null);
- Assert (q2.Count == --q2size);
- for (int i = 0; i < 50; i++) {
- Assert (((int) q2.Dequeue ()) == i);
- Assert (q2.Count == --q2size);
- }
- }
-
- // TODO: test Syncronized operation
-
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs b/mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs
deleted file mode 100644
index 1ec201d2db2..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Collections.ReadOnlyCollectionBase
-// Test suite for System.Collections.ReadOnlyCollectionBase
-//
-// Author:
-// Nick D. Drochak II
-//
-// (C) 2001 Nick D. Drochak II
-//
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections {
- public class ReadOnlyCollectionBaseTest : TestCase {
- public ReadOnlyCollectionBaseTest () : base ("System.Collection.ReadOnlyCollectionBase testsuite") {}
- public ReadOnlyCollectionBaseTest (String name) : base (name) {}
-
- // We need a concrete class to test the abstract base class
- public class ConcreteReadOnlyCollection : ReadOnlyCollectionBase
- {
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(ReadOnlyCollectionBaseTest));
- }
- }
-
- // Make sure that the Count is 0 for a new object
- public void TestZeroCountOnNew()
- {
- ConcreteReadOnlyCollection myCollection;
- myCollection = new ConcreteReadOnlyCollection();
- Assert(0 == myCollection.Count);
- }
-
- // Make sure we get an object from GetEnumerator()
- public void TestGetEnumerator()
- {
- ConcreteReadOnlyCollection myCollection;
- myCollection = new ConcreteReadOnlyCollection();
- Assert(null != myCollection.GetEnumerator());
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Collections/StackTest.cs b/mcs/class/corlib/Test/System.Collections/StackTest.cs
deleted file mode 100644
index fdcc3b07cce..00000000000
--- a/mcs/class/corlib/Test/System.Collections/StackTest.cs
+++ /dev/null
@@ -1,270 +0,0 @@
-//
-// StackTest.cs
-//
-// Author:
-// Chris Hynes <chrish@assistedsolutions.com>
-//
-// (C) 2001 Chris Hynes
-//
-
-using System;
-
-using System.Collections;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections
-{
- public class StackTest: TestCase
- {
- private Stack stack1;
- private Stack stack2;
- private Stack stackInt;
-
- public void TestConstructor()
- {
- AssertEquals(false, stack1 == null);
- }
-
- public void TestICollectionConstructor()
- {
- Stack stackTest = new Stack(new int[] {0, 1, 2, 3, 4});
-
- for (int i = 4; i >= 0; i--)
- AssertEquals(i, stackTest.Pop());
-
- AssertEquals(0, stackTest.Count);
- }
-
- public void TestIntConstructor()
- {
- Stack stackTest = new Stack(50);
-
- AssertEquals(false, stackTest == null);
- }
-
- public void TestCount()
- {
- Stack stackTest = new Stack();
-
- stackTest.Push(50);
- stackTest.Push(5);
- stackTest.Push(0);
- stackTest.Push(50);
-
- AssertEquals(4, stackTest.Count);
- }
-
- public void TestIsSyncronized()
- {
- AssertEquals(false, stack1.IsSynchronized);
- AssertEquals(true, Stack.Synchronized(stack1).IsSynchronized);
- }
-
- public void TestSyncRoot()
- {
- AssertEquals(false, stack1.SyncRoot == null);
- }
-
- public void TestGetEnumerator()
- {
- stackInt.Pop();
-
- int j = 3;
-
- foreach (int i in stackInt)
- {
- AssertEquals(j--, i);
- }
-
- stackInt.Clear();
-
- IEnumerator e = stackInt.GetEnumerator();
-
- AssertEquals(false, e.MoveNext());
- }
-
- public void TestClear()
- {
- stackInt.Clear();
-
- AssertEquals(0, stackInt.Count);
- }
-
- public void TestClone()
- {
- Stack clone = (Stack)stackInt.Clone();
-
- while (stackInt.Count > 0)
- {
- AssertEquals(stackInt.Pop(), clone.Pop());
- }
- }
-
- public void TestContains()
- {
- string toLocate = "test";
-
- stackInt.Push(toLocate);
-
- stackInt.Push("chaff");
-
- Assert(stackInt.Contains(toLocate));
-
- stackInt.Pop();
-
- Assert(stackInt.Contains(toLocate));
-
- stackInt.Pop();
-
- Assert(!stackInt.Contains(toLocate));
- }
-
- public void TestCopyTo()
- {
- int[] arr = new int[stackInt.Count - 1];
- int[,] arrMulti;
-
- try
- {
- stackInt.CopyTo(null, 0);
- Fail("Should throw an ArgumentNullException");
- }
- catch (ArgumentNullException) {}
-
- try
- {
- stackInt.CopyTo(arr, -1);
- Fail("Should throw an ArgumentOutOfRangeException");
- }
- catch (ArgumentOutOfRangeException) {}
-
- try
- {
- stackInt.CopyTo(arrMulti = new int[1, 1], 1);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- try
- {
- stackInt.CopyTo(arr = new int[2], 3);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- try
- {
- stackInt.CopyTo(arr = new int[3], 2);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- try
- {
- stackInt.CopyTo(arr = new int[2], 3);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- arr = new int[stackInt.Count];
-
- stackInt.CopyTo(arr, 0);
-
- int j = 4;
-
- for (int i = 0; i < 4; i++)
- {
- AssertEquals(j--, arr[i]);
- }
- }
-
- public void TestSyncronized()
- {
- Stack syncStack = Stack.Synchronized(stackInt);
-
- syncStack.Push(5);
-
- for (int i = 5; i >= 0; i--)
- AssertEquals(i, syncStack.Pop());
- }
-
- public void TestPushPeekPop()
- {
- stackInt.Pop();
-
- int topVal = (int)stackInt.Peek();
-
- AssertEquals(3, topVal);
-
- AssertEquals(4, stackInt.Count);
-
- AssertEquals(topVal, stackInt.Pop());
-
- AssertEquals(2, stackInt.Pop());
-
- Stack test = new Stack();
- test.Push(null);
-
- AssertEquals(null, test.Pop());
- }
-
- public void TestToArray()
- {
- object[] arr = stackInt.ToArray();
-
- AssertEquals(stackInt.Count, arr.Length);
-
- for (int i = 0; i < 5; i++)
- AssertEquals(arr[i], stackInt.Pop());
- }
-
- static void Main(string[] args)
- {
- //
- // TODO: Add code to start application here
- //
- }
-
- protected override void SetUp()
- {
- stack1 = new Stack();
- stack2 = new Stack();
-
- stackInt = new Stack();
-
- for (int i = 0; i < 5; i++)
- stackInt.Push(i);
- }
-
- public static ITest Suite
- {
- get
- {
- TestSuite stackSuite = new TestSuite();
-
- stackSuite.AddTest(new StackTest("TestConstructor"));
- stackSuite.AddTest(new StackTest("TestICollectionConstructor"));
- stackSuite.AddTest(new StackTest("TestIntConstructor"));
-
- stackSuite.AddTest(new StackTest("TestCount"));
- stackSuite.AddTest(new StackTest("TestIsSyncronized"));
- stackSuite.AddTest(new StackTest("TestSyncRoot"));
-
- stackSuite.AddTest(new StackTest("TestGetEnumerator"));
- stackSuite.AddTest(new StackTest("TestClear"));
- stackSuite.AddTest(new StackTest("TestClone"));
- stackSuite.AddTest(new StackTest("TestContains"));
- stackSuite.AddTest(new StackTest("TestPushPeekPop"));
- stackSuite.AddTest(new StackTest("TestCopyTo"));
- stackSuite.AddTest(new StackTest("TestSyncronized"));
- stackSuite.AddTest(new StackTest("TestToArray"));
-
- return stackSuite;
- }
- }
-
- public StackTest() : base ("MonoTests.System.Collections.StackTest testcase") {}
- public StackTest(string name): base(name) {}
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/AllTests.cs b/mcs/class/corlib/Test/System.Diagnostics/AllTests.cs
deleted file mode 100644
index d97f4ad2277..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/AllTests.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(StackTraceTest.Suite);
- suite.AddTest(StackFrameTest.Suite);
- suite.AddTest(TextWriterTraceListenerTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Diagnostics/ChangeLog b/mcs/class/corlib/Test/System.Diagnostics/ChangeLog
deleted file mode 100644
index a679bf57b2e..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * DebugTest.cs: Put in correct namespace.
- * TextWriterTraceListenerTest.cs: Put in correct namespace. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs b/mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs
deleted file mode 100644
index 5d620ea5813..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// MonoTests.System.Diagnostics.DebugTest.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2002
-using System;
-using System.Diagnostics;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics
-{
- public class DebugTest
- {
- private DebugTest()
- {
-
- }
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(DebugTest1.Suite);
- return suite;
- }
- }
-
- private class DebugTest1 : TestCase
- {
- public DebugTest1(string name) : base(name)
- {
-
- }
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(DebugTest1));
- }
- }
-
- protected override void SetUp()
- {
- Debug.Listeners.Add(new TextWriterTraceListener(Console.Error));
- }
-
- protected override void TearDown()
- {
-
- }
-
- public void TestAssert()
- {
- Debug.Assert(false, "Testing Assertions");
- }
-
- public void TestFail()
- {
- Debug.Fail("Testing Fail method");
- }
-
- public void TestWrite()
- {
- Debug.Write("Testing Write", "Testing the output of the Write method");
- }
-
- public void TestWriteIf()
- {
- Debug.WriteIf(true, "Testing WriteIf");
- Debug.WriteIf(false, "Testing WriteIf", "Passed false");
- }
-
- public void TestWriteLine()
- {
- Debug.WriteLine("Testing WriteLine method");
- }
-
- public void TestWriteLineIf()
- {
- Debug.WriteLineIf(true, "Testing WriteLineIf");
- Debug.WriteLineIf(false, "Testing WriteLineIf", "Passed false");
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs b/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs
deleted file mode 100644
index 36666a39471..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs
+++ /dev/null
@@ -1,350 +0,0 @@
-//
-// Ximian.Mono.Tests.StackFrameTest.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Diagnostics;
-using System.Reflection;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics {
- public class StackFrameTest {
- private StackFrameTest() {}
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(StackFrameTest1.Suite);
- suite.AddTest(StackFrameTest2.Suite);
- suite.AddTest(StackFrameTest3.Suite);
- return suite;
- }
- }
-
- /// <summary>
- /// Tests the case where StackFrame is created for specified file name and
- /// location inside it.
- /// </summary>
- private class StackFrameTest1 : TestCase {
- public StackFrameTest1(string name) : base(name) {}
-
- private StackFrame frame1;
- private StackFrame frame2;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackFrameTest1));
- }
- }
-
- protected override void SetUp() {
- frame1 = new StackFrame("dir/someFile", 13, 45);
- frame2 = new StackFrame("SomeFile2.cs", 24);
- }
-
- protected override void TearDown() {
- frame1 = null;
- frame2 = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting file name works.
- /// </summary>
- public void TestGetFileName() {
- AssertEquals("File name (1)",
- "dir/someFile",
- frame1.GetFileName());
-
- AssertEquals("File name (2)",
- "SomeFile2.cs",
- frame2.GetFileName());
- }
-
- /// <summary>
- /// Tests whether getting file line number works.
- /// </summary>
- public void TestGetFileLineNumber() {
- AssertEquals("Line number (1)",
- 13,
- frame1.GetFileLineNumber());
-
- AssertEquals("Line number (2)",
- 24,
- frame2.GetFileLineNumber());
- }
-
- /// <summary>
- /// Tests whether getting file column number works.
- /// </summary>
- public void TestGetFileColumnNumber() {
- AssertEquals("Column number (1)",
- 45,
- frame1.GetFileColumnNumber());
-
- AssertEquals("Column number (2)",
- 0,
- frame2.GetFileColumnNumber());
- }
-
-
- /// <summary>
- /// Tests whether getting method associated with frame works.
- /// </summary>
- public void TestGetMethod() {
- Assert("Method not null (1)", (frame1.GetMethod() != null));
-
- AssertEquals("Class declaring the method (1)",
- this.GetType(),
- frame1.GetMethod().DeclaringType);
- AssertEquals("Method name (1)",
- "SetUp",
- frame1.GetMethod().Name);
-
- Assert("Method not null (2)", (frame2.GetMethod() != null));
-
- AssertEquals("Class declaring the method (2)",
- this.GetType(),
- frame2.GetMethod().DeclaringType);
- AssertEquals("Method name (2)",
- "SetUp",
- frame2.GetMethod().Name);
- }
- }
-
- /// <summary>
- /// Tests the case where StackFrame is created for current method.
- /// </summary>
- /// <remarks>
- /// FIXME: Must be compiled with /debug switch. Otherwise some file
- /// information will be incorrect for the following test cases.
- /// What's the best way to do both types of tests with and without
- /// debug information?
- /// </remarks>
- private class StackFrameTest2 : TestCase {
- public StackFrameTest2(string name) : base(name) {}
-
- private StackFrame frame1;
- private StackFrame frame2;
- private StackFrame frame3;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackFrameTest2));
- }
- }
-
- protected override void SetUp() {
- frame1 = new StackFrame();
- frame2 = new StackFrame(true);
- frame3 = new StackFrame(0);
- }
-
- protected override void TearDown() {
- frame1 = null;
- frame2 = null;
- frame3 = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting file name works.
- /// </summary>
- public void TestGetFileName() {
- AssertNull("File name (1)",
- frame1.GetFileName());
-
- Assert("File name (2) " + frame2.GetFileName()
- + " ends with StackFrameTest.cs",
- frame2.GetFileName().EndsWith("StackFrameTest.cs"));
- }
-
- /// <summary>
- /// Tests whether getting file line number works.
- /// </summary>
- public void TestGetFileLineNumber() {
- AssertEquals("Line number (1)",
- 0,
- frame1.GetFileLineNumber());
-
- AssertEquals("Line number (2)",
- 154,
- frame2.GetFileLineNumber());
-
- AssertEquals("Line number (3)",
- 0,
- frame3.GetFileLineNumber());
- }
-
- /// <summary>
- /// Tests whether getting file column number works.
- /// </summary>
- public void TestGetFileColumnNumber() {
- AssertEquals("Column number (1)",
- 0,
- frame1.GetFileColumnNumber());
-
- AssertEquals("Column number (2)",
- 25,
- frame2.GetFileColumnNumber());
-
- AssertEquals("Column number (3)",
- 0,
- frame3.GetFileColumnNumber());
- }
-
-
- /// <summary>
- /// Tests whether getting method associated with frame works.
- /// </summary>
- public void TestGetMethod() {
- Assert("Method not null (1)",
- (frame1.GetMethod() != null));
-
- AssertEquals("Class declaring the method (1)",
- this.GetType(),
- frame1.GetMethod().DeclaringType);
- AssertEquals("Method name (1)",
- "SetUp",
- frame1.GetMethod().Name);
-
- Assert("Method not null (2)",
- (frame2.GetMethod() != null));
-
- AssertEquals("Class declaring the method (2)",
- this.GetType(),
- frame2.GetMethod().DeclaringType);
- AssertEquals("Method name (2)",
- "SetUp",
- frame2.GetMethod().Name);
-
- Assert("Method not null (3)",
- (frame3.GetMethod() != null));
-
- AssertEquals("Class declaring the method (3)",
- this.GetType(),
- frame3.GetMethod().DeclaringType);
- AssertEquals("Method name (3)",
- "SetUp",
- frame3.GetMethod().Name);
- }
- }
-
-
- /// <summary>
- /// Tests the case where StackFrame is created for current method but
- /// skipping some frames.
- /// </summary>
- /// <remarks>
- /// FIXME: Must be compiled with /debug switch. Otherwise some file
- /// information will be incorrect for the following test cases.
- /// What's the best way to do both types of tests with and without
- /// debug information?
- /// </remarks>
- private class StackFrameTest3 : TestCase {
- public StackFrameTest3(string name) : base(name) {}
-
- private StackFrame frame1;
- private StackFrame frame2;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackFrameTest3));
- }
- }
-
- protected override void SetUp() {
- // In order to get better test cases with stack traces
- NestedSetUp();
- }
-
- private void NestedSetUp() {
- frame1 = new StackFrame(2);
- frame2 = new StackFrame(1, true);
- }
-
- protected override void TearDown() {
- frame1 = null;
- frame2 = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting file name works.
- /// </summary>
- public void TestGetFileName() {
- AssertNull("File name (1)",
- frame1.GetFileName());
-
- Assert("File name (2) " + frame2.GetFileName()
- + " ends with StackFrameTest.cs",
- frame2.GetFileName().EndsWith("StackFrameTest.cs"));
- }
-
- /// <summary>
- /// Tests whether getting file line number works.
- /// </summary>
- public void TestGetFileLineNumber() {
- AssertEquals("Line number (1)",
- 0,
- frame1.GetFileLineNumber());
-
- AssertEquals("Line number (2)",
- 277,
- frame2.GetFileLineNumber());
- }
-
- /// <summary>
- /// Tests whether getting file column number works.
- /// </summary>
- public void TestGetFileColumnNumber() {
- AssertEquals("Column number (1)",
- 0,
- frame1.GetFileColumnNumber());
-
- AssertEquals("Column number (2)",
- 17,
- frame2.GetFileColumnNumber());
- }
-
-
- /// <summary>
- /// Tests whether getting method associated with frame works.
- /// </summary>
- public void TestGetMethod() {
- Assert("Method not null (1)", (frame1.GetMethod() != null));
-
- AssertEquals("Class declaring the method (1)",
- typeof(NUnit.Framework.TestCase),
- frame1.GetMethod().DeclaringType);
- AssertEquals("Method name (1)",
- "RunBare",
- frame1.GetMethod().Name);
-
- Assert("Method not null (2)", (frame2.GetMethod() != null));
-
- AssertEquals("Class declaring the method (2)",
- this.GetType(),
- frame2.GetMethod().DeclaringType);
- AssertEquals("Method name (2)",
- "SetUp",
- frame2.GetMethod().Name);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs b/mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs
deleted file mode 100644
index 1469a7c83aa..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// Ximian.Mono.Tests.StackTraceTest.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Diagnostics;
-using System.Reflection;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics {
- public class StackTraceTest {
- private StackTraceTest() {}
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(StackTraceTest1.Suite);
- return suite;
- }
- }
-
- /// <summary>
- /// Tests the case where StackTrace is created for specified
- /// stack frame.
- /// </summary>
- private class StackTraceTest1 : TestCase {
- public StackTraceTest1(string name) : base(name) {}
-
- private StackTrace trace;
- private StackFrame frame;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackTraceTest1));
- }
- }
-
- protected override void SetUp() {
- frame = new StackFrame("dir/someFile",
- 13,
- 45);
- trace = new StackTrace(frame);
- }
-
- protected override void TearDown() {
- trace = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting number of frames works.
- /// </summary>
- public void TestFrameCount() {
- AssertEquals("Frame count",
- 1,
- trace.FrameCount);
- }
-
- /// <summary>
- /// Tests whether getting frames by index which is out of
- /// range works.
- /// </summary>
- public void TestGetFrameOutOfRange() {
- Assert("Frame with index -1 == null",
- (trace.GetFrame(-1) == null));
-
- Assert("Frame with index -129 = null",
- (trace.GetFrame(-129) == null));
-
- Assert("Frame with index 1 = null",
- (trace.GetFrame(1) == null));
-
- Assert("Frame with index 145 = null",
- (trace.GetFrame(145) == null));
-
- }
-
-
- /// <summary>
- /// Tests whether getting frames by index works.
- /// </summary>
- public void TestGetFrame() {
- AssertEquals("Frame with index 0",
- frame,
- trace.GetFrame(0));
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs b/mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs
deleted file mode 100644
index c7cc8e35b90..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// MonoTests.System.Diagnostics.TextWriterTraceListenerTest.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-
-using System;
-using System.IO;
-using System.Text;
-using System.Diagnostics;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics
-{
-
- public class TextWriterTraceListenerTest
- {
- private TextWriterTraceListenerTest()
- {
-
- }
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(TextWriterTraceListenerTest1.Suite);
- return suite;
- }
- }
-
- private class TextWriterTraceListenerTest1 : TestCase
- {
- public TextWriterTraceListenerTest1(string name) : base(name)
- {
- }
-
- private TextWriterTraceListener listener;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(TextWriterTraceListenerTest1));
- }
- }
-
- protected override void SetUp()
- {
- listener = new TextWriterTraceListener();
- listener.Writer = Console.Out;
- }
-
- protected override void TearDown()
- {
- listener = null;
- }
-
- public void TestWrite()
- {
- Assert("Null Listener", !(listener == null));
- Assert("Null Writer", !(listener.Writer == null));
- listener.Write("Test Message\n");
-
- }
-
- public void TestWriteLine()
- {
- Assert("Null Listener", !(listener == null));
- Assert("Null Writer", !(listener.Writer == null));
- listener.WriteLine("Test WriteLine Message");
- }
-
- public void TestFlush()
- {
- listener.Flush();
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.IO/AllTests.cs b/mcs/class/corlib/Test/System.IO/AllTests.cs
deleted file mode 100644
index 91cdb4924c5..00000000000
--- a/mcs/class/corlib/Test/System.IO/AllTests.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.IO {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(MemoryStreamTest.Suite);
- suite.AddTest(StreamReaderTest.Suite);
- suite.AddTest(StreamWriterTest.Suite);
- suite.AddTest(PathTest.Suite);
- suite.AddTest(StringReaderTest.Suite);
- suite.AddTest(StringWriterTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.IO/ChangeLog b/mcs/class/corlib/Test/System.IO/ChangeLog
deleted file mode 100644
index 7c9f2d1d791..00000000000
--- a/mcs/class/corlib/Test/System.IO/ChangeLog
+++ /dev/null
@@ -1,11 +0,0 @@
-2002-02-05 Duncan Mak <duncan@ximian.com>
-
- * FileTest.cs: Added to CVS. However, this portion of the code
- can't be tested right now.
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: removed duplicate MemoryStream test
- * MemoryStreamTest.cs: wrapped try-catch blocks around read/write/seek
- tests. These were throwing exceptions that NUnit wasn't catching. I
- don't think it used to behave this way before .NET.1.0. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.IO/FileTest.cs b/mcs/class/corlib/Test/System.IO/FileTest.cs
deleted file mode 100644
index d91865c4d33..00000000000
--- a/mcs/class/corlib/Test/System.IO/FileTest.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// FileTest.cs: Test cases for System.IO.File
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-namespace MonoTests.System.IO
-{
- public class FileTest : TestCase
- {
- public FileTest ()
- : base ("System.IO.File testsuite")
- {
- }
-
- public FileTest (string name)
- : base (name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- protected override void TearDown ()
- {
- }
-
- public static ITest Suite
- {
- get { return new TestSuite (typeof (FileTest)); }
- }
-
- public void TestExists ()
- {
- Assert ("File filetest/test should exist", File.Exists ("filetest/test"));
- }
-
- public void TestCreate ()
- {
- File.Create ("filetest/foo");
- Assert ("File should exist", File.Exists ("filetest/foo"));
- }
-
- public void TestCopy ()
- {
- File.Copy ("filetest/foo", "filetest/bar", false);
- Assert ("File foo should exist", File.Exists ("filetest/foo"));
- Assert ("File bar should exist", File.Exists ("filetest/bar"));
- }
-
- public void TestDelete ()
- {
- File.Delete ("filetest/foo");
- Assert ("File should not exist", !File.Exists ("filetest/foo"));
- }
-
- public void TestMove ()
- {
- Assert ("File filetest/bar should exist", File.Exists ("filetest/bar"));
- File.Move ("filetest/bar", "filetest/baz");
- Assert ("File filetest/bar should not exist", !File.Exists ("filetest/bar"));
- Assert ("File filetest/baz should exist", File.Exists ("filetest/baz"));
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs b/mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs
deleted file mode 100644
index d300472cc82..00000000000
--- a/mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add some testing for exceptions
-//
-// TODO: Add some testing for the CanXXX properties, exceptions,
-// various different constructors.
-//
-
-using NUnit.Framework;
-using System.IO;
-using System;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class MemoryStreamTest : TestCase {
-
- private MemoryStream testStream;
- private byte[] testStreamData;
-
- public MemoryStreamTest() : base ("MonoTests.System.IO.MemoryStream testcase") { }
- public MemoryStreamTest( string name ): base(name) { }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(MemoryStreamTest));
- }
- }
-
- protected override void SetUp() {
- testStreamData = new byte[100];
-
- for( int i = 0; i < 100; i++ ) {
- testStreamData[i] = (byte)(100 - i);
- }
-
- testStream = new MemoryStream( testStreamData );
- }
-
- //
- // Verify that the first count bytes in testBytes are the same as
- // the count bytes from index start in testStreamData
- //
- private void VerifyTestData( byte[] testBytes, int start, int count) {
- if( testBytes == null ) {
- throw new ArgumentNullException();
- } else if( ( start < 0 || count < 0 ) || start + count > testStreamData.Length || start > testStreamData.Length ) {
- throw new ArgumentOutOfRangeException();
- }
-
- for( int test = 0; test < count; test++ ) {
- if( testBytes[ test ] != testStreamData[ start + test ] ) {
- string failStr = String.Format( "testByte {0} (testStream {1}) was <{2}>, expecting <{3}>", test, start+test,
- testBytes[ test ], testStreamData[ start+test] );
- Fail( failStr );
- }
- }
- }
-
- public void TestConstructors() {
- MemoryStream ms = new MemoryStream();
-
- AssertEquals( 0, ms.Length );
- AssertEquals( 0, ms.Capacity );
- AssertEquals( true, ms.CanWrite );
-
- ms = new MemoryStream( 10 );
-
- AssertEquals( 0, ms.Length );
- AssertEquals( 10, ms.Capacity );
- }
-
- public void TestRead() {
- byte[] readBytes = new byte[20];
-
- try {
- /* Test simple read */
- testStream.Read( readBytes, 0, 10 );
- VerifyTestData( readBytes, 0, 10 );
-
- /* Seek back to beginning */
-
- testStream.Seek( 0, SeekOrigin.Begin );
-
- /* Read again, bit more this time */
- testStream.Read( readBytes, 0, 20 );
- VerifyTestData( readBytes, 0, 20 );
-
- /* Seek to 20 bytes from End */
- testStream.Seek( -20, SeekOrigin.End );
- testStream.Read( readBytes, 0, 20);
- VerifyTestData( readBytes, 80, 20);
-
- int readByte = testStream.ReadByte();
- AssertEquals( -1, readByte );
- }
- catch(Exception e){
- Fail("Threw an unexpected exception:"+e.ToString());
- return;
- }
- }
-
- public void TestWriteBytes() {
- byte[] readBytes = new byte[100];
-
- try {
- MemoryStream ms = new MemoryStream( 100 );
-
- for( int i = 0; i < 100; i++ ) {
- ms.WriteByte( testStreamData[i] );
- }
-
- ms.Seek( 0, SeekOrigin.Begin);
-
- testStream.Read( readBytes, 0, 100 );
-
- VerifyTestData( readBytes, 0, 100 );
- }
- catch(Exception e){
- Fail("Threw an unexpected exception:"+e.ToString());
- return;
- }
- }
-
- public void TestWriteBlock() {
- byte[] readBytes = new byte[100];
-
- try {
- MemoryStream ms = new MemoryStream( 100 );
-
- ms.Write( testStreamData, 0, 100 );
-
- ms.Seek( 0, SeekOrigin.Begin);
-
- testStream.Read( readBytes, 0, 100 );
-
- VerifyTestData( readBytes, 0, 100 );
-
- byte[] arrayBytes = testStream.ToArray();
-
- VerifyTestData( arrayBytes, 0, 100 );
- }
- catch(Exception e){
- Fail("Threw an unexpected exception:"+e.ToString());
- return;
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.IO/PathTest.cs b/mcs/class/corlib/Test/System.IO/PathTest.cs
deleted file mode 100644
index 0735807a3cf..00000000000
--- a/mcs/class/corlib/Test/System.IO/PathTest.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// System.IO.Path Test Cases
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add a more thorough workout for some
-// of the "trickier" functions.
-
-#define WINDOWS
-
-using NUnit.Framework;
-using System.IO;
-using System;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class PathTest : TestCase {
-
- string path1;
- string path2;
- string path3;
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(PathTest));
- }
- }
-
- public PathTest() : base ("MonoTests.System.IO.PathTest testcase") { }
- public PathTest( string name ): base(name) { }
-
- protected override void SetUp() {
-
- #if WINDOWS
-
- path1 = "c:\\foo\\test.txt";
- path2 = "c:\\winnt";
- path3 = "system32";
-
- #elif UNIX
-
- path1 = "/foo/test.txt";
- path2 = "/etc";
- path3 = "init.d"
-
- #elif MAC
-
- path1 = "foo:test.txt";
- path2 = "foo";
- path3 = "bar";
-
- #endif
-
- }
-
-
- public void TestChangeExtension() {
- string testPath = Path.ChangeExtension( path1, "doc" );
-
- #if WINDOWS
- AssertEquals( "c:\\foo\\test.doc", testPath );
- #elif UNIX
- AssertEquals( "/foo/test.doc", testPath );
- #elif MAC
- AssertEquals( "foo:test.doc", testPath );
- #endif
- }
-
- public void TestCombine() {
- string testPath = Path.Combine( path2, path3 );
-
- #if WINDOWS
- AssertEquals( "c:\\winnt\\system32", testPath );
- #elif UNIX
- AssertEquals( "/etc/init.d", testPath );
- #elif MAC
- AssertEquals( "foo:bar", testPath );
- #endif
- }
-
- public void TestDirectoryName() {
- string testDirName = Path.GetDirectoryName( path1 );
-
- #if WINDOWS
- AssertEquals( "c:\\foo", testDirName );
- #elif UNIX
- AssertEquals( "/etc", testDirName );
- #elif MAC
- AssertEquals( "foo", testDirName );
- #endif
- }
-
- public void TestGetExtension() {
- string testExtn = Path.GetExtension( path1 );
-
- AssertEquals( ".txt", testExtn );
-
- testExtn = Path.GetExtension( path2 );
-
- AssertEquals ( "", testExtn );
- }
-
- public void TestGetFileName() {
- string testFileName = Path.GetFileName( path1 );
-
- AssertEquals( "test.txt", testFileName );
- }
-
- public void TestGetFileNameWithoutExtension() {
- string testFileName = Path.GetFileNameWithoutExtension( path1 );
-
- AssertEquals( "test", testFileName );
- }
-
- public void TestGetFullPath() {
- string testFullPath = Path.GetFullPath( "foo.txt" );
- // AssertEquals( "foo.txt", testFullPath );
- }
-
- public void TestGetTempPath() {
- string getTempPath = Path.GetTempPath();
- AssertEquals( Environment.GetEnvironmentVariable( "TEMP" ) + '\\', getTempPath );
- }
-
- /*
- // Not sure what's an appropriate test for this function? Maybe just
- // check if the temp file exists as advertised
- //
- public void TestGetTempFileName() {
- string getTempFileName = Path.GetTempFileName();
- //Console.WriteLine( getTempFileName );
- }*/
-
- public void TestHasExtension() {
- AssertEquals( true, Path.HasExtension( "foo.txt" ) );
- AssertEquals( false, Path.HasExtension( "foo" ) );
- AssertEquals( true, Path.HasExtension( path1 ) );
- AssertEquals( false, Path.HasExtension( path2 ) );
- }
-
- public void TestRooted() {
- AssertEquals( true, Path.IsPathRooted( "c:\\winnt\\" ) );
- AssertEquals( false, Path.IsPathRooted( "system32\\drivers\\" ) );
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.IO/StreamReaderTest.cs b/mcs/class/corlib/Test/System.IO/StreamReaderTest.cs
deleted file mode 100644
index 0e340620451..00000000000
--- a/mcs/class/corlib/Test/System.IO/StreamReaderTest.cs
+++ /dev/null
@@ -1,488 +0,0 @@
-// StreamReaderTest.cs - NUnit Test Cases for the SystemIO.StreamReader class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class StreamReaderTest : TestCase
-{
- public StreamReaderTest() :
- base ("MonoTests.System.StreamReaderTest testsuite") {}
- public StreamReaderTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StreamReaderTest));
- }
- }
-
- // assume testing pwd is corlib/Test
- private string _codeFileName = "System.IO/StreamReaderTest.cs";
-
- public void TestCtor1() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((Stream)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_codeFileName, FileMode.Open, FileAccess.Write);
- try {
- StreamReader r = new StreamReader(f);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f);
- AssertNotNull("no stream reader", r);
- r.Close();
- f.Close();
- }
- }
- public void TestCtor2() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("");
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((string)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentfile");
- } catch (FileNotFoundException) {
- errorThrown = true;
- }
- Assert("fileNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentdir/file");
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("!$what? what? Huh? !$*#");
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- StreamReader r = new StreamReader(_codeFileName);
- AssertNotNull("no stream reader", r);
- r.Close();
- }
- }
- public void TestCtor3() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((Stream)null, false);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_codeFileName, FileMode.Open, FileAccess.Write);
- try {
- StreamReader r = new StreamReader(f, false);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f, false);
- AssertNotNull("no stream reader", r);
- r.Close();
- f.Close();
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((Stream)null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_codeFileName, FileMode.Open, FileAccess.Write);
- try {
- StreamReader r = new StreamReader(f, true);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f, true);
- AssertNotNull("no stream reader", r);
- r.Close();
- f.Close();
- }
- }
- public void TestCtor4() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("", false);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((string)null, false);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentfile", false);
- } catch (FileNotFoundException) {
- errorThrown = true;
- }
- Assert("fileNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentdir/file", false);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("!$what? what? Huh? !$*#", false);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- StreamReader r = new StreamReader(_codeFileName, false);
- AssertNotNull("no stream reader", r);
- r.Close();
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("", true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((string)null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentfile", true);
- } catch (FileNotFoundException) {
- errorThrown = true;
- }
- Assert("fileNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentdir/file", true);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("!$what? what? Huh? !$*#", true);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- StreamReader r = new StreamReader(_codeFileName, true);
- AssertNotNull("no stream reader", r);
- r.Close();
- }
- }
-
- // TODO - Ctor with Encoding
-
- public void TestBaseStream() {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f);
- //AssertEquals("wrong base stream ", f.Name, ((FileStream)r.BaseStream).Name);
- AssertEquals("wrong base stream ", f, r.BaseStream);
- r.Close();
- f.Close();
- }
-
- public void TestCurrentEncoding() {
- StreamReader r = new StreamReader(_codeFileName);
- AssertEquals("wrong encoding",
- Encoding.UTF8, r.CurrentEncoding);
- }
-
- // TODO - Close - annoying spec - won't commit to any exceptions. How to test?
- // TODO - DiscardBufferedData - I have no clue how to test this function.
-
- public void TestPeek() {
- // FIXME - how to get an IO Exception?
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- m.Close();
- int nothing = r.Peek();
- } catch (ObjectDisposedException) {
- errorThrown = true;
- }
- Assert("nothing-to-peek-at error not thrown", errorThrown);
- }
- {
- Byte[] b = {1, 2, 3, 4, 5, 6};
- MemoryStream m = new MemoryStream(b);
-
- StreamReader r = new StreamReader(m);
- for (int i = 1; i <= 6; i++) {
- AssertEquals("peek incorrect", i, r.Peek());
- r.Read();
- }
- AssertEquals("should be none left", -1, r.Peek());
- }
- }
-
- public void TestRead() {
- // FIXME - how to get an IO Exception?
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- m.Close();
- int nothing = r.Read();
- } catch (ObjectDisposedException) {
- errorThrown = true;
- }
- Assert("nothing-to-read error not thrown", errorThrown);
- }
- {
- Byte[] b = {1, 2, 3, 4, 5, 6};
- MemoryStream m = new MemoryStream(b);
-
- StreamReader r = new StreamReader(m);
- for (int i = 1; i <= 6; i++) {
- AssertEquals("read incorrect", i, r.Read());
- }
- AssertEquals("Should be none left", -1, r.Read());
- }
-
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- r.Read(null, 0, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("null buffer error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- Char[] c = new Char[1];
- r.Read(c, 0, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("too-long range error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- Char[] c = new Char[1];
- r.Read(c, -1, 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- Char[] c = new Char[1];
- r.Read(c, 0, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error not thrown", errorThrown);
- }
- {
- Byte[] b = {(byte)'a', (byte)'b', (byte)'c',
- (byte)'d', (byte)'e', (byte)'f',
- (byte)'g'};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
-
- char[] buffer = new Char[7];
- char[] target = {'g','d','e','f','b','c','a'};
- r.Read(buffer, 6, 1);
- r.Read(buffer, 4, 2);
- r.Read(buffer, 1, 3);
- r.Read(buffer, 0, 1);
- for (int i = 0; i < target.Length; i++) {
- AssertEquals("read no work",
- target[i], buffer[i]);
- }
- }
- }
-
- public void TestReadLine() {
- // TODO Out Of Memory Exc? IO Exc?
- Byte[] b = new Byte[8];
- b[0] = (byte)'a';
- b[1] = (byte)'\n';
- b[2] = (byte)'b';
- b[3] = (byte)'\n';
- b[4] = (byte)'c';
- b[5] = (byte)'\n';
- b[6] = (byte)'d';
- b[7] = (byte)'\n';
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("line doesn't match", "a", r.ReadLine());
- AssertEquals("line doesn't match", "b", r.ReadLine());
- AssertEquals("line doesn't match", "c", r.ReadLine());
- AssertEquals("line doesn't match", "d", r.ReadLine());
- AssertEquals("line doesn't match", null, r.ReadLine());
- }
-
- public void TestReadToEnd() {
- // TODO Out Of Memory Exc? IO Exc?
- Byte[] b = new Byte[8];
- b[0] = (byte)'a';
- b[1] = (byte)'\n';
- b[2] = (byte)'b';
- b[3] = (byte)'\n';
- b[4] = (byte)'c';
- b[5] = (byte)'\n';
- b[6] = (byte)'d';
- b[7] = (byte)'\n';
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("line doesn't match", "a\nb\nc\nd\n", r.ReadToEnd());
- AssertEquals("line doesn't match", "", r.ReadToEnd());
- }
-}
-}
diff --git a/mcs/class/corlib/Test/System.IO/StreamWriterTest.cs b/mcs/class/corlib/Test/System.IO/StreamWriterTest.cs
deleted file mode 100644
index 6b7ea9dbc9b..00000000000
--- a/mcs/class/corlib/Test/System.IO/StreamWriterTest.cs
+++ /dev/null
@@ -1,319 +0,0 @@
-// StreamWriterTest.cs - NUnit Test Cases for the SystemIO.StreamWriter class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class StreamWriterTest : TestCase
-{
- public StreamWriterTest() :
- base ("MonoTests.System.StreamWriterTest testsuite") {}
- public StreamWriterTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StreamWriterTest));
- }
- }
-
- private string _codeFileName = "StreamWriterTest.temp";
- private string _thisCodeFileName = "System.IO/StreamReaderTest.cs";
-
- // TODO - ctors
- public void TestCtor1() {
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((Stream)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_thisCodeFileName,
- FileMode.Open,
- FileAccess.Read);
- try {
- StreamWriter r = new StreamWriter(f);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Append,
- FileAccess.Write);
- StreamWriter r = new StreamWriter(f);
- AssertNotNull("no stream writer", r);
- r.Close();
- f.Close();
- }
- }
- public void TestCtor2() {
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("");
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((string)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("nonexistentdir/file");
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#");
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- // TODO - Security/Auth exceptions
- {
- StreamWriter r = new StreamWriter(_codeFileName);
- AssertNotNull("no stream writer", r);
- r.Close();
- }
- }
- public void TestCtor3() {
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("", false);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((string)null, false);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("nonexistentdir/file", false);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#", false);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- StreamWriter r = new StreamWriter(_codeFileName, false);
- AssertNotNull("no stream writer", r);
- r.Close();
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("", true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((string)null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("nonexistentdir/file", true);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#", true);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- StreamWriter r = new StreamWriter(_codeFileName, true);
- AssertNotNull("no stream writer", r);
- r.Close();
- }
- }
-
- // TODO - ctors with Encoding
-
- // TODO - AutoFlush
- public void TestAutoFlush() {
- {
- MemoryStream m = new MemoryStream();
- StreamWriter w = new StreamWriter(m);
- w.AutoFlush = false;
- w.Write(1);
- w.Write(2);
- w.Write(3);
- w.Write(4);
- AssertEquals("Should be nothing before flush",
- 0, m.Length);
- w.Flush();
- AssertEquals("Should be something after flush",
- 4, m.Length);
- }
- {
- MemoryStream m = new MemoryStream();
- StreamWriter w = new StreamWriter(m);
- w.AutoFlush = true;
- w.Write(1);
- w.Write(2);
- w.Write(3);
- w.Write(4);
- AssertEquals("Should be something before flush",
- 4, m.Length);
- w.Flush();
- AssertEquals("Should be something after flush",
- 4, m.Length);
- }
- }
-
- public void TestBaseStream() {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Append,
- FileAccess.Write);
- StreamWriter r = new StreamWriter(f);
- AssertEquals("wrong base stream ", f, r.BaseStream);
- r.Close();
- f.Close();
- }
-
- public void TestEncoding() {
- StreamWriter r = new StreamWriter(_codeFileName);
- AssertEquals("wrong encoding",
- Encoding.UTF8.GetType(), r.Encoding.GetType());
- r.Close();
- }
-
- // TODO - Close - not entirely sure how to test Close
- //public void TestClose() {
- //{
- //MemoryStream m = new MemoryStream();
- //StreamWriter w = new StreamWriter(m);
- //StreamReader r = new StreamReader(m);
- //w.Write(1);
- //w.Write(2);
- //w.Write(3);
- //w.Write(4);
- //AssertEquals("Should be nothing before close",
- //0, m.Length);
- //AssertEquals("Should be nothing in reader",
- //-1, r.Peek());
- //w.Close();
- //AssertEquals("Should be something after close",
- //1, r.Peek());
- //}
- //}
-
- // TODO - Flush
- public void TestFlush() {
- {
- bool errorThrown = false;
- try {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Append,
- FileAccess.Write);
- StreamWriter r = new StreamWriter(f);
- r.Close();
- r.Flush();
- } catch (ObjectDisposedException) {
- errorThrown = true;
- }
- Assert("can't flush closed error not thrown", errorThrown);
- }
- {
- MemoryStream m = new MemoryStream();
- StreamWriter w = new StreamWriter(m);
- w.Write(1);
- w.Write(2);
- w.Write(3);
- w.Write(4);
- AssertEquals("Should be nothing before flush",
- 0, m.Length);
- w.Flush();
- AssertEquals("Should be something after flush",
- 4, m.Length);
- }
- }
-
- // TODO - Write - test errors, functionality tested in TestFlush.
-}
-}
diff --git a/mcs/class/corlib/Test/System.IO/StringReaderTest.cs b/mcs/class/corlib/Test/System.IO/StringReaderTest.cs
deleted file mode 100644
index 9e6be0fbb71..00000000000
--- a/mcs/class/corlib/Test/System.IO/StringReaderTest.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add some testing for exceptions
-//
-// TODO: Some of the tests could be a bit more thorough
-//
-
-using NUnit.Framework;
-using System.IO;
-using System;
-
-namespace MonoTests.System.IO {
-
-public class StringReaderTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StringReaderTest));
- }
- }
-
- public StringReaderTest() : base ("MonoTests.System.IO.StringReaderTest testcase") { }
- public StringReaderTest( string name ): base(name) { }
-
- public void TestPeekRead() {
- StringReader reader = new StringReader( "Test String" );
-
- int c = reader.Peek();
- AssertEquals( c, 'T' );
-
- int read = reader.Read();
-
- AssertEquals( read, 'T' );
-
- c = reader.Peek();
-
- AssertEquals( c, 'e' );
- }
-
- public void TestRead() {
- StringReader reader = new StringReader( "Test String" );
-
- /* Read from start of string */
- char[] test = new char[5];
-
- int charsRead = reader.Read( test, 0, 5 );
-
- AssertEquals( 5, charsRead );
- AssertEquals( "Test ", new String(test) );
-
- /* Read to end of string */
- //reader = new StringReader( "Test String" );
-
- test = new char[6];
- charsRead = reader.Read( test, 0, 6 );
- AssertEquals( 6, charsRead);
- AssertEquals( "String", new String( test ) );
-
- /* Read past end of string */
-
- test = new char[6];
- reader = new StringReader( "Foo" );
- charsRead = reader.Read( test, 0, 6 );
- AssertEquals( 3, charsRead );
- AssertEquals( "Foo\0\0\0", new String( test ) );
-
- }
-
- public void TestReadEOL() {
- StringReader reader = new StringReader( "Line1\rLine2\r\nLine3\nLine4" );
-
- string test = reader.ReadLine();
-
- AssertEquals( "Line1", test );
-
- test = reader.ReadLine();
-
- AssertEquals( "Line2", test );
-
- test = reader.ReadLine();
-
- AssertEquals( "Line3", test );
-
- test = reader.ReadLine();
-
- AssertEquals( "Line4", test );
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.IO/StringWriterTest.cs b/mcs/class/corlib/Test/System.IO/StringWriterTest.cs
deleted file mode 100644
index bf254ace832..00000000000
--- a/mcs/class/corlib/Test/System.IO/StringWriterTest.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add some testing for exceptions
-//
-
-using NUnit.Framework;
-using System.IO;
-using System;
-using System.Text;
-
-namespace MonoTests.System.IO {
-
-public class StringWriterTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StringWriterTest));
- }
- }
-
- public StringWriterTest() : base ("MonoTests.System.IO.StringWriterTest testcase") { }
- public StringWriterTest( string name ): base(name) { }
-
- public void TestConstructors() {
- StringBuilder sb = new StringBuilder("Test String");
-
- StringWriter writer = new StringWriter( sb );
- AssertEquals( sb, writer.GetStringBuilder() );
- }
-
- public void TestWrite() {
- StringWriter writer = new StringWriter();
-
- AssertEquals( String.Empty, writer.ToString() );
-
- writer.Write( 'A' );
- AssertEquals( "A", writer.ToString() );
-
- writer.Write( " foo" );
- AssertEquals( "A foo", writer.ToString() );
-
-
- char[] testBuffer = "Test String".ToCharArray();
-
- writer.Write( testBuffer, 0, 4 );
- AssertEquals( "A fooTest", writer.ToString() );
-
- writer.Write( testBuffer, 5, 6 );
- AssertEquals( "A fooTestString", writer.ToString() );
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Resources/AllTests.cs b/mcs/class/corlib/Test/System.Resources/AllTests.cs
deleted file mode 100644
index 0ea192b33a9..00000000000
--- a/mcs/class/corlib/Test/System.Resources/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// MonoTests.System.Resources.AllTests.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Resources {
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(ResourceReaderTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Resources/ChangeLog b/mcs/class/corlib/Test/System.Resources/ChangeLog
deleted file mode 100644
index 10a4a8f4928..00000000000
--- a/mcs/class/corlib/Test/System.Resources/ChangeLog
+++ /dev/null
@@ -1,17 +0,0 @@
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReaderTest.cs: Fix path name to resource files
-
-2002-01-25 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs:
- * Empty.resources:
- * MyResources.resources: Added files
- * ResourceReaderTest.cs: Test the enumerator
-
-2002-01-24 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReaderTest.cs: Add new file. This test is not done yet.
- Wanted to save it in cvs for 'disaster recovery' purposes.
- Just in case.
-
diff --git a/mcs/class/corlib/Test/System.Resources/Empty.resources b/mcs/class/corlib/Test/System.Resources/Empty.resources
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mcs/class/corlib/Test/System.Resources/Empty.resources
+++ /dev/null
diff --git a/mcs/class/corlib/Test/System.Resources/MyResources.resources b/mcs/class/corlib/Test/System.Resources/MyResources.resources
deleted file mode 100644
index b486e9e5111..00000000000
--- a/mcs/class/corlib/Test/System.Resources/MyResources.resources
+++ /dev/null
Binary files differ
diff --git a/mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs b/mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs
deleted file mode 100644
index 5c15a5f63a3..00000000000
--- a/mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// MonoTests.System.Resources.ResourceReaderTest.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-
-using System;
-using System.Resources;
-using System.IO;
-
-using System.Collections;
-using MonoTests.System.Resources;
-using NUnit.Framework;
-
-namespace MonoTests.System.Resources {
-
- public class ResourceReaderTest : TestCase {
- private static string m_ResourceFile = "System.Resources\\MyResources.resources";
- private static string m_BadResourceFile = "System.Resources\\Empty.resources";
-
- public ResourceReaderTest() : base ("MonoTests.System.Resources.ResourceReaderTest testcase") { }
- public ResourceReaderTest(String name) : base(name) {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ResourceReaderTest));
- }
- }
-
- protected override void SetUp() {
- }
-
- public void TestConstructorStringExceptions() {
- ResourceReader r;
- try {
- r = new ResourceReader((String)null);
- Fail("Should throw exception on null");
- } catch{}
- try {
- r = new ResourceReader("");
- Fail("Should throw exception on empty path");
- } catch{}
- try {
- // use a file name that is *very* unlikely to exsist
- r = new ResourceReader("j38f8axvnn9h38hfa9nxn93f8hav4zvag87vvah32o");
- Fail("Should throw exception on file not found");
- } catch{}
- try {
- r = new ResourceReader(m_BadResourceFile);
- Fail("Should throw exception on bad resource file");
- }
- catch {}
- }
-
- public void TestConstructorString() {
- if (!File.Exists(m_ResourceFile)) {
- Fail("Resource file is not where it should be:" + Directory.GetCurrentDirectory()+ "\\" + m_ResourceFile);
- }
- ResourceReader r = null;
- try {
- r = new ResourceReader(m_ResourceFile);
- }
- catch {
- Fail("Should have been able to open resource file.");
- }
- finally {
- if (null != r)
- r.Close();
- }
- Assert("String constructor should not be null", null != r);
- }
-
- public void TestConstructorStreamExceptions() {
- ResourceReader r;
- try {
- r = new ResourceReader((Stream)null);
- Fail("Should throw exception on null");
- } catch{}
-
- try {
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- stream.Close();
- r = new ResourceReader(stream);
- Fail("Should throw exception on cannot read");
- } catch{}
- }
-
- public void TestStream(){
- ResourceReader r = null;
- try {
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- r = new ResourceReader(stream);
- }
- catch{
- Fail("Should not throw exception constructing from stream");
- }
- finally {
- if (null != r) {
- r.Close();
- }
- }
- }
-
- public void TestClose() {
- ResourceReader r = null;
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- r = new ResourceReader(stream);
- r.Close();
- try {
- stream = new FileStream (m_ResourceFile, FileMode.Open);
- }
- catch{
- Fail("Should be able to open the stream again after close");
- }
- finally {
- if (null != stream) {
- stream.Close();
- }
- }
- }
-
- public void TestEnumerator(){
- ResourceReader reader = null;
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- reader = new ResourceReader(stream);
- IDictionaryEnumerator en = reader.GetEnumerator();
- // Goes through the enumerator, printing out the key and value pairs.
- while (en.MoveNext()) {
- DictionaryEntry de = (DictionaryEntry)en.Current;
- Assert("Current.Key should not be empty",String.Empty != (string)de.Key);
- Assert("Current.Value should not be empty",String.Empty != (string)de.Value);
- Assert("Current.Value should not be empty",String.Empty != (string)de.Value);
- Assert("Entry.Key should not be empty",String.Empty != (string)en.Key);
- Assert("Entry.Value should not be empty",String.Empty != (string)en.Value);
- }
- reader.Close();
- }
- } // class ResourceReaderTest
-} // namespace MonoTests.System.Resources \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs b/mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs
deleted file mode 100644
index 96b1e4f2500..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.AllCryptoTests.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
- /// <summary>
- /// Combines all available crypto unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(SymmetricAlgorithmTest.Suite);
- suite.AddTest(AsymmetricAlgorithmTest.Suite);
- suite.AddTest(RNGCryptoServiceProviderTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs
deleted file mode 100755
index 37da7bf16fe..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.AsymmetricAlgorithmTest.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class AsymmetricAlgorithmTest : TestCase {
- private AsymmetricAlgorithm _algo;
-
- public AsymmetricAlgorithmTest() : base ("MonoTests.System.Security.Cryptography.AsymmetricAlgorithmTest testcase") {
- _algo = null;
- }
- public AsymmetricAlgorithmTest(String name) : base(name) {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(AsymmetricAlgorithmTest));
- }
- }
-
- protected override void SetUp() {
- _algo = AsymmetricAlgorithm.Create();
- }
-
- private void SetDefaultData() {
- }
-
- public void TestProperties() {
- Assert("Properties (1)", _algo != null);
-
- bool thrown = false;
- try {
- KeySizes[] keys = _algo.LegalKeySizes;
- foreach (KeySizes myKey in keys) {
- for (int i=myKey.MinSize; i<=myKey.MaxSize; i+=myKey.SkipSize) {
- _algo.KeySize = i;
- }
- }
- } catch (CryptographicException) {thrown=true;}
- Assert("Properties (2)", !thrown);
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs
deleted file mode 100644
index f9d16d58df1..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.RNGCryptoServiceProviderTest.cs
-//
-// Author:
-// Mark Crichton (crichton@gimp.org)
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class RNGCryptoServiceProviderTest : TestCase {
- private RNGCryptoServiceProvider _algo;
-
- public RNGCryptoServiceProviderTest() : base ("MonoTests.System.Security.Cryptography.RNGCryptoServiceProviderTest testcase") {
- _algo = null;
- }
- public RNGCryptoServiceProviderTest(String name) : base(name) {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(RNGCryptoServiceProviderTest));
- }
- }
-
- protected override void SetUp() {
- _algo = new RNGCryptoServiceProvider();
- }
-
- private void SetDefaultData() {
- }
-
- public void TestProperties() {
- Assert("Properties (1)", _algo != null);
-
- byte[] random = new Byte[25];
-
- // The C code doesn't throw an exception yet.
- _algo.GetBytes(random);
-
- // This one we can check...
- _algo.GetNonZeroBytes(random);
-
- foreach (Byte rnd_byte in random) {
- Assert("Properties (2)", rnd_byte != 0);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs
deleted file mode 100755
index 0c4c8786925..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.SymmetricAlgorithmTest.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class SymmetricAlgorithmTest : TestCase {
- private SymmetricAlgorithm _algo;
-
- public SymmetricAlgorithmTest() : base ("MonoTests.System.Security.Cryptography.SymmetricAlgorithmTest testcase") {
- _algo = null;
- }
- public SymmetricAlgorithmTest(String name) : base(name) {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(SymmetricAlgorithmTest));
- }
- }
-
- protected override void SetUp() {
- _algo = SymmetricAlgorithm.Create();
- }
-
- private void SetDefaultData() {
- }
-
- public void TestProperties() {
- Assert("Properties (1)", _algo != null);
-
- bool thrown = false;
- try
- {
- // try setting an illegal blocksize -> must throw an exception
- _algo.BlockSize = 12;
- } catch (CryptographicException) {thrown = true;}
- Assert("Properties (2)", thrown);
-
- byte[] key = _algo.Key;
- Assert("Properties (3)", key != null);
-
- thrown = false;
- try {
- KeySizes[] keys = _algo.LegalKeySizes;
- foreach (KeySizes myKey in keys) {
- for (int i=myKey.MinSize; i<=myKey.MaxSize; i+=myKey.SkipSize) {
- _algo.KeySize = i;
- }
- }
- } catch (CryptographicException) {thrown=true;}
- Assert("Properties (4)", !thrown);
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs b/mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs
deleted file mode 100644
index 95782000656..00000000000
--- a/mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// MonoTests.System.Security.Permissions.AllTests.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Permissions {
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(FileIOPermissionTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Permissions/ChangeLog b/mcs/class/corlib/Test/System.Security.Permissions/ChangeLog
deleted file mode 100644
index bcb7d5ab136..00000000000
--- a/mcs/class/corlib/Test/System.Security.Permissions/ChangeLog
+++ /dev/null
@@ -1,11 +0,0 @@
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermissionTest.cs: Remove intersect test where it was trying
- to intersect a permission with itself. This throws an exception
- with mscorlib.
-
-2002-01-14 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermissionTest.cs: New File.
- * AllTests.cs: New File.
-
diff --git a/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs b/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs
deleted file mode 100644
index e9338e56591..00000000000
--- a/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs
+++ /dev/null
@@ -1,284 +0,0 @@
-//
-// MonoTests.System.Security.Permissions.FileIOPermissionTest.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Permissions {
-
- public class FileIOPermissionTest : TestCase {
-
- public FileIOPermissionTest() : base ("MonoTests.System.Security.Permissions.FileIOPermissionTest testcase") { }
- public FileIOPermissionTest(String name) : base(name) {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(FileIOPermissionTest));
- }
- }
-
- protected override void SetUp() {
- }
-
- private void SetDefaultData() {
- }
-
- public void TestConstructorPermissionState() {
- FileIOPermission p;
- p = new FileIOPermission(PermissionState.None);
- AssertEquals("Should be Restricted", false, p.IsUnrestricted());
- p = new FileIOPermission(PermissionState.Unrestricted);
- AssertEquals("Should be Unrestricted", true, p.IsUnrestricted());
- try{
- p = new FileIOPermission((PermissionState)77);
- Fail("Should have thrown an exception on invalid PermissionState");
- }
- catch{
- // we should be here if things are working. nothing to do
- }
- }
-
- public void TestConstructorString() {
- FileIOPermission p;
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, "this path is not rooted");
- Fail("Should have thrown an exception on path not rooted");
- }
- catch{}
-
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, "<this is not a valid path>");
- Fail("Should have thrown an exception on invalid characters in path");
- }
- catch{}
-
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, "\\\\mycomputer\\test*");
- Fail("Should have thrown an exception on wildcards not allowed in path");
- }
- catch{}
-
- try{
- p = new FileIOPermission((FileIOPermissionAccess)77, "c:\\temp");
- Fail("Should have thrown an exception on invalid access value");
- }
- catch{}
-
- string pathToAdd = "c:\\temp";
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathToAdd);
- string[] pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Does not contain correct number of paths. Expected 1 but got: "+pathsInPermission.Length, pathsInPermission.Length == 1);
- Assert("Does not contain expected path from constructor: "+pathToAdd, pathsInPermission[0] == pathToAdd);
- }
-
- public void TestConstructorStringArray() {
- FileIOPermission p;
- string[] pathArrayGood = {"c:\\temp1", "d:\\temp2"};
- string[] pathArrayBad = {"c:\\temp1", "d:\\temp*"};
- string[] pathsInPermission;
-
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, pathArrayBad);
- Fail("Should have thrown an exception on wildcards not allowed in path");
- }
- catch{}
-
- try{
- p = new FileIOPermission((FileIOPermissionAccess)77, pathArrayGood);
- Fail("Should have thrown an exception on invalid access value");
- }
- catch{}
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Does not contain correct number of paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
-
- }
-
- public void TestAddPathListStringArray() {
- FileIOPermission p;
- string[] pathArrayGood = {"c:\\temp1", "d:\\temp2"};
- string[] pathsInPermission;
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Does not contain correct number of paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
-
- p.AddPathList(FileIOPermissionAccess.Append, pathArrayGood);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should still contain correct number Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Append);
- Assert("Should contain correct number of Append paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
- }
-
- public void TestIntersect() {
- FileIOPermission p;
- FileIOPermission p2;
- FileIOPermission unrestricted;
- FileIOPermission intersection;
- string[] pathArrayGood = {"c:\\temp1\\", "d:\\temp2\\"};
- string[] pathArrayGood2 = {"c:\\temp1\\", "d:\\temp2\\", "z:\\something"};
- string[] pathsInPermission;
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- p.AllFiles = FileIOPermissionAccess.Append;
- p.AllLocalFiles = FileIOPermissionAccess.Write;
-
- unrestricted = new FileIOPermission(PermissionState.Unrestricted);
-
- intersection = (FileIOPermission)p.Intersect(unrestricted);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have Append bit in AllFiles.", (intersection.AllFiles & FileIOPermissionAccess.Append) != 0);
- Assert("Should have Write bit in AllLocalFiles.", (intersection.AllLocalFiles & FileIOPermissionAccess.Write) != 0);
-
- intersection = (FileIOPermission)unrestricted.Intersect(p);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have Append bit in AllFiles.", (intersection.AllFiles & FileIOPermissionAccess.Append) != 0);
- Assert("Should have Write bit in AllLocalFiles.", (intersection.AllLocalFiles & FileIOPermissionAccess.Write) != 0);
-
- p2 = new FileIOPermission(FileIOPermissionAccess.Append | FileIOPermissionAccess.Read, pathArrayGood2);
- p2.AllFiles = FileIOPermissionAccess.Append | FileIOPermissionAccess.Write;
- p2.AllLocalFiles = FileIOPermissionAccess.Write | FileIOPermissionAccess.Read;
- intersection = (FileIOPermission)p.Intersect(p2);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have only Append bit in AllFiles.", intersection.AllFiles == FileIOPermissionAccess.Append);
- Assert("Should have only Write bit in AllLocalFiles.", intersection.AllLocalFiles == FileIOPermissionAccess.Write);
-
- intersection = (FileIOPermission)p2.Intersect(p);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have only Append bit in AllFiles.", intersection.AllFiles == FileIOPermissionAccess.Append);
- Assert("Should have only Write bit in AllLocalFiles.", intersection.AllLocalFiles == FileIOPermissionAccess.Write);
- }
-
- public void TestIsSubsetOf() {
- FileIOPermission p;
- FileIOPermission p2;
- FileIOPermission unrestricted;
- string[] pathArrayGood = {"c:\\temp1\\", "d:\\temp2\\"};
- string[] pathArrayGood2 = {"c:\\temp1\\", "d:\\temp2\\", "z:\\something"};
-
- unrestricted = new FileIOPermission(PermissionState.Unrestricted);
- Assert("IsSubsetOf reflective test failed", unrestricted.IsSubsetOf(unrestricted));
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- p.AllFiles = FileIOPermissionAccess.Append;
- p.AllLocalFiles = FileIOPermissionAccess.Write;
- Assert("IsSubsetOf reflective test failed", p.IsSubsetOf(p));
- Assert("IsSubsetOf false test failed", !unrestricted.IsSubsetOf(p));
- Assert("IsSubsetOf true test failed", p.IsSubsetOf(unrestricted));
-
- p2 = new FileIOPermission(FileIOPermissionAccess.Append | FileIOPermissionAccess.Read, pathArrayGood2);
- p2.AllFiles = FileIOPermissionAccess.Append | FileIOPermissionAccess.Write;
- p2.AllLocalFiles = FileIOPermissionAccess.Write | FileIOPermissionAccess.Read;
- Assert("IsSubsetOf reflective test failed", p2.IsSubsetOf(p2));
-
- Assert("IsSubsetOf true test failed", p.IsSubsetOf(p2));
- Assert("IsSubsetOf false test failed", !p2.IsSubsetOf(p));
- }
-
- public void TestUnion() {
- FileIOPermission p;
- FileIOPermission p2;
- FileIOPermission unrestricted;
- FileIOPermission union;
- string[] pathArrayGood = {"c:\\temp1\\", "d:\\temp2\\"};
- string[] pathArrayGood2 = {"c:\\temp1\\", "d:\\temp2\\", "z:\\something"};
- string[] pathsInPermission;
-
- unrestricted = new FileIOPermission(PermissionState.Unrestricted);
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- union = (FileIOPermission)unrestricted.Union(p);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should get an unrestricted permission", union.IsUnrestricted());
- Assert("Path list should be empty", pathsInPermission == null);
-
- union = (FileIOPermission)p.Union(unrestricted);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should get an unrestricted permission", union.IsUnrestricted());
- Assert("Path list should be empty", pathsInPermission == null);
-
- p2 = new FileIOPermission(FileIOPermissionAccess.Append, pathArrayGood2);
-
- union = (FileIOPermission)p.Union(p2);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Path list should have 2 for Read", pathsInPermission.Length == pathArrayGood.Length);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Append);
- Assert("Path list should have 3 for Append", pathsInPermission.Length == pathArrayGood2.Length);
-
- union = (FileIOPermission)p2.Union(p);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Path list should have 2 for Read", pathsInPermission.Length == pathArrayGood.Length);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Append);
- Assert("Path list should have 3 for Append", pathsInPermission.Length == pathArrayGood2.Length);
- }
-
- public void TestFromXML() {
- FileIOPermission p = new FileIOPermission(PermissionState.None);
- SecurityElement esd;
- string[] pathsInPermission;
-
- esd = new SecurityElement("IPermission");
- esd.AddAttribute("class", "FileIOPermission");
- esd.AddAttribute("version", "1");
- esd.AddAttribute("Unrestricted", "true");
- p.FromXml(esd);
- Assert("Should get an unrestricted permission", p.IsUnrestricted());
-
- esd = new SecurityElement("IPermission");
- esd.AddAttribute("class", "FileIOPermission");
- esd.AddAttribute("version", "1");
- esd.AddAttribute("Read", "c:\\temp;d:\\temp2");
- esd.AddAttribute("Write", "c:\\temp;d:\\temp2;z:\\temp3");
-
- p = new FileIOPermission(PermissionState.None);
- p.FromXml(esd);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Path list should have 2 for Read", pathsInPermission.Length == 2);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Write);
- Assert("Path list should have 2 for Write", pathsInPermission.Length == 3);
- }
-
- public void TestToXML() {
- FileIOPermission p;
- SecurityElement esd;
- string[] pathsInPermission;
- string read;
- string[] pathArrayGood = {"c:\\temp1\\", "d:\\temp2\\"};
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- esd = p.ToXml();
- Assert("Esd tag incorrect", esd.Tag == "IPermission");
- Assert("Esd version incorrect", (String)esd.Attributes["version"] == "1");
- read = (String)esd.Attributes["Read"];
- pathsInPermission = read.Split(';');
- Assert("Path list should have 2 for Read", pathsInPermission.Length == 2);
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Security.Policy/AllTests.cs b/mcs/class/corlib/Test/System.Security.Policy/AllTests.cs
deleted file mode 100644
index a0632fdd70c..00000000000
--- a/mcs/class/corlib/Test/System.Security.Policy/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// MonoTests.System.Security.Policy.AllTests.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Policy {
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(CodeGroupTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Policy/ChangeLog b/mcs/class/corlib/Test/System.Security.Policy/ChangeLog
deleted file mode 100644
index 51b9aae2eab..00000000000
--- a/mcs/class/corlib/Test/System.Security.Policy/ChangeLog
+++ /dev/null
@@ -1,15 +0,0 @@
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add new file.
-
-2002-02-07 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroupTest.cs: Tests everything except the (To|From)Xml methods.
-
-2002-02-01 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroupTest.cs: Still not done, checking in now just in case
-
-2002-01-30 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroupTest.cs: New File. Not done, but checking in now just in case \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs b/mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs
deleted file mode 100644
index 73415017c3d..00000000000
--- a/mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs
+++ /dev/null
@@ -1,248 +0,0 @@
-//
-// MonoTests.System.Security.Policy.CodeGroupTest
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak, All rights reserved.
-
-using NUnit.Framework;
-using System;
-using System.Security;
-using System.Security.Policy;
-using System.Security.Permissions;
-
-namespace MonoTests.System.Security.Policy
-{
-
- public class CodeGroupTest : TestCase
- {
-
- public CodeGroupTest( string name ): base(name)
- {
- }
-
- public CodeGroupTest() : base("CodeGroupTest")
- {
- }
-
- public static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(CodeGroupTest));
- }
- }
-
- protected override void SetUp()
- {
- }
-
- public class MyCodeGroup : CodeGroup
- {
- public MyCodeGroup(IMembershipCondition membershipCondition,
- PolicyStatement policy) :base(membershipCondition, policy)
- {
- }
-
- public override CodeGroup Copy()
- {
- return this;
- }
-
- public override string MergeLogic
- {
- get
- {
- return "";
- }
- }
-
- public override PolicyStatement Resolve( Evidence evidence)
- {
- return (PolicyStatement)null;
- }
-
- public override CodeGroup ResolveMatchingCodeGroups(Evidence evidence)
- {
- return this;
- }
- }
-
- public void TestConstructorExceptions()
- {
- MyCodeGroup cg;
- try
- {
- cg = new MyCodeGroup(null, null);
- Fail("Constructor should throw exception on null paramters");
- }
- catch(Exception e)
- {
- Assert("Should have caught an ArgumentNull Exception", e is ArgumentNullException);
- }
- }
-
- public void TestConstructor()
- {
- MyCodeGroup cg = null;
- try
- {
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- Assert("PolicyStatement property not set correctly by constructor.", cg.PolicyStatement != null);
- Assert("MembershipCondition property not set correctly by constructor.", cg.MembershipCondition != null);
- }
- catch(Exception e)
- {
- Fail("Constructor failed. Exception caught was: " + e.ToString());
- }
- }
-
- public void TestDescriptionProperty()
- {
- MyCodeGroup cg = null;
- const string description = "Test Description";
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- cg.Description = description;
- Assert("Description not the expected value", cg.Description == description);
- }
-
- public void TestNameProperty()
- {
- MyCodeGroup cg = null;
- const string name = "Test Name";
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- cg.Name = name;
- Assert("Description not the expected value", cg.Name == name);
- }
-
- public void TestChildren()
- {
- MyCodeGroup cg = null;
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- cg.AddChild(new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.Unrestricted))));
- Assert("Unexpected number of children", cg.Children.Count == 1);
- }
-
- public void TestAttributeStringProperty()
- {
- MyCodeGroup cg = null;
- PolicyStatementAttribute psa = PolicyStatementAttribute.LevelFinal;
- PolicyStatement ps = new PolicyStatement(new PermissionSet(PermissionState.None));
- ps.Attributes = psa;
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- AssertEquals("AttributeString", psa.ToString(), cg.AttributeString);
- }
-
- public void TestPermissionSetNameProperty()
- {
- MyCodeGroup cg = null;
- const string ps_Name = "TestName";
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- AssertEquals("AttributeString", ps_Name, cg.PermissionSetName);
- }
-
- public void TestEquals()
- {
- MyCodeGroup cg = null;
- MyCodeGroup cg2 = null;
- const string ps_Name = "TestName";
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg.Name = "SomeName";
- cg.Description = "Some Description";
- bool isEquals;
- isEquals = cg.Equals(cg);
-
- isEquals = cg.Equals("Not Equal to this");
- Assert("CodeGroup should not be equal to a non-CodeGroup type", !isEquals);
-
- cg2 = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg2.Name = "SomeOtherName";
- cg2.Description = "Some Other Description";
-
- isEquals = cg.Equals(cg2);
- Assert("CodeGroup should not be equal when Name or Description is different", !isEquals);
-
- cg2 = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cg2.Name = cg.Name;
- cg2.Description = cg.Description;
- isEquals = cg.Equals(cg2);
- Assert("CodeGroup should not be equal when Membership Condition is different", !isEquals);
- }
-
- public void TestEqualsWithChildren()
- {
- MyCodeGroup cg = null;
- MyCodeGroup cg2 = null;
- MyCodeGroup cgChild = null;
- const string ps_Name = "TestName";
- bool isEquals;
-
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg.Name = "SomeName";
- cg.Description = "Some Description";
-
- cgChild = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cgChild.Name = "ChildName";
- cgChild.Description = "Child Descripiton";
-
- cg.AddChild(cgChild);
-
- cg2 = new MyCodeGroup(cg.MembershipCondition, cg.PolicyStatement);
- cg2.Name = cg.Name;
- cg2.Description = cg.Description;
-
- isEquals = cg.Equals(cg2);
- Assert("Should be equal when Children are ignored", isEquals);
-
- isEquals = cg.Equals(cg2, true);
- Assert("Should not be equal when Child count is different", !isEquals);
-
- cg2.AddChild(cgChild);
- isEquals = cg2.Equals(cg, true);
- Assert("Should be equal when children are equal", isEquals);
- }
-
-
- public void TestRemoveChild()
- {
- MyCodeGroup cg = null;
- MyCodeGroup cgChild = null;
- MyCodeGroup cgChild2 = null;
- const string ps_Name = "TestName";
-
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg.Name = "SomeName";
- cg.Description = "Some Description";
-
- cgChild = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cgChild.Name = "ChildName";
- cgChild.Description = "Child Descripiton";
-
- cg.AddChild(cgChild);
-
- cgChild2 = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cgChild2.Name = "ChildName2";
- cgChild2.Description = "Child Descripiton 2";
-
- cg.AddChild(cgChild2);
-
- AssertEquals("Should be two children before the call to Remove()", 2, cg.Children.Count);
-
- cg.RemoveChild(cgChild);
-
- AssertEquals("Remaing child does not have correct name", "ChildName2", ((CodeGroup)cg.Children[0]).Name);
- try
- {
- cg.RemoveChild(cgChild);
- Fail("Should have throw error on trying to remove non-existant child");
- }
- catch{}
- }
- } // public class CodeGroupTest
-
-} // namespace MonoTests.System.Security.Policy \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Text/AllTests.cs b/mcs/class/corlib/Test/System.Text/AllTests.cs
deleted file mode 100644
index e6a41d81710..00000000000
--- a/mcs/class/corlib/Test/System.Text/AllTests.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Text {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- //suite.AddTest(StringBuilderTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Text/ChangeLog b/mcs/class/corlib/Test/System.Text/ChangeLog
deleted file mode 100644
index c3d3132f9ba..00000000000
--- a/mcs/class/corlib/Test/System.Text/ChangeLog
+++ /dev/null
@@ -1,8 +0,0 @@
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Remove StringBuilderTest suite. There's a major failure
- when it's included and the test errors aren't displayed.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilderTest.cs: Fixed tests that were failing against mscorlib. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs b/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
deleted file mode 100644
index 9f2677e1f1c..00000000000
--- a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// StringBuilderTest.dll - NUnit Test Cases for the System.Text.StringBuilder class
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// NOTES: I've also run all these tests against the MS implementation of
-// System.Text.StringBuilder to confirm that they return the same results
-// and they do.
-//
-// TODO: Add tests for the AppendFormat methods once the AppendFormat methods
-// are implemented in the StringBuilder class itself
-//
-// TODO: Potentially add more variations on Insert / Append tests for all the
-// possible types. I don't really think that's necessary as they all
-// pretty much just do .ToString().ToCharArray() and then use the Append / Insert
-// CharArray function. The ToString() bit for each type should be in the unit
-// tests for those types, and the unit test for ToCharArray should be in the
-// string test type. If someone wants to add those tests here for completness
-// (and some double checking) then feel free :)
-//
-
-using NUnit.Framework;
-using System.Text;
-using System;
-
-namespace MonoTests.System.Text {
-
-public class StringBuilderTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StringBuilderTest));
- }
- }
-
- public StringBuilderTest( string name ) : base(name) { }
-
-
- private StringBuilder sb;
-
- public void TestConstructor1()
- {
- // check the parameterless ctor
- sb = new StringBuilder();
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- AssertEquals(16, sb.Capacity);
- }
-
- public void TestConstructor2()
- {
- // check ctor that specifies the capacity
- sb = new StringBuilder(10);
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- // check that capacity is not less than default
- AssertEquals(10, sb.Capacity);
-
- sb = new StringBuilder(42);
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- // check that capacity is set
- AssertEquals(42, sb.Capacity);
- }
-
- public void TestConstructor3() {
- // check ctor that specifies the capacity & maxCapacity
- sb = new StringBuilder(444, 1234);
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- AssertEquals(444, sb.Capacity);
- AssertEquals(1234, sb.MaxCapacity);
- }
-
- public void TestConstructor4()
- {
- // check for exception in ctor that specifies the capacity & maxCapacity
- try {
- sb = new StringBuilder(9999, 15);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("Capacity exeeds MaxCapacity");
- }
-
- public void TestConstructor5() {
- String someString = null;
- sb = new StringBuilder(someString);
- AssertEquals("Should be empty string", String.Empty, sb.ToString());
- }
-
- public void TestConstructor6() {
- // check for exception in ctor that prevents startIndex less than zero
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, -1, 3, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("StartIndex not allowed to be less than zero.");
- }
-
- public void TestConstructor7() {
- // check for exception in ctor that prevents length less than zero
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, 2, -222, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("Length not allowed to be less than zero.");
- }
-
- public void TestConstructor8() {
- // check for exception in ctor that ensures substring is contained in given string
- // check that startIndex is not too big
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, 10000, 4, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
- }
-
- public void TestConstructor9() {
- // check for exception in ctor that ensures substring is contained in given string
- // check that length doesn't go beyond end of string
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, 4, 4000, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
- }
-
- public void TestConstructor10() {
- // check that substring is taken properly and made into a StringBuilder
- String someString = "someString";
- sb = new StringBuilder(someString, 4, 6, 18);
- string expected = "String";
- AssertEquals( expected, sb.ToString());
- }
-
- public void TestAppend() {
- StringBuilder sb = new StringBuilder( "Foo" );
- sb.Append( "Two" );
- string expected = "FooTwo";
- AssertEquals( expected, sb.ToString() );
- }
-
- public void TestInsert() {
- StringBuilder sb = new StringBuilder();
-
- AssertEquals( String.Empty, sb.ToString() );
- /* Test empty StringBuilder conforms to spec */
-
- sb.Insert( 0, "Foo" ); /* Test insert at start of empty string */
-
- AssertEquals( "Foo", sb.ToString() );
-
- sb.Insert( 1, "!!" ); /* Test insert not at start of string */
-
- AssertEquals( "F!!oo", sb.ToString() );
-
- sb.Insert( 5, ".." ); /* Test insert at end of string */
-
- AssertEquals( "F!!oo..", sb.ToString() );
-
- sb.Insert( 0, 1234 ); /* Test insert of a number (at start of string) */
-
- // FIX: Why does this test fail?
- //AssertEquals( "1234F!!oo..", sb.ToString() );
-
- sb.Insert( 5, 1.5 ); /* Test insert of a decimal (and end of string) */
-
- // FIX: Why does this test fail?
- //AssertEquals( "1234F1.5!!oo..", sb.ToString() );
-
- sb.Insert( 4, 'A' ); /* Test char insert in middle of string */
-
- // FIX: Why does this test fail?
- //AssertEquals( "1234AF1.5!!oo..", sb.ToString() );
-
- }
-
- public void TestReplace() {
- StringBuilder sb = new StringBuilder( "Foobarbaz" );
-
- sb.Replace( "bar", "!!!" ); /* Test same length replace in middle of string */
-
- AssertEquals( "Foo!!!baz", sb.ToString() );
-
- sb.Replace( "Foo", "ABcD" ); /* Test longer replace at start of string */
-
- AssertEquals( "ABcD!!!baz", sb.ToString() );
-
- sb.Replace( "baz", "00" ); /* Test shorter replace at end of string */
-
- AssertEquals( "ABcD!!!00", sb.ToString() );
-
- sb.Replace( sb.ToString(), null ); /* Test string clear as in spec */
-
- AssertEquals( String.Empty, sb.ToString() );
-
- /* | 10 20 30
- /* |0123456789012345678901234567890| */
- sb.Append( "abc this is testing abc the abc abc partial replace abc" );
-
- sb.Replace( "abc", "!!!", 0, 31 ); /* Partial replace at start of string */
-
- AssertEquals( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
-
- sb.Replace( "testing", "", 0, 15 ); /* Test replace across boundary */
-
- AssertEquals( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
-
- sb.Replace( "!!!", "" ); /* Test replace with empty string */
-
- AssertEquals(" this is testing the abc partial replace abc", sb.ToString() );
- }
-
- public void TestAppendFormat() {
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/AllTests.cs b/mcs/class/corlib/Test/System/AllTests.cs
deleted file mode 100644
index 97209354995..00000000000
--- a/mcs/class/corlib/Test/System/AllTests.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(ArrayTest.Suite);
- suite.AddTest(BitConverterTest.Suite);
- suite.AddTest(BooleanTest.Suite);
- suite.AddTest(ByteTest.Suite);
- suite.AddTest(CharTest.Suite);
- suite.AddTest(ConsoleTest.Suite);
- suite.AddTest(EnumTest.Suite);
- suite.AddTest(GuidTest.Suite);
- suite.AddTest(Int16Test.Suite);
- suite.AddTest(Int32Test.Suite);
- suite.AddTest(Int64Test.Suite);
- suite.AddTest(ObjectTest.Suite);
- suite.AddTest(RandomTest.Suite);
- suite.AddTest(ResolveEventArgsTest.Suite);
- suite.AddTest(SByteTest.Suite);
- suite.AddTest(StringTest.Suite);
- suite.AddTest(TimeSpanTest.Suite);
- suite.AddTest(UInt16Test.Suite);
- suite.AddTest(UInt32Test.Suite);
- suite.AddTest(UInt64Test.Suite);
- suite.AddTest(DoubleTest.Suite);
- suite.AddTest(TimeZoneTest.Suite);
- suite.AddTest(DateTimeTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System/ArrayTest.cs b/mcs/class/corlib/Test/System/ArrayTest.cs
deleted file mode 100644
index 658979a16f7..00000000000
--- a/mcs/class/corlib/Test/System/ArrayTest.cs
+++ /dev/null
@@ -1,1447 +0,0 @@
-// ArrayTest.cs - NUnit Test Cases for the System.Array class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class ArrayTest : TestCase
-{
- public ArrayTest() : base ("MonoTests.System.ArrayTest testsuite") {}
- public ArrayTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ArrayTest));
- }
- }
-
- public void TestIsFixedSize() {
- char[] a1 = {'a'};
- Assert("All arrays are fixed", a1.IsFixedSize);
- }
-
- public void TestIsReadOnly() {
- char[] a1 = {'a'};
- Assert("No array is readonly", !a1.IsReadOnly);
- }
-
- public void TestIsSynchronized() {
- char[] a1 = {'a'};
- Assert("No array is synchronized", !a1.IsSynchronized);
- }
-
- public void TestLength() {
- {
- char[] a1 = { };
- AssertEquals("Zero length array", 0, a1.Length);
- }
- {
- char[] a1 = {'c'};
- AssertEquals("One-length array", 1, a1.Length);
- }
- {
- char[] a1 = {'c', 'c'};
- AssertEquals("Two-length array", 2, a1.Length);
- }
- }
-
- public void TestRank() {
- char[] a1 = { 'c', 'd', 'e' };
- AssertEquals("Rank one", 1, a1.Rank);
-
- char[,] a2 = new Char[3,3];
- AssertEquals("Rank two", 2, a2.Rank);
-
- char[,,] a3 = new Char[3,3,3];
- AssertEquals("Rank three", 3, a3.Rank);
- }
-
- public void TestBinarySearch1() {
- bool errorThrown = false;
- try {
- Array.BinarySearch(null, "blue");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("Error not thrown", errorThrown);
- errorThrown = false;
- try {
- char[,] c1 = new Char[2,2];
- Array.BinarySearch(c1, "needle");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("Error not thrown", errorThrown);
-
- {
- char[] bad = {'d', 'a', 'd', 'a', 'c', 'a'};
- AssertEquals("shouldn't find elem in badly-sorted array", -1, Array.BinarySearch(bad, 'c'));
- }
- {
- char[] bad = {'a', 'd', 'a', 'd', 'a', 'c', 'a'};
- AssertEquals("shouldn't find elem in badly-sorted array", -2, Array.BinarySearch(bad, 'c'));
- }
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- Assert("couldn't find elem",
- Array.BinarySearch(arr, 'c') >= 3);
- Assert("couldn't find elem",
- Array.BinarySearch(arr, 'c') < 6);
- }
- {
- char[] arr = {'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e'};
- AssertEquals("couldn't find next-higher elem",
- -4, Array.BinarySearch(arr, 'c'));
- }
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- AssertEquals("couldn't find end",
- -9, Array.BinarySearch(arr, 'e'));
- }
- }
- public void TestBinarySearch2() {
- bool errorThrown = false;
- try {
- Array.BinarySearch(null, 0, 1, "blue");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("Error not thrown", errorThrown);
- errorThrown = false;
- try {
- char[,] c1 = new Char[2,2];
- Array.BinarySearch(c1, 0, 1, "needle");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("Error not thrown", errorThrown);
- errorThrown = false;
- try {
- char[] c1 = {'a'};
- Array.BinarySearch(c1, -1, 1, 'a');
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Error not thrown", errorThrown);
- errorThrown = false;
- try {
- char[] c1 = {'a'};
- Array.BinarySearch(c1, 0, -1, 'a');
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Error not thrown", errorThrown);
- errorThrown = false;
- try {
- char[] c1 = {'a'};
- Array.BinarySearch(c1, 0, 4, 'a');
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("Error not thrown", errorThrown);
-
- // FIXME - see commented-out tests in TestBinarySearch1, above
-
- {
- char[] bad = {'z', 'z', 'd', 'a', 'd', 'a', 'c', 'a'};
- AssertEquals("shouldn't find elem in badly-sorted array", -3, Array.BinarySearch(bad, 2, 6, 'c'));
- }
- {
- char[] bad = {'z', 'z', 'a', 'd', 'a', 'd', 'a', 'c', 'a'};
- AssertEquals("shouldn't find elem in badly-sorted array", -4, Array.BinarySearch(bad, 2, 7, 'c'));
- }
- {
- char[] arr = {'z', 'z', 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- Assert("couldn't find elem",
- Array.BinarySearch(arr, 2, 8, 'c') >= 5);
- Assert("couldn't find elem",
- Array.BinarySearch(arr, 2, 8, 'c') < 8);
- }
- {
- char[] arr = {'z', 'z', 'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e'};
- AssertEquals("couldn't find next-higher elem",
- -6, Array.BinarySearch(arr, 2, 8, 'c'));
- }
- {
- char[] arr = {'z', 'z', 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- AssertEquals("couldn't find end",
- -11, Array.BinarySearch(arr, 2, 8, 'e'));
- }
- }
-
- // TODO - testBinarySearch with explicit IComparer args
-
- public void TestClear() {
- bool errorThrown = false;
- try {
- Array.Clear(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- int[] i1 = { 1, 2, 3, 4 };
- {
- int[] compare = {1,2,3,4};
- AssertEquals("array match", compare[0], i1[0]);
- AssertEquals("array match", compare[1], i1[1]);
- AssertEquals("array match", compare[2], i1[2]);
- AssertEquals("array match", compare[3], i1[3]);
- }
- Array.Clear(i1, 3, 1);
- {
- int[] compare = {1,2,3,0};
- AssertEquals("array match", compare[0], i1[0]);
- AssertEquals("array match", compare[1], i1[1]);
- AssertEquals("array match", compare[2], i1[2]);
- AssertEquals("array match", compare[3], i1[3]);
- }
- Array.Clear(i1, 1, 1);
- {
- int[] compare = {1,0,3,0};
- AssertEquals("array match", compare[0], i1[0]);
- AssertEquals("array match", compare[1], i1[1]);
- AssertEquals("array match", compare[2], i1[2]);
- AssertEquals("array match", compare[3], i1[3]);
- }
- Array.Clear(i1, 1, 3);
- {
- int[] compare = {1,0,0,0};
- AssertEquals("array match", compare[0], i1[0]);
- AssertEquals("array match", compare[1], i1[1]);
- AssertEquals("array match", compare[2], i1[2]);
- AssertEquals("array match", compare[3], i1[3]);
- }
-
- string[] s1 = { "red", "green", "blue" };
- Array.Clear(s1, 0, 3);
- {
- string[] compare = {null, null, null};
- AssertEquals("array match", compare[0], s1[0]);
- AssertEquals("array match", compare[1], s1[1]);
- AssertEquals("array match", compare[2], s1[2]);
- }
- }
-
- public void TestClone() {
- char[] c1 = {'a', 'b', 'c'};
- char[] c2 = (char[])c1.Clone();
- AssertEquals("Array match", c1[0], c2[0]);
- AssertEquals("Array match", c1[1], c2[1]);
- AssertEquals("Array match", c1[2], c2[2]);
-
- char[] d10 = {'a', 'b'};
- char[] d11 = {'a', 'c'};
- char[] d12 = {'b', 'c'};
- char[][] d1 = {d10, d11, d12};
- char[][] d2 = (char[][])d1.Clone();
- AssertEquals("Array match", d1[0], d2[0]);
- AssertEquals("Array match", d1[1], d2[1]);
- AssertEquals("Array match", d1[2], d2[2]);
-
- d1[0][0] = 'z';
- AssertEquals("shallow copy", d1[0], d2[0]);
- }
-
- public void TestCopy() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = {};
- Array.Copy(c1, null, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = {};
- Array.Copy(null, c1, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[,] c2 = new Char[1,1];
- Array.Copy(c1, c2, 1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- string[] s1 = new String[1];
- Array.Copy(c1, s1, 1);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Object[] o1 = new Object[1];
- o1[0] = "hello";
- Array.Copy(o1, c1, 1);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[] c2 = new Char[1];
- Array.Copy(c1, c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[] c2 = new Char[2];
- Array.Copy(c1, c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[] c2 = new Char[2];
- Array.Copy(c2, c1, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[] orig = {'a', 'b', 'd', 'a'};
- char[] copy = new Char[4];
- Array.Copy(orig, copy, 4);
- for (int i = 0; i < orig.Length; i++) {
- AssertEquals("copy unsuccessful " + i,
- orig[i], copy[i]);
- }
- Array.Clear(copy, 0, copy.Length);
- for (int i = 0; i < orig.Length; i++) {
- AssertEquals("clear unsuccessful " + i,
- (char)0, copy[i]);
- }
- Array.Copy(orig, copy, 2);
- AssertEquals("copy unsuccessful 1", orig[0], copy[0]);
- AssertEquals("copy unsuccessful 2", orig[1], copy[1]);
- Assert("copy unsuccessful 3", orig[2] != copy[2]);
- Assert("copy unsuccessful 4", orig[3] != copy[3]);
- }
- public void TestCopy2() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- Array.Copy(c2, 1, c1, 0, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- Array.Copy(c2, 0, c1, 1, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[] orig = {'a', 'b', 'd', 'a'};
- char[] copy = new Char[4];
- Array.Copy(orig, 1, copy, 1, 3);
- Assert("copy unsuccessful", copy[0] != orig[0]);
- for (int i = 1; i < orig.Length; i++) {
- AssertEquals("copy unsuccessful " + i,
- orig[i], copy[i]);
- }
- Array.Clear(copy, 0, copy.Length);
- Array.Copy(orig, 1, copy, 0, 2);
- AssertEquals("copy unsuccessful", orig[1], copy[0]);
- AssertEquals("copy unsuccessful", orig[2], copy[1]);
- Assert("copy unsuccessful", copy[2] != orig[2]);
- Assert("copy unsuccessful", copy[3] != orig[3]);
- }
-
- public void TestCopyTo() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- c1.CopyTo(null, 2);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[,] c2 = new Char[2,2];
- c1.CopyTo(c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[,] c1 = new Char[2,2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 2);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String[] c1 = new String[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 0);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- Char[] orig = {'a', 'b', 'c', 'd'};
- Char[] copy = new Char[10];
- Array.Clear(copy, 0, copy.Length);
- orig.CopyTo(copy, 3);
- AssertEquals("Wrong CopyTo 0", (char)0, copy[0]);
- AssertEquals("Wrong CopyTo 0", (char)0, copy[1]);
- AssertEquals("Wrong CopyTo 0", (char)0, copy[2]);
- AssertEquals("Wrong CopyTo 0", orig[0], copy[3]);
- AssertEquals("Wrong CopyTo 0", orig[1], copy[4]);
- AssertEquals("Wrong CopyTo 0", orig[2], copy[5]);
- AssertEquals("Wrong CopyTo 0", orig[3], copy[6]);
- AssertEquals("Wrong CopyTo 0", (char)0, copy[7]);
- AssertEquals("Wrong CopyTo 0", (char)0, copy[8]);
- AssertEquals("Wrong CopyTo 0", (char)0, copy[9]);
- }
-
- public void TestCreateInstance() {
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(null, 12);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(Type.GetType("System.Char"), -3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[] c1 = (char[])Array.CreateInstance(Type.GetType("System.Char"), 12);
- AssertEquals("Array wrong size", 12, c1.Length);
- }
-
- public void TestGetEnumerator() {
- String[] s1 = {"this", "is", "a", "test"};
- IEnumerator en = s1.GetEnumerator();
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- AssertEquals("Not enumerating", s1[i], en.Current);
- }
- }
-
- public void TestGetLength() {
- {
- bool errorThrown = false;
- try {
- char[] c1 = {'a', 'b', 'c'};
- c1.GetLength(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c1 = {'a', 'b', 'c'};
- c1.GetLength(1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[] c2 = new Char[5];
- AssertEquals("wrong single dimension length",
- 5, c2.GetLength(0));
-
- char[,] c3 = new Char[6,7];
- AssertEquals("wrong single dimension length",
- 6, c3.GetLength(0));
- AssertEquals("wrong single dimension length",
- 7, c3.GetLength(1));
- }
-
- public void TestGetLowerBound() {
- // I have no idea what the point of this function is.
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetLowerBound(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetLowerBound(1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[] c1 = new Char[5];
- AssertEquals("single-dimensional lower bound",
- 0, c1.GetLowerBound(0));
-
- char[,] c2 = new Char[4,4];
- AssertEquals("multiple-dimensional lower bound",
- 0, c2.GetLowerBound(0));
- AssertEquals("multiple-dimensional lower bound",
- 0, c2.GetLowerBound(1));
- }
-
- public void TestGetUpperBound() {
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetUpperBound(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetUpperBound(1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[] c1 = new Char[5];
- AssertEquals("single-dimensional lower bound",
- 4, c1.GetUpperBound(0));
-
- char[,] c2 = new Char[4,6];
- AssertEquals("multiple-dimensional lower bound",
- 3, c2.GetUpperBound(0));
- AssertEquals("multiple-dimensional lower bound",
- 5, c2.GetUpperBound(1));
- }
-
- public void TestGetValue1() {
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.GetValue(1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetValue(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetValue(4);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[] c1 = {'a', 'b', 'c', 'd'};
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("Bad GetValue", c1[i], c1.GetValue(i));
- }
- }
- public void TestGetValue2() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.GetValue(1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.GetValue(-1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.GetValue(4,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- AssertEquals("Bad GetValue",
- c1[i,j], c1.GetValue(i, j));
- }
- }
- }
- public void TestGetValue3() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.GetValue(1,1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.GetValue(-1, 1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.GetValue(4,1,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[,,] c1 = new Char[4,2,3];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int remains = i % 6;
- int second = remains / 3;
- int third = remains % 3;
- c1[first,second, third] = (char)(((int)'a')+i);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- for (int k = 0; k < c1.GetLength(2); k++) {
- AssertEquals("Bad GetValue",
- c1[i,j,k], c1.GetValue(i,j,k));
- }
- }
- }
- }
- public void TestGetValueN() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.GetValue(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- int[] coords = {1, 1};
- c.GetValue(coords);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {-1, 1};
- c.GetValue(coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {4, 1};
- c.GetValue(coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- int[] coords = {i, j};
- AssertEquals("Bad GetValue",
- c1[i,j], c1.GetValue(coords));
- }
- }
- }
-
- public void TestIndexOf1() {
- {
- bool errorThrown = false;
- try {
- Array.IndexOf(null, "huh?");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.IndexOf(c, "huh?");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- String[] s1 = {"this", "is", "a", "test"};
- AssertEquals("No null here", -1, Array.IndexOf(s1, null));
- AssertEquals("No nothing here", -1, Array.IndexOf(s1, "nothing"));
- AssertEquals("Found first", 0, Array.IndexOf(s1, "this"));
- AssertEquals("Found last", 3, Array.IndexOf(s1, "test"));
- }
- public void TestIndexOf2() {
- {
- bool errorThrown = false;
- try {
- Array.IndexOf(null, "huh?", 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.IndexOf(c, "huh?", 0);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.IndexOf(c, "huh?", 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("No null here", -1, Array.IndexOf(s1, null, 1));
- AssertEquals("No nothing here", -1, Array.IndexOf(s1, "nothing", 1));
- AssertEquals("Didn't find first", -1, Array.IndexOf(s1, "this", 1));
- AssertEquals("Found first", 1, Array.IndexOf(s1, "is", 1));
- AssertEquals("Found last", 4, Array.IndexOf(s1, "test", 1));
- }
- public void TestIndexOf3() {
- {
- bool errorThrown = false;
- try {
- Array.IndexOf(null, "huh?", 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.IndexOf(c, "huh?", 0, 1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.IndexOf(c, "huh?", 3, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.IndexOf(c, "huh?", 0, 5);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("No null here", -1, Array.IndexOf(s1, null, 1, 3));
- AssertEquals("No nothing here", -1, Array.IndexOf(s1, "nothing", 1, 3));
- AssertEquals("Didn't find first", -1, Array.IndexOf(s1, "this", 1, 3));
- AssertEquals("Found first", 1, Array.IndexOf(s1, "is", 1, 3));
- AssertEquals("Didn't find last", -1, Array.IndexOf(s1, "test", 1, 3));
- AssertEquals("Found last", 3, Array.IndexOf(s1, "a", 1, 3));
- }
-
- public void TestLastIndexOf1() {
- {
- bool errorThrown = false;
- try {
- Array.LastIndexOf(null, "huh?");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.LastIndexOf(c, "huh?");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- String[] s1 = {"this", "is", "a", "a", "test"};
- AssertEquals("No null here", -1, Array.LastIndexOf(s1, null));
- AssertEquals("No nothing here", -1, Array.LastIndexOf(s1, "nothing"));
- AssertEquals("Found first", 0, Array.LastIndexOf(s1, "this"));
- AssertEquals("Found last", 4, Array.LastIndexOf(s1, "test"));
- AssertEquals("Found repeat", 3, Array.LastIndexOf(s1, "a"));
- }
- public void TestLastIndexOf2() {
- {
- bool errorThrown = false;
- try {
- Array.LastIndexOf(null, "huh?", 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.LastIndexOf(c, "huh?", 0);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.LastIndexOf(c, "huh?", 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("No null here", -1, Array.LastIndexOf(s1, null, 3));
- AssertEquals("No nothing here", -1, Array.LastIndexOf(s1, "nothing", 3));
- AssertEquals("Didn't find larst", -1, Array.LastIndexOf(s1, "test", 3));
- AssertEquals("Found last", 3, Array.LastIndexOf(s1, "a", 3));
- AssertEquals("Found first", 0, Array.LastIndexOf(s1, "this", 3));
- }
- public void TestLastIndexOf3() {
- {
- bool errorThrown = false;
- try {
- Array.LastIndexOf(null, "huh?", 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.LastIndexOf(c, "huh?", 0, 1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.LastIndexOf(c, "huh?", 3, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.LastIndexOf(c, "huh?", 0, 5);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("No null here",
- -1, Array.LastIndexOf(s1, null, 3, 3));
- AssertEquals("No nothing here",
- -1, Array.LastIndexOf(s1, "nothing", 3, 3));
- AssertEquals("Didn't find first",
- -1, Array.LastIndexOf(s1, "this", 3, 3));
- AssertEquals("Found first",
- 1, Array.LastIndexOf(s1, "is", 3, 3));
- AssertEquals("Didn't find last",
- -1, Array.LastIndexOf(s1, "test", 3, 3));
- AssertEquals("Found last",
- 3, Array.LastIndexOf(s1, "a", 3, 3));
- }
-
- public void TestReverse() {
- {
- bool errorThrown = false;
- try {
- Array.Reverse(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.Reverse(c);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[] c1 = {'a', 'b', 'c', 'd'};
- Array.Reverse(c1);
- AssertEquals("Reverse not working", 'd', c1[0]);
- AssertEquals("Reverse not working", 'c', c1[1]);
- AssertEquals("Reverse not working", 'b', c1[2]);
- AssertEquals("Reverse not working", 'a', c1[3]);
-
- {
- bool errorThrown = false;
- try {
- Array.Reverse(null, 0, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.Reverse(c, 0, 0);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- //{
- //bool errorThrown = false;
- //try {
- // char[] c = new Char[2];
- // Array.Reverse(c, 0, 3);
- //} catch (ArgumentOutOfRangeException) {
- // errorThrown = true;
- //}
- //Assert("error not thrown", errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- // char[] c = new Char[2];
- // Array.Reverse(c, 3, 0);
- //} catch (ArgumentOutOfRangeException) {
- // errorThrown = true;
- //}
- //Assert("error not thrown", errorThrown);
- //}
-
- char[] c2 = { 'a', 'b', 'c', 'd'};
- Array.Reverse(c2, 1, 2);
- AssertEquals("Reverse not working", 'a', c2[0]);
- AssertEquals("Reverse not working", 'c', c2[1]);
- AssertEquals("Reverse not working", 'b', c2[2]);
- AssertEquals("Reverse not working", 'd', c2[3]);
- }
-
- public void TestSetValue1() {
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.SetValue("buh", 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.SetValue("buh", -1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.SetValue("buh", 4);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[] c1 = {'a', 'b', 'c', 'd'};
- char[] c2 = new char[4];
- for (int i = 0; i < c1.Length; i++) {
- c2.SetValue(c1[i], i);
- }
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("Bad SetValue", c1[i], c2[i]);
- }
- }
- public void TestSetValue2() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.SetValue("buh", 1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.SetValue("buh", -1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.SetValue("buh", 4,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- char[,] c2 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- c2.SetValue(c1[first,second], first, second);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- AssertEquals("Bad SetValue",
- c1[i,j], c2[i, j]);
- }
- }
- }
- public void TestSetValue3() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.SetValue("buh", 1,1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.SetValue("buh", -1, 1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.SetValue("buh", 4,1,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[,,] c1 = new Char[4,2,3];
- char[,,] c2 = new Char[4,2,3];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int remains = i % 6;
- int second = remains / 3;
- int third = remains % 3;
- c1[first,second, third] = (char)(((int)'a')+i);
- c2.SetValue(c1[first, second, third], first, second, third);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- for (int k = 0; k < c1.GetLength(2); k++) {
- AssertEquals("Bad SetValue",
- c1[i,j,k], c2[i,j,k]);
- }
- }
- }
- }
- public void TestSetValueN() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.SetValue("buh", null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- int[] coords = {1, 1};
- c.SetValue("buh", coords);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {-1, 1};
- c.SetValue("buh", coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {4, 1};
- c.SetValue("buh", coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- char[,] c2 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- int[] coords = {first, second};
- c2.SetValue(c1[first,second], coords);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- AssertEquals("Bad SetValue",
- c1[i,j], c2[i,j]);
- }
- }
- }
-
- public void TestSort() {
- {
- bool errorThrown = false;
- try {
- Array.Sort(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown 1", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.Sort(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown 2", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c1 = new Char[2];
- Array.Sort(null, c1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown 5", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c1 = new Char[2];
- Array.Sort(null, c1, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("error not thrown 6", errorThrown);
- }
-
- // note: null second array => just sort first array
- char[] starter = {'d', 'b', 'f', 'e', 'a', 'c'};
- int[] starter1 = {1,2,3,4,5,6};
- {
- char[] c1 = (char[])starter.Clone();
- Array.Sort(c1);
- AssertEquals("Basic sort problem", 'a', c1[0]);
- AssertEquals("Basic sort problem", 'b', c1[1]);
- AssertEquals("Basic sort problem", 'c', c1[2]);
- AssertEquals("Basic sort problem", 'd', c1[3]);
- AssertEquals("Basic sort problem", 'e', c1[4]);
- AssertEquals("Basic sort problem", 'f', c1[5]);
- }
- {
- char[] c1 = (char[])starter.Clone();
- int[] i1 = (int[])starter1.Clone();
- Array.Sort(c1, i1);
- AssertEquals("Keyed sort problem", 'a', c1[0]);
- AssertEquals("Keyed sort problem", 'b', c1[1]);
- AssertEquals("Keyed sort problem", 'c', c1[2]);
- AssertEquals("Keyed sort problem", 'd', c1[3]);
- AssertEquals("Keyed sort problem", 'e', c1[4]);
- AssertEquals("Keyed sort problem", 'f', c1[5]);
- AssertEquals("Keyed sort problem", 5, i1[0]);
- AssertEquals("Keyed sort problem", 2, i1[1]);
- AssertEquals("Keyed sort problem", 6, i1[2]);
- AssertEquals("Keyed sort problem", 1, i1[3]);
- AssertEquals("Keyed sort problem", 4, i1[4]);
- AssertEquals("Keyed sort problem", 3, i1[5]);
- }
- {
- char[] c1 = (char[])starter.Clone();
- Array.Sort(c1, 1, 4);
- AssertEquals("Basic sort chunk problem", 'd', c1[0]);
- AssertEquals("Basic sort chunk problem", 'a', c1[1]);
- AssertEquals("Basic sort chunk problem", 'b', c1[2]);
- AssertEquals("Basic sort chunk problem", 'e', c1[3]);
- AssertEquals("Basic sort chunk problem", 'f', c1[4]);
- AssertEquals("Basic sort chunk problem", 'c', c1[5]);
- }
- {
- char[] c1 = (char[])starter.Clone();
- int[] i1 = (int[])starter1.Clone();
- Array.Sort(c1, i1, 1, 4);
- AssertEquals("Keyed sort chunk problem", 'd', c1[0]);
- AssertEquals("Keyed sort chunk problem", 'a', c1[1]);
- AssertEquals("Keyed sort chunk problem", 'b', c1[2]);
- AssertEquals("Keyed sort chunk problem", 'e', c1[3]);
- AssertEquals("Keyed sort chunk problem", 'f', c1[4]);
- AssertEquals("Keyed sort chunk problem", 'c', c1[5]);
- AssertEquals("Keyed sort chunk problem", 1, i1[0]);
- AssertEquals("Keyed sort chunk problem", 5, i1[1]);
- AssertEquals("Keyed sort chunk problem", 2, i1[2]);
- AssertEquals("Keyed sort chunk problem", 4, i1[3]);
- AssertEquals("Keyed sort chunk problem", 3, i1[4]);
- AssertEquals("Keyed sort chunk problem", 6, i1[5]);
- }
- }
-
- // TODO - TestSort passed-in IComparable versions
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/BitConverterTest.cs b/mcs/class/corlib/Test/System/BitConverterTest.cs
deleted file mode 100755
index bf1934d5ee5..00000000000
--- a/mcs/class/corlib/Test/System/BitConverterTest.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// BitConverterTest.cs - NUnit Test Cases for System.BitConverter
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class BitConverterTest : TestCase {
-
- public BitConverterTest() : base("System.BitConverter testsuite") {}
- public BitConverterTest(string name) : base(name) {}
-
- protected override void SetUp() {}
-
- protected override void TearDown() {}
-
- // this property is required. You need change the parameter for
- // typeof() below to be your class.
- public static ITest Suite {
- get {
- return new TestSuite(typeof(BitConverterTest));
- }
- }
-
- public void TestIsLittleEndian () {
- byte[] b;
-
- b = BitConverter.GetBytes(1);
- AssertEquals ("A1", b[0] == 1, BitConverter.IsLittleEndian );
- }
-
- public void TestDouble() {
- double d = 123.321;
-
- AssertEquals("A1", d, BitConverter.Int64BitsToDouble (BitConverter.DoubleToInt64Bits (d)));
- }
-
- public void TestChar () {
- char v1 = 'A';
- char v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 2, b.Length);
-
- v2 = BitConverter.ToChar (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToChar (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToChar (larger, 3);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- AssertEquals ("A4", true, exception);
-
- try {
- v2 = BitConverter.ToChar ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- AssertEquals("A5", true, exception);
-
- }
-
-}
-}
diff --git a/mcs/class/corlib/Test/System/BooleanTest.cs b/mcs/class/corlib/Test/System/BooleanTest.cs
deleted file mode 100644
index a7bae95c993..00000000000
--- a/mcs/class/corlib/Test/System/BooleanTest.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-// BooleanTest.cs - NUnit Test Cases for the System.Boolean class
-//
-// Bob Doan <bdoan@sicompos.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class BooleanTest : TestCase
-{
- public BooleanTest () : base ("MonoTests.System.BooleanTests testcase") {}
- public BooleanTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (BooleanTest));
- }
- }
-
- public void TestStrings ()
- {
- AssertEquals("Wrong False string", "False", Boolean.FalseString);
- AssertEquals("Wrong True string", "True", Boolean.TrueString);
- }
-
- public void TestCompareTo() {
- Boolean t=true,f=false;
- String s = "What Ever";
- AssertEquals("CompareTo Failed", true, f.CompareTo(t) < 0);
- AssertEquals("CompareTo Failed", 0, f.CompareTo(f));
- AssertEquals("CompareTo Failed", 0, t.CompareTo(t));
- AssertEquals("CompareTo Failed", true, t.CompareTo(f) > 0);
- AssertEquals("CompareTo Failed", true, t.CompareTo(null) > 0);
- try {
- t.CompareTo(s);
- Fail("CompareTo should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert("CompareTo should be a System.ArgumentException", typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals() {
- Boolean t=true, f=false;
- String s = "What Ever";
- AssertEquals("Equals Failed", true, t.Equals(t));
- AssertEquals("Equals Failed", true, f.Equals(f));
- AssertEquals("Equals Failed", false, f.Equals(t));
- AssertEquals("Equals Failed", false, t.Equals(null));
- AssertEquals("Equals Failed", false, t.Equals(s));
- }
-
- public void TestGetHashCode() {
- Boolean t=true, f=false;
- AssertEquals("GetHashCode True failed", 1, t.GetHashCode());
- AssertEquals("GetHashCode True failed", 0, f.GetHashCode());
- }
-
- public void TestGetType() {
- Boolean t=true, f=false;
- AssertEquals("GetType failed", true, Object.ReferenceEquals(t.GetType(), f.GetType()));
- }
-
- public void TestGetTypeCode() {
- Boolean b=true;
- AssertEquals("GetTypeCode failed", TypeCode.Boolean, b.GetTypeCode());
- }
-
- public void TestParse() {
- AssertEquals("Parse True failed", true, Boolean.Parse("True"));
- AssertEquals("Parse True failed", true, Boolean.Parse(" True"));
- AssertEquals("Parse True failed", true, Boolean.Parse("True "));
- AssertEquals("Parse True failed", true, Boolean.Parse("tRuE"));
- AssertEquals("Parse False failed", false, Boolean.Parse("False"));
- AssertEquals("Parse False failed", false, Boolean.Parse(" False"));
- AssertEquals("Parse False failed", false, Boolean.Parse("False "));
- AssertEquals("Parse False failed", false, Boolean.Parse("fAlSe"));
-
- try {
- Boolean.Parse("not-t-or-f");
- Fail("Parse should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("Parse should be a System.FormatException", typeof(FormatException) == e.GetType());
- }
-
- try {
- Boolean.Parse(null);
- Fail("Parse should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Parse should be a System.ArgumentNullException", typeof(ArgumentNullException) == e.GetType());
- }
- }
-
- public void TestToString() {
- Boolean t=true,f=false;
- AssertEquals("ToString True Failed", Boolean.TrueString, t.ToString());
- AssertEquals("ToString False Failed", Boolean.FalseString, f.ToString());
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ByteTest.cs b/mcs/class/corlib/Test/System/ByteTest.cs
deleted file mode 100644
index f825f25910b..00000000000
--- a/mcs/class/corlib/Test/System/ByteTest.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-// ByteTest.cs - NUnit Test Cases for the System.Byte struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class ByteTest : TestCase
-{
- private const Byte MyByte1 = 42;
- private const Byte MyByte2 = 0;
- private const Byte MyByte3 = 255;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "255";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results1_Nfi = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"255.00000",
- "00255", "2.55000e+002", "255.00000",
- "255", "255.00000", "25,500.00000 %", "000ff"};
- private string[] Results2_Nfi = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"255.00000",
- "00255", "2.55000e+002", "255.00000",
- "255", "255.00000", "25,500.00000 %", "000ff"};
-
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public ByteTest() : base ("MonoTests.System.ByteTests testcase") {}
- public ByteTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ByteTest));
- }
- }
-
- public void TestMinMax()
- {
- AssertEquals(Byte.MinValue, MyByte2);
- AssertEquals(Byte.MaxValue, MyByte3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyByte3.CompareTo(MyByte2) > 0);
- Assert(MyByte2.CompareTo(MyByte2) == 0);
- Assert(MyByte1.CompareTo((Byte)42) == 0);
- Assert(MyByte2.CompareTo(MyByte3) < 0);
- try {
- MyByte2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyByte1.Equals(MyByte1));
- Assert(MyByte1.Equals((Byte)42));
- Assert(MyByte1.Equals((Int16)42) == false);
- Assert(MyByte1.Equals(MyByte2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyByte1.GetHashCode();
- MyByte2.GetHashCode();
- MyByte3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert("MyByte1="+MyByte1+", MyString1="+MyString1+", Parse="+Byte.Parse(MyString1) , MyByte1 == Byte.Parse(MyString1));
- Assert("MyByte2", MyByte2 == Byte.Parse(MyString2));
- Assert("MyByte3", MyByte3 == Byte.Parse(MyString3));
-
- try {
- Byte.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Should get ArgumentNullException", typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Byte.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("not-a-number", typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = Byte.MaxValue + 1;
- Byte.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert("OverflowException", typeof(OverflowException) == e.GetType());
- }
-
- //test Parse(string s, NumberStyles style)
- Assert(" $42 ", 42 == Byte.Parse(" $42 ", NumberStyles.Currency));
- try {
- Byte.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("$42 and NumberStyles.Integer", typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(" 42 and Nfi", 42 == Byte.Parse(" 42 ", Nfi));
- try {
- Byte.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("%42 and Nfi", typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert("NumberStyles.HexNumber", 16 == Byte.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Byte.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("$42, NumberStyles.Integer, Nfi", typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals("Compare failed for MyString1 and MyByte1", MyString1, MyByte1.ToString());
- AssertEquals("Compare failed for MyString2 and MyByte2", MyString2, MyByte2.ToString());
- AssertEquals("Compare failed for MyString3 and MyByte3", MyString3, MyByte3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("Compare failed for Formats1["+i.ToString()+"]", Results1[i], MyByte2.ToString(Formats1[i]));
- AssertEquals("Compare failed for Formats2["+i.ToString()+"]", Results2[i], MyByte3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("Compare failed for Formats1["+i.ToString()+"] with Nfi", Results1_Nfi[i], MyByte2.ToString(Formats1[i], Nfi));
- AssertEquals("Compare failed for Formats2["+i.ToString()+"] with Nfi", Results2_Nfi[i], MyByte3.ToString(Formats2[i], Nfi));
- }
- try {
- MyByte1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("Exception is the wrong type", typeof(FormatException) == e.GetType());
- }
-
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ChangeLog b/mcs/class/corlib/Test/System/ChangeLog
deleted file mode 100644
index 48d2a79ee1c..00000000000
--- a/mcs/class/corlib/Test/System/ChangeLog
+++ /dev/null
@@ -1,110 +0,0 @@
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: New file. This contains all the test which already
- work on Linux.
-
- * String.cs: Added two testcases to TestTrim(), TestTrimStart() and
- TestTrimEnd().
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTimeTest.cs: Added testcases for the parsers. Use the invariant
- culture to run this test suite.
-
- * TimeZoneTest.cs: Use the invariant culture to run this test suite.
-
-2002-02-26 Duco Fijma <duco@lorentz.xs4all>
- * TimeSpanTest.cs: added test from TimeSpan.FromMilliseconds
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTimeTest.cs: New test.
-
- * TimeZoneTest.cs: New test.
-
-2002-02-25 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: all methods of System.Guid are now covered
- * BitConverterTest.cs: created, not yet complete
-
-2002-02-21 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: changed according to fix in System.Guid
-
-2002-02-20 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: One array was giving us trouble. Not sure why, but
- it's related to the number of elements in an Array. For short Arrays
- the compiler doesn't use the PrivateImplmentationDetails struct,
- but for longer ones it does. That's when our corlib fails. I paired
- down the array for now.
-
-2002-02-19 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: added a few cases
-
-2002-02-18 Nick Drochak <ndrochak@gol.com>
-
- * GuidTest.cs: Fix compile error. Needed to cast the null in the call to
- constructor to avoid ambiguity.
-
-2002-02-11 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: Various fixes to make tests work against the ms corlib.
- Currency Symbol tests seem to be system dependant. Not sure if this
- will work on other systems, so please test it if you can. The most
- disturbing one is negative numbers. Should they be (n) or -n ?
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add Int64Test to the Suite
- * Int64Test.cs: Change static member to instance member. This was
- causing NUnitConsole some grief. Should be instance member anyway.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs:
- * Int16Test.cs:
- * Int32Test.cs:
- * SByteTest.cs:
- * UInt16Test.cs:
- * UInt32Test.cs:
- * UInt64Test.cs: Fixed tests where a "$" was hard coded. Change it to
- use NumberFormatInfo.CurrentInfo.CurrencySymbol. Also used
- NumberFormatInfo.InvariantInfo.CurrencySymbol where appropriate. These
- tests all pass now with mscorlib.
-
-2002-01-06 Nick Drochak <ndrochak@gol.com>
-
- * ResolveEventArgsTest.cs: New test.
- * AllTests.cs: Added new test to suite.
-
-2001-12-27 Nick Drochak <ndrochak@gol.com>
-
- * UInt32Test.cs: Added messages to Asserts()'s to find out which one was faliing.
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * UInt32Test.cs: Added tests for UInt32.Parse.
-
- * Int32Test.cs: Added tests for Int32.Parse for various cases.
-
-2001-12-08 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs: Added messages to Assert()'s to find out which one was failing.
-
-2001-11-28 Nick Drochak <ndrochak@gol.com>
-
- * Int16Test.cs Int32Test.cs SByteTest.cs: Surgically removed tests that rely on culture of system. These need to be crafted a bit differently.
-
-2001-11-27 Nick Drochak <ndrochak@gol.com>
-
- * SByteTest.cs: Add messages to Assert()'s so we can tell where the tests fail.
-
-2002-02-21 Bob Doan <bdoan@sicompos.com>
-
- * BooleanTest.cs: Added New test suite
- * AllTests.cs: Added new Boolean test to suite.
-
-2002-02-24 Bob Doan <bdoan@sicompos.com>
-
- * BooleanTest.cs: Use correct argument order in AssertEquals
- * AllTests.cs: Added new Double test to suite.
- * DoubleTest.cs: Add new test suite
diff --git a/mcs/class/corlib/Test/System/CharTest.cs b/mcs/class/corlib/Test/System/CharTest.cs
deleted file mode 100644
index 3f89fd24381..00000000000
--- a/mcs/class/corlib/Test/System/CharTest.cs
+++ /dev/null
@@ -1,500 +0,0 @@
-// CharTest.cs - NUnit Test Cases for the System.Char struct
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class CharTest : TestCase
-{
- public CharTest() : base ("MonoTests.System.CharTest testsuite") {}
- public CharTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(CharTest));
- }
- }
-
- public void TestCompareTo()
- {
- Char c1 = 'a';
- Char c2 = 'b';
- Char c3 = 'b';
- Assert("Less than", c1.CompareTo(c2) == -1);
- Assert("Greater than", c2.CompareTo(c1) == 1);
- Assert("Equal 1", c2.CompareTo(c3) == 0);
- Assert("Equal 2", c1.CompareTo(c1) == 0);
- }
-
- public void TestEquals()
- {
- Char c1 = 'a';
- Char c2 = 'b';
- Char c3 = 'b';
- Assert("Same", c1.Equals(c1));
- Assert("Same value", c2.Equals(c3));
- Assert("Not same", !c1.Equals(c2));
- }
-
- public void TestGetHashValue()
- {
- Char c1 = ' ';
- AssertEquals("deterministic hash code ", c1.GetHashCode(), c1.GetHashCode());
- // TODO - the spec doesn't say what algorithm is used to get hash codes. So far, just a weak test for determinism and mostly-uniqueness.
- }
-
- public void TestGetNumericValue()
- {
- Char c1 = ' ';
- Char c2 = '3';
- AssertEquals("code 1", -1.0, Char.GetNumericValue(c1), 0.1);
- AssertEquals("code 2", 3.0, Char.GetNumericValue(c2), 0.1);
-
- string s1 = " 3 ";
- AssertEquals("space not number", -1.0, Char.GetNumericValue(s1, 0), 0.1);
- AssertEquals("space not number", 3.0, Char.GetNumericValue(s1, 1), 0.1);
- AssertEquals("space not number", -1.0, Char.GetNumericValue(s1, 2), 0.1);
- }
-
- public void TestGetUnicodeCategory()
- {
- {
- char Pe1 = ']';
- char Pe2 = '}';
- char Pe3 = ')';
- AssertEquals("Close Punctuation",
- UnicodeCategory.ClosePunctuation,
- Char.GetUnicodeCategory(Pe1));
- AssertEquals("Close Punctuation",
- UnicodeCategory.ClosePunctuation,
- Char.GetUnicodeCategory(Pe2));
- AssertEquals("Close Punctuation",
- UnicodeCategory.ClosePunctuation,
- Char.GetUnicodeCategory(Pe3));
- }
- // TODO - ConnectorPunctuation
- {
- char c1 = (char)0; // 0000-001F, 007F-009F
- char c2 = (char)0x001F;
- char c3 = (char)0x007F;
- char c4 = (char)0x00F;
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c1));
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c2));
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c3));
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c4));
- }
- {
- // TODO - more currencies?
- char c1 = '$';
- AssertEquals("Currency",
- UnicodeCategory.CurrencySymbol,
- Char.GetUnicodeCategory(c1));
- }
- {
- char c1 = '-';
- AssertEquals("Dash Punctuation",
- UnicodeCategory.DashPunctuation,
- Char.GetUnicodeCategory(c1));
- }
- {
- char c1 = '2';
- char c2 = '7';
- AssertEquals("Decimal Digit",
- UnicodeCategory.DecimalDigitNumber,
- Char.GetUnicodeCategory(c1));
- AssertEquals("Decimal Digit",
- UnicodeCategory.DecimalDigitNumber,
- Char.GetUnicodeCategory(c2));
- }
- // TODO - EnclosingMark
- // TODO - FinalQuotePunctuation
- // TODO - Format
- // TODO - InitialQuotePunctuation
- // TODO - LetterNumber
- // TODO - LineSeparator (not '\n', that's a control char)
- {
- char c1 = 'a';
- char c2 = 'z';
- AssertEquals("LowercaseLetter",
- UnicodeCategory.LowercaseLetter,
- Char.GetUnicodeCategory(c1));
- AssertEquals("LowercaseLetter",
- UnicodeCategory.LowercaseLetter,
- Char.GetUnicodeCategory(c2));
- }
- {
- char c1 = '+';
- char c2 = '=';
- AssertEquals("MathSymbol",
- UnicodeCategory.MathSymbol,
- Char.GetUnicodeCategory(c1));
- AssertEquals("MathSymbol",
- UnicodeCategory.MathSymbol,
- Char.GetUnicodeCategory(c2));
- }
- // TODO - ModifierSymbol
- // TODO - NonSpacingMark
- // TODO - OpenPunctuation
- {
- char c1 = '[';
- char c2 = '{';
- char c3 = '(';
- AssertEquals("OpenPunctuation",
- UnicodeCategory.OpenPunctuation,
- Char.GetUnicodeCategory(c1));
- AssertEquals("OpenPunctuation",
- UnicodeCategory.OpenPunctuation,
- Char.GetUnicodeCategory(c2));
- AssertEquals("OpenPunctuation",
- UnicodeCategory.OpenPunctuation,
- Char.GetUnicodeCategory(c3));
- }
- // TODO - OtherLetter
- // TODO - OtherNotAssigned
- // TODO - OtherNumber
- {
- char c1 = '/';
- AssertEquals("OtherPunctuation",
- UnicodeCategory.OtherPunctuation,
- Char.GetUnicodeCategory(c1));
- }
- // TODO - OtherSymbol
- // TODO - ParagraphSeparator
- // TODO - PrivateUse
- {
- char c1 = ' ';
- AssertEquals("SpaceSeparator",
- UnicodeCategory.SpaceSeparator,
- Char.GetUnicodeCategory(c1));
- }
- // TODO - SpacingCombiningMark
- {
- char c1 = (char)0xD800; // D800-DBFF
- char c2 = (char)0xDBFF; // D800-DBFF
- char c3 = (char)0xDC01; // DC00-DEFF
- char c4 = (char)0xDEFF; // DC00-DEFF
- AssertEquals("High Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c1));
- AssertEquals("High Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c2));
- AssertEquals("Low Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c3));
- AssertEquals("Low Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c4));
- }
- // TODO - TitlecaseLetter
- // TODO - UppercaseLetter
- {
- char c1 = 'A';
- char c2 = 'Z';
- AssertEquals("UppercaseLetter",
- UnicodeCategory.UppercaseLetter,
- Char.GetUnicodeCategory(c1));
- AssertEquals("UppercaseLetter",
- UnicodeCategory.UppercaseLetter,
- Char.GetUnicodeCategory(c2));
- }
- }
-
- public void TestIsControl()
- {
- // control is 0000-001F, 007F-009F
- char c1 = (char)0;
- char c2 = (char)0x001F;
- char c3 = (char)0x007F;
- char c4 = (char)0x009F;
- Assert("Not control", !Char.IsControl(' '));
- Assert("control", Char.IsControl(c1));
- Assert("control", Char.IsControl(c2));
- Assert("control", Char.IsControl(c3));
- Assert("control", Char.IsControl(c4));
-
- string s1 = " " + c1 + c2 + c3 + c4;
- Assert("Not control", !Char.IsControl(s1, 0));
- Assert("control", Char.IsControl(s1, 1));
- Assert("control", Char.IsControl(s1, 2));
- Assert("control", Char.IsControl(s1, 3));
- Assert("control", Char.IsControl(s1, 4));
- }
-
- public void TestIsDigit()
- {
- char c1 = '0';
- char c2 = '9';
- Assert("Not digit", !Char.IsDigit(' '));
- Assert("digit", Char.IsDigit(c1));
- Assert("digit", Char.IsDigit(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not digit", !Char.IsDigit(s1, 0));
- Assert("digit", Char.IsDigit(s1, 1));
- Assert("digit", Char.IsDigit(s1, 2));
- }
-
- public void TestIsLetter()
- {
- char c1 = 'a';
- char c2 = 'z';
- char c3 = 'A';
- char c4 = 'Z';
- Assert("Not letter", !Char.IsLetter(' '));
- Assert("letter", Char.IsLetter(c1));
- Assert("letter", Char.IsLetter(c2));
- Assert("letter", Char.IsLetter(c3));
- Assert("letter", Char.IsLetter(c4));
-
- string s1 = " " + c1 + c2 + c3 + c4;
- Assert("Not letter", !Char.IsLetter(s1, 0));
- Assert("letter", Char.IsLetter(s1, 1));
- Assert("letter", Char.IsLetter(s1, 2));
- Assert("letter", Char.IsLetter(s1, 3));
- Assert("letter", Char.IsLetter(s1, 4));
- }
-
- public void TestIsLetterOrDigit()
- {
- char c1 = 'a';
- char c2 = 'z';
- char c3 = 'A';
- char c4 = 'Z';
- char c5 = '0';
- char c6 = '9';
- Assert("Not letterordigit", !Char.IsLetterOrDigit(' '));
- Assert("letterordigit", Char.IsLetterOrDigit(c1));
- Assert("letterordigit", Char.IsLetterOrDigit(c2));
- Assert("letterordigit", Char.IsLetterOrDigit(c3));
- Assert("letterordigit", Char.IsLetterOrDigit(c4));
- Assert("letterordigit", Char.IsLetterOrDigit(c5));
- Assert("letterordigit", Char.IsLetterOrDigit(c6));
-
- string s1 = " " + c1 + c2 + c3 + c4 + c5 + c6;
- Assert("Not letterordigit", !Char.IsLetterOrDigit(s1, 0));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 1));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 2));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 3));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 4));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 5));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 6));
- }
-
- public void TestIsLower()
- {
- char c1 = 'a';
- char c2 = 'z';
- Assert("Not lower", !Char.IsLower(' '));
- Assert("lower", Char.IsLower(c1));
- Assert("lower", Char.IsLower(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not lower", !Char.IsLower(s1, 0));
- Assert("lower", Char.IsLower(s1, 1));
- Assert("lower", Char.IsLower(s1, 2));
- }
-
- public void TestIsNumber()
- {
- char c1 = '0';
- char c2 = '9';
- // TODO - IsNumber of less obvious characters
-
- Assert("Not number", !Char.IsNumber(' '));
- Assert("number", Char.IsNumber(c1));
- Assert("number", Char.IsNumber(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not number", !Char.IsNumber(s1, 0));
- Assert("number", Char.IsNumber(s1, 1));
- Assert("number", Char.IsNumber(s1, 2));
- }
-
- public void TestIsPunctuation()
- {
- char c1 = '.';
- char c2 = '?';
- Assert("Not punctuation", !Char.IsPunctuation(' '));
- Assert("punctuation", Char.IsPunctuation(c1));
- Assert("punctuation", Char.IsPunctuation(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not punctuation", !Char.IsPunctuation(s1, 0));
- Assert("punctuation", Char.IsPunctuation(s1, 1));
- Assert("punctuation", Char.IsPunctuation(s1, 2));
- }
-
- public void TestIsSeparator()
- {
- char c1 = ' ';
-
- Assert("Not separator", !Char.IsSeparator('.'));
- Assert("separator1", Char.IsSeparator(c1));
-
- string s1 = "." + c1;
- Assert("Not separator", !Char.IsSeparator(s1, 0));
- Assert("separator1-2", Char.IsSeparator(s1, 1));
- }
-
- public void TestIsSurrogate()
- {
- // high surrogate - D800-DBFF
- // low surrogate - DC00-DEFF
- char c1 = (char)0xD800;
- char c2 = (char)0xDBFF;
- char c3 = (char)0xDC00;
- char c4 = (char)0xDEFF;
- Assert("Not surrogate", !Char.IsSurrogate(' '));
- Assert("surrogate1", Char.IsSurrogate(c1));
- Assert("surrogate2", Char.IsSurrogate(c2));
- Assert("surrogate3", Char.IsSurrogate(c3));
- Assert("surrogate4", Char.IsSurrogate(c4));
-
- string s1 = " " + c1 + c2 + c3 + c4;
- Assert("Not surrogate", !Char.IsSurrogate(s1, 0));
- Assert("surrogate1-2", Char.IsSurrogate(s1, 1));
- Assert("surrogate2-2", Char.IsSurrogate(s1, 2));
- Assert("surrogate3-2", Char.IsSurrogate(s1, 3));
- Assert("surrogate4-2", Char.IsSurrogate(s1, 4));
- }
-
- public void TestIsSymbol()
- {
- char c1 = '+';
- char c2 = '=';
- Assert("Not symbol", !Char.IsSymbol(' '));
- Assert("symbol", Char.IsSymbol(c1));
- Assert("symbol", Char.IsSymbol(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not symbol", !Char.IsSymbol(s1, 0));
- Assert("symbol", Char.IsSymbol(s1, 1));
- Assert("symbol", Char.IsSymbol(s1, 2));
- }
-
- public void TestIsUpper()
- {
- char c1 = 'A';
- char c2 = 'Z';
- Assert("Not upper", !Char.IsUpper('a'));
- Assert("upper", Char.IsUpper(c1));
- Assert("upper", Char.IsUpper(c2));
-
- string s1 = "a" + c1 + c2;
- Assert("Not upper", !Char.IsUpper(s1, 0));
- Assert("upper", Char.IsUpper(s1, 1));
- Assert("upper", Char.IsUpper(s1, 2));
- }
-
- public void TestIsWhiteSpace()
- {
- char c1 = ' ';
- char c2 = '\n';
- char c3 = '\t';
-
- Assert("Not whitespace", !Char.IsWhiteSpace('.'));
- Assert("whitespace1", Char.IsWhiteSpace(c1));
- Assert("whitespace2", Char.IsWhiteSpace(c2));
- Assert("whitespace3", Char.IsWhiteSpace(c3));
-
- string s1 = "." + c1 + c2 + c3;
- Assert("Not whitespace", !Char.IsWhiteSpace(s1, 0));
- Assert("whitespace1-2", Char.IsWhiteSpace(s1, 1));
- Assert("whitespace2-2", Char.IsWhiteSpace(s1, 2));
- Assert("whitespace3-2", Char.IsWhiteSpace(s1, 3));
- }
-
-
- public void TestParse()
- {
- char c1 = 'a';
- string s1 = "a";
- Assert(c1.Equals(Char.Parse(s1)));
- }
-
- public void TestToLower()
- {
- char a1 = 'a';
- char a2 = 'A';
- char a3 = 'z';
- char a4 = 'Z';
- char a5 = ' ';
- char a6 = '+';
- char b1 = 'a';
- char b2 = 'a';
- char b3 = 'z';
- char b4 = 'z';
- char b5 = ' ';
- char b6 = '+';
- AssertEquals("char lowered", b1, Char.ToLower(a1));
- AssertEquals("char lowered", b2, Char.ToLower(a2));
- AssertEquals("char lowered", b3, Char.ToLower(a3));
- AssertEquals("char lowered", b4, Char.ToLower(a4));
- AssertEquals("char lowered", b5, Char.ToLower(a5));
- AssertEquals("char lowered", b6, Char.ToLower(a6));
- }
-
- public void TestToUpper()
- {
- char a1 = 'a';
- char a2 = 'A';
- char a3 = 'z';
- char a4 = 'Z';
- char a5 = ' ';
- char a6 = '+';
- char b1 = 'A';
- char b2 = 'A';
- char b3 = 'Z';
- char b4 = 'Z';
- char b5 = ' ';
- char b6 = '+';
- AssertEquals("char uppered", b1, Char.ToUpper(a1));
- AssertEquals("char uppered", b2, Char.ToUpper(a2));
- AssertEquals("char uppered", b3, Char.ToUpper(a3));
- AssertEquals("char uppered", b4, Char.ToUpper(a4));
- AssertEquals("char uppered", b5, Char.ToUpper(a5));
- AssertEquals("char uppered", b6, Char.ToUpper(a6));
- }
-
-
- public void TestToString()
- {
- char c1 = 'a';
- string s1 = "a";
- Assert(s1.Equals(c1.ToString()));
- }
-
- public void TestGetTypeCode()
- {
- char c1 = 'a';
- Assert(c1.GetTypeCode().Equals(TypeCode.Char));
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ConsoleTest.cs b/mcs/class/corlib/Test/System/ConsoleTest.cs
deleted file mode 100644
index da331fa6fff..00000000000
--- a/mcs/class/corlib/Test/System/ConsoleTest.cs
+++ /dev/null
@@ -1,286 +0,0 @@
-// ConsoleTest.cs - NUnit Test Cases for the System.Console class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-
-namespace MonoTests.System
-{
-
-public class ConsoleTest : TestCase
-{
- public ConsoleTest() : base ("MonoTests.System.ConsoleTest testsuite") {}
- public ConsoleTest(string name) : base(name) {}
-
- TextWriter _err;
- TextReader _in;
- TextWriter _out;
- protected override void SetUp()
- {
- _err = Console.Error;
- _in = Console.In;
- _out = Console.Out;
- }
-
- protected override void TearDown()
- {
- Console.SetError(_err);
- Console.SetIn(_in);
- Console.SetOut(_out);
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ConsoleTest));
- }
- }
-
- public void TestError() {
- AssertNotNull("No error", Console.Error);
- }
-
- public void TestIn() {
- AssertNotNull("No in", Console.In);
- }
-
- public void TestOut() {
- AssertNotNull("No out", Console.Out);
- }
-
- public void TestOpenStandardError() {
- {
- Stream err = Console.OpenStandardError();
- AssertNotNull("Can't open error", err);
- }
- {
- Stream err = Console.OpenStandardError(512);
- AssertNotNull("Can't open error", err);
- }
- // Spec says these are here, MS implementation says no.
- //{
- //bool errorThrown = false;
- //try {
- //Stream err = Console.OpenStandardError(-1);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("negative buffer error not thrown",
- //errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- //Stream err = Console.OpenStandardError(0);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("zero buffer error not thrown", errorThrown);
- //}
- }
-
- public void TestOpenStandardInput() {
- {
- Stream in1 = Console.OpenStandardInput();
- AssertNotNull("Can't open input", in1);
- }
- {
- Stream in1 = Console.OpenStandardInput(512);
- AssertNotNull("Can't open input", in1);
- }
- // see commented-out tests in TestOpenStandardError
- }
-
- public void TestOpenStandardOutput() {
- {
- Stream out1 = Console.OpenStandardOutput();
- AssertNotNull("Can't open output", out1);
- }
- {
- Stream out1 = Console.OpenStandardOutput(512);
- AssertNotNull("Can't open output", out1);
- }
- // see commented-out tests in TestOpenStandardError
- }
-
- public void TestRead() {
- String testStr = "This is a readline test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetIn(r);
- w.WriteLine(testStr);
- s.Position = 0;
- char val = (char) Console.Read();
- AssertEquals("Wrong read", 'T', val);
- }
-
- public void TestReadLine() {
- String testStr = "This is a readline test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetIn(r);
- w.WriteLine(testStr);
- s.Position = 0;
- String line = Console.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
-
- public void TestSetError() {
- {
- bool errorThrown = false;
- try {
- Console.SetError(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null error error not thrown", errorThrown);
- }
- {
- String testStr = "This is a stderr test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetError(w);
- Console.Error.WriteLine(testStr);
- s.Position = 0;
- String line = r.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
- }
-
- public void TestSetIn() {
- {
- bool errorThrown = false;
- try {
- Console.SetIn(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null in error not thrown", errorThrown);
- }
- {
- String testStr = "This is a stdin test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetIn(r);
- w.WriteLine(testStr);
- s.Position = 0;
- String line = Console.In.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
- }
-
- public void TestSetOut() {
- {
- bool errorThrown = false;
- try {
- Console.SetOut(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null out error not thrown", errorThrown);
- }
- {
- String testStr = "This is a stdout test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetOut(w);
- Console.Out.WriteLine(testStr);
- s.Position = 0;
- String line = r.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
- }
-
- public void TestWrite() {
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetOut(w);
-
- long endPos = 0;
-
- String testStr = "This is a stdout write test";
- Console.Write(testStr);
- s.Position = endPos;
- String line = r.ReadToEnd();
- AssertEquals("Wrong line", testStr, line);
- endPos = s.Position;
-
- Boolean[] booleans = {true, false};
- foreach (bool b in booleans ) {
- Console.Write(b);
- s.Position = endPos;
- line = r.ReadToEnd();
- AssertEquals("Wrong boolean", b.ToString(), line);
- endPos = s.Position;
- }
-
- Char[] chars = {'a', ';', '?'};
- foreach (Char c in chars ) {
- Console.Write(c);
- s.Position = endPos;
- line = r.ReadToEnd();
- AssertEquals("Wrong char", c.ToString(), line);
- endPos = s.Position;
- }
-
- // TODO - Likewise for char[], decimal, double, int, long, object, single, uint32, uint64
- // TODO - write with format string
- }
-
- public void TestWriteLine() {
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetOut(w);
-
- long endPos = 0;
-
- String testStr = "This is a stdout writeline test";
- Console.WriteLine(testStr);
- s.Position = endPos;
- String line = r.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- endPos = s.Position;
-
- Boolean[] booleans = {true, false};
- foreach (bool b in booleans ) {
- Console.WriteLine(b);
- s.Position = endPos;
- line = r.ReadLine();
- AssertEquals("Wrong boolean", b.ToString(), line);
- endPos = s.Position;
- }
-
- Char[] chars = {'a', ';', '?'};
- foreach (Char c in chars ) {
- Console.WriteLine(c);
- s.Position = endPos;
- line = r.ReadLine();
- AssertEquals("Wrong char", c.ToString(), line);
- endPos = s.Position;
- }
-
- // TODO - Likewise for char[], decimal, double, int, long, object, single, uint32, uint64
- // TODO - write with format string
- }
-
-}
-}
diff --git a/mcs/class/corlib/Test/System/DateTimeTest.cs b/mcs/class/corlib/Test/System/DateTimeTest.cs
deleted file mode 100755
index 5d5e0e158b5..00000000000
--- a/mcs/class/corlib/Test/System/DateTimeTest.cs
+++ /dev/null
@@ -1,327 +0,0 @@
-//
-// DateTimeTest.cs - NUnit Test Cases for the System.DateTime struct
-//
-// author:
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Free Software Foundation
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class DateTimeTest : TestCase
-{
- static long[] myTicks = {
- 631501920000000000L, // 25 Feb 2002 - 00:00:00
- 631502475130080000L, // 25 Feb 2002 - 15:25:13,8
- 631502115130080000L, // 25 Feb 2002 - 05:25:13,8
- 631502115000000000L, // 25 Feb 2002 - 05:25:00
- 631502115130000000L, // 25 Feb 2002 - 05:25:13
- 631502079130000000L // 25 Feb 2002 - 04:25:13
- };
-
- public DateTimeTest() : base ("MonoTests.System.DateTimeTest testcase") {}
- public DateTimeTest (string name): base(name) {}
-
- public static ITest Suite
- {
- get {
- TestSuite suite = new TestSuite ();
- return suite;
- }
- }
-
- public void TestCtors ()
- {
- DateTime t1 = new DateTime (2002,2,25);
- AssertEquals("A01", myTicks[0], t1.Ticks);
- DateTime t2 = new DateTime (2002,2,25,15,25,13,8);
- AssertEquals("A02", myTicks[1], t2.Ticks);
- AssertEquals("A03", myTicks[0], t2.Date.Ticks);
- AssertEquals("A04", 2002, t2.Year);
- AssertEquals("A05", 2, t2.Month);
- AssertEquals("A06", 25, t2.Day);
- AssertEquals("A07", 15, t2.Hour);
- AssertEquals("A08", 25, t2.Minute);
- AssertEquals("A09", 13, t2.Second);
- AssertEquals("A10", 8, t2.Millisecond);
- DateTime t3 = new DateTime (2002,2,25,5,25,13,8);
- AssertEquals("A11", myTicks[2], t3.Ticks);
- }
-
- public void TestToString ()
- {
- DateTime t1 = new DateTime (myTicks[2]);
- DateTime t2 = new DateTime (myTicks[1]);
- // Standard patterns
- AssertEquals("B01", "02/25/2002", t1.ToString ("d"));
- AssertEquals("B02", "Monday, 25 February 2002", t1.ToString ("D"));
- AssertEquals("B03", "Monday, 25 February 2002 05:25", t1.ToString ("f"));
- AssertEquals("B04", "Monday, 25 February 2002 05:25:13", t1.ToString ("F"));
- AssertEquals("B05", "02/25/2002 05:25", t1.ToString ("g"));
- AssertEquals("B06", "02/25/2002 05:25:13", t1.ToString ("G"));
- AssertEquals("B07", "February 25", t1.ToString ("m"));
- AssertEquals("B08", "February 25", t1.ToString ("M"));
- AssertEquals("B09", "Mon, 25 Feb 2002 04:25:13 GMT", t1.ToString ("r"));
- AssertEquals("B10", "Mon, 25 Feb 2002 04:25:13 GMT", t1.ToString ("R"));
- AssertEquals("B11", "2002-02-25T05:25:13", t1.ToString ("s"));
- AssertEquals("B12", "05:25", t1.ToString ("t"));
- AssertEquals("B13", "05:25:13", t1.ToString ("T"));
- AssertEquals("B14", "2002-02-25 04:25:13Z", t1.ToString ("u"));
- AssertEquals("B15", "Monday, 25 February 2002 04:25:13", t1.ToString ("U"));
- AssertEquals("B16", "2002 February", t1.ToString ("y"));
- AssertEquals("B17", "2002 February", t1.ToString ("Y"));
-
- // Custom patterns
- AssertEquals("C01", "25", t1.ToString ("%d"));
- AssertEquals("C02", "25", t1.ToString ("dd"));
- AssertEquals("C03", "Mon", t1.ToString ("ddd"));
- AssertEquals("C04", "Monday", t1.ToString ("dddd"));
- AssertEquals("C05", "2", t1.ToString ("%M"));
- AssertEquals("C06", "02", t1.ToString ("MM"));
- AssertEquals("C07", "Feb", t1.ToString ("MMM"));
- AssertEquals("C08", "February", t1.ToString ("MMMM"));
- AssertEquals("C09", "2", t1.ToString ("%y"));
- AssertEquals("C10", "02", t1.ToString ("yy"));
- AssertEquals("C11", "2002", t1.ToString ("yyyy"));
- AssertEquals("C12", "5", t1.ToString ("%h"));
- AssertEquals("C13", "05", t1.ToString ("hh"));
- AssertEquals("C14", "3", t2.ToString ("%h"));
- AssertEquals("C15", "03", t2.ToString ("hh"));
- AssertEquals("C16", "15", t2.ToString ("%H"));
- AssertEquals("C17", "15", t2.ToString ("HH"));
- AssertEquals("C18", "25", t2.ToString ("%m"));
- AssertEquals("C19", "25", t2.ToString ("mm"));
- AssertEquals("C20", "13", t2.ToString ("%s"));
- AssertEquals("C21", "13", t2.ToString ("ss"));
- AssertEquals("C22", "A", t1.ToString ("%t"));
- AssertEquals("C23", "P", t2.ToString ("%t"));
- AssertEquals("C24", "AM", t1.ToString ("tt"));
- AssertEquals("C25", "PM", t2.ToString ("tt"));
- AssertEquals("C26", "+1", t1.ToString ("%z"));
- AssertEquals("C27", "+01", t1.ToString ("zz"));
- AssertEquals("C28", "+01:00", t1.ToString ("zzz"));
- AssertEquals("C29", " : ", t1.ToString (" : "));
- AssertEquals("C30", " / ", t1.ToString (" / "));
- AssertEquals("C31", " yyy ", t1.ToString (" 'yyy' "));
- AssertEquals("C32", " d", t1.ToString (" \\d"));
- }
-
- public void TestParseExact ()
- {
- // Standard patterns
- DateTime t1 = DateTime.ParseExact ("02/25/2002", "d", null);
- AssertEquals ("D01", myTicks[0], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002", "D", null);
- AssertEquals ("D02", myTicks[0], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25", "f", null);
- AssertEquals ("D03", myTicks[3], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25:13", "F", null);
- AssertEquals ("D04", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("02/25/2002 05:25", "g", null);
- AssertEquals ("D05", myTicks[3], t1.Ticks);
- t1 = DateTime.ParseExact ("02/25/2002 05:25:13", "G", null);
- AssertEquals ("D06", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("2002-02-25 04:25:13Z", "u", null);
- AssertEquals ("D07", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 04:25:13", "U", null);
- AssertEquals ("D08", myTicks[4], t1.Ticks);
-
- DateTime t2 = new DateTime (DateTime.Today.Year, 2, 25);
- t1 = DateTime.ParseExact ("February 25", "m", null);
- AssertEquals ("D09", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 25);
- t1 = DateTime.ParseExact ("February 25", "M", null);
- AssertEquals ("D10", t2.Ticks, t1.Ticks);
-
- t1 = DateTime.ParseExact ("Mon, 25 Feb 2002 04:25:13 GMT", "r", null);
- AssertEquals ("D11", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("Mon, 25 Feb 2002 04:25:13 GMT", "R", null);
- AssertEquals ("D12", myTicks[4], t1.Ticks);
-
- t1 = DateTime.ParseExact ("2002-02-25T05:25:13", "s", null);
- AssertEquals ("D13", myTicks[4], t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,0);
- t1 = DateTime.ParseExact ("05:25", "t", null);
- AssertEquals("D14", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,13);
- t1 = DateTime.ParseExact ("05:25:13", "T", null);
- AssertEquals("D15", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.ParseExact ("2002 February", "y", null);
- AssertEquals ("D16", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.ParseExact ("2002 February", "Y", null);
- AssertEquals ("D16", t2.Ticks, t1.Ticks);
-
- // Custom patterns
- t2 = new DateTime (2002, 1, 25);
- t1 = DateTime.ParseExact ("25", "%d", null);
- AssertEquals ("E01", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("25", "dd", null);
- AssertEquals ("E02", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 1);
- t1 = DateTime.ParseExact ("2", "%M", null);
- AssertEquals ("E03", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("02", "MM", null);
- AssertEquals ("E04", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("Feb", "MMM", null);
- AssertEquals ("E05", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("February", "MMMM", null);
- AssertEquals ("E06", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2005, 1, 1);
- t1 = DateTime.ParseExact ("5", "%y", null);
- AssertEquals ("E07", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("05", "yy", null);
- AssertEquals ("E08", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("2005", "yyyy", null);
- AssertEquals ("E09", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5, 0, 0);
- t1 = DateTime.ParseExact ("5A", "ht", null);
- AssertEquals ("E10", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("05A", "hht", null);
- AssertEquals ("E11", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (15, 0, 0);
- t1 = DateTime.ParseExact ("3P", "ht", null);
- AssertEquals ("E12", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("03P", "hht", null);
- AssertEquals ("E13", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5, 0, 0);
- t1 = DateTime.ParseExact ("5", "%H", null);
- AssertEquals ("E14", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (15, 0, 0);
- t1 = DateTime.ParseExact ("15", "%H", null);
- AssertEquals ("E15", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("15", "HH", null);
- AssertEquals ("E16", t2.Ticks, t1.Ticks);
-
- // Time zones
- t2 = DateTime.Today + new TimeSpan (17, 18, 0);
- t1 = DateTime.ParseExact ("11:18AM -5", "h:mmtt z", null);
- AssertEquals ("F01", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("11:18AM -05:00", "h:mmtt zzz", null);
- AssertEquals ("F02", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("7:18PM +03", "h:mmtt zz", null);
- AssertEquals ("F03", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("7:48PM +03:30", "h:mmtt zzz", null);
- AssertEquals ("F04", t2.Ticks, t1.Ticks);
-
- // Options
- t2 = DateTime.Today + new TimeSpan (16, 18, 0);
- t1 = DateTime.ParseExact ("11:18AM -5", "h:mmtt z",
- null, DateTimeStyles.AdjustToUniversal);
- AssertEquals ("G01", t2.Ticks, t1.Ticks);
-
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25:13", "F",
- null, DateTimeStyles.AdjustToUniversal);
- AssertEquals ("G02", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25:13",
- "dddd, dd MMMM yyyy HH:mm:ss",
- null, DateTimeStyles.AdjustToUniversal);
- AssertEquals ("G03", myTicks[4], t1.Ticks);
-
- t1 = DateTime.ParseExact ("02/25/2002", "d", null,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("G04", myTicks[0], t1.Ticks);
-
- t1 = DateTime.ParseExact (" 02/25/2002", "d", null,
- DateTimeStyles.AllowLeadingWhite);
- AssertEquals ("G05", myTicks[0], t1.Ticks);
-
- t1 = DateTime.ParseExact ("02/25/2002 ", "d", null,
- DateTimeStyles.AllowTrailingWhite);
- AssertEquals ("G06", myTicks[0], t1.Ticks);
-
- t1 = DateTime.ParseExact (" 02 / 25 / 2002 ", "d", null,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("G07", myTicks[0], t1.Ticks);
- }
-
- public void TestParse ()
- {
- // Standard patterns
- DateTime t1 = DateTime.Parse ("02/25/2002");
- AssertEquals ("H01", myTicks[0], t1.Ticks);
- t1 = DateTime.Parse ("Monday, 25 February 2002");
- AssertEquals ("H02", myTicks[0], t1.Ticks);
- t1 = DateTime.Parse ("Monday, 25 February 2002 05:25");
- AssertEquals ("H03", myTicks[3], t1.Ticks);
- t1 = DateTime.Parse ("Monday, 25 February 2002 05:25:13");
- AssertEquals ("H04", myTicks[4], t1.Ticks);
- t1 = DateTime.Parse ("02/25/2002 05:25");
- AssertEquals ("H05", myTicks[3], t1.Ticks);
- t1 = DateTime.Parse ("02/25/2002 05:25:13");
- AssertEquals ("H06", myTicks[4], t1.Ticks);
- t1 = DateTime.Parse ("2002-02-25 04:25:13Z");
- AssertEquals ("H07", myTicks[4], t1.Ticks);
-
- DateTime t2 = new DateTime (DateTime.Today.Year, 2, 25);
- t1 = DateTime.Parse ("February 25");
- AssertEquals ("H08", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 8);
- t1 = DateTime.Parse ("February 08");
- AssertEquals ("H09", t2.Ticks, t1.Ticks);
-
- t1 = DateTime.Parse ("Mon, 25 Feb 2002 04:25:13 GMT");
- AssertEquals ("H10", myTicks[4], t1.Ticks);
-
- t1 = DateTime.Parse ("2002-02-25T05:25:13");
- AssertEquals ("H11", myTicks[4], t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,0);
- t1 = DateTime.Parse ("05:25");
- AssertEquals("H12", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,13);
- t1 = DateTime.Parse ("05:25:13");
- AssertEquals("H13", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.Parse ("2002 February");
- AssertEquals ("H14", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.Parse ("2002 February");
- AssertEquals ("H15", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 8);
- t1 = DateTime.Parse ("February 8");
- AssertEquals ("H16", t2.Ticks, t1.Ticks);
- }
-
-
- protected override void RunTest ()
- {
- CultureInfo oldcult = Thread.CurrentThread.CurrentCulture;
-
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("");
-
- TestCtors ();
- TestToString ();
- TestParseExact ();
- TestParse ();
-
- Thread.CurrentThread.CurrentCulture = oldcult;
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/DecimalTest.cs b/mcs/class/corlib/Test/System/DecimalTest.cs
deleted file mode 100644
index ae0bf0a2b58..00000000000
--- a/mcs/class/corlib/Test/System/DecimalTest.cs
+++ /dev/null
@@ -1,856 +0,0 @@
-// DecimalTest.cs - NUnit Test Cases for the System.Decimal struct
-//
-// Author: Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, 2001
-//
-
-using NUnit.Framework;
-using System;
-using S = System; // for implementation switching only
-
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace MonoTests.System {
- internal struct ParseTest
- {
- public ParseTest(String str, bool exceptionFlag)
- {
- this.str = str;
- this.exceptionFlag = exceptionFlag;
- this.style = NumberStyles.Number;
- this.d = 0;
- }
-
- public ParseTest(String str, S.Decimal d)
- {
- this.str = str;
- this.exceptionFlag = false;
- this.style = NumberStyles.Number;
- this.d = d;
- }
-
- public ParseTest(String str, S.Decimal d, NumberStyles style)
- {
- this.str = str;
- this.exceptionFlag = false;
- this.style = style;
- this.d = d;
- }
-
- public String str;
- public S.Decimal d;
- public NumberStyles style;
- public bool exceptionFlag;
- }
-
- internal struct ToStringTest
- {
- public ToStringTest(String format, S.Decimal d, String str)
- {
- this.format = format;
- this.d = d;
- this.str = str;
- }
-
- public String format;
- public S.Decimal d;
- public String str;
- }
-
- /// <summary>
- /// Tests for System.Decimal
- /// </summary>
- public class DecimalTest : TestCase
- {
- public DecimalTest(string name) : base(name) {}
-
- public static ITest Suite
- {
- get { return new TestSuite(typeof(DecimalTest)); }
- }
-
- private const int negativeBitValue = unchecked ((int)0x80000000);
- private const int negativeScale4Value = unchecked ((int)0x80040000);
- private int [] parts0 = {0,0,0,0}; //Positive Zero.
- private int [] parts1 = {1,0,0,0};
- private int [] parts2 = {0,1,0,0};
- private int [] parts3 = {0,0,1,0};
- private int [] parts4 = {0,0,0,negativeBitValue}; // Negative zero.
- private int [] parts5 = {1,1,1,0};
- private int [] partsMaxValue = {-1,-1,-1,0};
- private int [] partsMinValue = {-1,-1,-1,negativeBitValue};
- private int [] parts6 = {1234, 5678, 8888, negativeScale4Value};
- private NumberFormatInfo NfiUser;
-
- protected override void SetUp()
- {
- NfiUser = new NumberFormatInfo();
- NfiUser.CurrencyDecimalDigits = 3;
- NfiUser.CurrencyDecimalSeparator = ",";
- NfiUser.CurrencyGroupSeparator = "_";
- NfiUser.CurrencyGroupSizes = new int[] { 2,1,0 };
- NfiUser.CurrencyNegativePattern = 10;
- NfiUser.CurrencyPositivePattern = 3;
- NfiUser.CurrencySymbol = "XYZ";
- NfiUser.NumberDecimalSeparator = "##";
- NfiUser.NumberDecimalDigits = 4;
- NfiUser.NumberGroupSeparator = "__";
- NfiUser.NumberGroupSizes = new int[] { 2,1 };
- NfiUser.PercentDecimalDigits = 1;
- NfiUser.PercentDecimalSeparator = ";";
- NfiUser.PercentGroupSeparator = "~";
- NfiUser.PercentGroupSizes = new int[] {1};
- NfiUser.PercentNegativePattern = 2;
- NfiUser.PercentPositivePattern = 2;
- NfiUser.PercentSymbol = "%%%";
- }
-
- public void TestToString()
- {
- ToStringTest[] tab = {
- new ToStringTest("F", 12.345678m, "12.35"),
- new ToStringTest("F3", 12.345678m, "12.346"),
- new ToStringTest("F0", 12.345678m, "12"),
- new ToStringTest("F7", 12.345678m, "12.3456780"),
- new ToStringTest("g", 12.345678m, "12.345678"),
- new ToStringTest("E", 12.345678m, "1.234568E+001"),
- new ToStringTest("E3", 12.345678m, "1.235E+001"),
- new ToStringTest("E0", 12.345678m, "1E+001"),
- new ToStringTest("e8", 12.345678m, "1.23456780e+001"),
- new ToStringTest("F", 0.0012m, "0.00"),
- new ToStringTest("F3", 0.0012m, "0.001"),
- new ToStringTest("F0", 0.0012m, "0"),
- new ToStringTest("F6", 0.0012m, "0.001200"),
- new ToStringTest("e", 0.0012m, "1.200000e-003"),
- new ToStringTest("E3", 0.0012m, "1.200E-003"),
- new ToStringTest("E0", 0.0012m, "1E-003"),
- new ToStringTest("E6", 0.0012m, "1.200000E-003"),
- new ToStringTest("F4", -0.001234m, "-0.0012"),
- new ToStringTest("E3", -0.001234m, "-1.234E-003"),
- new ToStringTest("g", -0.000012m, "-1.2e-05"),
- new ToStringTest("g", -0.00012m, "-0.00012"),
- new ToStringTest("g4", -0.00012m, "-0.00012"),
- new ToStringTest("g7", -0.00012m, "-0.00012"),
- new ToStringTest("g", -0.0001234m, "-0.0001234"),
- new ToStringTest("g", -0.0012m, "-0.0012"),
- new ToStringTest("g", -0.001234m, "-0.001234"),
- new ToStringTest("g", -0.012m, "-0.012"),
- new ToStringTest("g4", -0.012m, "-0.012"),
- new ToStringTest("g", -0.12m, "-0.12"),
- new ToStringTest("g", -1.2m, "-1.2"),
- new ToStringTest("g4", -120m, "-120"),
- new ToStringTest("g", -12m, "-12"),
- new ToStringTest("g", -120m, "-120"),
- new ToStringTest("g", -1200m, "-1200"),
- new ToStringTest("g4", -1200m, "-1200"),
- new ToStringTest("g", -1234m, "-1234"),
- new ToStringTest("g", -12000m, "-12000"),
- new ToStringTest("g4", -12000m, "-1.2e+04"),
- new ToStringTest("g5", -12000m, "-12000"),
- new ToStringTest("g", -12345m, "-12345"),
- new ToStringTest("g", -120000m, "-120000"),
- new ToStringTest("g4", -120000m, "-1.2e+05"),
- new ToStringTest("g5", -120000m, "-1.2e+05"),
- new ToStringTest("g6", -120000m, "-120000"),
- new ToStringTest("g", -123456.1m, "-123456.1"),
- new ToStringTest("g5", -123456.1m, "-1.2346e+05"),
- new ToStringTest("g6", -123456.1m, "-123456"),
- new ToStringTest("g", -1200000m, "-1200000"),
- new ToStringTest("g", -123456.1m, "-123456.1"),
- new ToStringTest("g", -123456.1m, "-123456.1"),
- new ToStringTest("g", -1234567.1m, "-1234567.1"),
- new ToStringTest("g", -12000000m, "-12000000"),
- new ToStringTest("g", -12345678.1m, "-12345678.1"),
- new ToStringTest("g", -12000000000000000000m, "-12000000000000000000"),
- new ToStringTest("F", -123, "-123.00"),
- new ToStringTest("F3", -123, "-123.000"),
- new ToStringTest("F0", -123, "-123"),
- new ToStringTest("E3", -123, "-1.230E+002"),
- new ToStringTest("E0", -123, "-1E+002"),
- new ToStringTest("E", -123, "-1.230000E+002"),
- new ToStringTest("F3", S.Decimal.MinValue, "-79228162514264337593543950335.000"),
- new ToStringTest("F", S.Decimal.MinValue, "-79228162514264337593543950335.00"),
- new ToStringTest("F0", S.Decimal.MinValue, "-79228162514264337593543950335"),
- new ToStringTest("E", S.Decimal.MinValue, "-7.922816E+028"),
- new ToStringTest("E3", S.Decimal.MinValue, "-7.923E+028"),
- new ToStringTest("E28", S.Decimal.MinValue, "-7.9228162514264337593543950335E+028"),
- new ToStringTest("E30", S.Decimal.MinValue, "-7.922816251426433759354395033500E+028"),
- new ToStringTest("E0", S.Decimal.MinValue, "-8E+028"),
- new ToStringTest("N3", S.Decimal.MinValue, "(79,228,162,514,264,337,593,543,950,335.000)"),
- new ToStringTest("N0", S.Decimal.MinValue, "(79,228,162,514,264,337,593,543,950,335)"),
- new ToStringTest("N", S.Decimal.MinValue, "(79,228,162,514,264,337,593,543,950,335.00)"),
- new ToStringTest("C", 123456.7890m, "$123,456.79"),
- new ToStringTest("C", -123456.7890m, "($123,456.79)"),
- new ToStringTest("C3", 1123456.7890m, "$1,123,456.789"),
- new ToStringTest("P", 123456.7891m, "12,345,678.91 %"),
- new ToStringTest("P", -123456.7892m, "-12,345,678.92 %"),
- new ToStringTest("P3", 1234.56789m, "123,456.789 %"),
- };
-
- NumberFormatInfo nfi = NumberFormatInfo.InvariantInfo;
-
- for (int i = 0; i < tab.Length; i++)
- {
- try
- {
- string s = tab[i].d.ToString(tab[i].format, nfi);
- if (s != tab[i].str)
- {
- Fail(tab[i].d.ToString(tab[i].format, nfi) + " (format = '" + tab[i].format + "') != " + tab[i].str);
- }
- }
- catch (OverflowException)
- {
- Fail(tab[i].d.ToString(tab[i].format, nfi) + " (format = '" + tab[i].format + "'): unexpected exception !");
- }
- }
- }
-
- public void TestCurrencyPattern()
- {
- NumberFormatInfo nfi2 = (NumberFormatInfo)NfiUser.Clone();
- S.Decimal d = -1234567.8976m;
- string[] ergCurrencyNegativePattern = new String[16] {
- "(XYZ1234_5_67,898)", "-XYZ1234_5_67,898", "XYZ-1234_5_67,898", "XYZ1234_5_67,898-",
- "(1234_5_67,898XYZ)", "-1234_5_67,898XYZ", "1234_5_67,898-XYZ", "1234_5_67,898XYZ-",
- "-1234_5_67,898 XYZ", "-XYZ 1234_5_67,898", "1234_5_67,898 XYZ-", "XYZ 1234_5_67,898-",
- "XYZ -1234_5_67,898", "1234_5_67,898- XYZ", "(XYZ 1234_5_67,898)", "(1234_5_67,898 XYZ)",
- };
-
- for (int i = 0; i < ergCurrencyNegativePattern.Length; i++)
- {
- nfi2.CurrencyNegativePattern = i;
- if (d.ToString("C", nfi2) != ergCurrencyNegativePattern[i])
- {
- Fail("CurrencyNegativePattern #" + i + " failed: " +
- d.ToString("C", nfi2) + " != " + ergCurrencyNegativePattern[i]);
- }
- }
-
- d = 1234567.8976m;
- string[] ergCurrencyPositivePattern = new String[4] {
- "XYZ1234_5_67,898", "1234_5_67,898XYZ", "XYZ 1234_5_67,898", "1234_5_67,898 XYZ",
- };
-
- for (int i = 0; i < ergCurrencyPositivePattern.Length; i++)
- {
- nfi2.CurrencyPositivePattern = i;
- if (d.ToString("C", nfi2) != ergCurrencyPositivePattern[i])
- {
- Fail("CurrencyPositivePattern #" + i + " failed: " +
- d.ToString("C", nfi2) + " != " + ergCurrencyPositivePattern[i]);
- }
- }
- }
-
- public void TestNumberNegativePattern()
- {
- NumberFormatInfo nfi2 = (NumberFormatInfo)NfiUser.Clone();
- S.Decimal d = -1234.89765m;
- string[] ergNumberNegativePattern = new String[5] {
- "(1__2__34##8976)", "-1__2__34##8976", "- 1__2__34##8976", "1__2__34##8976-", "1__2__34##8976 -",
- };
-
- for (int i = 0; i < ergNumberNegativePattern.Length; i++)
- {
- nfi2.NumberNegativePattern = i;
- if (d.ToString("N", nfi2) != ergNumberNegativePattern[i])
- {
- Fail("NumberNegativePattern #" + i + " failed: " +
- d.ToString("N", nfi2) + " != " + ergNumberNegativePattern[i]);
- }
- }
- }
-
- public void TestPercentPattern()
- {
- NumberFormatInfo nfi2 = (NumberFormatInfo)NfiUser.Clone();
- S.Decimal d = -1234.8976m;
- string[] ergPercentNegativePattern = new String[3] {
- "-1~2~3~4~8~9;8 %%%", "-1~2~3~4~8~9;8%%%", "-%%%1~2~3~4~8~9;8"
- };
-
- for (int i = 0; i < ergPercentNegativePattern.Length; i++)
- {
- nfi2.PercentNegativePattern = i;
- if (d.ToString("P", nfi2) != ergPercentNegativePattern[i])
- {
- Fail("PercentNegativePattern #" + i + " failed: " +
- d.ToString("P", nfi2) + " != " + ergPercentNegativePattern[i]);
- }
- }
-
- d = 1234.8976m;
- string[] ergPercentPositivePattern = new String[3] {
- "1~2~3~4~8~9;8 %%%", "1~2~3~4~8~9;8%%%", "%%%1~2~3~4~8~9;8"
- };
-
- for (int i = 0; i < ergPercentPositivePattern.Length; i++)
- {
- nfi2.PercentPositivePattern = i;
- if (d.ToString("P", nfi2) != ergPercentPositivePattern[i])
- {
- Fail("PercentPositivePattern #" + i + " failed: " +
- d.ToString("P", nfi2) + " != " + ergPercentPositivePattern[i]);
- }
- }
- }
-
- public void TestParse()
- {
- ParseTest[] tab = {
- new ParseTest("1.2345", 1.2345m),
- new ParseTest("-9876543210", -9876543210m),
- new ParseTest("$ ( 79,228,162,514,264,337,593,543,950,335.000 ) ", S.Decimal.MinValue, NumberStyles.Currency),
- new ParseTest("1.234567890e-10", (S.Decimal)1.234567890e-10, NumberStyles.Float),
- new ParseTest("1.234567890e-24", 1.2346e-24m, NumberStyles.Float),
- new ParseTest(" 47896396.457983645462346E10 ", 478963964579836454.62346m, NumberStyles.Float),
- new ParseTest("-7922816251426433759354395033.250000000000001", -7922816251426433759354395033.3m),
- new ParseTest("-00000000000000795033.2500000000000000", -795033.25m),
- new ParseTest("-000000000000001922816251426433759354395033.300000000000000", -1922816251426433759354395033.3m),
- new ParseTest("-7922816251426433759354395033.150000000000", -7922816251426433759354395033.2m),
- new ParseTest("-7922816251426433759354395033.2400000000000", -7922816251426433759354395033.2m),
- new ParseTest("-7922816251426433759354395033.2600000000000", -7922816251426433759354395033.3m)
- };
-
- S.Decimal d;
- for (int i = 0; i < tab.Length; i++)
- {
- try
- {
- d = S.Decimal.Parse(tab[i].str, tab[i].style, NumberFormatInfo.InvariantInfo);
- if (tab[i].exceptionFlag)
- {
- Fail(tab[i].str + ": missing exception !");
- }
- else if (d != tab[i].d)
- {
- Fail(tab[i].str + " != " + d);
- }
- }
- catch (OverflowException)
- {
- if (!tab[i].exceptionFlag)
- {
- Fail(tab[i].str + ": unexpected exception !");
- }
- }
- }
-
- try
- {
- d = S.Decimal.Parse(null);
- Fail("Expected ArgumentNullException");
- }
- catch (ArgumentNullException)
- {
- //ok
- }
-
- try
- {
- d = S.Decimal.Parse("123nx");
- Fail("Expected FormatException");
- }
- catch (FormatException)
- {
- //ok
- }
-
- try
- {
- d = S.Decimal.Parse("79228162514264337593543950336");
- Fail("Expected OverflowException" + d);
- }
- catch (OverflowException)
- {
- //ok
- }
- }
-
- public void TestConstants()
- {
- Assert(0m == (decimal)S.Decimal.Zero);
- Assert(1m == (decimal)S.Decimal.One);
- Assert(-1m == (decimal)S.Decimal.MinusOne);
- Assert(0m == (decimal)S.Decimal.Zero);
- Assert(79228162514264337593543950335m == (decimal)S.Decimal.MaxValue);
- Assert(-79228162514264337593543950335m == (decimal)S.Decimal.MinValue);
- }
-
- public void TestConstructInt32()
- {
- decimal[] dtab = {0m, 1m, -1m, 123456m, -1234567m};
- int[] itab = {0, 1, -1, 123456, -1234567};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("Int32 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- int n = (int) d;
- if (n != itab[i])
- {
- Fail("Decimal -> Int32: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(Int32.MaxValue);
- Assert((int)d == Int32.MaxValue);
-
- d = new S.Decimal(Int32.MinValue);
- Assert((int)d == Int32.MinValue);
- }
-
- public void TestConstructUInt32()
- {
- decimal[] dtab = {0m, 1m, 123456m, 123456789m};
- uint[] itab = {0, 1, 123456, 123456789};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("UInt32 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- uint n = (uint) d;
- if (n != itab[i])
- {
- Fail("Decimal -> UInt32: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(UInt32.MaxValue);
- Assert((uint)d == UInt32.MaxValue);
-
- d = new Decimal(UInt32.MinValue);
- Assert((uint)d == UInt32.MinValue);
- }
-
- public void TestConstructInt64()
- {
- decimal[] dtab = {0m, 1m, -1m, 9876543m, -9876543210m, 12345678987654321m};
- long[] itab = {0, 1, -1, 9876543, -9876543210L, 12345678987654321L};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("Int64 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- long n = (long) d;
- if (n != itab[i])
- {
- Fail("Decimal -> Int64: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(Int64.MaxValue);
- Assert((long)d == Int64.MaxValue);
-
- d = new Decimal(Int64.MinValue);
- Assert((long)d == Int64.MinValue);
- }
-
- public void TestConstructUInt64()
- {
- decimal[] dtab = {0m, 1m, 987654321m, 123456789876543210m};
- ulong[] itab = {0, 1, 987654321, 123456789876543210L};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("UInt64 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- ulong n = (ulong) d;
- if (n != itab[i])
- {
- Fail("Decimal -> UInt64: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(UInt64.MaxValue);
- Assert((ulong)d == UInt64.MaxValue);
-
- d = new Decimal(UInt64.MinValue);
- Assert((ulong)d == UInt64.MinValue);
- }
-
- public void TestConstructSingle()
- {
- S.Decimal d;
-
- d = new S.Decimal(-1.2345678f);
- Assert((decimal)d == -1.234568m);
-
- d=3;
- Assert(3.0f == (float)d);
-
- d = new S.Decimal(0.0f);
- Assert((decimal)d == 0m);
- Assert(0.0f == (float)d);
-
- d = new S.Decimal(1.0f);
- Assert((decimal)d == 1m);
- Assert(1.0f == (float)d);
-
- d = new S.Decimal(-1.2345678f);
- Assert((decimal)d == -1.234568m);
- Assert(-1.234568f == (float)d);
-
- d = new S.Decimal(1.2345673f);
- Assert((decimal)d == 1.234567m);
-
- d = new S.Decimal(1.2345673e7f);
- Assert((decimal)d == 12345670m);
-
- d = new S.Decimal(1.2345673e-17f);
- Assert((decimal)d == 0.00000000000000001234567m);
- Assert(1.234567e-17f == (float)d);
-
- // test exceptions
- try
- {
- d = new S.Decimal(Single.MaxValue);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Single.NaN);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Single.PositiveInfinity);
- Fail();
- }
- catch (OverflowException)
- {
- }
- }
-
- public void TestConstructSingleRounding()
- {
- decimal d;
-
- d = new S.Decimal(1765.2356f);
- Assert(d == 1765.236m);
-
- d = new S.Decimal(1765.23554f);
- Assert("failed banker's rule rounding test 1", d == 1765.236m);
-
- d = new S.Decimal(1765.2354f);
- Assert(d == 1765.235m);
-
- d = new S.Decimal(1765.2346f);
- Assert(d == 1765.235m);
-
- d = new S.Decimal(1765.23454f);
- Assert("failed banker's rule rounding test 2", d == 1765.234m);
-
- d = new S.Decimal(1765.2344f);
- Assert(d == 1765.234m);
-
- d = new S.Decimal(0.00017652356f);
- Assert(d == 0.0001765236m);
-
- d = new S.Decimal(0.000176523554f);
- Assert("failed banker's rule rounding test 3", d == 0.0001765236m);
-
- d = new S.Decimal(0.00017652354f);
- Assert(d == 0.0001765235m);
-
- d = new S.Decimal(0.00017652346f);
- Assert(d == 0.0001765235m);
-
- d = new S.Decimal(0.000176523454f);
- Assert("failed banker's rule rounding test 4", d == 0.0001765234m);
-
- d = new S.Decimal(0.00017652344f);
- Assert(d == 0.0001765234m);
-
- d = new S.Decimal(3.7652356e10f);
- Assert(d == 37652360000m);
-
- d = new S.Decimal(3.7652356e20f);
- Assert(d == 376523600000000000000m);
-
- d = new S.Decimal(3.76523554e20f);
- Assert("failed banker's rule rounding test 5", d == 376523600000000000000m);
-
- d = new S.Decimal(3.7652352e20f);
- Assert(d == 376523500000000000000m);
-
- d = new S.Decimal(3.7652348e20f);
- Assert(d == 376523500000000000000m);
-
- d = new S.Decimal(3.76523454e20f);
- Assert("failed banker's rule rounding test 6", d == 376523400000000000000m);
-
- d = new S.Decimal(3.7652342e20f);
- Assert(d == 376523400000000000000m);
- }
-
- public void TestConstructDouble()
- {
- S.Decimal d;
-
- d = new S.Decimal(0.0);
- Assert((decimal)d == 0m);
-
- d = new S.Decimal(1.0);
- Assert((decimal)d == 1m);
- Assert(1.0 == (double)d);
-
- d = new S.Decimal(-1.2345678901234);
- Assert((decimal)d == -1.2345678901234m);
- Assert(-1.2345678901234 == (double)d);
-
- d = new S.Decimal(1.2345678901234);
- Assert((decimal)d == 1.2345678901234m);
-
- d = new S.Decimal(1.2345678901234e8);
- Assert((decimal)d == 123456789.01234m);
- Assert(1.2345678901234e8 == (double)d);
-
- d = new S.Decimal(1.2345678901234e16);
- Assert((decimal)d == 12345678901234000m);
- Assert(1.2345678901234e16 == (double)d);
-
- d = new S.Decimal(1.2345678901234e24);
- Assert((decimal)d == 1234567890123400000000000m);
- Assert(1.2345678901234e24 == (double)d);
-
- d = new S.Decimal(1.2345678901234e28);
- Assert((decimal)d == 1.2345678901234e28m);
- Assert(1.2345678901234e28 == (double)d);
-
- d = new S.Decimal(7.2345678901234e28);
- Assert((decimal)d == 7.2345678901234e28m);
- Assert(new S.Decimal((double)d) == d);
-
- d = new S.Decimal(1.2345678901234e-8);
- Assert((decimal)d == 1.2345678901234e-8m);
-
- d = new S.Decimal(1.2345678901234e-14);
- Assert((decimal)d == 1.2345678901234e-14m);
- Assert(1.2345678901234e-14 == (double)d);
-
- d = new S.Decimal(1.2342278901234e-25);
- Assert((decimal)d == 1.234e-25m);
-
- // test exceptions
- try
- {
- d = new S.Decimal(8e28);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(8e48);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Double.NaN);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Double.PositiveInfinity);
- Fail();
- }
- catch (OverflowException)
- {
- }
- }
-
- public void TestConstructDoubleRound()
- {
- decimal d;
-
- d = new S.Decimal(1765.231234567857);
- Assert(d == 1765.23123456786m);
-
- d = new S.Decimal(1765.2312345678554);
- Assert("failed banker's rule rounding test 1", d == 1765.23123456786m);
- Assert(1765.23123456786 == (double)d);
-
- d = new S.Decimal(1765.231234567853);
- Assert(d == 1765.23123456785m);
-
- d = new S.Decimal(1765.231234567847);
- Assert(d == 1765.23123456785m);
-
- d = new S.Decimal(1765.231234567843);
- Assert(d == 1765.23123456784m);
-
- d = new S.Decimal(1.765231234567857e-9);
- Assert(d == 1.76523123456786e-9m);
-
- d = new S.Decimal(1.7652312345678554e-9);
- Assert("failed banker's rule rounding test 3", d == 1.76523123456786e-9m);
-
- d = new S.Decimal(1.765231234567853e-9);
- Assert(d == 1.76523123456785e-9m);
-
- d = new S.Decimal(1.765231234567857e+24);
- Assert(d == 1.76523123456786e+24m);
-
- d = new S.Decimal(1.7652312345678554e+24);
- Assert("failed banker's rule rounding test 4", d == 1.76523123456786e+24m);
-
- d = new S.Decimal(1.765231234567853e+24);
- Assert(d == 1.76523123456785e+24m);
-
- d = new S.Decimal(1765.2312345678454);
- Assert(d == 1765.23123456785m);
- }
-
- public void TestNegate()
- {
- decimal d;
-
- d = new S.Decimal(12345678);
- Assert((decimal)S.Decimal.Negate(d) == -12345678m);
- }
-
- public void TestPartConstruct()
- {
- decimal d;
-
- d = new Decimal(parts0);
- Assert(d == 0);
-
- d = new Decimal(parts1);
- Assert(d == 1);
-
- d = new Decimal(parts2);
- Assert(d == 4294967296m);
-
- d = new Decimal(parts3);
- Assert(d == 18446744073709551616m);
-
- d = new Decimal(parts4);
- Assert(d == 0m);
-
- d = new Decimal(parts5);
- Assert(d == 18446744078004518913m);
-
- d = new Decimal(partsMaxValue);
- Assert(d == Decimal.MaxValue);
-
- d = new Decimal(partsMinValue);
- Assert(d == Decimal.MinValue);
-
- d = new Decimal(parts6);
- int[] erg = Decimal.GetBits(d);
- for (int i = 0; i < 4; i++)
- {
- Assert(erg[i] == parts6[i]);
- }
- }
-
- public void TestFloorTruncate()
- {
- decimal[,] dtab = {
- {0m, 0m, 0m}, {1m, 1m, 1m}, {-1m, -1m, -1m}, {1.1m, 1m, 1m},
- {-1.000000000001m, -2m, -1m}, {12345.67890m,12345m,12345m},
- {-123456789012345.67890m, -123456789012346m, -123456789012345m},
- {S.Decimal.MaxValue, S.Decimal.MaxValue, S.Decimal.MaxValue},
- {S.Decimal.MinValue, S.Decimal.MinValue, S.Decimal.MinValue},
- {6.999999999m, 6m, 6m}, {-6.999999999m, -7m, -6m},
- {0.00001m, 0m, 0m}, {-0.00001m, -1m, 0m}
- };
-
- decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = S.Decimal.Floor(dtab[i,0]);
- if (d != dtab[i,1])
- {
- Fail("Floor: Floor(" + dtab[i,0] + ") != " + d);
- }
- d = S.Decimal.Truncate(dtab[i,0]);
- if (d != dtab[i,2])
- {
- Fail("Truncate: Truncate(" + dtab[i,0] + ") != " + d);
- }
- }
- }
-
- public void TestRound()
- {
- decimal[,] dtab = {
- {1m, 0, 1m}, {1.234567890m, 1, 1.2m},
- {1.234567890m, 2, 1.23m}, {1.23450000001m, 3, 1.235m},
- {1.2345m, 3, 1.234m}, {1.2355m, 3, 1.236m},
- {1.234567890m, 4, 1.2346m}, {1.23567890m, 2, 1.24m},
- {47893764694.4578563236436621m, 7, 47893764694.4578563m},
- {-47893764694.4578563236436621m, 9, -47893764694.457856324m},
- {-47893764694.4578m, 5, -47893764694.4578m}
- };
-
- decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = S.Decimal.Round(dtab[i,0], (int)dtab[i,1]);
- if (d != dtab[i,2])
- {
- Fail("Round: Round(" + dtab[i,0] + "," + (int)dtab[i,1] + ") != " + d);
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System/DecimalTest2.cs b/mcs/class/corlib/Test/System/DecimalTest2.cs
deleted file mode 100644
index b6df1478e8d..00000000000
--- a/mcs/class/corlib/Test/System/DecimalTest2.cs
+++ /dev/null
@@ -1,3125 +0,0 @@
-// DecimalTest.cs - NUnit Test Cases for the System.Decimal struct
-//
-// Author: Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, 2001
-//
-
-using NUnit.Framework;
-using System;
-using S = System; // used for implementation switching
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace MonoTests.System
-{
-
- public enum TestResultInfo
- {
- Ok = 0,
- Overflow = 1,
- ReverseRound = 2,
- DivideByZero = 3,
- ReverseOverflow = 4
- }
-
- public struct TestResult
- {
- public TestResult(int i, decimal v)
- {
- info = (TestResultInfo) i;
- val = v;
- }
-
- public TestResultInfo info;
- public decimal val;
- }
-
-
- /// <summary>
- /// Tests for System.Decimal
- /// </summary>
- public class DecimalTest2 : TestCase
- {
- public DecimalTest2(string name) : base(name) {}
-
- public static ITest Suite
- {
- get { return new TestSuite(typeof(DecimalTest2)); }
- }
-
- private void ReportOpError(string msg, int i, int j, decimal d1, decimal d2, decimal d3, decimal d3b)
- {
- Console.WriteLine("*** " + msg + " for " + d1 + " #" + i + " " + d2 + " #" + j);
- Console.WriteLine("Ist:" + d3 + " Soll:" + d3b + " delta=" + (d3 - d3b) + " ==" + (d3 == d3b));
- }
-
- public void TestCompare()
- {
- const int size = 14;
- decimal[] data = new decimal[size] {
- 0m, 1m, -1m, 2m, 10m, 0.1m, 0.11m,
- 79228162514264337593543950335m,
- -79228162514264337593543950335m,
- 27703302467091960609331879.532m,
- -3203854.9559968181492513385018m,
- -3203854.9559968181492513385017m,
- -48466870444188873796420.0286m,
- -48466870444188873796420.02860m
- };
-
- short[,] cmpTable = new short[size,size] {
- {0,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,1,1},
- {1,0,1,-1,-1,1,1,-1,1,-1,1,1,1,1},
- {-1,-1,0,-1,-1,-1,-1,-1,1,-1,1,1,1,1},
- {1,1,1,0,-1,1,1,-1,1,-1,1,1,1,1},
- {1,1,1,1,0,1,1,-1,1,-1,1,1,1,1},
- {1,-1,1,-1,-1,0,-1,-1,1,-1,1,1,1,1},
- {1,-1,1,-1,-1,1,0,-1,1,-1,1,1,1,1},
- {1,1,1,1,1,1,1,0,1,1,1,1,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1},
- {1,1,1,1,1,1,1,-1,1,0,1,1,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,0,-1,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,1,0,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,0,0},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,0,0}
- };
-
- for (int i = 0; i < size; i++)
- {
- S.Decimal d1 = data[i];
- for (int j = 0; j < size; j++)
- {
- Assert(cmpTable[i,j] == -cmpTable[j,i]);
- int x = cmpTable[i,j];
- S.Decimal d2 = data[j];
-
- int y = S.Decimal.Compare(d1, d2);
- if (y < 0) y = -1;
- else if (y > 0) y = 1;
- Assert(x == y);
-
- y = d1.CompareTo(d2);
- if (y < 0) y = -1;
- else if (y > 0) y = 1;
- Assert(x == y);
-
- bool b = d1 < d2;
- if (x != -1) b = !b;
- Assert(b);
-
- b = d1 <= d2;
- if (x == 1) b = !b;
- Assert(b);
-
- b = d1 >= d2;
- if (x == -1) b = !b;
- Assert(b);
-
- b = d1 > d2;
- if (x != 1) b = !b;
- Assert(b);
-
- b = d1 == d2;
- if (x != 0) b = !b;
- Assert(b);
-
- b = d1.Equals(d2);
- if (x != 0) b = !b;
- Assert(b);
-
- b = S.Decimal.Equals(d1, d2);
- if (x != 0) b = !b;
- Assert(b);
- }
- }
- }
-
- public void TestRemainder()
- {
- Assert((decimal)S.Decimal.Remainder(3.6m, 1.3m) == 1.0m);
- Assert((decimal)S.Decimal.Remainder(79228162514264337593543950335m ,
- 27703302467091960609331879.53200m) == 24420760848422211464106753m);
-
- Assert((decimal)S.Decimal.Remainder(45937986975432m, 43987453m)
- == 42334506m);
- Assert((decimal)S.Decimal.Remainder(45937986975000m, 5000m)
- == 0m);
- Assert((decimal)S.Decimal.Remainder(-54789548973.6234m, 1.3356m)
- == -0.1074m);
- }
-
- public void TestAdd()
- {
- decimal[] args = auto_build2;
- TestResult[] trs = trAuto_Add_build2;
- int errOverflow = 0;
- int errOp = 0;
- int count = args.GetLength(0);
- int n = 0;
- for (int i = 0; i < count; i++)
- {
- decimal d1 = args[i];
- for (int j = 0; j < count; j++, n++)
- {
- decimal d2 = args[j];
- decimal d3 = 0;
- decimal d4 = 0;
- TestResult tr = trs[n];
- try
- {
- d3 = S.Decimal.Add(d1, d2);
- if (d3 != tr.val)
- {
- if (tr.info == TestResultInfo.Overflow)
- {
- ReportOpError("Add: expected overflow", i, j, d1, d2, d3, tr.val);
- errOverflow++;
- }
- else
- {
- ReportOpError("Add: result mismatch", i, j, d1, d2, d3, tr.val);
- errOp++;
- }
- }
- else if (tr.info == TestResultInfo.Ok)
- {
- d4 = S.Decimal.Subtract(d3, d2);
- if (d4 != d1)
- {
- ReportOpError("Subtract: result mismatch", i, j, d3, d2, d4, d1);
- errOp++;
- }
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.Overflow)
- {
- ReportOpError("Add: unexpected overflow", i, j, d1, d2, d3, 0);
- errOverflow++;
- }
- }
- }
- }
-
- if (errOverflow + errOp > 0)
- {
- Fail("" + errOp + " wrong additions, " + errOverflow + " wrong overflows");
- }
- }
-
- public void TestMult()
- {
- decimal[] args = auto_build2;
- TestResult[] trs = trAuto_Mult_build2;
- int errOverflow = 0;
- int errOp = 0;
- int count = args.GetLength(0);
- int n = 0;
- for (int i = 0; i < count; i++)
- {
- decimal d1 = args[i];
- for (int j = 0; j < count; j++, n++)
- {
- decimal d2 = args[j];
- decimal d3 = 0;
- decimal d4 = 0;
- TestResult tr = trs[n];
- try
- {
- d3 = S.Decimal.Multiply(d1, d2);
- if (d3 != tr.val)
- {
- if (tr.info == TestResultInfo.Overflow)
- {
- ReportOpError("Mult: expected overflow", i, j, d1, d2, d3, tr.val);
- errOverflow++;
- }
- else
- {
- ReportOpError("Mult: result mismatch", i, j, d1, d2, d3, tr.val);
- errOp++;
- }
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.Overflow)
- {
- ReportOpError("Mult: unexpected overflow", i, j, d1, d2, d3, 0);
- errOverflow++;
- }
- }
-
- if (d2 != 0 && tr.info != TestResultInfo.Overflow)
- {
- try
- {
- d4 = S.Decimal.Divide(d3, d2);
- if (d4 != d1 && tr.info != TestResultInfo.ReverseRound)
- {
- ReportOpError("MultDiv: result mismatch", i, j, d3, d2, d4, d1);
- errOp++;
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.ReverseOverflow)
- {
- ReportOpError("MultDiv: unexpected overflow", i, j, d3, d2, d4, d1);
- errOverflow++;
- }
- }
- }
-
- }
- }
-
- if (errOverflow + errOp > 0)
- {
- Fail("" + errOp + " wrong multiplications, " + errOverflow + " wrong overflows");
- }
- }
-
- public void TestDiv()
- {
- decimal[] args = auto_build2;
- TestResult[] trs = trAuto_Div_build2;
- int errOverflow = 0;
- int errDivideByZero = 0;
- int errOp = 0;
- int count = args.GetLength(0);
- int n = 0;
- for (int i = 0; i < count; i++)
- {
- decimal d1 = args[i];
- for (int j = 0; j < count; j++, n++)
- {
- decimal d2 = args[j];
- decimal d3 = 0;
- decimal d4 = 0;
- TestResult tr = trs[n];
- try
- {
- d3 = S.Decimal.Divide(d1, d2);
- if (d3 != tr.val)
- {
- if (tr.info == TestResultInfo.Overflow)
- {
- ReportOpError("Div: expected overflow", i, j, d1, d2, d3, tr.val);
- errOverflow++;
- }
- else if (tr.info == TestResultInfo.DivideByZero)
- {
- ReportOpError("Div: expected divide by zero", i, j, d1, d2, d3, tr.val);
- errDivideByZero++;
- }
- else
- {
- ReportOpError("Div: result mismatch", i, j, d1, d2, d3, tr.val);
- errOp++;
- }
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.Overflow)
- {
- ReportOpError("Div: unexpected overflow", i, j, d1, d2, d3, 0);
- errOverflow++;
- }
- }
- catch (DivideByZeroException)
- {
- if (tr.info != TestResultInfo.DivideByZero)
- {
- ReportOpError("Div: unexpected divide by zero", i, j, d1, d2, d3, 0);
- errDivideByZero++;
- }
- }
-
- if (d3 != 0)
- {
- try
- {
- d4 = S.Decimal.Multiply(d3, d2);
- if (d4 != d1 && tr.info != TestResultInfo.ReverseRound)
- {
- ReportOpError("DivMult: result mismatch", i, j, d3, d2, d4, d1);
- errOp++;
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.ReverseOverflow)
- {
- ReportOpError("DivMult: unexpected overflow", i, j, d3, d2, d4, d1);
- errOverflow++;
- }
- }
- }
- }
- }
-
- if (errOverflow + errOp > 0)
- {
- Fail("" + errOp + " wrong division, " + errOverflow + " wrong overflows, " + errDivideByZero + " wrong divide by zero, ");
- }
- }
-
- #region Data
-
-
- // generated argument list build2
- decimal[] auto_build2 = new decimal[] {
- 0m, // 0
- 1m, // 1
- -1m, // 2
- 2m, // 3
- 10m, // 4
- 0.1m, // 5
- 79228162514264337593543950335m, // 6
- -79228162514264337593543950335m, // 7
- 27703302467091960609331879.532m, // 8
- -3203854.9559968181492513385018m, // 9
- -48466870444188873796420.028868m, // 10
- -545193693242804794.30331374676m, // 11
- 0.7629234053338741809892531431m, // 12
- -400453059665371395972.33474452m, // 13
- 222851627785191714190050.61676m, // 14
- 14246043379204153213661335.584m, // 15
- -421123.30446308691436596648186m, // 16
- 24463288738299545.200508898642m, // 17
- -5323259153836385912697776.001m, // 18
- 102801066199805834724673169.19m, // 19
- 7081320760.3793287174700927968m, // 20
- 415752273939.77704245656837041m, // 21
- -6389392489892.6362673670820462m, // 22
- 442346282742915.0596416330681m, // 23
- -512833780867323.89020837443764m, // 24
- 608940580690915704.1450897514m, // 25
- -42535053313319986966115.037787m, // 26
- -7808274522591953107485.8812311m, // 27
- 1037807626804273037330059471.7m, // 28
- -4997122966.448652425771563042m, // 29
- };
-
-
- // generated result list build2
- TestResult[] trAuto_Add_build2 = new TestResult[] {
- new TestResult(0, 0m), // 0 + 0
- new TestResult(0, 1m), // 0 + 1
- new TestResult(0, -1m), // 0 + 2
- new TestResult(0, 2m), // 0 + 3
- new TestResult(0, 10m), // 0 + 4
- new TestResult(0, 0.1m), // 0 + 5
- new TestResult(0, 79228162514264337593543950335m), // 0 + 6
- new TestResult(0, -79228162514264337593543950335m), // 0 + 7
- new TestResult(0, 27703302467091960609331879.532m), // 0 + 8
- new TestResult(0, -3203854.9559968181492513385018m), // 0 + 9
- new TestResult(0, -48466870444188873796420.028868m), // 0 + 10
- new TestResult(0, -545193693242804794.30331374676m), // 0 + 11
- new TestResult(0, 0.7629234053338741809892531431m), // 0 + 12
- new TestResult(0, -400453059665371395972.33474452m), // 0 + 13
- new TestResult(0, 222851627785191714190050.61676m), // 0 + 14
- new TestResult(0, 14246043379204153213661335.584m), // 0 + 15
- new TestResult(0, -421123.30446308691436596648186m), // 0 + 16
- new TestResult(0, 24463288738299545.200508898642m), // 0 + 17
- new TestResult(0, -5323259153836385912697776.001m), // 0 + 18
- new TestResult(0, 102801066199805834724673169.19m), // 0 + 19
- new TestResult(0, 7081320760.3793287174700927968m), // 0 + 20
- new TestResult(0, 415752273939.77704245656837041m), // 0 + 21
- new TestResult(0, -6389392489892.6362673670820462m), // 0 + 22
- new TestResult(0, 442346282742915.0596416330681m), // 0 + 23
- new TestResult(0, -512833780867323.89020837443764m), // 0 + 24
- new TestResult(0, 608940580690915704.1450897514m), // 0 + 25
- new TestResult(0, -42535053313319986966115.037787m), // 0 + 26
- new TestResult(0, -7808274522591953107485.8812311m), // 0 + 27
- new TestResult(0, 1037807626804273037330059471.7m), // 0 + 28
- new TestResult(0, -4997122966.448652425771563042m), // 0 + 29
- new TestResult(0, 1m), // 1 + 0
- new TestResult(0, 2m), // 1 + 1
- new TestResult(0, 0m), // 1 + 2
- new TestResult(0, 3m), // 1 + 3
- new TestResult(0, 11m), // 1 + 4
- new TestResult(0, 1.1m), // 1 + 5
- new TestResult(1, 0m), // 1 + 6
- new TestResult(0, -79228162514264337593543950334m), // 1 + 7
- new TestResult(0, 27703302467091960609331880.532m), // 1 + 8
- new TestResult(0, -3203853.9559968181492513385018m), // 1 + 9
- new TestResult(0, -48466870444188873796419.028868m), // 1 + 10
- new TestResult(0, -545193693242804793.30331374676m), // 1 + 11
- new TestResult(0, 1.7629234053338741809892531431m), // 1 + 12
- new TestResult(0, -400453059665371395971.33474452m), // 1 + 13
- new TestResult(0, 222851627785191714190051.61676m), // 1 + 14
- new TestResult(0, 14246043379204153213661336.584m), // 1 + 15
- new TestResult(0, -421122.30446308691436596648186m), // 1 + 16
- new TestResult(0, 24463288738299546.200508898642m), // 1 + 17
- new TestResult(0, -5323259153836385912697775.001m), // 1 + 18
- new TestResult(0, 102801066199805834724673170.19m), // 1 + 19
- new TestResult(0, 7081320761.3793287174700927968m), // 1 + 20
- new TestResult(0, 415752273940.77704245656837041m), // 1 + 21
- new TestResult(0, -6389392489891.6362673670820462m), // 1 + 22
- new TestResult(0, 442346282742916.0596416330681m), // 1 + 23
- new TestResult(0, -512833780867322.89020837443764m), // 1 + 24
- new TestResult(0, 608940580690915705.1450897514m), // 1 + 25
- new TestResult(0, -42535053313319986966114.037787m), // 1 + 26
- new TestResult(0, -7808274522591953107484.8812311m), // 1 + 27
- new TestResult(0, 1037807626804273037330059472.7m), // 1 + 28
- new TestResult(0, -4997122965.448652425771563042m), // 1 + 29
- new TestResult(0, -1m), // 2 + 0
- new TestResult(0, 0m), // 2 + 1
- new TestResult(0, -2m), // 2 + 2
- new TestResult(0, 1m), // 2 + 3
- new TestResult(0, 9m), // 2 + 4
- new TestResult(0, -0.9m), // 2 + 5
- new TestResult(0, 79228162514264337593543950334m), // 2 + 6
- new TestResult(1, 0m), // 2 + 7
- new TestResult(0, 27703302467091960609331878.532m), // 2 + 8
- new TestResult(0, -3203855.9559968181492513385018m), // 2 + 9
- new TestResult(0, -48466870444188873796421.028868m), // 2 + 10
- new TestResult(0, -545193693242804795.30331374676m), // 2 + 11
- new TestResult(0, -0.2370765946661258190107468569m), // 2 + 12
- new TestResult(0, -400453059665371395973.33474452m), // 2 + 13
- new TestResult(0, 222851627785191714190049.61676m), // 2 + 14
- new TestResult(0, 14246043379204153213661334.584m), // 2 + 15
- new TestResult(0, -421124.30446308691436596648186m), // 2 + 16
- new TestResult(0, 24463288738299544.200508898642m), // 2 + 17
- new TestResult(0, -5323259153836385912697777.001m), // 2 + 18
- new TestResult(0, 102801066199805834724673168.19m), // 2 + 19
- new TestResult(0, 7081320759.3793287174700927968m), // 2 + 20
- new TestResult(0, 415752273938.77704245656837041m), // 2 + 21
- new TestResult(0, -6389392489893.6362673670820462m), // 2 + 22
- new TestResult(0, 442346282742914.0596416330681m), // 2 + 23
- new TestResult(0, -512833780867324.89020837443764m), // 2 + 24
- new TestResult(0, 608940580690915703.1450897514m), // 2 + 25
- new TestResult(0, -42535053313319986966116.037787m), // 2 + 26
- new TestResult(0, -7808274522591953107486.8812311m), // 2 + 27
- new TestResult(0, 1037807626804273037330059470.7m), // 2 + 28
- new TestResult(0, -4997122967.448652425771563042m), // 2 + 29
- new TestResult(0, 2m), // 3 + 0
- new TestResult(0, 3m), // 3 + 1
- new TestResult(0, 1m), // 3 + 2
- new TestResult(0, 4m), // 3 + 3
- new TestResult(0, 12m), // 3 + 4
- new TestResult(0, 2.1m), // 3 + 5
- new TestResult(1, 0m), // 3 + 6
- new TestResult(0, -79228162514264337593543950333m), // 3 + 7
- new TestResult(0, 27703302467091960609331881.532m), // 3 + 8
- new TestResult(0, -3203852.9559968181492513385018m), // 3 + 9
- new TestResult(0, -48466870444188873796418.028868m), // 3 + 10
- new TestResult(0, -545193693242804792.30331374676m), // 3 + 11
- new TestResult(0, 2.7629234053338741809892531431m), // 3 + 12
- new TestResult(0, -400453059665371395970.33474452m), // 3 + 13
- new TestResult(0, 222851627785191714190052.61676m), // 3 + 14
- new TestResult(0, 14246043379204153213661337.584m), // 3 + 15
- new TestResult(0, -421121.30446308691436596648186m), // 3 + 16
- new TestResult(0, 24463288738299547.200508898642m), // 3 + 17
- new TestResult(0, -5323259153836385912697774.001m), // 3 + 18
- new TestResult(0, 102801066199805834724673171.19m), // 3 + 19
- new TestResult(0, 7081320762.3793287174700927968m), // 3 + 20
- new TestResult(0, 415752273941.77704245656837041m), // 3 + 21
- new TestResult(0, -6389392489890.6362673670820462m), // 3 + 22
- new TestResult(0, 442346282742917.0596416330681m), // 3 + 23
- new TestResult(0, -512833780867321.89020837443764m), // 3 + 24
- new TestResult(0, 608940580690915706.1450897514m), // 3 + 25
- new TestResult(0, -42535053313319986966113.037787m), // 3 + 26
- new TestResult(0, -7808274522591953107483.8812311m), // 3 + 27
- new TestResult(0, 1037807626804273037330059473.7m), // 3 + 28
- new TestResult(0, -4997122964.448652425771563042m), // 3 + 29
- new TestResult(0, 10m), // 4 + 0
- new TestResult(0, 11m), // 4 + 1
- new TestResult(0, 9m), // 4 + 2
- new TestResult(0, 12m), // 4 + 3
- new TestResult(0, 20m), // 4 + 4
- new TestResult(0, 10.1m), // 4 + 5
- new TestResult(1, 0m), // 4 + 6
- new TestResult(0, -79228162514264337593543950325m), // 4 + 7
- new TestResult(0, 27703302467091960609331889.532m), // 4 + 8
- new TestResult(0, -3203844.9559968181492513385018m), // 4 + 9
- new TestResult(0, -48466870444188873796410.028868m), // 4 + 10
- new TestResult(0, -545193693242804784.30331374676m), // 4 + 11
- new TestResult(0, 10.762923405333874180989253143m), // 4 + 12
- new TestResult(0, -400453059665371395962.33474452m), // 4 + 13
- new TestResult(0, 222851627785191714190060.61676m), // 4 + 14
- new TestResult(0, 14246043379204153213661345.584m), // 4 + 15
- new TestResult(0, -421113.30446308691436596648186m), // 4 + 16
- new TestResult(0, 24463288738299555.200508898642m), // 4 + 17
- new TestResult(0, -5323259153836385912697766.001m), // 4 + 18
- new TestResult(0, 102801066199805834724673179.19m), // 4 + 19
- new TestResult(0, 7081320770.3793287174700927968m), // 4 + 20
- new TestResult(0, 415752273949.77704245656837041m), // 4 + 21
- new TestResult(0, -6389392489882.6362673670820462m), // 4 + 22
- new TestResult(0, 442346282742925.0596416330681m), // 4 + 23
- new TestResult(0, -512833780867313.89020837443764m), // 4 + 24
- new TestResult(0, 608940580690915714.1450897514m), // 4 + 25
- new TestResult(0, -42535053313319986966105.037787m), // 4 + 26
- new TestResult(0, -7808274522591953107475.8812311m), // 4 + 27
- new TestResult(0, 1037807626804273037330059481.7m), // 4 + 28
- new TestResult(0, -4997122956.448652425771563042m), // 4 + 29
- new TestResult(0, 0.1m), // 5 + 0
- new TestResult(0, 1.1m), // 5 + 1
- new TestResult(0, -0.9m), // 5 + 2
- new TestResult(0, 2.1m), // 5 + 3
- new TestResult(0, 10.1m), // 5 + 4
- new TestResult(0, 0.2m), // 5 + 5
- new TestResult(2, 79228162514264337593543950335m), // 5 + 6
- new TestResult(2, -79228162514264337593543950335m), // 5 + 7
- new TestResult(0, 27703302467091960609331879.632m), // 5 + 8
- new TestResult(0, -3203854.8559968181492513385018m), // 5 + 9
- new TestResult(0, -48466870444188873796419.928868m), // 5 + 10
- new TestResult(0, -545193693242804794.20331374676m), // 5 + 11
- new TestResult(0, 0.8629234053338741809892531431m), // 5 + 12
- new TestResult(0, -400453059665371395972.23474452m), // 5 + 13
- new TestResult(0, 222851627785191714190050.71676m), // 5 + 14
- new TestResult(0, 14246043379204153213661335.684m), // 5 + 15
- new TestResult(0, -421123.20446308691436596648186m), // 5 + 16
- new TestResult(0, 24463288738299545.300508898642m), // 5 + 17
- new TestResult(0, -5323259153836385912697775.901m), // 5 + 18
- new TestResult(0, 102801066199805834724673169.29m), // 5 + 19
- new TestResult(0, 7081320760.4793287174700927968m), // 5 + 20
- new TestResult(0, 415752273939.87704245656837041m), // 5 + 21
- new TestResult(0, -6389392489892.5362673670820462m), // 5 + 22
- new TestResult(0, 442346282742915.1596416330681m), // 5 + 23
- new TestResult(0, -512833780867323.79020837443764m), // 5 + 24
- new TestResult(0, 608940580690915704.2450897514m), // 5 + 25
- new TestResult(0, -42535053313319986966114.937787m), // 5 + 26
- new TestResult(0, -7808274522591953107485.7812311m), // 5 + 27
- new TestResult(0, 1037807626804273037330059471.8m), // 5 + 28
- new TestResult(0, -4997122966.348652425771563042m), // 5 + 29
- new TestResult(0, 79228162514264337593543950335m), // 6 + 0
- new TestResult(1, 0m), // 6 + 1
- new TestResult(0, 79228162514264337593543950334m), // 6 + 2
- new TestResult(1, 0m), // 6 + 3
- new TestResult(1, 0m), // 6 + 4
- new TestResult(0, 79228162514264337593543950335m), // 6 + 5
- new TestResult(1, 0m), // 6 + 6
- new TestResult(0, 0m), // 6 + 7
- new TestResult(1, 0m), // 6 + 8
- new TestResult(0, 79228162514264337593540746480m), // 6 + 9
- new TestResult(0, 79228114047393893404670153915m), // 6 + 10
- new TestResult(0, 79228162513719143900301145541m), // 6 + 11
- new TestResult(1, 0m), // 6 + 12
- new TestResult(0, 79228162113811277928172554363m), // 6 + 13
- new TestResult(1, 0m), // 6 + 14
- new TestResult(1, 0m), // 6 + 15
- new TestResult(0, 79228162514264337593543529212m), // 6 + 16
- new TestResult(1, 0m), // 6 + 17
- new TestResult(0, 79222839255110501207631252559m), // 6 + 18
- new TestResult(1, 0m), // 6 + 19
- new TestResult(1, 0m), // 6 + 20
- new TestResult(1, 0m), // 6 + 21
- new TestResult(0, 79228162514264331204151460442m), // 6 + 22
- new TestResult(1, 0m), // 6 + 23
- new TestResult(0, 79228162514263824759763083011m), // 6 + 24
- new TestResult(1, 0m), // 6 + 25
- new TestResult(0, 79228119979211024273556984220m), // 6 + 26
- new TestResult(0, 79228154705989815001590842849m), // 6 + 27
- new TestResult(1, 0m), // 6 + 28
- new TestResult(0, 79228162514264337588546827369m), // 6 + 29
- new TestResult(0, -79228162514264337593543950335m), // 7 + 0
- new TestResult(0, -79228162514264337593543950334m), // 7 + 1
- new TestResult(1, 0m), // 7 + 2
- new TestResult(0, -79228162514264337593543950333m), // 7 + 3
- new TestResult(0, -79228162514264337593543950325m), // 7 + 4
- new TestResult(0, -79228162514264337593543950335m), // 7 + 5
- new TestResult(0, 0m), // 7 + 6
- new TestResult(1, 0m), // 7 + 7
- new TestResult(0, -79200459211797245632934618455m), // 7 + 8
- new TestResult(1, 0m), // 7 + 9
- new TestResult(1, 0m), // 7 + 10
- new TestResult(1, 0m), // 7 + 11
- new TestResult(0, -79228162514264337593543950334m), // 7 + 12
- new TestResult(1, 0m), // 7 + 13
- new TestResult(0, -79227939662636552401829760284m), // 7 + 14
- new TestResult(0, -79213916470885133440330288999m), // 7 + 15
- new TestResult(1, 0m), // 7 + 16
- new TestResult(0, -79228162514239874304805650790m), // 7 + 17
- new TestResult(1, 0m), // 7 + 18
- new TestResult(0, -79125361448064531758819277166m), // 7 + 19
- new TestResult(0, -79228162514264337586462629575m), // 7 + 20
- new TestResult(0, -79228162514264337177791676395m), // 7 + 21
- new TestResult(1, 0m), // 7 + 22
- new TestResult(0, -79228162514263895247261207420m), // 7 + 23
- new TestResult(1, 0m), // 7 + 24
- new TestResult(0, -79228162513655397012853034631m), // 7 + 25
- new TestResult(1, 0m), // 7 + 26
- new TestResult(1, 0m), // 7 + 27
- new TestResult(0, -78190354887460064556213890863m), // 7 + 28
- new TestResult(1, 0m), // 7 + 29
- new TestResult(0, 27703302467091960609331879.532m), // 8 + 0
- new TestResult(0, 27703302467091960609331880.532m), // 8 + 1
- new TestResult(0, 27703302467091960609331878.532m), // 8 + 2
- new TestResult(0, 27703302467091960609331881.532m), // 8 + 3
- new TestResult(0, 27703302467091960609331889.532m), // 8 + 4
- new TestResult(0, 27703302467091960609331879.632m), // 8 + 5
- new TestResult(1, 0m), // 8 + 6
- new TestResult(2, -79200459211797245632934618455m), // 8 + 7
- new TestResult(0, 55406604934183921218663759.064m), // 8 + 8
- new TestResult(0, 27703302467091960606128024.576m), // 8 + 9
- new TestResult(0, 27654835596647771735535459.503m), // 8 + 10
- new TestResult(0, 27703301921898267366527085.229m), // 8 + 11
- new TestResult(0, 27703302467091960609331880.295m), // 8 + 12
- new TestResult(0, 27702902014032295237935907.197m), // 8 + 13
- new TestResult(0, 27926154094877152323521930.149m), // 8 + 14
- new TestResult(0, 41949345846296113822993215.116m), // 8 + 15
- new TestResult(0, 27703302467091960608910756.228m), // 8 + 16
- new TestResult(0, 27703302491555249347631424.733m), // 8 + 17
- new TestResult(0, 22380043313255574696634103.531m), // 8 + 18
- new TestResult(2, 130504368666897795334005048.72m), // 8 + 19
- new TestResult(0, 27703302467091967690652639.911m), // 8 + 20
- new TestResult(0, 27703302467092376361605819.309m), // 8 + 21
- new TestResult(0, 27703302467085571216841986.896m), // 8 + 22
- new TestResult(0, 27703302467534306892074794.592m), // 8 + 23
- new TestResult(0, 27703302466579126828464555.642m), // 8 + 24
- new TestResult(0, 27703303076032541300247583.677m), // 8 + 25
- new TestResult(0, 27660767413778640622365764.494m), // 8 + 26
- new TestResult(0, 27695494192569368656224393.651m), // 8 + 27
- new TestResult(2, 1065510929271364997939391351.2m), // 8 + 28
- new TestResult(0, 27703302467091955612208913.083m), // 8 + 29
- new TestResult(0, -3203854.9559968181492513385018m), // 9 + 0
- new TestResult(0, -3203853.9559968181492513385018m), // 9 + 1
- new TestResult(0, -3203855.9559968181492513385018m), // 9 + 2
- new TestResult(0, -3203852.9559968181492513385018m), // 9 + 3
- new TestResult(0, -3203844.9559968181492513385018m), // 9 + 4
- new TestResult(0, -3203854.8559968181492513385018m), // 9 + 5
- new TestResult(2, 79228162514264337593540746480m), // 9 + 6
- new TestResult(1, 0m), // 9 + 7
- new TestResult(2, 27703302467091960606128024.576m), // 9 + 8
- new TestResult(0, -6407709.9119936362985026770036m), // 9 + 9
- new TestResult(2, -48466870444188877000274.984865m), // 9 + 10
- new TestResult(2, -545193693246008649.25931056491m), // 9 + 11
- new TestResult(0, -3203854.1930734128153771575125m), // 9 + 12
- new TestResult(2, -400453059665374599827.29074134m), // 9 + 13
- new TestResult(2, 222851627785191710986195.66076m), // 9 + 14
- new TestResult(2, 14246043379204153210457480.628m), // 9 + 15
- new TestResult(0, -3624978.2604599050636173049837m), // 9 + 16
- new TestResult(2, 24463288735095690.244512080493m), // 9 + 17
- new TestResult(2, -5323259153836385915901630.957m), // 9 + 18
- new TestResult(2, 102801066199805834721469314.23m), // 9 + 19
- new TestResult(2, 7078116905.4233318993208414583m), // 9 + 20
- new TestResult(2, 415749070084.82104563841911907m), // 9 + 21
- new TestResult(2, -6389395693747.5922641852312975m), // 9 + 22
- new TestResult(2, 442346279539060.10364481491885m), // 9 + 23
- new TestResult(2, -512833784071178.84620519258689m), // 9 + 24
- new TestResult(2, 608940580687711849.18909293325m), // 9 + 25
- new TestResult(2, -42535053313319990169969.993784m), // 9 + 26
- new TestResult(2, -7808274522591956311340.8372279m), // 9 + 27
- new TestResult(2, 1037807626804273037326855616.7m), // 9 + 28
- new TestResult(2, -5000326821.4046492439208143805m), // 9 + 29
- new TestResult(0, -48466870444188873796420.028868m), // 10 + 0
- new TestResult(0, -48466870444188873796419.028868m), // 10 + 1
- new TestResult(0, -48466870444188873796421.028868m), // 10 + 2
- new TestResult(0, -48466870444188873796418.028868m), // 10 + 3
- new TestResult(0, -48466870444188873796410.028868m), // 10 + 4
- new TestResult(0, -48466870444188873796419.928868m), // 10 + 5
- new TestResult(2, 79228114047393893404670153915m), // 10 + 6
- new TestResult(1, 0m), // 10 + 7
- new TestResult(2, 27654835596647771735535459.503m), // 10 + 8
- new TestResult(0, -48466870444188877000274.984865m), // 10 + 9
- new TestResult(2, -96933740888377747592840.05774m), // 10 + 10
- new TestResult(0, -48467415637882116601214.332182m), // 10 + 11
- new TestResult(0, -48466870444188873796419.265945m), // 10 + 12
- new TestResult(0, -48867323503854245192392.363613m), // 10 + 13
- new TestResult(2, 174384757341002840393630.58789m), // 10 + 14
- new TestResult(2, 14197576508759964339864915.555m), // 10 + 15
- new TestResult(0, -48466870444188874217543.333331m), // 10 + 16
- new TestResult(0, -48466845980900135496874.828359m), // 10 + 17
- new TestResult(2, -5371726024280574786494196.0299m), // 10 + 18
- new TestResult(2, 102752599329361645850876749.16m), // 10 + 19
- new TestResult(0, -48466870444181792475659.649539m), // 10 + 20
- new TestResult(0, -48466870443773121522480.251826m), // 10 + 21
- new TestResult(0, -48466870450578266286312.665135m), // 10 + 22
- new TestResult(0, -48466870001842591053504.969226m), // 10 + 23
- new TestResult(0, -48466870957022654663743.919076m), // 10 + 24
- new TestResult(0, -48466261503608182880715.883778m), // 10 + 25
- new TestResult(2, -91001923757508860762535.06666m), // 10 + 26
- new TestResult(0, -56275144966780826903905.910099m), // 10 + 27
- new TestResult(2, 1037759159933828848456263051.7m), // 10 + 28
- new TestResult(0, -48466870444193870919386.47752m), // 10 + 29
- new TestResult(0, -545193693242804794.30331374676m), // 11 + 0
- new TestResult(0, -545193693242804793.30331374676m), // 11 + 1
- new TestResult(0, -545193693242804795.30331374676m), // 11 + 2
- new TestResult(0, -545193693242804792.30331374676m), // 11 + 3
- new TestResult(0, -545193693242804784.30331374676m), // 11 + 4
- new TestResult(0, -545193693242804794.20331374676m), // 11 + 5
- new TestResult(2, 79228162513719143900301145541m), // 11 + 6
- new TestResult(1, 0m), // 11 + 7
- new TestResult(2, 27703301921898267366527085.229m), // 11 + 8
- new TestResult(0, -545193693246008649.25931056491m), // 11 + 9
- new TestResult(2, -48467415637882116601214.332182m), // 11 + 10
- new TestResult(2, -1090387386485609588.6066274935m), // 11 + 11
- new TestResult(0, -545193693242804793.54039034143m), // 11 + 12
- new TestResult(2, -400998253358614200766.63805827m), // 11 + 13
- new TestResult(2, 222851082591498471385256.31345m), // 11 + 14
- new TestResult(2, 14246042834010459970856541.281m), // 11 + 15
- new TestResult(0, -545193693243225917.60777683367m), // 11 + 16
- new TestResult(0, -520730404504505249.10280484812m), // 11 + 17
- new TestResult(2, -5323259699030079155502570.3043m), // 11 + 18
- new TestResult(2, 102801065654612141481868374.89m), // 11 + 19
- new TestResult(0, -545193686161484033.92398502929m), // 11 + 20
- new TestResult(0, -545193277490530854.52627129019m), // 11 + 21
- new TestResult(0, -545200082635294686.93958111384m), // 11 + 22
- new TestResult(0, -544751346960061879.24367211369m), // 11 + 23
- new TestResult(0, -545706527023672118.1935221212m), // 11 + 24
- new TestResult(0, 63746887448110909.84177600464m), // 11 + 25
- new TestResult(2, -42535598507013229770909.341101m), // 11 + 26
- new TestResult(2, -7808819716285195912280.1845448m), // 11 + 27
- new TestResult(2, 1037807626259079344087254677.4m), // 11 + 28
- new TestResult(0, -545193698239927760.75196617253m), // 11 + 29
- new TestResult(0, 0.7629234053338741809892531431m), // 12 + 0
- new TestResult(0, 1.7629234053338741809892531431m), // 12 + 1
- new TestResult(0, -0.2370765946661258190107468569m), // 12 + 2
- new TestResult(0, 2.7629234053338741809892531431m), // 12 + 3
- new TestResult(2, 10.762923405333874180989253143m), // 12 + 4
- new TestResult(0, 0.8629234053338741809892531431m), // 12 + 5
- new TestResult(1, 0m), // 12 + 6
- new TestResult(2, -79228162514264337593543950334m), // 12 + 7
- new TestResult(2, 27703302467091960609331880.295m), // 12 + 8
- new TestResult(2, -3203854.1930734128153771575125m), // 12 + 9
- new TestResult(2, -48466870444188873796419.265945m), // 12 + 10
- new TestResult(2, -545193693242804793.54039034143m), // 12 + 11
- new TestResult(0, 1.5258468106677483619785062862m), // 12 + 12
- new TestResult(2, -400453059665371395971.57182111m), // 12 + 13
- new TestResult(2, 222851627785191714190051.37968m), // 12 + 14
- new TestResult(2, 14246043379204153213661336.347m), // 12 + 15
- new TestResult(2, -421122.54153968158049178549261m), // 12 + 16
- new TestResult(2, 24463288738299545.963432303976m), // 12 + 17
- new TestResult(2, -5323259153836385912697775.2381m), // 12 + 18
- new TestResult(2, 102801066199805834724673169.95m), // 12 + 19
- new TestResult(2, 7081320761.1422521228039669778m), // 12 + 20
- new TestResult(2, 415752273940.53996586190224459m), // 12 + 21
- new TestResult(2, -6389392489891.873343961748172m), // 12 + 22
- new TestResult(2, 442346282742915.82256503840197m), // 12 + 23
- new TestResult(2, -512833780867323.12728496910377m), // 12 + 24
- new TestResult(2, 608940580690915704.90801315673m), // 12 + 25
- new TestResult(2, -42535053313319986966114.274864m), // 12 + 26
- new TestResult(2, -7808274522591953107485.1183077m), // 12 + 27
- new TestResult(2, 1037807626804273037330059472.5m), // 12 + 28
- new TestResult(2, -4997122965.685729020437688861m), // 12 + 29
- new TestResult(0, -400453059665371395972.33474452m), // 13 + 0
- new TestResult(0, -400453059665371395971.33474452m), // 13 + 1
- new TestResult(0, -400453059665371395973.33474452m), // 13 + 2
- new TestResult(0, -400453059665371395970.33474452m), // 13 + 3
- new TestResult(0, -400453059665371395962.33474452m), // 13 + 4
- new TestResult(0, -400453059665371395972.23474452m), // 13 + 5
- new TestResult(2, 79228162113811277928172554363m), // 13 + 6
- new TestResult(1, 0m), // 13 + 7
- new TestResult(2, 27702902014032295237935907.197m), // 13 + 8
- new TestResult(0, -400453059665374599827.29074134m), // 13 + 9
- new TestResult(2, -48867323503854245192392.363613m), // 13 + 10
- new TestResult(0, -400998253358614200766.63805827m), // 13 + 11
- new TestResult(0, -400453059665371395971.57182111m), // 13 + 12
- new TestResult(2, -800906119330742791944.669489m), // 13 + 13
- new TestResult(2, 222451174725526342794078.28202m), // 13 + 14
- new TestResult(2, 14245642926144487842265363.249m), // 13 + 15
- new TestResult(0, -400453059665371817095.63920761m), // 13 + 16
- new TestResult(0, -400428596376633096427.13423562m), // 13 + 17
- new TestResult(2, -5323659606896051284093748.3357m), // 13 + 18
- new TestResult(2, 102800665746746169353277196.86m), // 13 + 19
- new TestResult(0, -400453059658290075211.9554158m), // 13 + 20
- new TestResult(0, -400453059249619122032.55770206m), // 13 + 21
- new TestResult(0, -400453066054763885864.97101189m), // 13 + 22
- new TestResult(0, -400452617319088653057.27510289m), // 13 + 23
- new TestResult(0, -400453572499152263296.22495289m), // 13 + 24
- new TestResult(0, -399844119084680480268.18965477m), // 13 + 25
- new TestResult(2, -42935506372985358362087.372532m), // 13 + 26
- new TestResult(2, -8208727582257324503458.215976m), // 13 + 27
- new TestResult(2, 1037807226351213371958663499.4m), // 13 + 28
- new TestResult(0, -400453059670368518938.78339695m), // 13 + 29
- new TestResult(0, 222851627785191714190050.61676m), // 14 + 0
- new TestResult(0, 222851627785191714190051.61676m), // 14 + 1
- new TestResult(0, 222851627785191714190049.61676m), // 14 + 2
- new TestResult(0, 222851627785191714190052.61676m), // 14 + 3
- new TestResult(0, 222851627785191714190060.61676m), // 14 + 4
- new TestResult(0, 222851627785191714190050.71676m), // 14 + 5
- new TestResult(1, 0m), // 14 + 6
- new TestResult(2, -79227939662636552401829760284m), // 14 + 7
- new TestResult(2, 27926154094877152323521930.149m), // 14 + 8
- new TestResult(0, 222851627785191710986195.66076m), // 14 + 9
- new TestResult(0, 174384757341002840393630.58789m), // 14 + 10
- new TestResult(0, 222851082591498471385256.31345m), // 14 + 11
- new TestResult(0, 222851627785191714190051.37968m), // 14 + 12
- new TestResult(0, 222451174725526342794078.28202m), // 14 + 13
- new TestResult(0, 445703255570383428380101.23352m), // 14 + 14
- new TestResult(2, 14468895006989344927851386.201m), // 14 + 15
- new TestResult(0, 222851627785191713768927.3123m), // 14 + 16
- new TestResult(0, 222851652248480452489595.81727m), // 14 + 17
- new TestResult(2, -5100407526051194198507725.3842m), // 14 + 18
- new TestResult(2, 103023917827591026438863219.81m), // 14 + 19
- new TestResult(0, 222851627785198795510810.99609m), // 14 + 20
- new TestResult(0, 222851627785607466463990.3938m), // 14 + 21
- new TestResult(0, 222851627778802321700157.98049m), // 14 + 22
- new TestResult(0, 222851628227537996932965.6764m), // 14 + 23
- new TestResult(0, 222851627272357933322726.72655m), // 14 + 24
- new TestResult(0, 222852236725772405105754.76185m), // 14 + 25
- new TestResult(0, 180316574471871727223935.57897m), // 14 + 26
- new TestResult(0, 215043353262599761082564.73553m), // 14 + 27
- new TestResult(2, 1038030478432058229044249522.3m), // 14 + 28
- new TestResult(0, 222851627785186717067084.16811m), // 14 + 29
- new TestResult(0, 14246043379204153213661335.584m), // 15 + 0
- new TestResult(0, 14246043379204153213661336.584m), // 15 + 1
- new TestResult(0, 14246043379204153213661334.584m), // 15 + 2
- new TestResult(0, 14246043379204153213661337.584m), // 15 + 3
- new TestResult(0, 14246043379204153213661345.584m), // 15 + 4
- new TestResult(0, 14246043379204153213661335.684m), // 15 + 5
- new TestResult(1, 0m), // 15 + 6
- new TestResult(2, -79213916470885133440330288999m), // 15 + 7
- new TestResult(0, 41949345846296113822993215.116m), // 15 + 8
- new TestResult(0, 14246043379204153210457480.628m), // 15 + 9
- new TestResult(0, 14197576508759964339864915.555m), // 15 + 10
- new TestResult(0, 14246042834010459970856541.281m), // 15 + 11
- new TestResult(0, 14246043379204153213661336.347m), // 15 + 12
- new TestResult(0, 14245642926144487842265363.249m), // 15 + 13
- new TestResult(0, 14468895006989344927851386.201m), // 15 + 14
- new TestResult(0, 28492086758408306427322671.168m), // 15 + 15
- new TestResult(0, 14246043379204153213240212.28m), // 15 + 16
- new TestResult(0, 14246043403667441951960880.785m), // 15 + 17
- new TestResult(0, 8922784225367767300963559.583m), // 15 + 18
- new TestResult(2, 117047109579009987938334504.77m), // 15 + 19
- new TestResult(0, 14246043379204160294982095.963m), // 15 + 20
- new TestResult(0, 14246043379204568965935275.361m), // 15 + 21
- new TestResult(0, 14246043379197763821171442.948m), // 15 + 22
- new TestResult(0, 14246043379646499496404250.644m), // 15 + 23
- new TestResult(0, 14246043378691319432794011.694m), // 15 + 24
- new TestResult(0, 14246043988144733904577039.729m), // 15 + 25
- new TestResult(0, 14203508325890833226695220.546m), // 15 + 26
- new TestResult(0, 14238235104681561260553849.703m), // 15 + 27
- new TestResult(2, 1052053670183477190543720807.3m), // 15 + 28
- new TestResult(0, 14246043379204148216538369.135m), // 15 + 29
- new TestResult(0, -421123.30446308691436596648186m), // 16 + 0
- new TestResult(0, -421122.30446308691436596648186m), // 16 + 1
- new TestResult(0, -421124.30446308691436596648186m), // 16 + 2
- new TestResult(0, -421121.30446308691436596648186m), // 16 + 3
- new TestResult(0, -421113.30446308691436596648186m), // 16 + 4
- new TestResult(0, -421123.20446308691436596648186m), // 16 + 5
- new TestResult(2, 79228162514264337593543529212m), // 16 + 6
- new TestResult(1, 0m), // 16 + 7
- new TestResult(2, 27703302467091960608910756.228m), // 16 + 8
- new TestResult(2, -3624978.2604599050636173049837m), // 16 + 9
- new TestResult(2, -48466870444188874217543.333331m), // 16 + 10
- new TestResult(2, -545193693243225917.60777683367m), // 16 + 11
- new TestResult(0, -421122.54153968158049178549261m), // 16 + 12
- new TestResult(2, -400453059665371817095.63920761m), // 16 + 13
- new TestResult(2, 222851627785191713768927.3123m), // 16 + 14
- new TestResult(2, 14246043379204153213240212.28m), // 16 + 15
- new TestResult(2, -842246.6089261738287319329637m), // 16 + 16
- new TestResult(2, 24463288737878421.896045811728m), // 16 + 17
- new TestResult(2, -5323259153836385913118899.3055m), // 16 + 18
- new TestResult(2, 102801066199805834724252045.89m), // 16 + 19
- new TestResult(2, 7080899637.0748656305557268303m), // 16 + 20
- new TestResult(2, 415751852816.47257936965400444m), // 16 + 21
- new TestResult(2, -6389392911015.9407304539964122m), // 16 + 22
- new TestResult(2, 442346282321791.75517854615373m), // 16 + 23
- new TestResult(2, -512833781288447.19467146135201m), // 16 + 24
- new TestResult(2, 608940580690494580.84062666449m), // 16 + 25
- new TestResult(2, -42535053313319987387238.34225m), // 16 + 26
- new TestResult(2, -7808274522591953528609.1856942m), // 16 + 27
- new TestResult(2, 1037807626804273037329638348.4m), // 16 + 28
- new TestResult(2, -4997544089.7531155126859290085m), // 16 + 29
- new TestResult(0, 24463288738299545.200508898642m), // 17 + 0
- new TestResult(0, 24463288738299546.200508898642m), // 17 + 1
- new TestResult(0, 24463288738299544.200508898642m), // 17 + 2
- new TestResult(0, 24463288738299547.200508898642m), // 17 + 3
- new TestResult(0, 24463288738299555.200508898642m), // 17 + 4
- new TestResult(0, 24463288738299545.300508898642m), // 17 + 5
- new TestResult(1, 0m), // 17 + 6
- new TestResult(2, -79228162514239874304805650790m), // 17 + 7
- new TestResult(2, 27703302491555249347631424.733m), // 17 + 8
- new TestResult(0, 24463288735095690.244512080493m), // 17 + 9
- new TestResult(2, -48466845980900135496874.828359m), // 17 + 10
- new TestResult(2, -520730404504505249.10280484812m), // 17 + 11
- new TestResult(0, 24463288738299545.963432303976m), // 17 + 12
- new TestResult(2, -400428596376633096427.13423562m), // 17 + 13
- new TestResult(2, 222851652248480452489595.81727m), // 17 + 14
- new TestResult(2, 14246043403667441951960880.785m), // 17 + 15
- new TestResult(0, 24463288737878421.896045811728m), // 17 + 16
- new TestResult(0, 48926577476599090.401017797284m), // 17 + 17
- new TestResult(2, -5323259129373097174398230.8005m), // 17 + 18
- new TestResult(2, 102801066224269123462972714.39m), // 17 + 19
- new TestResult(0, 24463295819620305.579837616112m), // 17 + 20
- new TestResult(0, 24463704490573484.97755135521m), // 17 + 21
- new TestResult(0, 24456899345809652.56424153156m), // 17 + 22
- new TestResult(0, 24905635021042460.26015053171m), // 17 + 23
- new TestResult(0, 23950454957432221.310300524204m), // 17 + 24
- new TestResult(2, 633403869429215249.34559865004m), // 17 + 25
- new TestResult(2, -42535028850031248666569.837278m), // 17 + 26
- new TestResult(2, -7808250059303214807940.6807222m), // 17 + 27
- new TestResult(2, 1037807626828736326068359016.9m), // 17 + 28
- new TestResult(0, 24463283741176578.75185647287m), // 17 + 29
- new TestResult(0, -5323259153836385912697776.001m), // 18 + 0
- new TestResult(0, -5323259153836385912697775.001m), // 18 + 1
- new TestResult(0, -5323259153836385912697777.001m), // 18 + 2
- new TestResult(0, -5323259153836385912697774.001m), // 18 + 3
- new TestResult(0, -5323259153836385912697766.001m), // 18 + 4
- new TestResult(0, -5323259153836385912697775.901m), // 18 + 5
- new TestResult(2, 79222839255110501207631252559m), // 18 + 6
- new TestResult(1, 0m), // 18 + 7
- new TestResult(0, 22380043313255574696634103.531m), // 18 + 8
- new TestResult(0, -5323259153836385915901630.957m), // 18 + 9
- new TestResult(0, -5371726024280574786494196.0299m), // 18 + 10
- new TestResult(0, -5323259699030079155502570.3043m), // 18 + 11
- new TestResult(0, -5323259153836385912697775.2381m), // 18 + 12
- new TestResult(0, -5323659606896051284093748.3357m), // 18 + 13
- new TestResult(0, -5100407526051194198507725.3842m), // 18 + 14
- new TestResult(0, 8922784225367767300963559.583m), // 18 + 15
- new TestResult(0, -5323259153836385913118899.3055m), // 18 + 16
- new TestResult(0, -5323259129373097174398230.8005m), // 18 + 17
- new TestResult(0, -10646518307672771825395552.002m), // 18 + 18
- new TestResult(2, 97477807045969448811975393.19m), // 18 + 19
- new TestResult(0, -5323259153836378831377015.6217m), // 18 + 20
- new TestResult(0, -5323259153835970160423836.224m), // 18 + 21
- new TestResult(0, -5323259153842775305187668.6373m), // 18 + 22
- new TestResult(0, -5323259153394039629954860.9414m), // 18 + 23
- new TestResult(0, -5323259154349219693565099.8912m), // 18 + 24
- new TestResult(0, -5323258544895805221782071.8559m), // 18 + 25
- new TestResult(0, -5365794207149705899663891.0388m), // 18 + 26
- new TestResult(0, -5331067428358977865805261.8822m), // 18 + 27
- new TestResult(2, 1032484367650436651417361695.7m), // 18 + 28
- new TestResult(0, -5323259153836390909820742.4497m), // 18 + 29
- new TestResult(0, 102801066199805834724673169.19m), // 19 + 0
- new TestResult(0, 102801066199805834724673170.19m), // 19 + 1
- new TestResult(0, 102801066199805834724673168.19m), // 19 + 2
- new TestResult(0, 102801066199805834724673171.19m), // 19 + 3
- new TestResult(0, 102801066199805834724673179.19m), // 19 + 4
- new TestResult(0, 102801066199805834724673169.29m), // 19 + 5
- new TestResult(1, 0m), // 19 + 6
- new TestResult(2, -79125361448064531758819277166m), // 19 + 7
- new TestResult(0, 130504368666897795334005048.72m), // 19 + 8
- new TestResult(0, 102801066199805834721469314.23m), // 19 + 9
- new TestResult(0, 102752599329361645850876749.16m), // 19 + 10
- new TestResult(0, 102801065654612141481868374.89m), // 19 + 11
- new TestResult(0, 102801066199805834724673169.95m), // 19 + 12
- new TestResult(0, 102800665746746169353277196.86m), // 19 + 13
- new TestResult(0, 103023917827591026438863219.81m), // 19 + 14
- new TestResult(0, 117047109579009987938334504.77m), // 19 + 15
- new TestResult(0, 102801066199805834724252045.89m), // 19 + 16
- new TestResult(0, 102801066224269123462972714.39m), // 19 + 17
- new TestResult(0, 97477807045969448811975393.19m), // 19 + 18
- new TestResult(0, 205602132399611669449346338.38m), // 19 + 19
- new TestResult(0, 102801066199805841805993929.57m), // 19 + 20
- new TestResult(0, 102801066199806250476947108.97m), // 19 + 21
- new TestResult(0, 102801066199799445332183276.55m), // 19 + 22
- new TestResult(0, 102801066200248181007416084.25m), // 19 + 23
- new TestResult(0, 102801066199293000943805845.3m), // 19 + 24
- new TestResult(0, 102801066808746415415588873.34m), // 19 + 25
- new TestResult(0, 102758531146492514737707054.15m), // 19 + 26
- new TestResult(0, 102793257925283242771565683.31m), // 19 + 27
- new TestResult(2, 1140608693004078872054732640.9m), // 19 + 28
- new TestResult(0, 102801066199805829727550202.74m), // 19 + 29
- new TestResult(0, 7081320760.3793287174700927968m), // 20 + 0
- new TestResult(0, 7081320761.3793287174700927968m), // 20 + 1
- new TestResult(0, 7081320759.3793287174700927968m), // 20 + 2
- new TestResult(0, 7081320762.3793287174700927968m), // 20 + 3
- new TestResult(0, 7081320770.3793287174700927968m), // 20 + 4
- new TestResult(0, 7081320760.4793287174700927968m), // 20 + 5
- new TestResult(1, 0m), // 20 + 6
- new TestResult(2, -79228162514264337586462629575m), // 20 + 7
- new TestResult(2, 27703302467091967690652639.911m), // 20 + 8
- new TestResult(0, 7078116905.4233318993208414583m), // 20 + 9
- new TestResult(2, -48466870444181792475659.649539m), // 20 + 10
- new TestResult(2, -545193686161484033.92398502929m), // 20 + 11
- new TestResult(0, 7081320761.1422521228039669778m), // 20 + 12
- new TestResult(2, -400453059658290075211.9554158m), // 20 + 13
- new TestResult(2, 222851627785198795510810.99609m), // 20 + 14
- new TestResult(2, 14246043379204160294982095.963m), // 20 + 15
- new TestResult(0, 7080899637.0748656305557268303m), // 20 + 16
- new TestResult(2, 24463295819620305.579837616112m), // 20 + 17
- new TestResult(2, -5323259153836378831377015.6217m), // 20 + 18
- new TestResult(2, 102801066199805841805993929.57m), // 20 + 19
- new TestResult(2, 14162641520.758657434940185594m), // 20 + 20
- new TestResult(2, 422833594700.15637117403846321m), // 20 + 21
- new TestResult(2, -6382311169132.2569386496119534m), // 20 + 22
- new TestResult(2, 442353364063675.43897035053819m), // 20 + 23
- new TestResult(2, -512826699546563.51087965696755m), // 20 + 24
- new TestResult(2, 608940587772236464.52441846887m), // 20 + 25
- new TestResult(2, -42535053313312905645354.658458m), // 20 + 26
- new TestResult(2, -7808274522584871786725.5019024m), // 20 + 27
- new TestResult(2, 1037807626804273044411380232.1m), // 20 + 28
- new TestResult(0, 2084197793.9306762916985297548m), // 20 + 29
- new TestResult(0, 415752273939.77704245656837041m), // 21 + 0
- new TestResult(0, 415752273940.77704245656837041m), // 21 + 1
- new TestResult(0, 415752273938.77704245656837041m), // 21 + 2
- new TestResult(0, 415752273941.77704245656837041m), // 21 + 3
- new TestResult(0, 415752273949.77704245656837041m), // 21 + 4
- new TestResult(0, 415752273939.87704245656837041m), // 21 + 5
- new TestResult(1, 0m), // 21 + 6
- new TestResult(2, -79228162514264337177791676395m), // 21 + 7
- new TestResult(2, 27703302467092376361605819.309m), // 21 + 8
- new TestResult(0, 415749070084.82104563841911907m), // 21 + 9
- new TestResult(2, -48466870443773121522480.251826m), // 21 + 10
- new TestResult(2, -545193277490530854.52627129019m), // 21 + 11
- new TestResult(0, 415752273940.53996586190224459m), // 21 + 12
- new TestResult(2, -400453059249619122032.55770206m), // 21 + 13
- new TestResult(2, 222851627785607466463990.3938m), // 21 + 14
- new TestResult(2, 14246043379204568965935275.361m), // 21 + 15
- new TestResult(0, 415751852816.47257936965400444m), // 21 + 16
- new TestResult(2, 24463704490573484.97755135521m), // 21 + 17
- new TestResult(2, -5323259153835970160423836.224m), // 21 + 18
- new TestResult(2, 102801066199806250476947108.97m), // 21 + 19
- new TestResult(0, 422833594700.15637117403846321m), // 21 + 20
- new TestResult(2, 831504547879.5540849131367408m), // 21 + 21
- new TestResult(2, -5973640215952.8592249105136758m), // 21 + 22
- new TestResult(2, 442762035016854.83668408963647m), // 21 + 23
- new TestResult(2, -512418028593384.11316591786927m), // 21 + 24
- new TestResult(2, 608940996443189643.92213220797m), // 21 + 25
- new TestResult(2, -42535053312904234692175.260745m), // 21 + 26
- new TestResult(2, -7808274522176200833546.1041886m), // 21 + 27
- new TestResult(2, 1037807626804273453082333411.5m), // 21 + 28
- new TestResult(0, 410755150973.32839003079680737m), // 21 + 29
- new TestResult(0, -6389392489892.6362673670820462m), // 22 + 0
- new TestResult(0, -6389392489891.6362673670820462m), // 22 + 1
- new TestResult(0, -6389392489893.6362673670820462m), // 22 + 2
- new TestResult(0, -6389392489890.6362673670820462m), // 22 + 3
- new TestResult(0, -6389392489882.6362673670820462m), // 22 + 4
- new TestResult(0, -6389392489892.5362673670820462m), // 22 + 5
- new TestResult(2, 79228162514264331204151460442m), // 22 + 6
- new TestResult(1, 0m), // 22 + 7
- new TestResult(2, 27703302467085571216841986.896m), // 22 + 8
- new TestResult(0, -6389395693747.5922641852312975m), // 22 + 9
- new TestResult(2, -48466870450578266286312.665135m), // 22 + 10
- new TestResult(2, -545200082635294686.93958111384m), // 22 + 11
- new TestResult(0, -6389392489891.873343961748172m), // 22 + 12
- new TestResult(2, -400453066054763885864.97101189m), // 22 + 13
- new TestResult(2, 222851627778802321700157.98049m), // 22 + 14
- new TestResult(2, 14246043379197763821171442.948m), // 22 + 15
- new TestResult(0, -6389392911015.9407304539964122m), // 22 + 16
- new TestResult(2, 24456899345809652.56424153156m), // 22 + 17
- new TestResult(2, -5323259153842775305187668.6373m), // 22 + 18
- new TestResult(2, 102801066199799445332183276.55m), // 22 + 19
- new TestResult(0, -6382311169132.2569386496119534m), // 22 + 20
- new TestResult(0, -5973640215952.8592249105136758m), // 22 + 21
- new TestResult(2, -12778784979785.272534734164092m), // 22 + 22
- new TestResult(2, 435956890253022.42337426598605m), // 22 + 23
- new TestResult(2, -519223173357216.52647574151969m), // 22 + 24
- new TestResult(2, 608934191298425811.50882238432m), // 22 + 25
- new TestResult(2, -42535053319709379456007.674054m), // 22 + 26
- new TestResult(2, -7808274528981345597378.5174985m), // 22 + 27
- new TestResult(2, 1037807626804266647937569579.1m), // 22 + 28
- new TestResult(0, -6394389612859.0849197928536092m), // 22 + 29
- new TestResult(0, 442346282742915.0596416330681m), // 23 + 0
- new TestResult(0, 442346282742916.0596416330681m), // 23 + 1
- new TestResult(0, 442346282742914.0596416330681m), // 23 + 2
- new TestResult(0, 442346282742917.0596416330681m), // 23 + 3
- new TestResult(0, 442346282742925.0596416330681m), // 23 + 4
- new TestResult(0, 442346282742915.1596416330681m), // 23 + 5
- new TestResult(1, 0m), // 23 + 6
- new TestResult(2, -79228162514263895247261207420m), // 23 + 7
- new TestResult(2, 27703302467534306892074794.592m), // 23 + 8
- new TestResult(0, 442346279539060.10364481491885m), // 23 + 9
- new TestResult(2, -48466870001842591053504.969226m), // 23 + 10
- new TestResult(2, -544751346960061879.24367211369m), // 23 + 11
- new TestResult(0, 442346282742915.82256503840197m), // 23 + 12
- new TestResult(2, -400452617319088653057.27510289m), // 23 + 13
- new TestResult(2, 222851628227537996932965.6764m), // 23 + 14
- new TestResult(2, 14246043379646499496404250.644m), // 23 + 15
- new TestResult(0, 442346282321791.75517854615373m), // 23 + 16
- new TestResult(2, 24905635021042460.26015053171m), // 23 + 17
- new TestResult(2, -5323259153394039629954860.9414m), // 23 + 18
- new TestResult(2, 102801066200248181007416084.25m), // 23 + 19
- new TestResult(0, 442353364063675.43897035053819m), // 23 + 20
- new TestResult(0, 442762035016854.83668408963647m), // 23 + 21
- new TestResult(0, 435956890253022.42337426598605m), // 23 + 22
- new TestResult(0, 884692565485830.1192832661362m), // 23 + 23
- new TestResult(0, -70487498124408.83056674136954m), // 23 + 24
- new TestResult(2, 609382926973658619.20473138447m), // 23 + 25
- new TestResult(2, -42535052870973704223199.978145m), // 23 + 26
- new TestResult(2, -7808274080245670364570.8215895m), // 23 + 27
- new TestResult(2, 1037807626804715383612802386.8m), // 23 + 28
- new TestResult(0, 442341285619948.61098920729654m), // 23 + 29
- new TestResult(0, -512833780867323.89020837443764m), // 24 + 0
- new TestResult(0, -512833780867322.89020837443764m), // 24 + 1
- new TestResult(0, -512833780867324.89020837443764m), // 24 + 2
- new TestResult(0, -512833780867321.89020837443764m), // 24 + 3
- new TestResult(0, -512833780867313.89020837443764m), // 24 + 4
- new TestResult(0, -512833780867323.79020837443764m), // 24 + 5
- new TestResult(2, 79228162514263824759763083011m), // 24 + 6
- new TestResult(1, 0m), // 24 + 7
- new TestResult(2, 27703302466579126828464555.642m), // 24 + 8
- new TestResult(0, -512833784071178.84620519258689m), // 24 + 9
- new TestResult(2, -48466870957022654663743.919076m), // 24 + 10
- new TestResult(2, -545706527023672118.1935221212m), // 24 + 11
- new TestResult(0, -512833780867323.12728496910377m), // 24 + 12
- new TestResult(2, -400453572499152263296.22495289m), // 24 + 13
- new TestResult(2, 222851627272357933322726.72655m), // 24 + 14
- new TestResult(2, 14246043378691319432794011.694m), // 24 + 15
- new TestResult(0, -512833781288447.19467146135201m), // 24 + 16
- new TestResult(2, 23950454957432221.310300524204m), // 24 + 17
- new TestResult(2, -5323259154349219693565099.8912m), // 24 + 18
- new TestResult(2, 102801066199293000943805845.3m), // 24 + 19
- new TestResult(0, -512826699546563.51087965696755m), // 24 + 20
- new TestResult(0, -512418028593384.11316591786927m), // 24 + 21
- new TestResult(0, -519223173357216.52647574151969m), // 24 + 22
- new TestResult(0, -70487498124408.83056674136954m), // 24 + 23
- new TestResult(2, -1025667561734647.7804167488753m), // 24 + 24
- new TestResult(2, 608427746910048380.25488137696m), // 24 + 25
- new TestResult(2, -42535053826153767833438.927995m), // 24 + 26
- new TestResult(2, -7808275035425733974809.7714395m), // 24 + 27
- new TestResult(2, 1037807626803760203549192147.8m), // 24 + 28
- new TestResult(0, -512838777990290.3388608002092m), // 24 + 29
- new TestResult(0, 608940580690915704.1450897514m), // 25 + 0
- new TestResult(0, 608940580690915705.1450897514m), // 25 + 1
- new TestResult(0, 608940580690915703.1450897514m), // 25 + 2
- new TestResult(0, 608940580690915706.1450897514m), // 25 + 3
- new TestResult(0, 608940580690915714.1450897514m), // 25 + 4
- new TestResult(0, 608940580690915704.2450897514m), // 25 + 5
- new TestResult(1, 0m), // 25 + 6
- new TestResult(2, -79228162513655397012853034631m), // 25 + 7
- new TestResult(2, 27703303076032541300247583.677m), // 25 + 8
- new TestResult(0, 608940580687711849.18909293325m), // 25 + 9
- new TestResult(2, -48466261503608182880715.883778m), // 25 + 10
- new TestResult(0, 63746887448110909.84177600464m), // 25 + 11
- new TestResult(0, 608940580690915704.90801315673m), // 25 + 12
- new TestResult(2, -399844119084680480268.18965477m), // 25 + 13
- new TestResult(2, 222852236725772405105754.76185m), // 25 + 14
- new TestResult(2, 14246043988144733904577039.729m), // 25 + 15
- new TestResult(0, 608940580690494580.84062666449m), // 25 + 16
- new TestResult(0, 633403869429215249.34559865004m), // 25 + 17
- new TestResult(2, -5323258544895805221782071.8559m), // 25 + 18
- new TestResult(2, 102801066808746415415588873.34m), // 25 + 19
- new TestResult(0, 608940587772236464.52441846887m), // 25 + 20
- new TestResult(0, 608940996443189643.92213220797m), // 25 + 21
- new TestResult(0, 608934191298425811.50882238432m), // 25 + 22
- new TestResult(0, 609382926973658619.20473138447m), // 25 + 23
- new TestResult(0, 608427746910048380.25488137696m), // 25 + 24
- new TestResult(0, 1217881161381831408.2901795028m), // 25 + 25
- new TestResult(2, -42534444372739296050410.892697m), // 25 + 26
- new TestResult(2, -7807665582011262191781.7361413m), // 25 + 27
- new TestResult(2, 1037807627413213618020975175.8m), // 25 + 28
- new TestResult(0, 608940575693792737.69643732563m), // 25 + 29
- new TestResult(0, -42535053313319986966115.037787m), // 26 + 0
- new TestResult(0, -42535053313319986966114.037787m), // 26 + 1
- new TestResult(0, -42535053313319986966116.037787m), // 26 + 2
- new TestResult(0, -42535053313319986966113.037787m), // 26 + 3
- new TestResult(0, -42535053313319986966105.037787m), // 26 + 4
- new TestResult(0, -42535053313319986966114.937787m), // 26 + 5
- new TestResult(2, 79228119979211024273556984220m), // 26 + 6
- new TestResult(1, 0m), // 26 + 7
- new TestResult(2, 27660767413778640622365764.494m), // 26 + 8
- new TestResult(0, -42535053313319990169969.993784m), // 26 + 9
- new TestResult(2, -91001923757508860762535.06666m), // 26 + 10
- new TestResult(0, -42535598507013229770909.341101m), // 26 + 11
- new TestResult(0, -42535053313319986966114.274864m), // 26 + 12
- new TestResult(0, -42935506372985358362087.372532m), // 26 + 13
- new TestResult(2, 180316574471871727223935.57897m), // 26 + 14
- new TestResult(2, 14203508325890833226695220.546m), // 26 + 15
- new TestResult(0, -42535053313319987387238.34225m), // 26 + 16
- new TestResult(0, -42535028850031248666569.837278m), // 26 + 17
- new TestResult(2, -5365794207149705899663891.0388m), // 26 + 18
- new TestResult(2, 102758531146492514737707054.15m), // 26 + 19
- new TestResult(0, -42535053313312905645354.658458m), // 26 + 20
- new TestResult(0, -42535053312904234692175.260745m), // 26 + 21
- new TestResult(0, -42535053319709379456007.674054m), // 26 + 22
- new TestResult(0, -42535052870973704223199.978145m), // 26 + 23
- new TestResult(0, -42535053826153767833438.927995m), // 26 + 24
- new TestResult(0, -42534444372739296050410.892697m), // 26 + 25
- new TestResult(2, -85070106626639973932230.07557m), // 26 + 26
- new TestResult(0, -50343327835911940073600.919018m), // 26 + 27
- new TestResult(2, 1037765091750959717343093356.7m), // 26 + 28
- new TestResult(0, -42535053313324984089081.486439m), // 26 + 29
- new TestResult(0, -7808274522591953107485.8812311m), // 27 + 0
- new TestResult(0, -7808274522591953107484.8812311m), // 27 + 1
- new TestResult(0, -7808274522591953107486.8812311m), // 27 + 2
- new TestResult(0, -7808274522591953107483.8812311m), // 27 + 3
- new TestResult(0, -7808274522591953107475.8812311m), // 27 + 4
- new TestResult(0, -7808274522591953107485.7812311m), // 27 + 5
- new TestResult(2, 79228154705989815001590842849m), // 27 + 6
- new TestResult(1, 0m), // 27 + 7
- new TestResult(2, 27695494192569368656224393.651m), // 27 + 8
- new TestResult(0, -7808274522591956311340.8372279m), // 27 + 9
- new TestResult(2, -56275144966780826903905.910099m), // 27 + 10
- new TestResult(0, -7808819716285195912280.1845448m), // 27 + 11
- new TestResult(0, -7808274522591953107485.1183077m), // 27 + 12
- new TestResult(2, -8208727582257324503458.215976m), // 27 + 13
- new TestResult(2, 215043353262599761082564.73553m), // 27 + 14
- new TestResult(2, 14238235104681561260553849.703m), // 27 + 15
- new TestResult(0, -7808274522591953528609.1856942m), // 27 + 16
- new TestResult(0, -7808250059303214807940.6807222m), // 27 + 17
- new TestResult(2, -5331067428358977865805261.8822m), // 27 + 18
- new TestResult(2, 102793257925283242771565683.31m), // 27 + 19
- new TestResult(0, -7808274522584871786725.5019024m), // 27 + 20
- new TestResult(0, -7808274522176200833546.1041886m), // 27 + 21
- new TestResult(0, -7808274528981345597378.5174985m), // 27 + 22
- new TestResult(0, -7808274080245670364570.8215895m), // 27 + 23
- new TestResult(0, -7808275035425733974809.7714395m), // 27 + 24
- new TestResult(0, -7807665582011262191781.7361413m), // 27 + 25
- new TestResult(2, -50343327835911940073600.919018m), // 27 + 26
- new TestResult(2, -15616549045183906214971.762462m), // 27 + 27
- new TestResult(2, 1037799818529750445376951985.8m), // 27 + 28
- new TestResult(0, -7808274522596950230452.3298835m), // 27 + 29
- new TestResult(0, 1037807626804273037330059471.7m), // 28 + 0
- new TestResult(0, 1037807626804273037330059472.7m), // 28 + 1
- new TestResult(0, 1037807626804273037330059470.7m), // 28 + 2
- new TestResult(0, 1037807626804273037330059473.7m), // 28 + 3
- new TestResult(0, 1037807626804273037330059481.7m), // 28 + 4
- new TestResult(0, 1037807626804273037330059471.8m), // 28 + 5
- new TestResult(1, 0m), // 28 + 6
- new TestResult(2, -78190354887460064556213890863m), // 28 + 7
- new TestResult(0, 1065510929271364997939391351.2m), // 28 + 8
- new TestResult(0, 1037807626804273037326855616.7m), // 28 + 9
- new TestResult(0, 1037759159933828848456263051.7m), // 28 + 10
- new TestResult(0, 1037807626259079344087254677.4m), // 28 + 11
- new TestResult(0, 1037807626804273037330059472.5m), // 28 + 12
- new TestResult(0, 1037807226351213371958663499.4m), // 28 + 13
- new TestResult(0, 1038030478432058229044249522.3m), // 28 + 14
- new TestResult(0, 1052053670183477190543720807.3m), // 28 + 15
- new TestResult(0, 1037807626804273037329638348.4m), // 28 + 16
- new TestResult(0, 1037807626828736326068359016.9m), // 28 + 17
- new TestResult(0, 1032484367650436651417361695.7m), // 28 + 18
- new TestResult(0, 1140608693004078872054732640.9m), // 28 + 19
- new TestResult(0, 1037807626804273044411380232.1m), // 28 + 20
- new TestResult(0, 1037807626804273453082333411.5m), // 28 + 21
- new TestResult(0, 1037807626804266647937569579.1m), // 28 + 22
- new TestResult(0, 1037807626804715383612802386.8m), // 28 + 23
- new TestResult(0, 1037807626803760203549192147.8m), // 28 + 24
- new TestResult(0, 1037807627413213618020975175.8m), // 28 + 25
- new TestResult(0, 1037765091750959717343093356.7m), // 28 + 26
- new TestResult(0, 1037799818529750445376951985.8m), // 28 + 27
- new TestResult(0, 2075615253608546074660118943.4m), // 28 + 28
- new TestResult(0, 1037807626804273032332936505.3m), // 28 + 29
- new TestResult(0, -4997122966.448652425771563042m), // 29 + 0
- new TestResult(0, -4997122965.448652425771563042m), // 29 + 1
- new TestResult(0, -4997122967.448652425771563042m), // 29 + 2
- new TestResult(0, -4997122964.448652425771563042m), // 29 + 3
- new TestResult(0, -4997122956.448652425771563042m), // 29 + 4
- new TestResult(0, -4997122966.348652425771563042m), // 29 + 5
- new TestResult(2, 79228162514264337588546827369m), // 29 + 6
- new TestResult(1, 0m), // 29 + 7
- new TestResult(2, 27703302467091955612208913.083m), // 29 + 8
- new TestResult(0, -5000326821.4046492439208143805m), // 29 + 9
- new TestResult(2, -48466870444193870919386.47752m), // 29 + 10
- new TestResult(2, -545193698239927760.75196617253m), // 29 + 11
- new TestResult(0, -4997122965.685729020437688861m), // 29 + 12
- new TestResult(2, -400453059670368518938.78339695m), // 29 + 13
- new TestResult(2, 222851627785186717067084.16811m), // 29 + 14
- new TestResult(2, 14246043379204148216538369.135m), // 29 + 15
- new TestResult(0, -4997544089.7531155126859290085m), // 29 + 16
- new TestResult(2, 24463283741176578.75185647287m), // 29 + 17
- new TestResult(2, -5323259153836390909820742.4497m), // 29 + 18
- new TestResult(2, 102801066199805829727550202.74m), // 29 + 19
- new TestResult(0, 2084197793.9306762916985297548m), // 29 + 20
- new TestResult(2, 410755150973.32839003079680737m), // 29 + 21
- new TestResult(2, -6394389612859.0849197928536092m), // 29 + 22
- new TestResult(2, 442341285619948.61098920729654m), // 29 + 23
- new TestResult(2, -512838777990290.3388608002092m), // 29 + 24
- new TestResult(2, 608940575693792737.69643732563m), // 29 + 25
- new TestResult(2, -42535053313324984089081.486439m), // 29 + 26
- new TestResult(2, -7808274522596950230452.3298835m), // 29 + 27
- new TestResult(2, 1037807626804273032332936505.3m), // 29 + 28
- new TestResult(0, -9994245932.897304851543126084m), // 29 + 29
- };
-
-
- // generated result list build2
- TestResult[] trAuto_Mult_build2 = new TestResult[] {
- new TestResult(0, 0m), // 0 * 0
- new TestResult(0, 0m), // 0 * 1
- new TestResult(0, 0m), // 0 * 2
- new TestResult(0, 0m), // 0 * 3
- new TestResult(0, 0m), // 0 * 4
- new TestResult(0, 0m), // 0 * 5
- new TestResult(0, 0m), // 0 * 6
- new TestResult(0, 0m), // 0 * 7
- new TestResult(0, 0m), // 0 * 8
- new TestResult(0, 0m), // 0 * 9
- new TestResult(0, 0m), // 0 * 10
- new TestResult(0, 0m), // 0 * 11
- new TestResult(0, 0m), // 0 * 12
- new TestResult(0, 0m), // 0 * 13
- new TestResult(0, 0m), // 0 * 14
- new TestResult(0, 0m), // 0 * 15
- new TestResult(0, 0m), // 0 * 16
- new TestResult(0, 0m), // 0 * 17
- new TestResult(0, 0m), // 0 * 18
- new TestResult(0, 0m), // 0 * 19
- new TestResult(0, 0m), // 0 * 20
- new TestResult(0, 0m), // 0 * 21
- new TestResult(0, 0m), // 0 * 22
- new TestResult(0, 0m), // 0 * 23
- new TestResult(0, 0m), // 0 * 24
- new TestResult(0, 0m), // 0 * 25
- new TestResult(0, 0m), // 0 * 26
- new TestResult(0, 0m), // 0 * 27
- new TestResult(0, 0m), // 0 * 28
- new TestResult(0, 0m), // 0 * 29
- new TestResult(0, 0m), // 1 * 0
- new TestResult(0, 1m), // 1 * 1
- new TestResult(0, -1m), // 1 * 2
- new TestResult(0, 2m), // 1 * 3
- new TestResult(0, 10m), // 1 * 4
- new TestResult(0, 0.1m), // 1 * 5
- new TestResult(0, 79228162514264337593543950335m), // 1 * 6
- new TestResult(0, -79228162514264337593543950335m), // 1 * 7
- new TestResult(0, 27703302467091960609331879.532m), // 1 * 8
- new TestResult(0, -3203854.9559968181492513385018m), // 1 * 9
- new TestResult(0, -48466870444188873796420.028868m), // 1 * 10
- new TestResult(0, -545193693242804794.30331374676m), // 1 * 11
- new TestResult(0, 0.7629234053338741809892531431m), // 1 * 12
- new TestResult(0, -400453059665371395972.33474452m), // 1 * 13
- new TestResult(0, 222851627785191714190050.61676m), // 1 * 14
- new TestResult(0, 14246043379204153213661335.584m), // 1 * 15
- new TestResult(0, -421123.30446308691436596648186m), // 1 * 16
- new TestResult(0, 24463288738299545.200508898642m), // 1 * 17
- new TestResult(0, -5323259153836385912697776.001m), // 1 * 18
- new TestResult(0, 102801066199805834724673169.19m), // 1 * 19
- new TestResult(0, 7081320760.3793287174700927968m), // 1 * 20
- new TestResult(0, 415752273939.77704245656837041m), // 1 * 21
- new TestResult(0, -6389392489892.6362673670820462m), // 1 * 22
- new TestResult(0, 442346282742915.0596416330681m), // 1 * 23
- new TestResult(0, -512833780867323.89020837443764m), // 1 * 24
- new TestResult(0, 608940580690915704.1450897514m), // 1 * 25
- new TestResult(0, -42535053313319986966115.037787m), // 1 * 26
- new TestResult(0, -7808274522591953107485.8812311m), // 1 * 27
- new TestResult(0, 1037807626804273037330059471.7m), // 1 * 28
- new TestResult(0, -4997122966.448652425771563042m), // 1 * 29
- new TestResult(0, 0m), // 2 * 0
- new TestResult(0, -1m), // 2 * 1
- new TestResult(0, 1m), // 2 * 2
- new TestResult(0, -2m), // 2 * 3
- new TestResult(0, -10m), // 2 * 4
- new TestResult(0, -0.1m), // 2 * 5
- new TestResult(0, -79228162514264337593543950335m), // 2 * 6
- new TestResult(0, 79228162514264337593543950335m), // 2 * 7
- new TestResult(0, -27703302467091960609331879.532m), // 2 * 8
- new TestResult(0, 3203854.9559968181492513385018m), // 2 * 9
- new TestResult(0, 48466870444188873796420.028868m), // 2 * 10
- new TestResult(0, 545193693242804794.30331374676m), // 2 * 11
- new TestResult(0, -0.7629234053338741809892531431m), // 2 * 12
- new TestResult(0, 400453059665371395972.33474452m), // 2 * 13
- new TestResult(0, -222851627785191714190050.61676m), // 2 * 14
- new TestResult(0, -14246043379204153213661335.584m), // 2 * 15
- new TestResult(0, 421123.30446308691436596648186m), // 2 * 16
- new TestResult(0, -24463288738299545.200508898642m), // 2 * 17
- new TestResult(0, 5323259153836385912697776.001m), // 2 * 18
- new TestResult(0, -102801066199805834724673169.19m), // 2 * 19
- new TestResult(0, -7081320760.3793287174700927968m), // 2 * 20
- new TestResult(0, -415752273939.77704245656837041m), // 2 * 21
- new TestResult(0, 6389392489892.6362673670820462m), // 2 * 22
- new TestResult(0, -442346282742915.0596416330681m), // 2 * 23
- new TestResult(0, 512833780867323.89020837443764m), // 2 * 24
- new TestResult(0, -608940580690915704.1450897514m), // 2 * 25
- new TestResult(0, 42535053313319986966115.037787m), // 2 * 26
- new TestResult(0, 7808274522591953107485.8812311m), // 2 * 27
- new TestResult(0, -1037807626804273037330059471.7m), // 2 * 28
- new TestResult(0, 4997122966.448652425771563042m), // 2 * 29
- new TestResult(0, 0m), // 3 * 0
- new TestResult(0, 2m), // 3 * 1
- new TestResult(0, -2m), // 3 * 2
- new TestResult(0, 4m), // 3 * 3
- new TestResult(0, 20m), // 3 * 4
- new TestResult(0, 0.2m), // 3 * 5
- new TestResult(1, 0m), // 3 * 6
- new TestResult(1, 0m), // 3 * 7
- new TestResult(0, 55406604934183921218663759.064m), // 3 * 8
- new TestResult(0, -6407709.9119936362985026770036m), // 3 * 9
- new TestResult(2, -96933740888377747592840.05774m), // 3 * 10
- new TestResult(0, -1090387386485609588.6066274935m), // 3 * 11
- new TestResult(0, 1.5258468106677483619785062862m), // 3 * 12
- new TestResult(2, -800906119330742791944.669489m), // 3 * 13
- new TestResult(0, 445703255570383428380101.23352m), // 3 * 14
- new TestResult(0, 28492086758408306427322671.168m), // 3 * 15
- new TestResult(0, -842246.6089261738287319329637m), // 3 * 16
- new TestResult(0, 48926577476599090.401017797284m), // 3 * 17
- new TestResult(0, -10646518307672771825395552.002m), // 3 * 18
- new TestResult(0, 205602132399611669449346338.38m), // 3 * 19
- new TestResult(2, 14162641520.758657434940185594m), // 3 * 20
- new TestResult(0, 831504547879.5540849131367408m), // 3 * 21
- new TestResult(2, -12778784979785.272534734164092m), // 3 * 22
- new TestResult(0, 884692565485830.1192832661362m), // 3 * 23
- new TestResult(0, -1025667561734647.7804167488753m), // 3 * 24
- new TestResult(0, 1217881161381831408.2901795028m), // 3 * 25
- new TestResult(2, -85070106626639973932230.07557m), // 3 * 26
- new TestResult(0, -15616549045183906214971.762462m), // 3 * 27
- new TestResult(0, 2075615253608546074660118943.4m), // 3 * 28
- new TestResult(0, -9994245932.897304851543126084m), // 3 * 29
- new TestResult(0, 0m), // 4 * 0
- new TestResult(0, 10m), // 4 * 1
- new TestResult(0, -10m), // 4 * 2
- new TestResult(0, 20m), // 4 * 3
- new TestResult(0, 100m), // 4 * 4
- new TestResult(0, 1m), // 4 * 5
- new TestResult(1, 0m), // 4 * 6
- new TestResult(1, 0m), // 4 * 7
- new TestResult(0, 277033024670919606093318795.32m), // 4 * 8
- new TestResult(0, -32038549.559968181492513385018m), // 4 * 9
- new TestResult(0, -484668704441888737964200.28868m), // 4 * 10
- new TestResult(0, -5451936932428047943.0331374676m), // 4 * 11
- new TestResult(0, 7.629234053338741809892531431m), // 4 * 12
- new TestResult(0, -4004530596653713959723.3474452m), // 4 * 13
- new TestResult(0, 2228516277851917141900506.1676m), // 4 * 14
- new TestResult(0, 142460433792041532136613355.84m), // 4 * 15
- new TestResult(0, -4211233.0446308691436596648186m), // 4 * 16
- new TestResult(0, 244632887382995452.00508898642m), // 4 * 17
- new TestResult(0, -53232591538363859126977760.01m), // 4 * 18
- new TestResult(0, 1028010661998058347246731691.9m), // 4 * 19
- new TestResult(0, 70813207603.793287174700927968m), // 4 * 20
- new TestResult(0, 4157522739397.7704245656837041m), // 4 * 21
- new TestResult(0, -63893924898926.362673670820462m), // 4 * 22
- new TestResult(0, 4423462827429150.596416330681m), // 4 * 23
- new TestResult(0, -5128337808673238.9020837443764m), // 4 * 24
- new TestResult(0, 6089405806909157041.450897514m), // 4 * 25
- new TestResult(0, -425350533133199869661150.37787m), // 4 * 26
- new TestResult(0, -78082745225919531074858.812311m), // 4 * 27
- new TestResult(0, 10378076268042730373300594717m), // 4 * 28
- new TestResult(0, -49971229664.48652425771563042m), // 4 * 29
- new TestResult(0, 0m), // 5 * 0
- new TestResult(0, 0.1m), // 5 * 1
- new TestResult(0, -0.1m), // 5 * 2
- new TestResult(0, 0.2m), // 5 * 3
- new TestResult(0, 1m), // 5 * 4
- new TestResult(0, 0.01m), // 5 * 5
- new TestResult(0, 7922816251426433759354395033.5m), // 5 * 6
- new TestResult(0, -7922816251426433759354395033.5m), // 5 * 7
- new TestResult(0, 2770330246709196060933187.9532m), // 5 * 8
- new TestResult(0, -320385.49559968181492513385018m), // 5 * 9
- new TestResult(0, -4846687044418887379642.0028868m), // 5 * 10
- new TestResult(0, -54519369324280479.430331374676m), // 5 * 11
- new TestResult(0, 0.0762923405333874180989253143m), // 5 * 12
- new TestResult(0, -40045305966537139597.233474452m), // 5 * 13
- new TestResult(0, 22285162778519171419005.061676m), // 5 * 14
- new TestResult(0, 1424604337920415321366133.5584m), // 5 * 15
- new TestResult(0, -42112.330446308691436596648186m), // 5 * 16
- new TestResult(0, 2446328873829954.5200508898642m), // 5 * 17
- new TestResult(0, -532325915383638591269777.6001m), // 5 * 18
- new TestResult(0, 10280106619980583472467316.919m), // 5 * 19
- new TestResult(0, 708132076.03793287174700927968m), // 5 * 20
- new TestResult(0, 41575227393.977704245656837041m), // 5 * 21
- new TestResult(0, -638939248989.26362673670820462m), // 5 * 22
- new TestResult(0, 44234628274291.50596416330681m), // 5 * 23
- new TestResult(0, -51283378086732.389020837443764m), // 5 * 24
- new TestResult(0, 60894058069091570.41450897514m), // 5 * 25
- new TestResult(0, -4253505331331998696611.5037787m), // 5 * 26
- new TestResult(0, -780827452259195310748.58812311m), // 5 * 27
- new TestResult(0, 103780762680427303733005947.17m), // 5 * 28
- new TestResult(0, -499712296.6448652425771563042m), // 5 * 29
- new TestResult(0, 0m), // 6 * 0
- new TestResult(0, 79228162514264337593543950335m), // 6 * 1
- new TestResult(0, -79228162514264337593543950335m), // 6 * 2
- new TestResult(1, 0m), // 6 * 3
- new TestResult(1, 0m), // 6 * 4
- new TestResult(0, 7922816251426433759354395033.5m), // 6 * 5
- new TestResult(1, 0m), // 6 * 6
- new TestResult(1, 0m), // 6 * 7
- new TestResult(1, 0m), // 6 * 8
- new TestResult(1, 0m), // 6 * 9
- new TestResult(1, 0m), // 6 * 10
- new TestResult(1, 0m), // 6 * 11
- new TestResult(4, 60445019543728147377669509413m), // 6 * 12
- new TestResult(1, 0m), // 6 * 13
- new TestResult(1, 0m), // 6 * 14
- new TestResult(1, 0m), // 6 * 15
- new TestResult(1, 0m), // 6 * 16
- new TestResult(1, 0m), // 6 * 17
- new TestResult(1, 0m), // 6 * 18
- new TestResult(1, 0m), // 6 * 19
- new TestResult(1, 0m), // 6 * 20
- new TestResult(1, 0m), // 6 * 21
- new TestResult(1, 0m), // 6 * 22
- new TestResult(1, 0m), // 6 * 23
- new TestResult(1, 0m), // 6 * 24
- new TestResult(1, 0m), // 6 * 25
- new TestResult(1, 0m), // 6 * 26
- new TestResult(1, 0m), // 6 * 27
- new TestResult(1, 0m), // 6 * 28
- new TestResult(1, 0m), // 6 * 29
- new TestResult(0, 0m), // 7 * 0
- new TestResult(0, -79228162514264337593543950335m), // 7 * 1
- new TestResult(0, 79228162514264337593543950335m), // 7 * 2
- new TestResult(1, 0m), // 7 * 3
- new TestResult(1, 0m), // 7 * 4
- new TestResult(0, -7922816251426433759354395033.5m), // 7 * 5
- new TestResult(1, 0m), // 7 * 6
- new TestResult(1, 0m), // 7 * 7
- new TestResult(1, 0m), // 7 * 8
- new TestResult(1, 0m), // 7 * 9
- new TestResult(1, 0m), // 7 * 10
- new TestResult(1, 0m), // 7 * 11
- new TestResult(4, -60445019543728147377669509413m), // 7 * 12
- new TestResult(1, 0m), // 7 * 13
- new TestResult(1, 0m), // 7 * 14
- new TestResult(1, 0m), // 7 * 15
- new TestResult(1, 0m), // 7 * 16
- new TestResult(1, 0m), // 7 * 17
- new TestResult(1, 0m), // 7 * 18
- new TestResult(1, 0m), // 7 * 19
- new TestResult(1, 0m), // 7 * 20
- new TestResult(1, 0m), // 7 * 21
- new TestResult(1, 0m), // 7 * 22
- new TestResult(1, 0m), // 7 * 23
- new TestResult(1, 0m), // 7 * 24
- new TestResult(1, 0m), // 7 * 25
- new TestResult(1, 0m), // 7 * 26
- new TestResult(1, 0m), // 7 * 27
- new TestResult(1, 0m), // 7 * 28
- new TestResult(1, 0m), // 7 * 29
- new TestResult(0, 0m), // 8 * 0
- new TestResult(0, 27703302467091960609331879.532m), // 8 * 1
- new TestResult(0, -27703302467091960609331879.532m), // 8 * 2
- new TestResult(0, 55406604934183921218663759.064m), // 8 * 3
- new TestResult(0, 277033024670919606093318795.32m), // 8 * 4
- new TestResult(0, 2770330246709196060933187.9532m), // 8 * 5
- new TestResult(1, 0m), // 8 * 6
- new TestResult(1, 0m), // 8 * 7
- new TestResult(1, 0m), // 8 * 8
- new TestResult(1, 0m), // 8 * 9
- new TestResult(1, 0m), // 8 * 10
- new TestResult(1, 0m), // 8 * 11
- new TestResult(2, 21135497857188116458095236.68m), // 8 * 12
- new TestResult(1, 0m), // 8 * 13
- new TestResult(1, 0m), // 8 * 14
- new TestResult(1, 0m), // 8 * 15
- new TestResult(1, 0m), // 8 * 16
- new TestResult(1, 0m), // 8 * 17
- new TestResult(1, 0m), // 8 * 18
- new TestResult(1, 0m), // 8 * 19
- new TestResult(1, 0m), // 8 * 20
- new TestResult(1, 0m), // 8 * 21
- new TestResult(1, 0m), // 8 * 22
- new TestResult(1, 0m), // 8 * 23
- new TestResult(1, 0m), // 8 * 24
- new TestResult(1, 0m), // 8 * 25
- new TestResult(1, 0m), // 8 * 26
- new TestResult(1, 0m), // 8 * 27
- new TestResult(1, 0m), // 8 * 28
- new TestResult(1, 0m), // 8 * 29
- new TestResult(0, 0m), // 9 * 0
- new TestResult(0, -3203854.9559968181492513385018m), // 9 * 1
- new TestResult(0, 3203854.9559968181492513385018m), // 9 * 2
- new TestResult(0, -6407709.9119936362985026770036m), // 9 * 3
- new TestResult(0, -32038549.559968181492513385018m), // 9 * 4
- new TestResult(0, -320385.49559968181492513385018m), // 9 * 5
- new TestResult(1, 0m), // 9 * 6
- new TestResult(1, 0m), // 9 * 7
- new TestResult(1, 0m), // 9 * 8
- new TestResult(2, 10264686579065.373559419307221m), // 9 * 9
- new TestResult(1, 0m), // 9 * 10
- new TestResult(2, 1746721516074169126608222.1692m), // 9 * 11
- new TestResult(2, -2444295.933224902121034426698m), // 9 * 12
- new TestResult(2, 1282993519852989666698903060.5m), // 9 * 13
- new TestResult(1, 0m), // 9 * 14
- new TestResult(1, 0m), // 9 * 15
- new TestResult(0, 1349217986089.8179781485646335m), // 9 * 16
- new TestResult(0, -78376828864182146369609.767831m), // 9 * 17
- new TestResult(1, 0m), // 9 * 18
- new TestResult(1, 0m), // 9 * 19
- new TestResult(0, -22687524613144469.045656755412m), // 9 * 20
- new TestResult(0, -1332009983328901461.3254059884m), // 9 * 21
- new TestResult(0, 20470686794551372519.831909846m), // 9 * 22
- new TestResult(0, -1417213330232658207868.9685141m), // 9 * 23
- new TestResult(0, 1643045050434361863551.7087135m), // 9 * 24
- new TestResult(0, -1950957297354170624860913.7855m), // 9 * 25
- new TestResult(1, 0m), // 9 * 26
- new TestResult(0, 25016579026989918165002777574m), // 9 * 27
- new TestResult(1, 0m), // 9 * 28
- new TestResult(2, 16010057181782036.694377696165m), // 9 * 29
- new TestResult(0, 0m), // 10 * 0
- new TestResult(0, -48466870444188873796420.028868m), // 10 * 1
- new TestResult(0, 48466870444188873796420.028868m), // 10 * 2
- new TestResult(2, -96933740888377747592840.05774m), // 10 * 3
- new TestResult(0, -484668704441888737964200.28868m), // 10 * 4
- new TestResult(0, -4846687044418887379642.0028868m), // 10 * 5
- new TestResult(1, 0m), // 10 * 6
- new TestResult(1, 0m), // 10 * 7
- new TestResult(1, 0m), // 10 * 8
- new TestResult(1, 0m), // 10 * 9
- new TestResult(1, 0m), // 10 * 10
- new TestResult(1, 0m), // 10 * 11
- new TestResult(0, -36976509845156274734545.845161m), // 10 * 12
- new TestResult(1, 0m), // 10 * 13
- new TestResult(1, 0m), // 10 * 14
- new TestResult(1, 0m), // 10 * 15
- new TestResult(2, 20410528638441139616161910791m), // 10 * 16
- new TestResult(1, 0m), // 10 * 17
- new TestResult(1, 0m), // 10 * 18
- new TestResult(1, 0m), // 10 * 19
- new TestResult(1, 0m), // 10 * 20
- new TestResult(1, 0m), // 10 * 21
- new TestResult(1, 0m), // 10 * 22
- new TestResult(1, 0m), // 10 * 23
- new TestResult(1, 0m), // 10 * 24
- new TestResult(1, 0m), // 10 * 25
- new TestResult(1, 0m), // 10 * 26
- new TestResult(1, 0m), // 10 * 27
- new TestResult(1, 0m), // 10 * 28
- new TestResult(1, 0m), // 10 * 29
- new TestResult(0, 0m), // 11 * 0
- new TestResult(0, -545193693242804794.30331374676m), // 11 * 1
- new TestResult(0, 545193693242804794.30331374676m), // 11 * 2
- new TestResult(2, -1090387386485609588.6066274935m), // 11 * 3
- new TestResult(0, -5451936932428047943.0331374676m), // 11 * 4
- new TestResult(0, -54519369324280479.430331374676m), // 11 * 5
- new TestResult(1, 0m), // 11 * 6
- new TestResult(1, 0m), // 11 * 7
- new TestResult(1, 0m), // 11 * 8
- new TestResult(2, 1746721516074169126608222.1692m), // 11 * 9
- new TestResult(1, 0m), // 11 * 10
- new TestResult(1, 0m), // 11 * 11
- new TestResult(0, -415941029015352223.2321562927m), // 11 * 12
- new TestResult(1, 0m), // 11 * 13
- new TestResult(1, 0m), // 11 * 14
- new TestResult(1, 0m), // 11 * 15
- new TestResult(0, 229593769670844494339647.60593m), // 11 * 16
- new TestResult(1, 0m), // 11 * 17
- new TestResult(1, 0m), // 11 * 18
- new TestResult(1, 0m), // 11 * 19
- new TestResult(0, -3860691418388152934958161711.9m), // 11 * 20
- new TestResult(1, 0m), // 11 * 21
- new TestResult(1, 0m), // 11 * 22
- new TestResult(1, 0m), // 11 * 23
- new TestResult(1, 0m), // 11 * 24
- new TestResult(1, 0m), // 11 * 25
- new TestResult(1, 0m), // 11 * 26
- new TestResult(1, 0m), // 11 * 27
- new TestResult(1, 0m), // 11 * 28
- new TestResult(2, 2724399925666581324856736883m), // 11 * 29
- new TestResult(0, 0m), // 12 * 0
- new TestResult(0, 0.7629234053338741809892531431m), // 12 * 1
- new TestResult(0, -0.7629234053338741809892531431m), // 12 * 2
- new TestResult(0, 1.5258468106677483619785062862m), // 12 * 3
- new TestResult(0, 7.629234053338741809892531431m), // 12 * 4
- new TestResult(2, 0.0762923405333874180989253143m), // 12 * 5
- new TestResult(0, 60445019543728147377669509413m), // 12 * 6
- new TestResult(0, -60445019543728147377669509413m), // 12 * 7
- new TestResult(0, 21135497857188116458095236.68m), // 12 * 8
- new TestResult(0, -2444295.933224902121034426698m), // 12 * 9
- new TestResult(0, -36976509845156274734545.845161m), // 12 * 10
- new TestResult(0, -415941029015352223.2321562927m), // 12 * 11
- new TestResult(0, 0.5820521224062348791152865214m), // 12 * 12
- new TestResult(0, -305515011956274243325.23330625m), // 12 * 13
- new TestResult(0, 170018722754075475876563.00661m), // 12 * 14
- new TestResult(0, 10868639927396524825477357.557m), // 12 * 15
- new TestResult(0, -321284.82550643216389212760083m), // 12 * 16
- new TestResult(0, 18663615549889303.426127037208m), // 12 * 17
- new TestResult(0, -4061239001119573143590088.0528m), // 12 * 18
- new TestResult(0, 78429339497108899549297058.831m), // 12 * 19
- new TestResult(0, 5402505348.7700567259404098662m), // 12 * 20
- new TestResult(0, 317187140609.43641612785737895m), // 12 * 21
- new TestResult(0, -4874617076403.5713301079734445m), // 12 * 22
- new TestResult(0, 337476332367005.49979200414696m), // 12 * 23
- new TestResult(0, -391252894469544.55412631906773m), // 12 * 24
- new TestResult(0, 464575021466700199.22364418475m), // 12 * 25
- new TestResult(0, -32450987719855972399063.033158m), // 12 * 26
- new TestResult(0, -5957115388557583551533.0994303m), // 12 * 27
- new TestResult(0, 791767728722982425613218218.59m), // 12 * 28
- new TestResult(0, -3812422070.43511700405678157m), // 12 * 29
- new TestResult(0, 0m), // 13 * 0
- new TestResult(0, -400453059665371395972.33474452m), // 13 * 1
- new TestResult(0, 400453059665371395972.33474452m), // 13 * 2
- new TestResult(2, -800906119330742791944.669489m), // 13 * 3
- new TestResult(0, -4004530596653713959723.3474452m), // 13 * 4
- new TestResult(0, -40045305966537139597.233474452m), // 13 * 5
- new TestResult(1, 0m), // 13 * 6
- new TestResult(1, 0m), // 13 * 7
- new TestResult(1, 0m), // 13 * 8
- new TestResult(2, 1282993519852989666698903060.5m), // 13 * 9
- new TestResult(1, 0m), // 13 * 10
- new TestResult(1, 0m), // 13 * 11
- new TestResult(0, -305515011956274243325.23330625m), // 13 * 12
- new TestResult(1, 0m), // 13 * 13
- new TestResult(1, 0m), // 13 * 14
- new TestResult(1, 0m), // 13 * 15
- new TestResult(2, 168640115768634908407809010.03m), // 13 * 16
- new TestResult(1, 0m), // 13 * 17
- new TestResult(1, 0m), // 13 * 18
- new TestResult(1, 0m), // 13 * 19
- new TestResult(1, 0m), // 13 * 20
- new TestResult(1, 0m), // 13 * 21
- new TestResult(1, 0m), // 13 * 22
- new TestResult(1, 0m), // 13 * 23
- new TestResult(1, 0m), // 13 * 24
- new TestResult(1, 0m), // 13 * 25
- new TestResult(1, 0m), // 13 * 26
- new TestResult(1, 0m), // 13 * 27
- new TestResult(1, 0m), // 13 * 28
- new TestResult(1, 0m), // 13 * 29
- new TestResult(0, 0m), // 14 * 0
- new TestResult(0, 222851627785191714190050.61676m), // 14 * 1
- new TestResult(0, -222851627785191714190050.61676m), // 14 * 2
- new TestResult(0, 445703255570383428380101.23352m), // 14 * 3
- new TestResult(0, 2228516277851917141900506.1676m), // 14 * 4
- new TestResult(0, 22285162778519171419005.061676m), // 14 * 5
- new TestResult(1, 0m), // 14 * 6
- new TestResult(1, 0m), // 14 * 7
- new TestResult(1, 0m), // 14 * 8
- new TestResult(1, 0m), // 14 * 9
- new TestResult(1, 0m), // 14 * 10
- new TestResult(1, 0m), // 14 * 11
- new TestResult(0, 170018722754075475876563.00661m), // 14 * 12
- new TestResult(1, 0m), // 14 * 13
- new TestResult(1, 0m), // 14 * 14
- new TestResult(1, 0m), // 14 * 15
- new TestResult(1, 0m), // 14 * 16
- new TestResult(1, 0m), // 14 * 17
- new TestResult(1, 0m), // 14 * 18
- new TestResult(1, 0m), // 14 * 19
- new TestResult(1, 0m), // 14 * 20
- new TestResult(1, 0m), // 14 * 21
- new TestResult(1, 0m), // 14 * 22
- new TestResult(1, 0m), // 14 * 23
- new TestResult(1, 0m), // 14 * 24
- new TestResult(1, 0m), // 14 * 25
- new TestResult(1, 0m), // 14 * 26
- new TestResult(1, 0m), // 14 * 27
- new TestResult(1, 0m), // 14 * 28
- new TestResult(1, 0m), // 14 * 29
- new TestResult(0, 0m), // 15 * 0
- new TestResult(0, 14246043379204153213661335.584m), // 15 * 1
- new TestResult(0, -14246043379204153213661335.584m), // 15 * 2
- new TestResult(0, 28492086758408306427322671.168m), // 15 * 3
- new TestResult(0, 142460433792041532136613355.84m), // 15 * 4
- new TestResult(0, 1424604337920415321366133.5584m), // 15 * 5
- new TestResult(1, 0m), // 15 * 6
- new TestResult(1, 0m), // 15 * 7
- new TestResult(1, 0m), // 15 * 8
- new TestResult(1, 0m), // 15 * 9
- new TestResult(1, 0m), // 15 * 10
- new TestResult(1, 0m), // 15 * 11
- new TestResult(0, 10868639927396524825477357.557m), // 15 * 12
- new TestResult(1, 0m), // 15 * 13
- new TestResult(1, 0m), // 15 * 14
- new TestResult(1, 0m), // 15 * 15
- new TestResult(1, 0m), // 15 * 16
- new TestResult(1, 0m), // 15 * 17
- new TestResult(1, 0m), // 15 * 18
- new TestResult(1, 0m), // 15 * 19
- new TestResult(1, 0m), // 15 * 20
- new TestResult(1, 0m), // 15 * 21
- new TestResult(1, 0m), // 15 * 22
- new TestResult(1, 0m), // 15 * 23
- new TestResult(1, 0m), // 15 * 24
- new TestResult(1, 0m), // 15 * 25
- new TestResult(1, 0m), // 15 * 26
- new TestResult(1, 0m), // 15 * 27
- new TestResult(1, 0m), // 15 * 28
- new TestResult(1, 0m), // 15 * 29
- new TestResult(0, 0m), // 16 * 0
- new TestResult(0, -421123.30446308691436596648186m), // 16 * 1
- new TestResult(0, 421123.30446308691436596648186m), // 16 * 2
- new TestResult(2, -842246.6089261738287319329637m), // 16 * 3
- new TestResult(0, -4211233.0446308691436596648186m), // 16 * 4
- new TestResult(0, -42112.330446308691436596648186m), // 16 * 5
- new TestResult(1, 0m), // 16 * 6
- new TestResult(1, 0m), // 16 * 7
- new TestResult(1, 0m), // 16 * 8
- new TestResult(0, 1349217986089.8179781485646335m), // 16 * 9
- new TestResult(2, 20410528638441139616161910791m), // 16 * 10
- new TestResult(0, 229593769670844494339647.60593m), // 16 * 11
- new TestResult(0, -321284.82550643216389212760083m), // 16 * 12
- new TestResult(2, 168640115768634908407809010.03m), // 16 * 13
- new TestResult(1, 0m), // 16 * 14
- new TestResult(1, 0m), // 16 * 15
- new TestResult(2, 177344837561.90979904837123025m), // 16 * 16
- new TestResult(2, -10302060991507324713598.483586m), // 16 * 17
- new TestResult(1, 0m), // 16 * 18
- new TestResult(1, 0m), // 16 * 19
- new TestResult(2, -2982109198574002.1833628108505m), // 16 * 20
- new TestResult(2, -175082971439561442.82206371811m), // 16 * 21
- new TestResult(2, 2690722078855217643.0013135833m), // 16 * 22
- new TestResult(2, -186282328305659347664.31347679m), // 16 * 23
- new TestResult(2, 215966256439146035447.16512997m), // 16 * 24
- new TestResult(0, -256439069562229438659442.67473m), // 16 * 25
- new TestResult(2, 17912502206818886711664532432m), // 16 * 26
- new TestResult(0, 3288246369108855691627019039.6m), // 16 * 27
- new TestResult(1, 0m), // 16 * 28
- new TestResult(2, 2104404936439239.9111285468803m), // 16 * 29
- new TestResult(0, 0m), // 17 * 0
- new TestResult(0, 24463288738299545.200508898642m), // 17 * 1
- new TestResult(0, -24463288738299545.200508898642m), // 17 * 2
- new TestResult(0, 48926577476599090.401017797284m), // 17 * 3
- new TestResult(0, 244632887382995452.00508898642m), // 17 * 4
- new TestResult(0, 2446328873829954.5200508898642m), // 17 * 5
- new TestResult(1, 0m), // 17 * 6
- new TestResult(1, 0m), // 17 * 7
- new TestResult(1, 0m), // 17 * 8
- new TestResult(0, -78376828864182146369609.767831m), // 17 * 9
- new TestResult(1, 0m), // 17 * 10
- new TestResult(1, 0m), // 17 * 11
- new TestResult(0, 18663615549889303.426127037208m), // 17 * 12
- new TestResult(1, 0m), // 17 * 13
- new TestResult(1, 0m), // 17 * 14
- new TestResult(1, 0m), // 17 * 15
- new TestResult(2, -10302060991507324713598.483586m), // 17 * 16
- new TestResult(1, 0m), // 17 * 17
- new TestResult(1, 0m), // 17 * 18
- new TestResult(1, 0m), // 17 * 19
- new TestResult(0, 173232394409674404469121757.58m), // 17 * 20
- new TestResult(2, 10170667920993375211218037940m), // 17 * 21
- new TestResult(1, 0m), // 17 * 22
- new TestResult(1, 0m), // 17 * 23
- new TestResult(1, 0m), // 17 * 24
- new TestResult(1, 0m), // 17 * 25
- new TestResult(1, 0m), // 17 * 26
- new TestResult(1, 0m), // 17 * 27
- new TestResult(1, 0m), // 17 * 28
- new TestResult(0, -122246061989021334943606343.1m), // 17 * 29
- new TestResult(0, 0m), // 18 * 0
- new TestResult(0, -5323259153836385912697776.001m), // 18 * 1
- new TestResult(0, 5323259153836385912697776.001m), // 18 * 2
- new TestResult(0, -10646518307672771825395552.002m), // 18 * 3
- new TestResult(0, -53232591538363859126977760.01m), // 18 * 4
- new TestResult(0, -532325915383638591269777.6001m), // 18 * 5
- new TestResult(1, 0m), // 18 * 6
- new TestResult(1, 0m), // 18 * 7
- new TestResult(1, 0m), // 18 * 8
- new TestResult(1, 0m), // 18 * 9
- new TestResult(1, 0m), // 18 * 10
- new TestResult(1, 0m), // 18 * 11
- new TestResult(2, -4061239001119573143590088.0528m), // 18 * 12
- new TestResult(1, 0m), // 18 * 13
- new TestResult(1, 0m), // 18 * 14
- new TestResult(1, 0m), // 18 * 15
- new TestResult(1, 0m), // 18 * 16
- new TestResult(1, 0m), // 18 * 17
- new TestResult(1, 0m), // 18 * 18
- new TestResult(1, 0m), // 18 * 19
- new TestResult(1, 0m), // 18 * 20
- new TestResult(1, 0m), // 18 * 21
- new TestResult(1, 0m), // 18 * 22
- new TestResult(1, 0m), // 18 * 23
- new TestResult(1, 0m), // 18 * 24
- new TestResult(1, 0m), // 18 * 25
- new TestResult(1, 0m), // 18 * 26
- new TestResult(1, 0m), // 18 * 27
- new TestResult(1, 0m), // 18 * 28
- new TestResult(1, 0m), // 18 * 29
- new TestResult(0, 0m), // 19 * 0
- new TestResult(0, 102801066199805834724673169.19m), // 19 * 1
- new TestResult(0, -102801066199805834724673169.19m), // 19 * 2
- new TestResult(0, 205602132399611669449346338.38m), // 19 * 3
- new TestResult(0, 1028010661998058347246731691.9m), // 19 * 4
- new TestResult(0, 10280106619980583472467316.919m), // 19 * 5
- new TestResult(1, 0m), // 19 * 6
- new TestResult(1, 0m), // 19 * 7
- new TestResult(1, 0m), // 19 * 8
- new TestResult(1, 0m), // 19 * 9
- new TestResult(1, 0m), // 19 * 10
- new TestResult(1, 0m), // 19 * 11
- new TestResult(0, 78429339497108899549297058.831m), // 19 * 12
- new TestResult(1, 0m), // 19 * 13
- new TestResult(1, 0m), // 19 * 14
- new TestResult(1, 0m), // 19 * 15
- new TestResult(1, 0m), // 19 * 16
- new TestResult(1, 0m), // 19 * 17
- new TestResult(1, 0m), // 19 * 18
- new TestResult(1, 0m), // 19 * 19
- new TestResult(1, 0m), // 19 * 20
- new TestResult(1, 0m), // 19 * 21
- new TestResult(1, 0m), // 19 * 22
- new TestResult(1, 0m), // 19 * 23
- new TestResult(1, 0m), // 19 * 24
- new TestResult(1, 0m), // 19 * 25
- new TestResult(1, 0m), // 19 * 26
- new TestResult(1, 0m), // 19 * 27
- new TestResult(1, 0m), // 19 * 28
- new TestResult(1, 0m), // 19 * 29
- new TestResult(0, 0m), // 20 * 0
- new TestResult(0, 7081320760.3793287174700927968m), // 20 * 1
- new TestResult(0, -7081320760.3793287174700927968m), // 20 * 2
- new TestResult(2, 14162641520.758657434940185594m), // 20 * 3
- new TestResult(0, 70813207603.793287174700927968m), // 20 * 4
- new TestResult(0, 708132076.03793287174700927968m), // 20 * 5
- new TestResult(1, 0m), // 20 * 6
- new TestResult(1, 0m), // 20 * 7
- new TestResult(1, 0m), // 20 * 8
- new TestResult(0, -22687524613144469.045656755412m), // 20 * 9
- new TestResult(1, 0m), // 20 * 10
- new TestResult(0, -3860691418388152934958161711.9m), // 20 * 11
- new TestResult(0, 5402505348.7700567259404098662m), // 20 * 12
- new TestResult(1, 0m), // 20 * 13
- new TestResult(1, 0m), // 20 * 14
- new TestResult(1, 0m), // 20 * 15
- new TestResult(2, -2982109198574002.1833628108505m), // 20 * 16
- new TestResult(2, 173232394409674404469121757.58m), // 20 * 17
- new TestResult(1, 0m), // 20 * 18
- new TestResult(1, 0m), // 20 * 19
- new TestResult(0, 50145103711379274243.914175878m), // 20 * 20
- new TestResult(2, 2944075208624656937377.9493098m), // 20 * 21
- new TestResult(0, -45245337684888495429839.445203m), // 20 * 22
- new TestResult(2, 3132395915264028802867467.4171m), // 20 * 23
- new TestResult(2, -3631540499079604049748263.216m), // 20 * 24
- new TestResult(0, 4312103575884025168661620716.9m), // 20 * 25
- new TestResult(1, 0m), // 20 * 26
- new TestResult(1, 0m), // 20 * 27
- new TestResult(1, 0m), // 20 * 28
- new TestResult(2, -35386230604481178142.543841269m), // 20 * 29
- new TestResult(0, 0m), // 21 * 0
- new TestResult(0, 415752273939.77704245656837041m), // 21 * 1
- new TestResult(0, -415752273939.77704245656837041m), // 21 * 2
- new TestResult(2, 831504547879.5540849131367408m), // 21 * 3
- new TestResult(0, 4157522739397.7704245656837041m), // 21 * 4
- new TestResult(0, 41575227393.977704245656837041m), // 21 * 5
- new TestResult(1, 0m), // 21 * 6
- new TestResult(1, 0m), // 21 * 7
- new TestResult(1, 0m), // 21 * 8
- new TestResult(2, -1332009983328901461.3254059884m), // 21 * 9
- new TestResult(1, 0m), // 21 * 10
- new TestResult(1, 0m), // 21 * 11
- new TestResult(0, 317187140609.43641612785737895m), // 21 * 12
- new TestResult(1, 0m), // 21 * 13
- new TestResult(1, 0m), // 21 * 14
- new TestResult(1, 0m), // 21 * 15
- new TestResult(2, -175082971439561442.82206371811m), // 21 * 16
- new TestResult(2, 10170667920993375211218037940m), // 21 * 17
- new TestResult(1, 0m), // 21 * 18
- new TestResult(1, 0m), // 21 * 19
- new TestResult(2, 2944075208624656937377.9493098m), // 21 * 20
- new TestResult(2, 172849953286095412912252.49708m), // 21 * 21
- new TestResult(2, -2656404456766597431365611.212m), // 21 * 22
- new TestResult(0, 183906472919174492029733196.17m), // 21 * 23
- new TestResult(0, -213211810548723232636647639.7m), // 21 * 24
- new TestResult(1, 0m), // 21 * 25
- new TestResult(1, 0m), // 21 * 26
- new TestResult(1, 0m), // 21 * 27
- new TestResult(1, 0m), // 21 * 28
- new TestResult(0, -2077565236457711426002.3992246m), // 21 * 29
- new TestResult(0, 0m), // 22 * 0
- new TestResult(0, -6389392489892.6362673670820462m), // 22 * 1
- new TestResult(0, 6389392489892.6362673670820462m), // 22 * 2
- new TestResult(2, -12778784979785.272534734164092m), // 22 * 3
- new TestResult(0, -63893924898926.362673670820462m), // 22 * 4
- new TestResult(0, -638939248989.26362673670820462m), // 22 * 5
- new TestResult(1, 0m), // 22 * 6
- new TestResult(1, 0m), // 22 * 7
- new TestResult(1, 0m), // 22 * 8
- new TestResult(2, 20470686794551372519.831909846m), // 22 * 9
- new TestResult(1, 0m), // 22 * 10
- new TestResult(1, 0m), // 22 * 11
- new TestResult(0, -4874617076403.5713301079734445m), // 22 * 12
- new TestResult(1, 0m), // 22 * 13
- new TestResult(1, 0m), // 22 * 14
- new TestResult(1, 0m), // 22 * 15
- new TestResult(2, 2690722078855217643.0013135833m), // 22 * 16
- new TestResult(1, 0m), // 22 * 17
- new TestResult(1, 0m), // 22 * 18
- new TestResult(1, 0m), // 22 * 19
- new TestResult(0, -45245337684888495429839.445203m), // 22 * 20
- new TestResult(2, -2656404456766597431365611.212m), // 22 * 21
- new TestResult(2, 40824336389896422046045259.169m), // 22 * 22
- new TestResult(2, -2826324016889506134750576955.1m), // 22 * 23
- new TestResult(2, 3276696308036925201560804370m), // 22 * 24
- new TestResult(1, 0m), // 22 * 25
- new TestResult(1, 0m), // 22 * 26
- new TestResult(1, 0m), // 22 * 27
- new TestResult(1, 0m), // 22 * 28
- new TestResult(2, 31928579952897032005741.500403m), // 22 * 29
- new TestResult(0, 0m), // 23 * 0
- new TestResult(0, 442346282742915.0596416330681m), // 23 * 1
- new TestResult(0, -442346282742915.0596416330681m), // 23 * 2
- new TestResult(0, 884692565485830.1192832661362m), // 23 * 3
- new TestResult(0, 4423462827429150.596416330681m), // 23 * 4
- new TestResult(0, 44234628274291.50596416330681m), // 23 * 5
- new TestResult(1, 0m), // 23 * 6
- new TestResult(1, 0m), // 23 * 7
- new TestResult(1, 0m), // 23 * 8
- new TestResult(2, -1417213330232658207868.9685141m), // 23 * 9
- new TestResult(1, 0m), // 23 * 10
- new TestResult(1, 0m), // 23 * 11
- new TestResult(2, 337476332367005.49979200414696m), // 23 * 12
- new TestResult(1, 0m), // 23 * 13
- new TestResult(1, 0m), // 23 * 14
- new TestResult(1, 0m), // 23 * 15
- new TestResult(2, -186282328305659347664.31347679m), // 23 * 16
- new TestResult(1, 0m), // 23 * 17
- new TestResult(1, 0m), // 23 * 18
- new TestResult(1, 0m), // 23 * 19
- new TestResult(2, 3132395915264028802867467.4171m), // 23 * 20
- new TestResult(0, 183906472919174492029733196.17m), // 23 * 21
- new TestResult(2, -2826324016889506134750576955.1m), // 23 * 22
- new TestResult(1, 0m), // 23 * 23
- new TestResult(1, 0m), // 23 * 24
- new TestResult(1, 0m), // 23 * 25
- new TestResult(1, 0m), // 23 * 26
- new TestResult(1, 0m), // 23 * 27
- new TestResult(1, 0m), // 23 * 28
- new TestResult(2, -2210458768617810051106106.871m), // 23 * 29
- new TestResult(0, 0m), // 24 * 0
- new TestResult(0, -512833780867323.89020837443764m), // 24 * 1
- new TestResult(0, 512833780867323.89020837443764m), // 24 * 2
- new TestResult(2, -1025667561734647.7804167488753m), // 24 * 3
- new TestResult(0, -5128337808673238.9020837443764m), // 24 * 4
- new TestResult(0, -51283378086732.389020837443764m), // 24 * 5
- new TestResult(1, 0m), // 24 * 6
- new TestResult(1, 0m), // 24 * 7
- new TestResult(1, 0m), // 24 * 8
- new TestResult(0, 1643045050434361863551.7087135m), // 24 * 9
- new TestResult(1, 0m), // 24 * 10
- new TestResult(1, 0m), // 24 * 11
- new TestResult(0, -391252894469544.55412631906773m), // 24 * 12
- new TestResult(1, 0m), // 24 * 13
- new TestResult(1, 0m), // 24 * 14
- new TestResult(1, 0m), // 24 * 15
- new TestResult(2, 215966256439146035447.16512997m), // 24 * 16
- new TestResult(1, 0m), // 24 * 17
- new TestResult(1, 0m), // 24 * 18
- new TestResult(1, 0m), // 24 * 19
- new TestResult(2, -3631540499079604049748263.216m), // 24 * 20
- new TestResult(0, -213211810548723232636647639.7m), // 24 * 21
- new TestResult(2, 3276696308036925201560804370m), // 24 * 22
- new TestResult(1, 0m), // 24 * 23
- new TestResult(1, 0m), // 24 * 24
- new TestResult(1, 0m), // 24 * 25
- new TestResult(1, 0m), // 24 * 26
- new TestResult(1, 0m), // 24 * 27
- new TestResult(1, 0m), // 24 * 28
- new TestResult(2, 2562693464342799730524457.4865m), // 24 * 29
- new TestResult(0, 0m), // 25 * 0
- new TestResult(0, 608940580690915704.1450897514m), // 25 * 1
- new TestResult(0, -608940580690915704.1450897514m), // 25 * 2
- new TestResult(0, 1217881161381831408.2901795028m), // 25 * 3
- new TestResult(0, 6089405806909157041.450897514m), // 25 * 4
- new TestResult(0, 60894058069091570.41450897514m), // 25 * 5
- new TestResult(1, 0m), // 25 * 6
- new TestResult(1, 0m), // 25 * 7
- new TestResult(1, 0m), // 25 * 8
- new TestResult(0, -1950957297354170624860913.7855m), // 25 * 9
- new TestResult(1, 0m), // 25 * 10
- new TestResult(1, 0m), // 25 * 11
- new TestResult(0, 464575021466700199.22364418475m), // 25 * 12
- new TestResult(1, 0m), // 25 * 13
- new TestResult(1, 0m), // 25 * 14
- new TestResult(1, 0m), // 25 * 15
- new TestResult(0, -256439069562229438659442.67473m), // 25 * 16
- new TestResult(1, 0m), // 25 * 17
- new TestResult(1, 0m), // 25 * 18
- new TestResult(1, 0m), // 25 * 19
- new TestResult(0, 4312103575884025168661620716.9m), // 25 * 20
- new TestResult(1, 0m), // 25 * 21
- new TestResult(1, 0m), // 25 * 22
- new TestResult(1, 0m), // 25 * 23
- new TestResult(1, 0m), // 25 * 24
- new TestResult(1, 0m), // 25 * 25
- new TestResult(1, 0m), // 25 * 26
- new TestResult(1, 0m), // 25 * 27
- new TestResult(1, 0m), // 25 * 28
- new TestResult(0, -3042950960973153681431212945.8m), // 25 * 29
- new TestResult(0, 0m), // 26 * 0
- new TestResult(0, -42535053313319986966115.037787m), // 26 * 1
- new TestResult(0, 42535053313319986966115.037787m), // 26 * 2
- new TestResult(2, -85070106626639973932230.07557m), // 26 * 3
- new TestResult(0, -425350533133199869661150.37787m), // 26 * 4
- new TestResult(0, -4253505331331998696611.5037787m), // 26 * 5
- new TestResult(1, 0m), // 26 * 6
- new TestResult(1, 0m), // 26 * 7
- new TestResult(1, 0m), // 26 * 8
- new TestResult(1, 0m), // 26 * 9
- new TestResult(1, 0m), // 26 * 10
- new TestResult(1, 0m), // 26 * 11
- new TestResult(0, -32450987719855972399063.033158m), // 26 * 12
- new TestResult(1, 0m), // 26 * 13
- new TestResult(1, 0m), // 26 * 14
- new TestResult(1, 0m), // 26 * 15
- new TestResult(2, 17912502206818886711664532432m), // 26 * 16
- new TestResult(1, 0m), // 26 * 17
- new TestResult(1, 0m), // 26 * 18
- new TestResult(1, 0m), // 26 * 19
- new TestResult(1, 0m), // 26 * 20
- new TestResult(1, 0m), // 26 * 21
- new TestResult(1, 0m), // 26 * 22
- new TestResult(1, 0m), // 26 * 23
- new TestResult(1, 0m), // 26 * 24
- new TestResult(1, 0m), // 26 * 25
- new TestResult(1, 0m), // 26 * 26
- new TestResult(1, 0m), // 26 * 27
- new TestResult(1, 0m), // 26 * 28
- new TestResult(1, 0m), // 26 * 29
- new TestResult(0, 0m), // 27 * 0
- new TestResult(0, -7808274522591953107485.8812311m), // 27 * 1
- new TestResult(0, 7808274522591953107485.8812311m), // 27 * 2
- new TestResult(2, -15616549045183906214971.762462m), // 27 * 3
- new TestResult(0, -78082745225919531074858.812311m), // 27 * 4
- new TestResult(0, -780827452259195310748.58812311m), // 27 * 5
- new TestResult(1, 0m), // 27 * 6
- new TestResult(1, 0m), // 27 * 7
- new TestResult(1, 0m), // 27 * 8
- new TestResult(0, 25016579026989918165002777574m), // 27 * 9
- new TestResult(1, 0m), // 27 * 10
- new TestResult(1, 0m), // 27 * 11
- new TestResult(0, -5957115388557583551533.0994303m), // 27 * 12
- new TestResult(1, 0m), // 27 * 13
- new TestResult(1, 0m), // 27 * 14
- new TestResult(1, 0m), // 27 * 15
- new TestResult(0, 3288246369108855691627019039.6m), // 27 * 16
- new TestResult(1, 0m), // 27 * 17
- new TestResult(1, 0m), // 27 * 18
- new TestResult(1, 0m), // 27 * 19
- new TestResult(1, 0m), // 27 * 20
- new TestResult(1, 0m), // 27 * 21
- new TestResult(1, 0m), // 27 * 22
- new TestResult(1, 0m), // 27 * 23
- new TestResult(1, 0m), // 27 * 24
- new TestResult(1, 0m), // 27 * 25
- new TestResult(1, 0m), // 27 * 26
- new TestResult(1, 0m), // 27 * 27
- new TestResult(1, 0m), // 27 * 28
- new TestResult(1, 0m), // 27 * 29
- new TestResult(0, 0m), // 28 * 0
- new TestResult(0, 1037807626804273037330059471.7m), // 28 * 1
- new TestResult(0, -1037807626804273037330059471.7m), // 28 * 2
- new TestResult(0, 2075615253608546074660118943.4m), // 28 * 3
- new TestResult(0, 10378076268042730373300594717m), // 28 * 4
- new TestResult(0, 103780762680427303733005947.17m), // 28 * 5
- new TestResult(1, 0m), // 28 * 6
- new TestResult(1, 0m), // 28 * 7
- new TestResult(1, 0m), // 28 * 8
- new TestResult(1, 0m), // 28 * 9
- new TestResult(1, 0m), // 28 * 10
- new TestResult(1, 0m), // 28 * 11
- new TestResult(0, 791767728722982425613218218.59m), // 28 * 12
- new TestResult(1, 0m), // 28 * 13
- new TestResult(1, 0m), // 28 * 14
- new TestResult(1, 0m), // 28 * 15
- new TestResult(1, 0m), // 28 * 16
- new TestResult(1, 0m), // 28 * 17
- new TestResult(1, 0m), // 28 * 18
- new TestResult(1, 0m), // 28 * 19
- new TestResult(1, 0m), // 28 * 20
- new TestResult(1, 0m), // 28 * 21
- new TestResult(1, 0m), // 28 * 22
- new TestResult(1, 0m), // 28 * 23
- new TestResult(1, 0m), // 28 * 24
- new TestResult(1, 0m), // 28 * 25
- new TestResult(1, 0m), // 28 * 26
- new TestResult(1, 0m), // 28 * 27
- new TestResult(1, 0m), // 28 * 28
- new TestResult(1, 0m), // 28 * 29
- new TestResult(0, 0m), // 29 * 0
- new TestResult(0, -4997122966.448652425771563042m), // 29 * 1
- new TestResult(0, 4997122966.448652425771563042m), // 29 * 2
- new TestResult(0, -9994245932.897304851543126084m), // 29 * 3
- new TestResult(0, -49971229664.48652425771563042m), // 29 * 4
- new TestResult(0, -499712296.6448652425771563042m), // 29 * 5
- new TestResult(1, 0m), // 29 * 6
- new TestResult(1, 0m), // 29 * 7
- new TestResult(1, 0m), // 29 * 8
- new TestResult(2, 16010057181782036.694377696165m), // 29 * 9
- new TestResult(1, 0m), // 29 * 10
- new TestResult(2, 2724399925666581324856736883m), // 29 * 11
- new TestResult(2, -3812422070.43511700405678157m), // 29 * 12
- new TestResult(1, 0m), // 29 * 13
- new TestResult(1, 0m), // 29 * 14
- new TestResult(1, 0m), // 29 * 15
- new TestResult(2, 2104404936439239.9111285468803m), // 29 * 16
- new TestResult(2, -122246061989021334943606343.1m), // 29 * 17
- new TestResult(1, 0m), // 29 * 18
- new TestResult(1, 0m), // 29 * 19
- new TestResult(0, -35386230604481178142.543841269m), // 29 * 20
- new TestResult(0, -2077565236457711426002.3992246m), // 29 * 21
- new TestResult(2, 31928579952897032005741.500403m), // 29 * 22
- new TestResult(2, -2210458768617810051106106.871m), // 29 * 23
- new TestResult(2, 2562693464342799730524457.4865m), // 29 * 24
- new TestResult(0, -3042950960973153681431212945.8m), // 29 * 25
- new TestResult(1, 0m), // 29 * 26
- new TestResult(1, 0m), // 29 * 27
- new TestResult(1, 0m), // 29 * 28
- new TestResult(0, 24971237941808579837.350664893m), // 29 * 29
- };
-
-
- // generated result list build2
- TestResult[] trAuto_Div_build2 = new TestResult[] {
- new TestResult(3, 0m), // 0 / 0
- new TestResult(0, 0m), // 0 / 1
- new TestResult(0, 0m), // 0 / 2
- new TestResult(0, 0m), // 0 / 3
- new TestResult(0, 0m), // 0 / 4
- new TestResult(0, 0m), // 0 / 5
- new TestResult(0, 0m), // 0 / 6
- new TestResult(0, 0m), // 0 / 7
- new TestResult(0, 0m), // 0 / 8
- new TestResult(0, 0m), // 0 / 9
- new TestResult(0, 0m), // 0 / 10
- new TestResult(0, 0m), // 0 / 11
- new TestResult(0, 0m), // 0 / 12
- new TestResult(0, 0m), // 0 / 13
- new TestResult(0, 0m), // 0 / 14
- new TestResult(0, 0m), // 0 / 15
- new TestResult(0, 0m), // 0 / 16
- new TestResult(0, 0m), // 0 / 17
- new TestResult(0, 0m), // 0 / 18
- new TestResult(0, 0m), // 0 / 19
- new TestResult(0, 0m), // 0 / 20
- new TestResult(0, 0m), // 0 / 21
- new TestResult(0, 0m), // 0 / 22
- new TestResult(0, 0m), // 0 / 23
- new TestResult(0, 0m), // 0 / 24
- new TestResult(0, 0m), // 0 / 25
- new TestResult(0, 0m), // 0 / 26
- new TestResult(0, 0m), // 0 / 27
- new TestResult(0, 0m), // 0 / 28
- new TestResult(0, 0m), // 0 / 29
- new TestResult(3, 0m), // 1 / 0
- new TestResult(0, 1m), // 1 / 1
- new TestResult(0, -1m), // 1 / 2
- new TestResult(0, 0.5m), // 1 / 3
- new TestResult(0, 0.1m), // 1 / 4
- new TestResult(0, 10m), // 1 / 5
- new TestResult(0, 0m), // 1 / 6
- new TestResult(0, 0m), // 1 / 7
- new TestResult(2, 3.61E-26m), // 1 / 8
- new TestResult(2, -3.121239924198969049581E-07m), // 1 / 9
- new TestResult(2, -2.06327E-23m), // 1 / 10
- new TestResult(2, -1.8342105061E-18m), // 1 / 11
- new TestResult(0, 1.3107475704751451797758879069m), // 1 / 12
- new TestResult(2, -2.4971716E-21m), // 1 / 13
- new TestResult(2, 4.4873E-24m), // 1 / 14
- new TestResult(2, 7.02E-26m), // 1 / 15
- new TestResult(2, -2.3746014276625098667414E-06m), // 1 / 16
- new TestResult(2, 4.08775782642E-17m), // 1 / 17
- new TestResult(2, -1.879E-25m), // 1 / 18
- new TestResult(2, 9.7E-27m), // 1 / 19
- new TestResult(2, 1.412165941691409118E-10m), // 1 / 20
- new TestResult(2, 2.4052784859689137E-12m), // 1 / 21
- new TestResult(2, -1.565094023542766E-13m), // 1 / 22
- new TestResult(2, 2.2606723262128E-15m), // 1 / 23
- new TestResult(2, -1.9499495495573E-15m), // 1 / 24
- new TestResult(2, 1.6421963517E-18m), // 1 / 25
- new TestResult(2, -2.351E-23m), // 1 / 26
- new TestResult(2, -1.280693E-22m), // 1 / 27
- new TestResult(2, 1E-27m), // 1 / 28
- new TestResult(2, -2.00115147598754898E-10m), // 1 / 29
- new TestResult(3, 0m), // 2 / 0
- new TestResult(0, -1m), // 2 / 1
- new TestResult(0, 1m), // 2 / 2
- new TestResult(0, -0.5m), // 2 / 3
- new TestResult(0, -0.1m), // 2 / 4
- new TestResult(0, -10m), // 2 / 5
- new TestResult(0, 0m), // 2 / 6
- new TestResult(0, 0m), // 2 / 7
- new TestResult(2, -3.61E-26m), // 2 / 8
- new TestResult(2, 3.121239924198969049581E-07m), // 2 / 9
- new TestResult(2, 2.06327E-23m), // 2 / 10
- new TestResult(2, 1.8342105061E-18m), // 2 / 11
- new TestResult(0, -1.3107475704751451797758879069m), // 2 / 12
- new TestResult(2, 2.4971716E-21m), // 2 / 13
- new TestResult(2, -4.4873E-24m), // 2 / 14
- new TestResult(2, -7.02E-26m), // 2 / 15
- new TestResult(2, 2.3746014276625098667414E-06m), // 2 / 16
- new TestResult(2, -4.08775782642E-17m), // 2 / 17
- new TestResult(2, 1.879E-25m), // 2 / 18
- new TestResult(2, -9.7E-27m), // 2 / 19
- new TestResult(2, -1.412165941691409118E-10m), // 2 / 20
- new TestResult(2, -2.4052784859689137E-12m), // 2 / 21
- new TestResult(2, 1.565094023542766E-13m), // 2 / 22
- new TestResult(2, -2.2606723262128E-15m), // 2 / 23
- new TestResult(2, 1.9499495495573E-15m), // 2 / 24
- new TestResult(2, -1.6421963517E-18m), // 2 / 25
- new TestResult(2, 2.351E-23m), // 2 / 26
- new TestResult(2, 1.280693E-22m), // 2 / 27
- new TestResult(2, -1E-27m), // 2 / 28
- new TestResult(2, 2.00115147598754898E-10m), // 2 / 29
- new TestResult(3, 0m), // 3 / 0
- new TestResult(0, 2m), // 3 / 1
- new TestResult(0, -2m), // 3 / 2
- new TestResult(0, 1m), // 3 / 3
- new TestResult(0, 0.2m), // 3 / 4
- new TestResult(0, 20m), // 3 / 5
- new TestResult(0, 0m), // 3 / 6
- new TestResult(0, 0m), // 3 / 7
- new TestResult(2, 7.22E-26m), // 3 / 8
- new TestResult(2, -6.242479848397938099161E-07m), // 3 / 9
- new TestResult(2, -4.12653E-23m), // 3 / 10
- new TestResult(2, -3.6684210122E-18m), // 3 / 11
- new TestResult(0, 2.6214951409502903595517758138m), // 3 / 12
- new TestResult(2, -4.9943432E-21m), // 3 / 13
- new TestResult(2, 8.9746E-24m), // 3 / 14
- new TestResult(2, 1.404E-25m), // 3 / 15
- new TestResult(2, -4.7492028553250197334829E-06m), // 3 / 16
- new TestResult(2, 8.17551565284E-17m), // 3 / 17
- new TestResult(2, -3.757E-25m), // 3 / 18
- new TestResult(2, 1.95E-26m), // 3 / 19
- new TestResult(2, 2.824331883382818237E-10m), // 3 / 20
- new TestResult(2, 4.8105569719378275E-12m), // 3 / 21
- new TestResult(2, -3.130188047085533E-13m), // 3 / 22
- new TestResult(2, 4.5213446524256E-15m), // 3 / 23
- new TestResult(2, -3.8998990991146E-15m), // 3 / 24
- new TestResult(2, 3.2843927034E-18m), // 3 / 25
- new TestResult(2, -4.702E-23m), // 3 / 26
- new TestResult(2, -2.561385E-22m), // 3 / 27
- new TestResult(2, 1.9E-27m), // 3 / 28
- new TestResult(2, -4.002302951975097959E-10m), // 3 / 29
- new TestResult(3, 0m), // 4 / 0
- new TestResult(0, 10m), // 4 / 1
- new TestResult(0, -10m), // 4 / 2
- new TestResult(0, 5m), // 4 / 3
- new TestResult(0, 1m), // 4 / 4
- new TestResult(0, 100m), // 4 / 5
- new TestResult(2, 1E-28m), // 4 / 6
- new TestResult(2, -1E-28m), // 4 / 7
- new TestResult(2, 3.61E-25m), // 4 / 8
- new TestResult(2, -3.1212399241989690495806E-06m), // 4 / 9
- new TestResult(2, -2.063265E-22m), // 4 / 10
- new TestResult(2, -1.83421050609E-17m), // 4 / 11
- new TestResult(0, 13.107475704751451797758879069m), // 4 / 12
- new TestResult(2, -2.49717158E-20m), // 4 / 13
- new TestResult(2, 4.48729E-23m), // 4 / 14
- new TestResult(2, 7.019E-25m), // 4 / 15
- new TestResult(2, -2.37460142766250986674143E-05m), // 4 / 16
- new TestResult(2, 4.087757826422E-16m), // 4 / 17
- new TestResult(2, -1.8785E-24m), // 4 / 18
- new TestResult(2, 9.73E-26m), // 4 / 19
- new TestResult(2, 1.4121659416914091185E-09m), // 4 / 20
- new TestResult(2, 2.40527848596891375E-11m), // 4 / 21
- new TestResult(2, -1.5650940235427663E-12m), // 4 / 22
- new TestResult(2, 2.26067232621278E-14m), // 4 / 23
- new TestResult(2, -1.94994954955729E-14m), // 4 / 24
- new TestResult(2, 1.64219635168E-17m), // 4 / 25
- new TestResult(2, -2.351002E-22m), // 4 / 26
- new TestResult(2, -1.2806927E-21m), // 4 / 27
- new TestResult(2, 9.6E-27m), // 4 / 28
- new TestResult(2, -2.0011514759875489796E-09m), // 4 / 29
- new TestResult(3, 0m), // 5 / 0
- new TestResult(0, 0.1m), // 5 / 1
- new TestResult(0, -0.1m), // 5 / 2
- new TestResult(0, 0.05m), // 5 / 3
- new TestResult(0, 0.01m), // 5 / 4
- new TestResult(0, 1m), // 5 / 5
- new TestResult(0, 0m), // 5 / 6
- new TestResult(0, 0m), // 5 / 7
- new TestResult(2, 3.6E-27m), // 5 / 8
- new TestResult(2, -3.12123992419896904958E-08m), // 5 / 9
- new TestResult(2, -2.0633E-24m), // 5 / 10
- new TestResult(2, -1.834210506E-19m), // 5 / 11
- new TestResult(0, 0.1310747570475145179775887907m), // 5 / 12
- new TestResult(2, -2.497172E-22m), // 5 / 13
- new TestResult(2, 4.487E-25m), // 5 / 14
- new TestResult(2, 7E-27m), // 5 / 15
- new TestResult(2, -2.374601427662509866741E-07m), // 5 / 16
- new TestResult(2, 4.0877578264E-18m), // 5 / 17
- new TestResult(2, -1.88E-26m), // 5 / 18
- new TestResult(2, 1E-27m), // 5 / 19
- new TestResult(2, 1.41216594169140912E-11m), // 5 / 20
- new TestResult(2, 2.405278485968914E-13m), // 5 / 21
- new TestResult(2, -1.56509402354277E-14m), // 5 / 22
- new TestResult(2, 2.260672326213E-16m), // 5 / 23
- new TestResult(2, -1.949949549557E-16m), // 5 / 24
- new TestResult(2, 1.642196352E-19m), // 5 / 25
- new TestResult(2, -2.351E-24m), // 5 / 26
- new TestResult(2, -1.28069E-23m), // 5 / 27
- new TestResult(2, 1E-28m), // 5 / 28
- new TestResult(2, -2.00115147598754898E-11m), // 5 / 29
- new TestResult(3, 0m), // 6 / 0
- new TestResult(0, 79228162514264337593543950335m), // 6 / 1
- new TestResult(0, -79228162514264337593543950335m), // 6 / 2
- new TestResult(4, 39614081257132168796771975168m), // 6 / 3
- new TestResult(0, 7922816251426433759354395033.5m), // 6 / 4
- new TestResult(1, 0m), // 6 / 5
- new TestResult(0, 1m), // 6 / 6
- new TestResult(0, -1m), // 6 / 7
- new TestResult(2, 2859.8815108190596050496514036m), // 6 / 8
- new TestResult(2, -24729010396044602218186.765763m), // 6 / 9
- new TestResult(0, -1634686.9890330150250120997619m), // 6 / 10
- new TestResult(2, -145321128061.87519668639091926m), // 6 / 11
- new TestResult(1, 0m), // 6 / 12
- new TestResult(0, -197846315.8215581473367403789m), // 6 / 13
- new TestResult(0, 355519.78373087286985534915017m), // 6 / 14
- new TestResult(0, 5561.4152228343398478498516935m), // 6 / 15
- new TestResult(0, -188135307817449443294332.61564m), // 6 / 16
- new TestResult(4, 3238655413907.0152158135371692m), // 6 / 17
- new TestResult(0, -14883.393842880239095927799143m), // 6 / 18
- new TestResult(0, 770.69397665852204557888702506m), // 6 / 19
- new TestResult(4, 11188331272543609822.484506627m), // 6 / 20
- new TestResult(0, 190565794778408772.72439011791m), // 6 / 21
- new TestResult(4, -12399952364735014.543439368391m), // 6 / 22
- new TestResult(2, 179108914452685.79816067884477m), // 6 / 23
- new TestResult(2, -154490919806941.48506503891762m), // 6 / 24
- new TestResult(2, 130108199431.16705963085822836m), // 6 / 25
- new TestResult(2, -1862655.7707746844883926874832m), // 6 / 26
- new TestResult(2, -10146692.753313261555369747673m), // 6 / 27
- new TestResult(0, 76.341858036091015923443233609m), // 6 / 28
- new TestResult(2, -15854755435520147876.101506668m), // 6 / 29
- new TestResult(3, 0m), // 7 / 0
- new TestResult(0, -79228162514264337593543950335m), // 7 / 1
- new TestResult(0, 79228162514264337593543950335m), // 7 / 2
- new TestResult(4, -39614081257132168796771975168m), // 7 / 3
- new TestResult(0, -7922816251426433759354395033.5m), // 7 / 4
- new TestResult(1, 0m), // 7 / 5
- new TestResult(0, -1m), // 7 / 6
- new TestResult(0, 1m), // 7 / 7
- new TestResult(2, -2859.8815108190596050496514036m), // 7 / 8
- new TestResult(2, 24729010396044602218186.765763m), // 7 / 9
- new TestResult(0, 1634686.9890330150250120997619m), // 7 / 10
- new TestResult(2, 145321128061.87519668639091926m), // 7 / 11
- new TestResult(1, 0m), // 7 / 12
- new TestResult(0, 197846315.8215581473367403789m), // 7 / 13
- new TestResult(0, -355519.78373087286985534915017m), // 7 / 14
- new TestResult(0, -5561.4152228343398478498516935m), // 7 / 15
- new TestResult(0, 188135307817449443294332.61564m), // 7 / 16
- new TestResult(4, -3238655413907.0152158135371692m), // 7 / 17
- new TestResult(0, 14883.393842880239095927799143m), // 7 / 18
- new TestResult(0, -770.69397665852204557888702506m), // 7 / 19
- new TestResult(4, -11188331272543609822.484506627m), // 7 / 20
- new TestResult(0, -190565794778408772.72439011791m), // 7 / 21
- new TestResult(4, 12399952364735014.543439368391m), // 7 / 22
- new TestResult(2, -179108914452685.79816067884477m), // 7 / 23
- new TestResult(2, 154490919806941.48506503891762m), // 7 / 24
- new TestResult(2, -130108199431.16705963085822836m), // 7 / 25
- new TestResult(2, 1862655.7707746844883926874832m), // 7 / 26
- new TestResult(2, 10146692.753313261555369747673m), // 7 / 27
- new TestResult(0, -76.341858036091015923443233609m), // 7 / 28
- new TestResult(2, 15854755435520147876.101506668m), // 7 / 29
- new TestResult(3, 0m), // 8 / 0
- new TestResult(0, 27703302467091960609331879.532m), // 8 / 1
- new TestResult(0, -27703302467091960609331879.532m), // 8 / 2
- new TestResult(0, 13851651233545980304665939.766m), // 8 / 3
- new TestResult(0, 2770330246709196060933187.9532m), // 8 / 4
- new TestResult(0, 277033024670919606093318795.32m), // 8 / 5
- new TestResult(2, 0.0003496648361888264585379374m), // 8 / 6
- new TestResult(2, -0.0003496648361888264585379374m), // 8 / 7
- new TestResult(0, 1m), // 8 / 8
- new TestResult(2, -8646865369244722339.540450168m), // 8 / 9
- new TestResult(0, -571.59255824023515226354006889m), // 8 / 10
- new TestResult(0, -50813688.438531062464476589278m), // 8 / 11
- new TestResult(0, 36312036402878882966329689.018m), // 8 / 12
- new TestResult(0, -69179.899612307954004328275068m), // 8 / 13
- new TestResult(2, 124.31276694014267187689413445m), // 8 / 14
- new TestResult(0, 1.9446313428704152390534655913m), // 8 / 15
- new TestResult(0, -65784301589322901428.917817252m), // 8 / 16
- new TestResult(2, 1132443914.7758524269197245123m), // 8 / 17
- new TestResult(0, -5.2041994700045071214948001057m), // 8 / 18
- new TestResult(2, 0.2694845831000173532986745484m), // 8 / 19
- new TestResult(0, 3912166021640285.6025706982227m), // 8 / 20
- new TestResult(0, 66634157414385.824002109431498m), // 8 / 21
- new TestResult(0, -4335827312364.3201348613764117m), // 8 / 22
- new TestResult(0, 62628089232.056911382057917869m), // 8 / 23
- new TestResult(0, -54020042166.955319300276527479m), // 8 / 24
- new TestResult(0, 45494262.240922193719761217507m), // 8 / 25
- new TestResult(0, -651.30522496410233725620872491m), // 8 / 26
- new TestResult(0, -3547.9416594456341168641639951m), // 8 / 27
- new TestResult(2, 0.0266940632845404098551052086m), // 8 / 28
- new TestResult(0, -5543850462175058.4016671641533m), // 8 / 29
- new TestResult(3, 0m), // 9 / 0
- new TestResult(0, -3203854.9559968181492513385018m), // 9 / 1
- new TestResult(0, 3203854.9559968181492513385018m), // 9 / 2
- new TestResult(0, -1601927.4779984090746256692509m), // 9 / 3
- new TestResult(0, -320385.49559968181492513385018m), // 9 / 4
- new TestResult(0, -32038549.559968181492513385018m), // 9 / 5
- new TestResult(2, -4.04383E-23m), // 9 / 6
- new TestResult(2, 4.04383E-23m), // 9 / 7
- new TestResult(2, -1.156488458E-19m), // 9 / 8
- new TestResult(0, 1m), // 9 / 9
- new TestResult(2, 6.61040196455E-17m), // 9 / 10
- new TestResult(2, 5.8765444202781065E-12m), // 9 / 11
- new TestResult(0, -4199445.0997275825559060668592m), // 9 / 12
- new TestResult(2, 8.0005755447943E-15m), // 9 / 13
- new TestResult(2, -1.43766280186E-17m), // 9 / 14
- new TestResult(2, -2.248943704E-19m), // 9 / 15
- new TestResult(0, 7.6078785525336521046280405305m), // 9 / 16
- new TestResult(2, -1.309658317109623269E-10m), // 9 / 17
- new TestResult(2, 6.018596622E-19m), // 9 / 18
- new TestResult(2, -3.1165581E-20m), // 9 / 19
- new TestResult(2, -0.0004524374850977934825669157m), // 9 / 20
- new TestResult(2, -7.7061633978240275370839E-06m), // 9 / 21
- new TestResult(2, 5.014334243928492665444E-07m), // 9 / 22
- new TestResult(2, -7.242866236221657103E-09m), // 9 / 23
- new TestResult(2, 6.2473555282928855602E-09m), // 9 / 24
- new TestResult(2, -5.261358920047113E-12m), // 9 / 25
- new TestResult(2, 7.53226975501E-17m), // 9 / 26
- new TestResult(2, 4.103153579868E-16m), // 9 / 27
- new TestResult(2, -3.0871376E-21m), // 9 / 28
- new TestResult(2, 0.0006411399074043056427231896m), // 9 / 29
- new TestResult(3, 0m), // 10 / 0
- new TestResult(0, -48466870444188873796420.028868m), // 10 / 1
- new TestResult(0, 48466870444188873796420.028868m), // 10 / 2
- new TestResult(0, -24233435222094436898210.014434m), // 10 / 3
- new TestResult(0, -4846687044418887379642.0028868m), // 10 / 4
- new TestResult(0, -484668704441888737964200.28868m), // 10 / 5
- new TestResult(2, -6.11737908669317400216E-07m), // 10 / 6
- new TestResult(2, 6.11737908669317400216E-07m), // 10 / 7
- new TestResult(2, -0.001749497934470499347067655m), // 10 / 8
- new TestResult(2, 15127673103138133.38384122385m), // 10 / 9
- new TestResult(0, 1m), // 10 / 10
- new TestResult(2, 88898.44296603758700885485801m), // 10 / 11
- new TestResult(0, -63527832683254186820073.01815m), // 10 / 12
- new TestResult(2, 121.03009147860926410013615872m), // 10 / 13
- new TestResult(2, -0.217484928990092181791376891m), // 10 / 14
- new TestResult(2, -0.0034021285176583848675539818m), // 10 / 15
- new TestResult(2, 115089499751104803.45385549602m), // 10 / 16
- new TestResult(2, -1981208.2898040400164777217752m), // 10 / 17
- new TestResult(2, 0.0091047362233453526323903968m), // 10 / 18
- new TestResult(2, -0.0004714627215051239953535366m), // 10 / 19
- new TestResult(0, -6844326374165.3505116694016252m), // 10 / 20
- new TestResult(2, -116576320761.65010852644993727m), // 10 / 21
- new TestResult(0, 7585520927.2021546507200976307m), // 10 / 22
- new TestResult(2, -109567712.75131768812510902617m), // 10 / 23
- new TestResult(2, 94507952.1910976087542637813m), // 10 / 24
- new TestResult(0, -79592.11782075260884714858998m), // 10 / 25
- new TestResult(0, 1.1394571457845409462816707224m), // 10 / 26
- new TestResult(0, 6.2071166048219727069770728387m), // 10 / 27
- new TestResult(2, -4.67012085789282405269787E-05m), // 10 / 28
- new TestResult(2, 9698954932588.587842740128447m), // 10 / 29
- new TestResult(3, 0m), // 11 / 0
- new TestResult(0, -545193693242804794.30331374676m), // 11 / 1
- new TestResult(0, 545193693242804794.30331374676m), // 11 / 2
- new TestResult(0, -272596846621402397.15165687338m), // 11 / 3
- new TestResult(0, -54519369324280479.430331374676m), // 11 / 4
- new TestResult(0, -5451936932428047943.0331374676m), // 11 / 5
- new TestResult(2, -6.8813118459568899E-12m), // 11 / 6
- new TestResult(2, 6.8813118459568899E-12m), // 11 / 7
- new TestResult(2, -1.96797365184322821747E-08m), // 11 / 8
- new TestResult(2, 170168032177.09280206999941461m), // 11 / 9
- new TestResult(2, 1.12487909420644868170014E-05m), // 11 / 10
- new TestResult(0, 1m), // 11 / 11
- new TestResult(0, -714611308856377959.50595110446m), // 11 / 12
- new TestResult(2, 0.0013614421967418161221277362m), // 11 / 13
- new TestResult(2, -2.4464424992592870530962E-06m), // 11 / 14
- new TestResult(2, -3.82698324531749191876E-08m), // 11 / 15
- new TestResult(2, 1294617722326.9607230936474447m), // 11 / 16
- new TestResult(0, -22.286197864690758108786295635m), // 11 / 17
- new TestResult(2, 1.024172743590536270877E-07m), // 11 / 18
- new TestResult(2, -5.3033855911879105358E-09m), // 11 / 19
- new TestResult(0, -76990396.522244266468310204941m), // 11 / 20
- new TestResult(2, -1311342.6610428539176292952583m), // 11 / 21
- new TestResult(2, 85327.93909675220473779587097m), // 11 / 22
- new TestResult(2, -1232.5042947397459817875590485m), // 11 / 23
- new TestResult(2, 1063.1001965602823514109428061m), // 11 / 24
- new TestResult(2, -0.8953150940018113683593315845m), // 11 / 25
- new TestResult(2, 1.28175152203717976446025E-05m), // 11 / 26
- new TestResult(2, 6.98225570406594773014162E-05m), // 11 / 27
- new TestResult(2, -5.253321320461122964E-10m), // 11 / 28
- new TestResult(2, 109101516.393194182269828744m), // 11 / 29
- new TestResult(3, 0m), // 12 / 0
- new TestResult(0, 0.7629234053338741809892531431m), // 12 / 1
- new TestResult(0, -0.7629234053338741809892531431m), // 12 / 2
- new TestResult(2, 0.3814617026669370904946265716m), // 12 / 3
- new TestResult(2, 0.0762923405333874180989253143m), // 12 / 4
- new TestResult(0, 7.629234053338741809892531431m), // 12 / 5
- new TestResult(0, 0m), // 12 / 6
- new TestResult(0, 0m), // 12 / 7
- new TestResult(2, 2.75E-26m), // 12 / 8
- new TestResult(2, -2.381266991833920788159E-07m), // 12 / 9
- new TestResult(2, -1.57411E-23m), // 12 / 10
- new TestResult(2, -1.3993621254E-18m), // 12 / 11
- new TestResult(0, 1m), // 12 / 12
- new TestResult(2, -1.9051506E-21m), // 12 / 13
- new TestResult(2, 3.4235E-24m), // 12 / 14
- new TestResult(2, 5.36E-26m), // 12 / 15
- new TestResult(2, -1.8116390075029613252172E-06m), // 12 / 16
- new TestResult(2, 3.11864612111E-17m), // 12 / 17
- new TestResult(2, -1.433E-25m), // 12 / 18
- new TestResult(2, 7.4E-27m), // 12 / 19
- new TestResult(2, 1.077374449131727051E-10m), // 12 / 20
- new TestResult(2, 1.8350432532917088E-12m), // 12 / 21
- new TestResult(2, -1.194046862108942E-13m), // 12 / 22
- new TestResult(2, 1.7247198294583E-15m), // 12 / 23
- new TestResult(2, -1.4876621505775E-15m), // 12 / 24
- new TestResult(2, 1.2528700328E-18m), // 12 / 25
- new TestResult(2, -1.79363E-23m), // 12 / 26
- new TestResult(2, -9.7707E-23m), // 12 / 27
- new TestResult(2, 7E-28m), // 12 / 28
- new TestResult(2, -1.526725298649329415E-10m), // 12 / 29
- new TestResult(3, 0m), // 13 / 0
- new TestResult(0, -400453059665371395972.33474452m), // 13 / 1
- new TestResult(0, 400453059665371395972.33474452m), // 13 / 2
- new TestResult(0, -200226529832685697986.16737226m), // 13 / 3
- new TestResult(0, -40045305966537139597.233474452m), // 13 / 4
- new TestResult(0, -4004530596653713959723.3474452m), // 13 / 5
- new TestResult(2, -5.0544282103383796846E-09m), // 13 / 6
- new TestResult(2, 5.0544282103383796846E-09m), // 13 / 7
- new TestResult(2, -1.44550657865090008770424E-05m), // 13 / 8
- new TestResult(0, 124991007759518.90460797449561m), // 13 / 9
- new TestResult(2, 0.0082624080324415766315344098m), // 13 / 10
- new TestResult(0, 734.51520923413833710945795487m), // 13 / 11
- new TestResult(0, -524892875045723911444.75281192m), // 13 / 12
- new TestResult(0, 1m), // 13 / 13
- new TestResult(2, -0.0017969492242227235536064218m), // 13 / 14
- new TestResult(2, -2.81097739916991934127E-05m), // 13 / 15
- new TestResult(0, 950916407193211.1625559901416m), // 13 / 16
- new TestResult(2, -16369.551287616739221174657438m), // 13 / 17
- new TestResult(2, 7.52270457050304262522489E-05m), // 13 / 18
- new TestResult(2, -3.8954173771607025488213E-06m), // 13 / 19
- new TestResult(0, -56550617210.555523949138629466m), // 13 / 20
- new TestResult(2, -963201129.053543593301215979m), // 13 / 21
- new TestResult(0, 62674669.039168758653283589393m), // 13 / 22
- new TestResult(2, -905293.1499327386264702284996m), // 13 / 23
- new TestResult(0, 780863.26331332938464898250347m), // 13 / 24
- new TestResult(0, -657.62255360122271090761257385m), // 13 / 25
- new TestResult(2, 0.0094146598739531437042039072m), // 13 / 26
- new TestResult(2, 0.0512857300939825548661107378m), // 13 / 27
- new TestResult(2, -3.858644408872661628546E-07m), // 13 / 28
- new TestResult(2, 80136723141.3087985919301071m), // 13 / 29
- new TestResult(3, 0m), // 14 / 0
- new TestResult(0, 222851627785191714190050.61676m), // 14 / 1
- new TestResult(0, -222851627785191714190050.61676m), // 14 / 2
- new TestResult(0, 111425813892595857095025.30838m), // 14 / 3
- new TestResult(0, 22285162778519171419005.061676m), // 14 / 4
- new TestResult(0, 2228516277851917141900506.1676m), // 14 / 5
- new TestResult(2, 2.8127829891936371496034E-06m), // 14 / 6
- new TestResult(2, -2.8127829891936371496034E-06m), // 14 / 7
- new TestResult(2, 0.0080442260647412496180191824m), // 14 / 8
- new TestResult(0, -69557339781586865.090190294226m), // 14 / 9
- new TestResult(0, -4.5980197554082303507855592074m), // 14 / 10
- new TestResult(0, -408756.79698287266169556154972m), // 14 / 11
- new TestResult(0, 292102229695871398106087.53771m), // 14 / 12
- new TestResult(0, -556.49875161751071295835933612m), // 14 / 13
- new TestResult(0, 1m), // 14 / 14
- new TestResult(2, 0.0156430541346309720805875037m), // 14 / 15
- new TestResult(0, -529183793495630496.21134784463m), // 14 / 16
- new TestResult(0, 9109634.856097530429701051341m), // 14 / 17
- new TestResult(2, -0.0418637570227228532534385582m), // 14 / 18
- new TestResult(2, 0.0021677949074190888565424407m), // 14 / 19
- new TestResult(0, 31470347880873.8650457716423m), // 14 / 20
- new TestResult(0, 536020225874.87383772032904409m), // 14 / 21
- new TestResult(0, -34878375078.338063831579069802m), // 14 / 22
- new TestResult(0, 503794507.78545299809142202221m), // 14 / 23
- new TestResult(0, -434549431.21784335466036244264m), // 14 / 24
- new TestResult(0, 365966.13011459996262470838791m), // 14 / 25
- new TestResult(0, -5.2392464667583952349382510034m), // 14 / 26
- new TestResult(0, -28.540444773093892153704750451m), // 14 / 27
- new TestResult(2, 0.0002147330796473523774307252m), // 14 / 28
- new TestResult(0, -44595986386856.427962855912902m), // 14 / 29
- new TestResult(3, 0m), // 15 / 0
- new TestResult(0, 14246043379204153213661335.584m), // 15 / 1
- new TestResult(0, -14246043379204153213661335.584m), // 15 / 2
- new TestResult(0, 7123021689602076606830667.792m), // 15 / 3
- new TestResult(0, 1424604337920415321366133.5584m), // 15 / 4
- new TestResult(0, 142460433792041532136613355.84m), // 15 / 5
- new TestResult(2, 0.000179810346814988644017588m), // 15 / 6
- new TestResult(2, -0.000179810346814988644017588m), // 15 / 7
- new TestResult(2, 0.5142362863101488055319975668m), // 15 / 8
- new TestResult(0, -4446531935704239606.853757764m), // 15 / 9
- new TestResult(0, -293.9336344319759696558350238m), // 15 / 10
- new TestResult(0, -26130242.436351157631251931791m), // 15 / 11
- new TestResult(0, 18672966748175371201221341.455m), // 15 / 12
- new TestResult(0, -35574.814663942145387025413585m), // 15 / 13
- new TestResult(0, 63.926135612238008074953534656m), // 15 / 14
- new TestResult(0, 1m), // 15 / 15
- new TestResult(0, -33828674946800228646.235978357m), // 15 / 16
- new TestResult(0, 582343753.18886100200299543357m), // 15 / 17
- new TestResult(0, -2.676188208672362394790189458m), // 15 / 18
- new TestResult(2, 0.1385787512311916118536189686m), // 15 / 19
- new TestResult(0, 2011777726397049.7148998294303m), // 15 / 20
- new TestResult(0, 34265701650179.633435597272951m), // 15 / 21
- new TestResult(0, -2229639735192.3415269889385254m), // 15 / 22
- new TestResult(0, 32205636025.393565317814400562m), // 15 / 23
- new TestResult(0, -27779065870.252746877787654023m), // 15 / 24
- new TestResult(0, 23394800.463191857206004010592m), // 15 / 25
- new TestResult(0, -334.92478013993600679391750784m), // 15 / 26
- new TestResult(0, -1824.480342998389574945394373m), // 15 / 27
- new TestResult(2, 0.0137270559699701534233028604m), // 15 / 28
- new TestResult(0, -2850849073527704.1131980257228m), // 15 / 29
- new TestResult(3, 0m), // 16 / 0
- new TestResult(0, -421123.30446308691436596648186m), // 16 / 1
- new TestResult(0, 421123.30446308691436596648186m), // 16 / 2
- new TestResult(0, -210561.65223154345718298324093m), // 16 / 3
- new TestResult(0, -42112.330446308691436596648186m), // 16 / 4
- new TestResult(0, -4211233.0446308691436596648186m), // 16 / 5
- new TestResult(2, -5.3153E-24m), // 16 / 6
- new TestResult(2, 5.3153E-24m), // 16 / 7
- new TestResult(2, -1.52011951E-20m), // 16 / 8
- new TestResult(2, 0.1314426870900784765046305445m), // 16 / 9
- new TestResult(2, 8.6888899697E-18m), // 16 / 10
- new TestResult(2, 7.724287894055618E-13m), // 16 / 11
- new TestResult(0, -551986.34819545603591091806686m), // 16 / 12
- new TestResult(2, 1.0516171478749E-15m), // 16 / 13
- new TestResult(2, -1.8897026181E-18m), // 16 / 14
- new TestResult(2, -2.95607204E-20m), // 16 / 15
- new TestResult(0, 1m), // 16 / 16
- new TestResult(2, -1.72145008370758982E-11m), // 16 / 17
- new TestResult(2, 7.91100512E-20m), // 16 / 18
- new TestResult(2, -4.0964877E-21m), // 16 / 19
- new TestResult(2, -5.94695987815313124908788E-05m), // 16 / 20
- new TestResult(2, -1.012918824165199591208E-06m), // 16 / 21
- new TestResult(2, 6.59097566989758101184E-08m), // 16 / 22
- new TestResult(2, -9.520218003229776933E-10m), // 16 / 23
- new TestResult(2, 8.211691978458736692E-10m), // 16 / 24
- new TestResult(2, -6.915671541963459E-13m), // 16 / 25
- new TestResult(2, 9.9006177649E-18m), // 16 / 26
- new TestResult(2, 5.39329532081E-17m), // 16 / 27
- new TestResult(2, -4.057817E-22m), // 16 / 28
- new TestResult(2, 8.42731522299060351340978E-05m), // 16 / 29
- new TestResult(3, 0m), // 17 / 0
- new TestResult(0, 24463288738299545.200508898642m), // 17 / 1
- new TestResult(0, -24463288738299545.200508898642m), // 17 / 2
- new TestResult(0, 12231644369149772.600254449321m), // 17 / 3
- new TestResult(0, 2446328873829954.5200508898642m), // 17 / 4
- new TestResult(0, 244632887382995452.00508898642m), // 17 / 5
- new TestResult(2, 3.087701135804474E-13m), // 17 / 6
- new TestResult(2, -3.087701135804474E-13m), // 17 / 7
- new TestResult(2, 8.830459389222225669E-10m), // 17 / 8
- new TestResult(0, -7635579348.7187565660747357791m), // 17 / 9
- new TestResult(2, -5.047424872722036356353E-07m), // 17 / 10
- new TestResult(2, -0.0448708212173039475800037318m), // 17 / 11
- new TestResult(0, 32065196279558108.529140993113m), // 17 / 12
- new TestResult(2, -6.10890294076955781848965E-05m), // 17 / 13
- new TestResult(2, 1.097738840026777145636E-07m), // 17 / 14
- new TestResult(2, 1.7171988100225883459E-09m), // 17 / 15
- new TestResult(0, -58090560363.286299748647320613m), // 17 / 16
- new TestResult(0, 1m), // 17 / 17
- new TestResult(2, -4.5955472073286630491E-09m), // 17 / 18
- new TestResult(2, 2.379672667086185355E-10m), // 17 / 19
- new TestResult(0, 3454622.3177989620890093190782m), // 17 / 20
- new TestResult(0, 58841.022098277508341771781449m), // 17 / 21
- new TestResult(0, -3828.7347000513678647353825371m), // 17 / 22
- new TestResult(0, 55.303479858826432190514052161m), // 17 / 23
- new TestResult(0, -47.702178855937114485246771806m), // 17 / 24
- new TestResult(2, 0.0401735235161089558399723624m), // 17 / 25
- new TestResult(2, -5.751324339033751411128E-07m), // 17 / 26
- new TestResult(2, -3.1329954739064384030107E-06m), // 17 / 27
- new TestResult(2, 2.35720841767462147E-11m), // 17 / 28
- new TestResult(0, -4895474.6366157719700764456737m), // 17 / 29
- new TestResult(3, 0m), // 18 / 0
- new TestResult(0, -5323259153836385912697776.001m), // 18 / 1
- new TestResult(0, 5323259153836385912697776.001m), // 18 / 2
- new TestResult(0, -2661629576918192956348888.0005m), // 18 / 3
- new TestResult(0, -532325915383638591269777.6001m), // 18 / 4
- new TestResult(0, -53232591538363859126977760.01m), // 18 / 5
- new TestResult(2, -6.71889765571425396685425E-05m), // 18 / 6
- new TestResult(2, 6.71889765571425396685425E-05m), // 18 / 7
- new TestResult(2, -0.1921525117866271842350897941m), // 18 / 8
- new TestResult(2, 1661516899781174928.9093780261m), // 18 / 9
- new TestResult(2, 109.83294578440517035615430815m), // 18 / 10
- new TestResult(0, 9763977.866606841461047851247m), // 18 / 11
- new TestResult(0, -6977449002900619940294072.5616m), // 18 / 12
- new TestResult(2, 13293.091475651689504900168879m), // 18 / 13
- new TestResult(2, -23.887010414694002921991680138m), // 18 / 14
- new TestResult(2, -0.3736657970315521134142448751m), // 18 / 15
- new TestResult(2, 12640618786517406225.453062932m), // 18 / 16
- new TestResult(2, -217601942.68166121398235985303m), // 18 / 17
- new TestResult(0, 1m), // 18 / 18
- new TestResult(2, -0.0517821395304403973786481636m), // 18 / 19
- new TestResult(0, -751732527584477.35915419894761m), // 18 / 20
- new TestResult(2, -12803920717959.743225565448731m), // 18 / 21
- new TestResult(2, 833140108743.8650907762143944m), // 18 / 22
- new TestResult(2, -12034144654.336754703603784598m), // 18 / 23
- new TestResult(2, 10380086789.199979490407779016m), // 18 / 24
- new TestResult(2, -8741836.761472709884309939817m), // 18 / 25
- new TestResult(2, 125.14993491660654415586289072m), // 18 / 26
- new TestResult(0, 681.74590153489282094280759828m), // 18 / 27
- new TestResult(2, -0.0051293313099156230719389272m), // 18 / 28
- new TestResult(2, 1065264791276391.4723331595476m), // 18 / 29
- new TestResult(3, 0m), // 19 / 0
- new TestResult(0, 102801066199805834724673169.19m), // 19 / 1
- new TestResult(0, -102801066199805834724673169.19m), // 19 / 2
- new TestResult(0, 51400533099902917362336584.595m), // 19 / 3
- new TestResult(0, 10280106619980583472467316.919m), // 19 / 4
- new TestResult(0, 1028010661998058347246731691.9m), // 19 / 5
- new TestResult(2, 0.0012975318742410238535080931m), // 19 / 6
- new TestResult(2, -0.0012975318742410238535080931m), // 19 / 7
- new TestResult(0, 3.7107874168403053465719309061m), // 19 / 8
- new TestResult(0, -32086679207305516282.844795417m), // 19 / 9
- new TestResult(0, -2121.0584726774239906503858037m), // 19 / 10
- new TestResult(0, -188558795.66094477019222763757m), // 19 / 11
- new TestResult(0, 134746247763650063417846672.74m), // 19 / 12
- new TestResult(0, -256711.90097962787395549999647m), // 19 / 13
- new TestResult(0, 461.29825131408293475234811789m), // 19 / 14
- new TestResult(0, 7.2161135175168023022995955438m), // 19 / 15
- new TestResult(0, -244111558563287122929.04506056m), // 19 / 16
- new TestResult(0, 4202258629.2276083227657702227m), // 19 / 17
- new TestResult(0, -19.311677908019711128996883838m), // 19 / 18
- new TestResult(0, 1m), // 19 / 19
- new TestResult(0, 14517216445692969.517326696553m), // 19 / 20
- new TestResult(0, 247265192865059.0518154425151m), // 19 / 21
- new TestResult(0, -16089333432314.039236231362245m), // 19 / 22
- new TestResult(0, 232399525463.06860877964908684m), // 19 / 23
- new TestResult(0, -200456892730.3205001486617745m), // 19 / 24
- new TestResult(0, 168819535.86204710848979659043m), // 19 / 25
- new TestResult(0, -2416.8552333191352676140967438m), // 19 / 26
- new TestResult(0, -13165.657265554370962757268367m), // 19 / 27
- new TestResult(2, 0.0990559941406113443335355768m), // 19 / 28
- new TestResult(0, -20572050535883517.889932557941m), // 19 / 29
- new TestResult(3, 0m), // 20 / 0
- new TestResult(0, 7081320760.3793287174700927968m), // 20 / 1
- new TestResult(0, -7081320760.3793287174700927968m), // 20 / 2
- new TestResult(0, 3540660380.1896643587350463984m), // 20 / 3
- new TestResult(0, 708132076.03793287174700927968m), // 20 / 4
- new TestResult(0, 70813207603.793287174700927968m), // 20 / 5
- new TestResult(2, 8.93788337E-20m), // 20 / 6
- new TestResult(2, -8.93788337E-20m), // 20 / 7
- new TestResult(2, 2.556128739088E-16m), // 20 / 8
- new TestResult(0, -2210.250107335496183875574735m), // 20 / 9
- new TestResult(2, -1.461064165166945E-13m), // 20 / 10
- new TestResult(2, -1.2988632935681496171E-08m), // 20 / 11
- new TestResult(2, 9281823982.422412820396304075m), // 20 / 12
- new TestResult(2, -1.76832729566273202E-11m), // 20 / 13
- new TestResult(2, 3.17759436211301E-14m), // 20 / 14
- new TestResult(2, 4.970728062443E-16m), // 20 / 15
- new TestResult(2, -16815.314387332923907118773285m), // 20 / 16
- new TestResult(2, 2.894672435964370128732E-07m), // 20 / 17
- new TestResult(2, -1.3302603829227E-15m), // 20 / 18
- new TestResult(2, 6.88837287603E-17m), // 20 / 19
- new TestResult(0, 1m), // 20 / 20
- new TestResult(2, 0.0170325484771854288433021822m), // 20 / 21
- new TestResult(2, -0.0011082932800859005017661851m), // 20 / 22
- new TestResult(2, 1.60085458760255588702037E-05m), // 20 / 23
- new TestResult(2, -1.38082182269723557757959E-05m), // 20 / 24
- new TestResult(2, 1.16289191177647018971E-08m), // 20 / 25
- new TestResult(2, -1.6648200034492E-13m), // 20 / 26
- new TestResult(2, -9.068995640318096E-13m), // 20 / 27
- new TestResult(2, 6.8233462325E-18m), // 20 / 28
- new TestResult(2, -1.4170795491574366313541174399m), // 20 / 29
- new TestResult(3, 0m), // 21 / 0
- new TestResult(0, 415752273939.77704245656837041m), // 21 / 1
- new TestResult(0, -415752273939.77704245656837041m), // 21 / 2
- new TestResult(2, 207876136969.8885212282841852m), // 21 / 3
- new TestResult(0, 41575227393.977704245656837041m), // 21 / 4
- new TestResult(0, 4157522739397.7704245656837041m), // 21 / 5
- new TestResult(2, 5.2475314427E-18m), // 21 / 6
- new TestResult(2, -5.2475314427E-18m), // 21 / 7
- new TestResult(2, 1.50073181503771E-14m), // 21 / 8
- new TestResult(2, -129766.25959973387113808743405m), // 21 / 9
- new TestResult(2, -8.5780713738991847E-12m), // 21 / 10
- new TestResult(2, -7.625771887911763590261E-07m), // 21 / 11
- new TestResult(0, 544946282986.07977368508338172m), // 21 / 12
- new TestResult(2, -1.0382047630930577807E-09m), // 21 / 13
- new TestResult(2, 1.8656012436244067E-12m), // 21 / 14
- new TestResult(2, 2.91837012476515E-14m), // 21 / 15
- new TestResult(2, -987245.9432513294606844938685m), // 21 / 16
- new TestResult(2, 1.69949461164997956913075E-05m), // 21 / 17
- new TestResult(2, -7.81010771643817E-14m), // 21 / 18
- new TestResult(2, 4.0442408752037E-15m), // 21 / 19
- new TestResult(0, 58.711120143850993772970798576m), // 21 / 20
- new TestResult(0, 1m), // 21 / 21
- new TestResult(2, -0.0650691399217460043995169619m), // 21 / 22
- new TestResult(2, 0.0009398796602556869430220663m), // 21 / 23
- new TestResult(2, -0.0008106959592962871308194687m), // 21 / 24
- new TestResult(2, 6.827468674662091164433E-07m), // 21 / 25
- new TestResult(2, -9.7743447240392408E-12m), // 21 / 26
- new TestResult(2, -5.32450892622776623E-11m), // 21 / 27
- new TestResult(2, 4.006063004374E-16m), // 21 / 28
- new TestResult(2, -83.19832766397646235747803502m), // 21 / 29
- new TestResult(3, 0m), // 22 / 0
- new TestResult(0, -6389392489892.6362673670820462m), // 22 / 1
- new TestResult(0, 6389392489892.6362673670820462m), // 22 / 2
- new TestResult(0, -3194696244946.3181336835410231m), // 22 / 3
- new TestResult(0, -638939248989.26362673670820462m), // 22 / 4
- new TestResult(0, -63893924898926.362673670820462m), // 22 / 5
- new TestResult(2, -8.06454710942E-17m), // 22 / 6
- new TestResult(2, 8.06454710942E-17m), // 22 / 7
- new TestResult(2, -2.306364917136659E-13m), // 22 / 8
- new TestResult(2, 1994282.6930829954142428134453m), // 22 / 9
- new TestResult(2, 1.31830102322167113E-10m), // 22 / 10
- new TestResult(2, 1.17194908324940723524544E-05m), // 22 / 11
- new TestResult(2, -8374880682938.911591614017805m), // 22 / 12
- new TestResult(2, 1.59554093436863052632E-08m), // 22 / 13
- new TestResult(2, -2.8671060442293101E-11m), // 22 / 14
- new TestResult(2, -4.485029505960676E-13m), // 22 / 15
- new TestResult(2, 15172260.52839517272431927284m), // 22 / 16
- new TestResult(2, -0.0002611828915663923103773216m), // 22 / 17
- new TestResult(2, 1.2002783079399592E-12m), // 22 / 18
- new TestResult(2, -6.21529788171079E-14m), // 22 / 19
- new TestResult(2, -902.2882462325251912660653119m), // 22 / 20
- new TestResult(2, -15.368268294350108200187006165m), // 22 / 21
- new TestResult(0, 1m), // 22 / 22
- new TestResult(2, -0.0144443227832120251558802997m), // 22 / 23
- new TestResult(2, 0.0124589930076108753677011728m), // 22 / 24
- new TestResult(2, -1.04926370363477969575619E-05m), // 22 / 25
- new TestResult(2, 1.50214752120500522E-10m), // 22 / 26
- new TestResult(2, 8.182848171393031905E-10m), // 22 / 27
- new TestResult(2, -6.156625105529E-15m), // 22 / 28
- new TestResult(2, 1278.6142211812409691677177837m), // 22 / 29
- new TestResult(3, 0m), // 23 / 0
- new TestResult(0, 442346282742915.0596416330681m), // 23 / 1
- new TestResult(0, -442346282742915.0596416330681m), // 23 / 2
- new TestResult(0, 221173141371457.52982081653405m), // 23 / 3
- new TestResult(0, 44234628274291.50596416330681m), // 23 / 4
- new TestResult(0, 4423462827429150.596416330681m), // 23 / 5
- new TestResult(2, 5.5831950244116E-15m), // 23 / 6
- new TestResult(2, -5.5831950244116E-15m), // 23 / 7
- new TestResult(2, 1.59672762216117307E-11m), // 23 / 8
- new TestResult(0, -138066887.80181919317571960944m), // 23 / 9
- new TestResult(2, -9.1267762636395250963E-09m), // 23 / 10
- new TestResult(2, -0.0008113561991369439495762269m), // 23 / 11
- new TestResult(0, 579804315413987.55317875373327m), // 23 / 12
- new TestResult(2, -1.104614566093091384748E-06m), // 23 / 13
- new TestResult(2, 1.9849362876061009571E-09m), // 23 / 14
- new TestResult(2, 3.10504658008156699E-11m), // 23 / 15
- new TestResult(2, -1050396114.5225303515983863327m), // 23 / 16
- new TestResult(2, 0.018082044792709369766201304m), // 23 / 17
- new TestResult(2, -8.30968904499273382E-11m), // 23 / 18
- new TestResult(2, 4.3029347758238576E-12m), // 23 / 19
- new TestResult(0, 62466.635492334295970467255163m), // 23 / 20
- new TestResult(2, 1063.9659972298557739709718754m), // 23 / 21
- new TestResult(0, -69.231352345729507070036842909m), // 23 / 22
- new TestResult(0, 1m), // 23 / 23
- new TestResult(2, -0.8625529347828887027197930493m), // 23 / 24
- new TestResult(2, 0.000726419451699245356034835m), // 23 / 25
- new TestResult(2, -1.03995704315807902618E-08m), // 23 / 26
- new TestResult(2, -5.66509644945319386873E-08m), // 23 / 27
- new TestResult(2, 4.262314819414408E-13m), // 23 / 28
- new TestResult(0, -88520.19166085901375500091819m), // 23 / 29
- new TestResult(3, 0m), // 24 / 0
- new TestResult(0, -512833780867323.89020837443764m), // 24 / 1
- new TestResult(0, 512833780867323.89020837443764m), // 24 / 2
- new TestResult(0, -256416890433661.94510418721882m), // 24 / 3
- new TestResult(0, -51283378086732.389020837443764m), // 24 / 4
- new TestResult(0, -5128337808673238.9020837443764m), // 24 / 5
- new TestResult(2, -6.4728723296466E-15m), // 24 / 6
- new TestResult(2, 6.4728723296466E-15m), // 24 / 7
- new TestResult(2, -1.85116478974485417E-11m), // 24 / 8
- new TestResult(0, 160067727.13209967231293920454m), // 24 / 9
- new TestResult(2, 1.05811201789450821647E-08m), // 24 / 10
- new TestResult(2, 0.0009406451087447388135269385m), // 24 / 11
- new TestResult(0, -672195632329427.78049892650167m), // 24 / 12
- new TestResult(2, 1.280633943203881720602E-06m), // 24 / 13
- new TestResult(2, -2.3012341707535026743E-09m), // 24 / 14
- new TestResult(2, -3.59983307095596564E-11m), // 24 / 15
- new TestResult(2, 1217775828.2011100471829103026m), // 24 / 16
- new TestResult(2, -0.0209634030139388041036175456m), // 24 / 17
- new TestResult(2, 9.63383081768117492E-11m), // 24 / 18
- new TestResult(2, -4.988603716138233E-12m), // 24 / 19
- new TestResult(0, -72420.639908967018993409156115m), // 24 / 20
- new TestResult(2, -1233.5080599982704934889448056m), // 24 / 21
- new TestResult(2, 80.26330855062892819843621147m), // 24 / 22
- new TestResult(0, -1.1593491363538259770624590073m), // 24 / 23
- new TestResult(0, 1m), // 24 / 24
- new TestResult(2, -0.0008421737639581399076256596m), // 24 / 25
- new TestResult(2, 1.20567329983039744731E-08m), // 24 / 26
- new TestResult(2, 6.56782467603468627053E-08m), // 24 / 27
- new TestResult(2, -4.941511004756208E-13m), // 24 / 28
- new TestResult(2, 102625.80775189204591883200668m), // 24 / 29
- new TestResult(3, 0m), // 25 / 0
- new TestResult(0, 608940580690915704.1450897514m), // 25 / 1
- new TestResult(0, -608940580690915704.1450897514m), // 25 / 2
- new TestResult(0, 304470290345457852.0725448757m), // 25 / 3
- new TestResult(0, 60894058069091570.41450897514m), // 25 / 4
- new TestResult(0, 6089405806909157041.450897514m), // 25 / 5
- new TestResult(2, 7.6859106833543095E-12m), // 25 / 6
- new TestResult(2, -7.6859106833543095E-12m), // 25 / 7
- new TestResult(2, 2.19807938571316735336E-08m), // 25 / 8
- new TestResult(2, -190064965191.73899284873850192m), // 25 / 9
- new TestResult(2, -1.2564058192949139177057E-05m), // 25 / 10
- new TestResult(2, -1.1169252106878663178369471734m), // 25 / 11
- new TestResult(2, 798167386704341861.9682340376m), // 25 / 12
- new TestResult(2, -0.0015206291124352045188095451m), // 25 / 13
- new TestResult(2, 2.7324933039209294299951E-06m), // 25 / 14
- new TestResult(2, 4.27445406757517405142E-08m), // 25 / 15
- new TestResult(0, -1445991172270.2862199666258075m), // 25 / 16
- new TestResult(2, 24.892016245451201449485802529m), // 25 / 17
- new TestResult(2, -1.143924357415629812325E-07m), // 25 / 18
- new TestResult(2, 5.9234850687965514433E-09m), // 25 / 19
- new TestResult(2, 85992514.8565500475609760009m), // 25 / 20
- new TestResult(2, 1464671.6779692768786214751455m), // 25 / 21
- new TestResult(2, -95304.9263532013818698238713m), // 25 / 22
- new TestResult(2, 1376.6151190758908669955780933m), // 25 / 23
- new TestResult(2, -1187.4034110254054607086172841m), // 25 / 24
- new TestResult(0, 1m), // 25 / 25
- new TestResult(2, -1.43162058880087033607313E-05m), // 25 / 26
- new TestResult(2, -7.79865742334041504368931E-05m), // 25 / 27
- new TestResult(2, 5.867567022667099857E-10m), // 25 / 28
- new TestResult(2, -121858234.18383411295432055833m), // 25 / 29
- new TestResult(3, 0m), // 26 / 0
- new TestResult(0, -42535053313319986966115.037787m), // 26 / 1
- new TestResult(0, 42535053313319986966115.037787m), // 26 / 2
- new TestResult(2, -21267526656659993483057.518894m), // 26 / 3
- new TestResult(0, -4253505331331998696611.5037787m), // 26 / 4
- new TestResult(0, -425350533133199869661150.37787m), // 26 / 5
- new TestResult(2, -5.368678505659136383798E-07m), // 26 / 6
- new TestResult(2, 5.368678505659136383798E-07m), // 26 / 7
- new TestResult(2, -0.0015353784395866262203076433m), // 26 / 8
- new TestResult(2, 13276210657946598.343741130625m), // 26 / 9
- new TestResult(2, 0.8776108901502200170717671109m), // 26 / 10
- new TestResult(0, 78018.241664392812128305230978m), // 26 / 11
- new TestResult(0, -55752717790464947101601.359896m), // 26 / 12
- new TestResult(2, 106.21732631750483463727976216m), // 26 / 13
- new TestResult(2, -0.1908671421252521905897157731m), // 26 / 14
- new TestResult(2, -0.0029857450367876236635795704m), // 26 / 15
- new TestResult(2, 101003798323510611.65980529603m), // 26 / 16
- new TestResult(0, -1738729.9707879186275737174853m), // 26 / 17
- new TestResult(2, 0.0079904156615530673319808542m), // 26 / 18
- new TestResult(2, -0.0004137608186927571471957746m), // 26 / 19
- new TestResult(0, -6006655361709.8810944800037905m), // 26 / 20
- new TestResult(2, -102308648634.06932650747319597m), // 26 / 21
- new TestResult(0, 6657135773.1750052361186583781m), // 26 / 22
- new TestResult(2, -96157817.91940752862823678187m), // 26 / 23
- new TestResult(2, 82941208.04870360868726566113m), // 26 / 24
- new TestResult(0, -69850.909369611886817979504214m), // 26 / 25
- new TestResult(0, 1m), // 26 / 26
- new TestResult(0, 5.4474331288240229212686639513m), // 26 / 27
- new TestResult(2, -4.09854892320443047650146E-05m), // 26 / 28
- new TestResult(0, 8511908471915.937756062101659m), // 26 / 29
- new TestResult(3, 0m), // 27 / 0
- new TestResult(0, -7808274522591953107485.8812311m), // 27 / 1
- new TestResult(0, 7808274522591953107485.8812311m), // 27 / 2
- new TestResult(2, -3904137261295976553742.9406156m), // 27 / 3
- new TestResult(0, -780827452259195310748.58812311m), // 27 / 4
- new TestResult(0, -78082745225919531074858.812311m), // 27 / 5
- new TestResult(2, -9.85542801296968307756E-08m), // 27 / 6
- new TestResult(2, 9.85542801296968307756E-08m), // 27 / 7
- new TestResult(2, -0.000281853563555002197999826m), // 27 / 8
- new TestResult(2, 2437149817901964.8960845694514m), // 27 / 9
- new TestResult(2, 0.1611053994415304138070003376m), // 27 / 10
- new TestResult(2, 14322.019163773595213651372685m), // 27 / 11
- new TestResult(2, -10234676860090376638967.506512m), // 27 / 12
- new TestResult(2, 19.498601232106311831598265533m), // 27 / 13
- new TestResult(2, -0.0350379963574616786880617938m), // 27 / 14
- new TestResult(2, -0.0005481012737887758520091497m), // 27 / 15
- new TestResult(2, 18541539828927654.501195934005m), // 27 / 16
- new TestResult(2, -319183.3529057512147016471775m), // 27 / 17
- new TestResult(2, 0.0014668221660718241029342142m), // 27 / 18
- new TestResult(2, -7.59551900698740123366376E-05m), // 27 / 19
- new TestResult(2, -1102657934418.1103423727465413m), // 27 / 20
- new TestResult(2, -18781074721.729615778535996388m), // 27 / 21
- new TestResult(2, 1222068378.9489912725931951927m), // 27 / 22
- new TestResult(2, -17651950.128695901472129097893m), // 27 / 23
- new TestResult(0, 15225741.38814783974528909088m), // 27 / 24
- new TestResult(2, -12822.719933909700245783228909m), // 27 / 25
- new TestResult(2, 0.1835726986181246222761380025m), // 27 / 26
- new TestResult(0, 1m), // 27 / 27
- new TestResult(2, -7.5238168625104611316081E-06m), // 27 / 28
- new TestResult(2, 1562554008580.0861321324839011m), // 27 / 29
- new TestResult(3, 0m), // 28 / 0
- new TestResult(0, 1037807626804273037330059471.7m), // 28 / 1
- new TestResult(0, -1037807626804273037330059471.7m), // 28 / 2
- new TestResult(0, 518903813402136518665029735.85m), // 28 / 3
- new TestResult(0, 103780762680427303733005947.17m), // 28 / 4
- new TestResult(0, 10378076268042730373300594717m), // 28 / 5
- new TestResult(2, 0.013098973822817421173845813m), // 28 / 6
- new TestResult(2, -0.013098973822817421173845813m), // 28 / 7
- new TestResult(0, 37.461513046578399246836695461m), // 28 / 8
- new TestResult(0, -323924659841968113506.41166762m), // 28 / 9
- new TestResult(0, -21412.722077843692663812014719m), // 28 / 10
- new TestResult(0, -1903557652.3848013647110715272m), // 28 / 11
- new TestResult(0, 1360303825454277040707598638.1m), // 28 / 12
- new TestResult(0, -2591583.7118874583629347087379m), // 28 / 13
- new TestResult(0, 4656.9443405844146143879311m), // 28 / 14
- new TestResult(0, 72.848832421725332869329889807m), // 28 / 15
- new TestResult(0, -2464379472248467996678.919247m), // 28 / 16
- new TestResult(0, 42423062487.893912564215173398m), // 28 / 17
- new TestResult(0, -194.95718634257023426451589779m), // 28 / 18
- new TestResult(0, 10.095300225653040883323838635m), // 28 / 19
- new TestResult(0, 146555658460058271.30028503504m), // 28 / 20
- new TestResult(0, 2496216357326773.3203945609668m), // 28 / 21
- new TestResult(0, -162426651429846.93508891542812m), // 28 / 22
- new TestResult(0, 2346142981848.9761467960716552m), // 28 / 23
- new TestResult(0, -2023672514414.1119557698582125m), // 28 / 24
- new TestResult(0, 1704283898.4827658021193146276m), // 28 / 25
- new TestResult(0, -24398.879182297399040382596287m), // 28 / 26
- new TestResult(0, -132911.26276382163838029345835m), // 28 / 27
- new TestResult(0, 1m), // 28 / 28
- new TestResult(0, -207681026417050638.7817636979m), // 28 / 29
- new TestResult(3, 0m), // 29 / 0
- new TestResult(0, -4997122966.448652425771563042m), // 29 / 1
- new TestResult(0, 4997122966.448652425771563042m), // 29 / 2
- new TestResult(0, -2498561483.224326212885781521m), // 29 / 3
- new TestResult(0, -499712296.6448652425771563042m), // 29 / 4
- new TestResult(0, -49971229664.48652425771563042m), // 29 / 5
- new TestResult(2, -6.30725591E-20m), // 29 / 6
- new TestResult(2, 6.30725591E-20m), // 29 / 7
- new TestResult(2, -1.803800457503E-16m), // 29 / 8
- new TestResult(0, 1559.7219709011119254589559305m), // 29 / 9
- new TestResult(2, 1.031038918059089E-13m), // 29 / 10
- new TestResult(2, 9.1657754452841005337E-09m), // 29 / 11
- new TestResult(0, -6549966787.6381215871101448624m), // 29 / 12
- new TestResult(2, 1.24786734570697837E-11m), // 29 / 13
- new TestResult(2, -2.24235425880102E-14m), // 29 / 14
- new TestResult(2, -3.507726905944E-16m), // 29 / 15
- new TestResult(2, 11866.175330334086443056587349m), // 29 / 16
- new TestResult(2, -2.042702851569255038994E-07m), // 29 / 17
- new TestResult(2, 9.387337384931E-16m), // 29 / 18
- new TestResult(2, -4.86096414286E-17m), // 29 / 19
- new TestResult(2, -0.705676685966272906628710787m), // 29 / 20
- new TestResult(2, -0.0120194723629401016807892544m), // 29 / 21
- new TestResult(2, 0.0007820967289697085504718691m), // 29 / 22
- new TestResult(2, -1.1296857600932761513324E-05m), // 29 / 23
- new TestResult(2, 9.7441376775089367720444E-06m), // 29 / 24
- new TestResult(2, -8.2062571043940289217E-09m), // 29 / 25
- new TestResult(2, 1.17482466276439E-13m), // 29 / 26
- new TestResult(2, 6.399778788502251E-13m), // 29 / 27
- new TestResult(2, -4.8150763565E-18m), // 29 / 28
- new TestResult(0, 1m), // 29 / 29
- };
-
- #endregion
- }
-}
diff --git a/mcs/class/corlib/Test/System/DoubleTest.cs b/mcs/class/corlib/Test/System/DoubleTest.cs
deleted file mode 100644
index d2c3b8ea424..00000000000
--- a/mcs/class/corlib/Test/System/DoubleTest.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-// BooleanTest.cs - NUnit Test Cases for the System.Double class
-//
-// Bob Doan <bdoan@sicompos.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class DoubleTest : TestCase
-{
- private const Double d_zero = 0.0;
- private const Double d_neg = -1234.5678;
- private const Double d_pos = 1234.9999;
- private const Double d_pos2 = 1234.9999;
- private const Double d_nan = Double.NaN;
- private const Double d_pinf = Double.PositiveInfinity;
- private const Double d_ninf = Double.NegativeInfinity;
- private const String s = "What Ever";
-
- public DoubleTest() : base ("MonoTests.System.DoubleTest testcase") {}
- public DoubleTest (string name) : base (name) {}
-
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (DoubleTest));
- }
- }
-
- public void TestPublicFields ()
- {
- AssertEquals("Epsilon Field has wrong value", 3.9406564584124654e-324, Double.Epsilon);
- AssertEquals("MaxValue Field has wrong value", 1.7976931348623157e+308, Double.MaxValue);
- AssertEquals("MinValue Field has wrong value", -1.7976931348623157e+308, Double.MinValue);
- AssertEquals("NegativeInfinity Field has wrong value", (double)-1.0 / (double)(0.0), Double.NegativeInfinity);
- AssertEquals("PositiveInfinity Field has wrong value", (double)1.0 / (double)(0.0), Double.PositiveInfinity);
- }
-
- public void TestCompareTo () {
- //If you do int foo = d_ninf.CompareTo(d_pinf); Assert(".." foo < 0, true) this works.... WHY???
- AssertEquals("CompareTo Infinity failed", d_ninf.CompareTo(d_pinf) < 0, true);
-
- AssertEquals("CompareTo Failed", d_neg.CompareTo(d_pos) < 0, true);
- AssertEquals("CompareTo NaN Failed", d_nan.CompareTo(d_neg) < 0, true);
-
- AssertEquals("CompareTo Failed", 0, d_pos.CompareTo(d_pos2));
- AssertEquals("CompareTo Failed", 0, d_pinf.CompareTo(d_pinf));
- AssertEquals("CompareTo Failed", 0, d_ninf.CompareTo(d_ninf));
- AssertEquals("CompareTo Failed", 0, d_nan.CompareTo(d_nan));
-
- AssertEquals("CompareTo Failed", d_pos.CompareTo(d_neg) > 0, true);
- AssertEquals("CompareTo Failed", d_pos.CompareTo(d_nan) > 0, true);
- AssertEquals("CompareTo Failed", d_pos.CompareTo(null) > 0, true);
-
- try {
- d_pos.CompareTo(s);
- Fail("CompareTo should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert("CompareTo should be a System.ArgumentException", typeof(ArgumentException) == e.GetType());
- }
-
- }
-
- public void TestEquals () {
- AssertEquals("Equals Failed", true, d_pos.Equals(d_pos2));
- AssertEquals("Equals Failed", false, d_pos.Equals(d_neg));
- AssertEquals("Equals Failed", false, d_pos.Equals(s));
-
- }
-
- public void TestGetHasCode () {
- //I have no idea why this is failing....
- AssertEquals("GetHashCode 1 Failed", 1234, d_pos.GetHashCode());
- AssertEquals("GetHashCode 2 Failed", -1234, d_neg.GetHashCode());
- }
-
- public void TestTypeCode () {
- AssertEquals("GetTypeCode Failed", TypeCode.Double, d_pos.GetTypeCode());
- }
-
- public void TestIsInfinity() {
- AssertEquals("IsInfinity Failed", true, Double.IsInfinity(Double.PositiveInfinity));
- AssertEquals("IsInfinity Failed", true, Double.IsInfinity(Double.NegativeInfinity));
- AssertEquals("IsInfinity Failed", false, Double.IsInfinity(12));
- }
-
- public void TestIsNan() {
- AssertEquals("IsNan Failed", true, Double.IsNaN(Double.NaN));
- AssertEquals("IsNan Failed", false, Double.IsNaN(12));
- AssertEquals("IsNan Failed", false, Double.IsNaN(Double.PositiveInfinity));
- }
-
- public void TestIsNegativeInfinity() {
- AssertEquals("IsNegativeInfinity Failed", true, Double.IsNegativeInfinity(Double.NegativeInfinity));
- AssertEquals("IsNegativeInfinity Failed", false, Double.IsNegativeInfinity(12));
- }
-
- public void TestIsPositiveInfinity() {
- AssertEquals("IsPositiveInfinity Failed", true, Double.IsPositiveInfinity(Double.PositiveInfinity));
- AssertEquals("IsPositiveInfinity Failed", false, Double.IsPositiveInfinity(12));
- }
-
- public void TestParse() {
- //I get a System.Security.SecuriytException with this... why???
- //AssertEquals("Parse Failed", 1234.5678, Double.Parse("1234.5678"));
- }
-
- public void TestToString() {
- //ToString is not yet Implemented......
- //AssertEquals("ToString Failed", "1234.9999", d_pos.ToString());
- }
-
-}
-}
diff --git a/mcs/class/corlib/Test/System/EnumTest.cs b/mcs/class/corlib/Test/System/EnumTest.cs
deleted file mode 100644
index 95efc50758c..00000000000
--- a/mcs/class/corlib/Test/System/EnumTest.cs
+++ /dev/null
@@ -1,711 +0,0 @@
-// EnumTest.cs - NUnit Test Cases for the System.Enum class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-
-namespace MonoTests.System
-{
-
-public class EnumTest : TestCase
-{
- public EnumTest() : base ("MonoTests.System.EnumTest testsuite") {}
- public EnumTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(EnumTest));
- }
- }
-
- enum TestingEnum {This, Is, A, Test};
- enum TestingEnum2 {This, Is, A, Test};
-
- public void TestCompareTo() {
- Enum e1 = new TestingEnum();
- Enum e2 = new TestingEnum();
- Enum e3 = new TestingEnum2();
-
- AssertEquals("An enum should equal itself",
- 0, e1.CompareTo(e1));
- AssertEquals("An enum should equal a copy",
- 0, e1.CompareTo(e2));
-
- TestingEnum x = TestingEnum.This;
- TestingEnum y = TestingEnum.Is;
- AssertEquals("should equal", 0, x.CompareTo(x));
- AssertEquals("less than", -1, x.CompareTo(y));
- AssertEquals("greater than", 1, y.CompareTo(x));
-
- {
- bool errorThrown = false;
- try {
- e1.CompareTo(e3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("Compare type mismatch not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ((Enum)e1).CompareTo((Enum)e3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("Compare type mismatch not caught.",
- errorThrown);
- }
- }
-
- public void TestEquals() {
- Enum e1 = new TestingEnum();
- Enum e2 = new TestingEnum();
- Enum e3 = new TestingEnum2();
-
- Assert("An enum should equal itself", e1.Equals(e1));
- Assert("An enum should equal a copy", e1.Equals(e2));
-
- Assert("Shouldn't match", !e1.Equals(e3));
- Assert("Shouldn't match null", !e1.Equals(null));
- }
-
- public void TestFormat() {
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(null, x, "G");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), null, "G");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), x, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null third arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Format(bad.GetType(), x, "G");
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- TestingEnum2 y = TestingEnum2.Test;
- Enum.Format(y.GetType(), x, "G");
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("wrong enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), bad, "G");
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum object not caught.",
- errorThrown);
- }
- string[] codes = {"a", "b", "c", "ad", "e", "af", "ag", "h",
- "i", "j", "k", "l", "m", "n", "o", "p",
- "q", "r", "s", "t", "u", "v", "w", "ax",
- "y", "z"};
- foreach (string code in codes) {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), x, code);
- } catch (FormatException) {
- errorThrown = true;
- }
- Assert("bad format code not caught - " + code,
- errorThrown);
- }
- {
- TestingEnum x = TestingEnum.Test;
- AssertEquals("decimal format wrong",
- "3", Enum.Format(x.GetType(), x, "d"));
- AssertEquals("named format wrong",
- "Test", Enum.Format(x.GetType(), x, "g"));
- AssertEquals("hex format wrong",
- "00000003", Enum.Format(x.GetType(), x, "x"));
- AssertEquals("bitfield format wrong",
- "Test", Enum.Format(x.GetType(), x, "f"));
- }
- }
-
- public void TestGetHashCode() {
- Enum e1 = new TestingEnum();
- Enum e2 = new TestingEnum2();
-
- AssertEquals("hash code is deterministic",
- e1.GetHashCode(), e1.GetHashCode());
- }
-
- public void GetName() {
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(null, x);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(x.GetType(), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(bad.GetType(), x);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- TestingEnum2 y = TestingEnum2.Test;
- Enum.GetName(y.GetType(), x);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("wrong enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum object not caught.",
- errorThrown);
- }
- {
- TestingEnum x = TestingEnum.This;
- TestingEnum y = TestingEnum.Is;
- TestingEnum z = TestingEnum.A;
-
- AssertEquals("first name doesn't match",
- "This", Enum.GetName(x.GetType(), x));
- AssertEquals("second name doesn't match",
- "Is", Enum.GetName(y.GetType(), y));
- AssertEquals("third name doesn't match",
- "A", Enum.GetName(z.GetType(), z));
- }
- }
-
- public void TestGetNames() {
- {
- bool errorThrown = false;
- try {
- Enum.GetNames(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- TestingEnum x = TestingEnum.This;
- string[] match = {"This", "Is", "A", "Test"};
- string[] names = Enum.GetNames(x.GetType());
- AssertNotNull("Got no names", names);
- AssertEquals("names wrong size",
- match.Length, names.Length);
- for (int i = 0; i < names.Length; i++) {
- AssertEquals("name mismatch",
- match[i], names[i]);
- }
- }
- }
-
- public void TestGetTypeCode() {
- TestingEnum x = TestingEnum.This;
- TestingEnum y = new TestingEnum();
- AssertEquals("bad type code",
- x.GetTypeCode(), TypeCode.Int32);
- AssertEquals("bad type code",
- y.GetTypeCode(), TypeCode.Int32);
- }
-
- enum TestShortEnum : short { zero, one, two, three, four, five, six};
- public void TestGetUnderlyingType() {
- {
- bool errorThrown = false;
- try {
- Enum.GetUnderlyingType(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- Enum.GetUnderlyingType(bad.GetType());
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- short sh = 5;
- int i = 5;
- Enum t1 = new TestingEnum();
- Enum t2 = new TestShortEnum();
- AssertEquals("Wrong default underlying type",
- i.GetType(),
- Enum.GetUnderlyingType(t1.GetType()));
- AssertEquals("Not short underlying type",
- sh.GetType(),
- Enum.GetUnderlyingType(t2.GetType()));
- }
- }
-
- public void TestGetValues() {
- {
- bool errorThrown = false;
- try {
- Enum.GetValues(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- Enum.GetValues(bad.GetType());
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- Enum t1 = new TestingEnum();
- Array a1 = Enum.GetValues(t1.GetType());
- for (int i= 0; i < a1.Length; i++) {
- AssertEquals("wrong enum value",
- (TestingEnum)i,
- a1.GetValue(i));
- }
- }
- {
- Enum t1 = new TestShortEnum();
- Array a1 = Enum.GetValues(t1.GetType());
- for (short i= 0; i < a1.Length; i++) {
- AssertEquals("wrong enum value",
- (TestShortEnum)i,
- a1.GetValue(i));
- }
- }
- }
-
- public void TestIsDefined() {
- {
- bool errorThrown = false;
- try {
- Enum.IsDefined(null, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.IsDefined(x.GetType(), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- int i = 4;
- Enum.IsDefined(bad.GetType(), i);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- short i = 4;
- Enum.IsDefined(x.GetType(), i);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("wrong underlying type not caught.",
- errorThrown);
- }
- // spec says yes, MS impl says no.
- //{
- //bool errorThrown = false;
- //try {
- //String bad = "huh?";
- //TestingEnum x = TestingEnum.Test;
- //Enum.IsDefined(x.GetType(), bad);
- //} catch (ExecutionEngineException) {
- //errorThrown = true;
- //}
- //Assert("non-enum object not caught.",
- //errorThrown);
- //}
- {
- Enum t1 = new TestingEnum();
- int i = 0;
- for (i = 0;
- i < Enum.GetValues(t1.GetType()).Length; i++) {
- Assert("should have value",
- Enum.IsDefined(t1.GetType(), i));
- }
- Assert("Shouldn't have value",
- !Enum.IsDefined(t1.GetType(), i));
- }
- }
-
- public void TestParse1() {
- {
- bool errorThrown = false;
- try {
- String name = "huh?";
- Enum.Parse(null, name);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- Enum.Parse(bad.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = "";
- Enum.Parse(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = " ";
- Enum.Parse(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("space-only string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("not-in-enum error not caught.",
- errorThrown);
- }
- {
- TestingEnum t1 = new TestingEnum();
- AssertEquals("parse first enum",
- TestingEnum.This,
- Enum.Parse(t1.GetType(), "This"));
- AssertEquals("parse second enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "Is"));
- AssertEquals("parse third enum",
- TestingEnum.A,
- Enum.Parse(t1.GetType(), "A"));
- AssertEquals("parse last enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "Test"));
-
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "This,Is"));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,Test"));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,Is,A"));
- }
- }
- public void TestParse2() {
- {
- bool errorThrown = true;
- try {
- String name = "huh?";
- Enum.Parse(null, name, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- String bad = "huh?";
- Enum.Parse(bad.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = "";
- Enum.Parse(x.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = " ";
- Enum.Parse(x.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("space-only string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("not-in-enum error not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- String bad = "test";
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), bad, false);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("not-in-enum error not caught.",
- errorThrown);
- }
- {
- TestingEnum t1 = new TestingEnum();
- AssertEquals("parse first enum",
- TestingEnum.This,
- Enum.Parse(t1.GetType(), "this", true));
- AssertEquals("parse second enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "is", true));
- AssertEquals("parse third enum",
- TestingEnum.A,
- Enum.Parse(t1.GetType(), "a", true));
- AssertEquals("parse last enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "test", true));
-
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "This,is", true));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,test", true));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,is,A", true));
- }
- }
-
- public void TestToObject() {
- {
- bool errorThrown = false;
- try {
- Enum.ToObject(null, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Enum.ToObject("huh?".GetType(), 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- TestingEnum t1 = new TestingEnum();
- AssertEquals("Should get object",
- TestingEnum.This,
- Enum.ToObject(t1.GetType(), 0));
- }
- // TODO - should probably test all the different underlying types
- }
-
- public void TestToString() {
- AssertEquals("invalid string", "This",
- TestingEnum.This.ToString());
- AssertEquals("invalid string", "Is",
- TestingEnum.Is.ToString());
- AssertEquals("invalid string", "A",
- TestingEnum.A.ToString());
- AssertEquals("invalid string", "Test",
- TestingEnum.Test.ToString());
-
- Enum is1 = TestingEnum.Is;
-
- AssertEquals("decimal parse wrong",
- "1", is1.ToString("d"));
- AssertEquals("named format wrong",
- "Is", is1.ToString("g"));
- AssertEquals("hex format wrong",
- "00000001", is1.ToString("x"));
- AssertEquals("bitfield format wrong",
- "Is", is1.ToString("f"));
- }
-
- // TODO - ToString with IFormatProviders
-}
-}
diff --git a/mcs/class/corlib/Test/System/GuidTest.cs b/mcs/class/corlib/Test/System/GuidTest.cs
deleted file mode 100755
index 461be3e039f..00000000000
--- a/mcs/class/corlib/Test/System/GuidTest.cs
+++ /dev/null
@@ -1,237 +0,0 @@
-//
-// GuidTest.cs - NUnit Test Cases for the System.Guid struct
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class GuidTest : TestCase
-{
- public GuidTest () : base ("MonoTests.System.GuidTest testcase") {}
- public GuidTest (string name): base(name) {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(GuidTest));
- }
- }
-
- public void TestCtor1() {
- Guid g = new Guid(new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f});
- bool exception;
-
- if (BitConverter.IsLittleEndian) {
- AssertEquals("A1", "03020100-0504-0706-0809-0a0b0c0d0e0f", g.ToString());
- }
- else {
- AssertEquals("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString());
- }
-
- try {
- Guid g1 = new Guid ((byte[])null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- AssertEquals("A2", true, exception);
-
- try {
- Guid g1 = new Guid(new byte[] {0x00, 0x01, 0x02});
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- AssertEquals("A3", true, exception);
- }
-
- public void TestCtor2() {
- Guid g1 = new Guid ("00010203-0405-0607-0809-0a0b0c0d0e0f");
- Guid g2 = new Guid ("{00010203-0405-0607-0809-0A0B0C0D0E0F}");
- Guid g3 = new Guid ("{0x00010203,0x0405,0x0607,{0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}}");
- Guid g4;
- Guid g5;
-
- bool exception;
-
- AssertEquals("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g1.ToString());
- AssertEquals("A2", "00010203-0405-0607-0809-0a0b0c0d0e0f", g2.ToString());
- AssertEquals("A3", "00010203-0405-0607-0809-0a0b0c0d0e0f", g3.ToString());
-
- try {
- g4 = new Guid((string) null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- AssertEquals("A4", true, exception);
-
- try {
- g5 = new Guid("invalid");
- exception = false;
- }
- catch (FormatException) {
- exception = true;
- }
- AssertEquals("A5", true, exception);
-
- }
-
- public void TestCtor4() {
- Guid g1 = new Guid(0x00010203, (short) 0x0405, (short) 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid(unchecked((int) 0xffffffff), unchecked((short) 0xffff), unchecked((short) 0xffff), 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff);
-
- AssertEquals("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g1.ToString());
- AssertEquals("A2", "ffffffff-ffff-ffff-ffff-ffffffffffff", g2.ToString());
-
- }
-
- public void TestCtor5() {
- Guid g1 = new Guid(0x00010203u, (ushort) 0x0405u, (ushort) 0x0607u, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid(0xffffffffu, (ushort) 0xffffu, (ushort) 0xffffu, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff);
-
- AssertEquals("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g1.ToString());
- AssertEquals("A2", "ffffffff-ffff-ffff-ffff-ffffffffffff", g2.ToString());
-
- }
-
- public void TestEmpty() {
- AssertEquals("A1", "00000000-0000-0000-0000-000000000000", Guid.Empty.ToString());
- }
-
- public void TestNewGuid() {
- Guid g1 = Guid.NewGuid ();
- Guid g2 = Guid.NewGuid ();
-
- Assert("A1", g1 != g2);
- }
-
- public void TestEqualityOp() {
- Guid g1 = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid(0x11223344, 0x5566, 0x6677, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
-
- AssertEquals("A1", true, g1 == g1);
- AssertEquals("A2", true, g1 == g2);
- AssertEquals("A3", false, g1 == g3);
- }
-
- public void TestInequalityOp() {
- Guid g1 = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid(0x11223344, 0x5566, 0x6677, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
-
- AssertEquals("A1", false, g1 != g1);
- AssertEquals("A2", false, g1 != g2);
- AssertEquals("A3", true, g1 != g3);
- }
-
- public void TestEquals() {
- Guid g1 = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid(0x11223344, 0x5566, 0x6677, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
- string s = "This is not a Guid!";
-
- AssertEquals("A1", true, g1.Equals(g1));
- AssertEquals("A2", true, g1.Equals(g2));
- AssertEquals("A3", false, g1.Equals(g3));
- AssertEquals("A4", false, g1.Equals(null));
- AssertEquals("A5", false, g1.Equals(s));
- }
-
- public void TestCompareTo() {
- Guid g1 = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid(0x00010204, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid(0x00010203, 0x0405, 0x0607, 0x09, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g4 = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x1f);
- bool exception;
-
- Assert("A1", g1.CompareTo(g2) < 0);
- Assert("A2", g1.CompareTo(g3) < 0);
- Assert("A3", g1.CompareTo(g4) < 0);
- Assert("A4", g2.CompareTo(g1) > 0);
- Assert("A5", g3.CompareTo(g1) > 0);
- Assert("A6", g4.CompareTo(g1) > 0);
- Assert("A7", g1.CompareTo(g1) == 0);
- Assert("A8", g1.CompareTo(null) > 0);
-
- try {
- g1.CompareTo("Say what?");
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert("A9", exception);
- }
-
- public void TestGetHashCode () {
- // We don't test anything but the availibility of this member
-
- int res = Guid.NewGuid().GetHashCode();
-
- Assert("A1", true);
- }
-
- public void TestToByteArray () {
- Guid g1 = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- byte[] b = g1.ToByteArray ();
-
- AssertEquals("A1", 0x00010203, BitConverter.ToInt32(b, 0));
- AssertEquals("A2", (short) 0x0405, BitConverter.ToInt16(b, 4));
- AssertEquals("A3", (short) 0x0607, BitConverter.ToInt16(b, 6));
- for (int i=8; i<16; ++i) {
- AssertEquals("A1", (byte) i, b[i]);
- }
-
- }
-
- public void TestToString() {
- Guid g = new Guid(0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- bool exception;
-
- AssertEquals("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString() );
- AssertEquals("A2", "000102030405060708090a0b0c0d0e0f", g.ToString("N") );
- AssertEquals("A3", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString("D") );
- AssertEquals("A4", "{00010203-0405-0607-0809-0a0b0c0d0e0f}", g.ToString("B") );
- AssertEquals("A5", "(00010203-0405-0607-0809-0a0b0c0d0e0f)", g.ToString("P") );
- AssertEquals("A6", "000102030405060708090a0b0c0d0e0f", g.ToString("") );
- AssertEquals("A7", "000102030405060708090a0b0c0d0e0f", g.ToString((string)null));
-
- try {
- g.ToString("X");
- exception = false;
- }
- catch ( FormatException ) {
- exception = true;
- }
- AssertEquals("A8", true, exception);
-
- try {
- g.ToString("This is invalid");
- exception = false;
- }
- catch ( FormatException ) {
- exception = true;
- }
- AssertEquals("A9", true, exception);
-
- AssertEquals("A10", "{00010203-0405-0607-0809-0a0b0c0d0e0f}", g.ToString("B", null));
-
-
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/Int16Test.cs b/mcs/class/corlib/Test/System/Int16Test.cs
deleted file mode 100644
index f59742e58ac..00000000000
--- a/mcs/class/corlib/Test/System/Int16Test.cs
+++ /dev/null
@@ -1,177 +0,0 @@
-// Int16Test.cs - NUnit Test Cases for the System.Int16 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class Int16Test : TestCase
-{
- private const Int16 MyInt16_1 = -42;
- private const Int16 MyInt16_2 = -32768;
- private const Int16 MyInt16_3 = 32767;
- private const string MyString1 = "-42";
- private const string MyString2 = "-32768";
- private const string MyString3 = "32767";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"32,768.00)", "-32768", "-3.276800e+004", "-32768.00",
- "-32768", "-32,768.00", "-3,276,800.00 %", "8000"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"32,767.00000", "32767", "3.27670e+004", "32767.00000",
- "32767", "32,767.00000", "3,276,700.00000 %", "07fff"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"32,768.00)", "-32768", "-3.276800e+004", "-32768.00",
- "-32768", "-32,768.00", "-3,276,800.00 %", "8000"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"32,767.00000", "32767", "3.27670e+004", "32767.00000",
- "32767", "32,767.00000", "3,276,700.00000 %", "07fff"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public Int16Test() : base ("MonoTests.System.Int16Test testcase") {}
- public Int16Test(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(Int16Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(Int16.MinValue, MyInt16_2);
- AssertEquals(Int16.MaxValue, MyInt16_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyInt16_3.CompareTo(MyInt16_2) > 0);
- Assert(MyInt16_2.CompareTo(MyInt16_2) == 0);
- Assert(MyInt16_1.CompareTo((Int16)(-42)) == 0);
- Assert(MyInt16_2.CompareTo(MyInt16_3) < 0);
- try {
- MyInt16_2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyInt16_1.Equals(MyInt16_1));
- Assert(MyInt16_1.Equals((Int16)(-42)));
- Assert(MyInt16_1.Equals((SByte)(-42)) == false);
- Assert(MyInt16_1.Equals(MyInt16_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyInt16_1.GetHashCode();
- MyInt16_2.GetHashCode();
- MyInt16_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyInt16_1 == Int16.Parse(MyString1));
- Assert(MyInt16_2 == Int16.Parse(MyString2));
- Assert(MyInt16_3 == Int16.Parse(MyString3));
- try {
- Int16.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Int16.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = Int16.MaxValue + 1;
- Int16.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == Int16.Parse(" $42 ", NumberStyles.Currency));
- try {
- Int16.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == Int16.Parse(" -42 ", Nfi));
- try {
- Int16.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == Int16.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Int16.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- Assert(String.Compare(MyString1, MyInt16_1.ToString()) == 0);
- Assert(String.Compare(MyString2, MyInt16_2.ToString()) == 0);
- Assert(String.Compare(MyString3, MyInt16_3.ToString()) == 0);
- //test ToString(string format)
- /*
- TODO: These tests are culture sensitive. Need to find a way to determine the culture
- of the system to decide the correct expected result.
- for (int i=0; i < Formats1.Length; i++) {
- Assert(String.Compare(Results1[i], MyInt16_2.ToString(Formats1[i])) == 0);
- Assert(String.Compare(Results2[i], MyInt16_3.ToString(Formats2[i])) == 0);
- }
- */
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MyInt16_2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MyInt16_2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MyInt16_2.ToString(Formats1[i], Nfi)) == 0);
- Assert("i="+i+", ResultsNfi2[i]="+ResultsNfi2[i]+", MyInt16_3.ToString(Formats2[i]="+Formats2[i]+"): Expected "+ResultsNfi2[i]+" but got "+MyInt16_3.ToString(Formats2[i], Nfi), String.Compare(ResultsNfi2[i], MyInt16_3.ToString(Formats2[i], Nfi)) == 0);
- }
- try {
- MyInt16_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/Int32Test.cs b/mcs/class/corlib/Test/System/Int32Test.cs
deleted file mode 100644
index 21dde68b911..00000000000
--- a/mcs/class/corlib/Test/System/Int32Test.cs
+++ /dev/null
@@ -1,216 +0,0 @@
-// Int32Test.cs - NUnit Test Cases for the System.Int32 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class Int32Test : TestCase
-{
- private const Int32 MyInt32_1 = -42;
- private const Int32 MyInt32_2 = -2147483648;
- private const Int32 MyInt32_3 = 2147483647;
- private const string MyString1 = "-42";
- private const string MyString2 = "-2147483648";
- private const string MyString3 = "2147483647";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"2,147,483,648.00)",
- "-2147483648", "-2.147484e+009", "-2147483648.00",
- "-2147483648", "-2,147,483,648.00", "-214,748,364,800.00 %", "80000000"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"2,147,483,647.00000",
- "2147483647", "2.14748e+009", "2147483647.00000",
- "2.1475e+09", "2,147,483,647.00000", "214,748,364,700.00000 %", "7fffffff"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"2,147,483,648.00)",
- "-2147483648", "-2.147484e+009", "-2147483648.00",
- "-2147483648", "-2,147,483,648.00", "-214,748,364,800.00 %", "80000000"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"2,147,483,647.00000",
- "2147483647", "2.14748e+009", "2147483647.00000",
- "2.1475e+09", "2,147,483,647.00000", "214,748,364,700.00000 %", "7fffffff"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public Int32Test() : base ("MonoTests.System.Int32Test testcase") {}
- public Int32Test(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(Int32Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(Int32.MinValue, MyInt32_2);
- AssertEquals(Int32.MaxValue, MyInt32_3);
- }
-
- public void TestCompareTo()
- {
- Assert("MyInt32_3.CompareTo(MyInt32_2) > 0", MyInt32_3.CompareTo(MyInt32_2) > 0);
- Assert("MyInt32_2.CompareTo(MyInt32_2) == 0", MyInt32_2.CompareTo(MyInt32_2) == 0);
- Assert("MyInt32_1.CompareTo((Int32)(-42)) == 0", MyInt32_1.CompareTo((Int32)(-42)) == 0);
- Assert("MyInt32_2.CompareTo(MyInt32_3) < 0", MyInt32_2.CompareTo(MyInt32_3) < 0);
- try {
- MyInt32_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert("typeof(ArgumentException) == e.GetType()", typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyInt32_1.Equals(MyInt32_1));
- Assert(MyInt32_1.Equals((Int32)(-42)));
- Assert(MyInt32_1.Equals((SByte)(-42)) == false);
- Assert(MyInt32_1.Equals(MyInt32_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyInt32_1.GetHashCode();
- MyInt32_2.GetHashCode();
- MyInt32_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyInt32_1 == Int32.Parse(MyString1));
- Assert(MyInt32_2 == Int32.Parse(MyString2));
- Assert(MyInt32_3 == Int32.Parse(MyString3));
-
- Assert (1 == Int32.Parse ("1"));
- Assert (1 == Int32.Parse (" 1"));
- Assert (1 == Int32.Parse (" 1"));
- Assert (1 == Int32.Parse ("1 "));
- Assert (1 == Int32.Parse ("+1"));
- Assert (-1 == Int32.Parse ("-1"));
- Assert (-1 == Int32.Parse (" -1"));
- Assert (-1 == Int32.Parse (" -1 "));
- Assert (-1 == Int32.Parse (" -1 "));
-
- try {
- Int32.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Int32.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- double OverInt = (double)Int32.MaxValue + 1;
- Int32.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == Int32.Parse(" $42 ", NumberStyles.Currency));
- try {
- Int32.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == Int32.Parse(" -42 ", Nfi));
- try {
- Int32.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == Int32.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Int32.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
-
- try {
- Int32.Parse (" - 1 ");
- Fail ("Should raise FormatException");
- } catch (Exception e){
- Assert (typeof (FormatException) == e.GetType ());
- }
-
- try {
- Int32.Parse (" - ");
- Fail ("Should raise FormatException");
- } catch (Exception e){
- Assert (typeof (FormatException) == e.GetType ());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- Assert(String.Compare(MyString1, MyInt32_1.ToString()) == 0);
- Assert(String.Compare(MyString2, MyInt32_2.ToString()) == 0);
- Assert(String.Compare(MyString3, MyInt32_3.ToString()) == 0);
- //test ToString(string format)
- /*
- TODO: These tests are culture sensitive. Need to find a way to determine the culture
- of the system to decide the correct expected result.
- for (int i=0; i < Formats1.Length; i++) {
- Assert(String.Compare(Results1[i], MyInt32_2.ToString(Formats1[i])) == 0);
- Assert(String.Compare(Results2[i], MyInt32_3.ToString(Formats2[i])) == 0);
- }
- */
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- Assert(String.Compare(ResultsNfi1[i], MyInt32_2.ToString(Formats1[i], Nfi)) == 0);
- Assert(String.Compare(ResultsNfi2[i], MyInt32_3.ToString(Formats2[i], Nfi)) == 0);
- }
- try {
- MyInt32_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestCustomToString()
- {
- // culture sensitive?
-
- int i = 123;
-
- Assert ("Custom format string 00000", i.ToString ("00000") == "00123");
- Assert ("Custom format string ####", i.ToString ("####") == "123");
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/Int64Test.cs b/mcs/class/corlib/Test/System/Int64Test.cs
deleted file mode 100644
index 33df6c9b708..00000000000
--- a/mcs/class/corlib/Test/System/Int64Test.cs
+++ /dev/null
@@ -1,330 +0,0 @@
-// Int64Test.cs - NUnit Test Cases for the System.Int64 struct
-//
-// Author: Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, 2001
-//
-// tests ToString and Parse function with the culture independent
-// NumberFormatInfo.InvariantInfo
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
- /// <summary>
- /// Tests for System.Int64
- /// </summary>
-namespace MonoTests.System
-{
-
-public class Int64Test : TestCase
-{
- private const Int64 MyInt64_1 = -42;
- private const Int64 MyInt64_2 = -9223372036854775808;
- private const Int64 MyInt64_3 = 9223372036854775807;
- private const string MyString1 = "-42";
- private const string MyString2 = "-9223372036854775808";
- private const string MyString3 = "9223372036854775807";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"($9,223,372,036,854,775,808.00)", "-9223372036854775808", "-9.223372e+018", "-9223372036854775808.00",
- "-9223372036854775808", "-9,223,372,036,854,775,808.00", "-922,337,203,685,477,580,800.00 %", "8000000000000000"};
- private string[] Results2 = {"$9,223,372,036,854,775,807.00000", "9223372036854775807", "9.22337e+018", "9223372036854775807.00000",
- "9.2234e+18", "9,223,372,036,854,775,807.00000", "922,337,203,685,477,580,700.00000 %", "7fffffffffffffff"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"9,223,372,036,854,775,808.00)", "-9223372036854775808", "-9.223372e+018", "-9223372036854775808.00",
- "-9223372036854775808", "-9,223,372,036,854,775,808.00", "-922,337,203,685,477,580,800.00 %", "8000000000000000"};
- private string[] ResultsNfi2 = {""+NumberFormatInfo.InvariantInfo.CurrencySymbol+"9,223,372,036,854,775,807.00000", "9223372036854775807", "9.22337e+018", "9223372036854775807.00000",
- "9.2234e+18", "9,223,372,036,854,775,807.00000", "922,337,203,685,477,580,700.00000 %", "7fffffffffffffff"};
-
- // FIXME: This is failing with an ArgumentException. Seems to be related to the number of elements in the arrary,
- // not the values themselves
-/* private long[] vals
- = { 0, Int64.MaxValue, Int64.MinValue,
- 1L, 12L, 123L, 1234L, -123L,
- 1234567890123456L, 6543210987654321L };
-*/
- private long[] vals
- = { 0, Int64.MaxValue, Int64.MinValue };
-
- private const long val1 = -1234567L;
- private const long val2 = 1234567L;
- private const string sval1Test1 = " -1,234,567 ";
- private const string sval1Test2 = " -1234567 ";
- //private const string sval1Test3 = " -12345,,,,67 "; // interesting: this case works on SDK Beta2, but the specification says nothing about this case
- private const string sval1Test4 = " -12345 67 ";
- private string sval1Test5 = " -"+NumberFormatInfo.InvariantInfo.CurrencySymbol+"1,234,567.00 ";
- private string sval1Test6 = "("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"1,234,567.00)";
- private const string sval1Test7 = "-1,234,567.00";
- private const string sval1UserCur1 = "1234/5/67:000 XYZ-";
- private const string sval2UserCur1 = "1234/5/67:000 XYZ";
- private const string sval1UserPercent1 = "-%%%1~2~3~4~5~6~7~0~0;0";
- private const string sval2UserPercent1 = "%%%1~2~3~4~5~6~7~0~0;0";
- private const NumberStyles style1 = NumberStyles.AllowLeadingWhite | NumberStyles.AllowLeadingSign
- | NumberStyles.AllowTrailingWhite | NumberStyles.AllowThousands;
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
- private NumberFormatInfo NfiUser;
-
- public Int64Test() : base("MonoTests.System.Int64Test") {}
- public Int64Test(string name) : base(name) {}
-
- public static ITest Suite
- {
- get { return new TestSuite(typeof(Int64Test)); }
- }
-
- protected override void SetUp()
- {
- NfiUser = new NumberFormatInfo();
- NfiUser.CurrencyDecimalDigits = 3;
- NfiUser.CurrencyDecimalSeparator = ":";
- NfiUser.CurrencyGroupSeparator = "/";
- NfiUser.CurrencyGroupSizes = new int[] { 2,1,0 };
- NfiUser.CurrencyNegativePattern = 10; // n $-
- NfiUser.CurrencyPositivePattern = 3; // n $
- NfiUser.CurrencySymbol = "XYZ";
- NfiUser.PercentDecimalDigits = 1;
- NfiUser.PercentDecimalSeparator = ";";
- NfiUser.PercentGroupSeparator = "~";
- NfiUser.PercentGroupSizes = new int[] {1};
- NfiUser.PercentNegativePattern = 2;
- NfiUser.PercentPositivePattern = 2;
- NfiUser.PercentSymbol = "%%%";
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(Int64.MinValue, MyInt64_2);
- AssertEquals(Int64.MaxValue, MyInt64_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyInt64_3.CompareTo(MyInt64_2) > 0);
- Assert(MyInt64_2.CompareTo(MyInt64_2) == 0);
- Assert(MyInt64_1.CompareTo((Int64)(-42)) == 0);
- Assert(MyInt64_2.CompareTo(MyInt64_3) < 0);
- try {
- MyInt64_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyInt64_1.Equals(MyInt64_1));
- Assert(MyInt64_1.Equals((Int64)(-42)));
- Assert(MyInt64_1.Equals((SByte)(-42)) == false);
- Assert(MyInt64_1.Equals(MyInt64_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyInt64_1.GetHashCode();
- MyInt64_2.GetHashCode();
- MyInt64_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestRoundTripGeneral()
- {
- foreach(long lv in vals)
- {
- string s = lv.ToString(Nfi);
- long lv2 = Int64.Parse(s);
- Assert(lv == lv2);
- long lv3 = Int64.Parse(s, NumberStyles.Integer, Nfi);
- Assert(lv == lv3);
- }
- }
-
- public void TestRoundTripHex()
- {
- foreach(long lv in vals)
- {
- string s = lv.ToString("x", Nfi);
- long lv2 = Int64.Parse(s, NumberStyles.HexNumber, Nfi);
- Assert(lv == lv2);
- }
- }
-
- public void TestParseNull()
- {
- try
- {
- Int64.Parse(null);
- Fail("Should raise System.ArgumentNullException");
- }
- catch (ArgumentNullException)
- {
- // ok
- }
- }
-
- public void TestParse()
- {
- long lv;
-
- lv = Int64.Parse(sval1Test1, style1, Nfi);
- AssertEquals("Long value should be equal for Test1", val1, lv);
-
- try
- {
- lv = Int64.Parse(sval1Test1, Nfi);
- Fail("Should raise FormatException 1");
- }
- catch (FormatException)
- {
- // ok
- }
-
- lv = Int64.Parse(sval1Test2, style1, Nfi);
- AssertEquals("Value should be the same for Test2 with style1", val1, lv);
- lv = Int64.Parse(sval1Test2, Nfi);
- AssertEquals("Value should be the same for Test2 without style1", val1, lv);
-
- try
- {
- lv = Int64.Parse(sval1Test4, style1, Nfi);
- Fail("Should raise FormatException 3");
- }
- catch (FormatException)
- {
- // ok
- }
-
- lv = Int64.Parse(sval1Test5, NumberStyles.Currency, Nfi);
- AssertEquals("Value should be the same for Test5 and currency style", val1, lv);
-
- //test Parse(string s)
- Assert(MyInt64_1 == Int64.Parse(MyString1));
- Assert(MyInt64_2 == Int64.Parse(MyString2));
- Assert(MyInt64_3 == Int64.Parse(MyString3));
- try {
- Int64.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Int64.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- try {
- double OverInt = (double)Int64.MaxValue + 1;
- Int64.Parse(OverInt.ToString(), NumberStyles.Float);
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- try {
- double OverInt = (double)Int64.MaxValue + 1;
- Int64.Parse(OverInt.ToString(), NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- Assert(42 == Int64.Parse(" $42 ", NumberStyles.Currency));
- try {
- Int64.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == Int64.Parse(" -42 ", Nfi));
- try {
- Int64.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == Int64.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Int64.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- string s;
-
- s = val1.ToString("c", Nfi);
- Assert("val1 does not become sval1Test6", s.Equals(sval1Test6));
-
- s = val1.ToString("n", Nfi);
- AssertEquals("val1 does not become sval1Test7", sval1Test7, s);
-
- //test ToString()
- AssertEquals("MyInt64_1.ToString()", MyString1, MyInt64_1.ToString());
- AssertEquals("MyInt64_2.ToString()", MyString2, MyInt64_2.ToString());
- AssertEquals("MyInt64_3.ToString()", MyString3, MyInt64_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("MyInt64_2.ToString(Formats1["+i+"])", Results1[i], MyInt64_2.ToString(Formats1[i]));
- AssertEquals("MyInt64_3.ToString(Formats2["+i+"])", Results2[i], MyInt64_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("MyInt64_2.ToString(Formats1["+i+"], Nfi)", ResultsNfi1[i], MyInt64_2.ToString(Formats1[i], Nfi));
- AssertEquals("MyInt64_3.ToString(Formats2["+i+"], Nfi)", ResultsNfi2[i], MyInt64_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyInt64_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- AssertEquals("Exception is wrong type", typeof(FormatException), e.GetType());
- }
- }
-
- public void TestUserCurrency()
- {
- string s;
- long v;
-
- s = val1.ToString("c", NfiUser);
- AssertEquals("Currency value type 1 is not what we want to try to parse", sval1UserCur1, s);
- v = Int64.Parse(s, NumberStyles.Currency, NfiUser);
- Assert(v == val1);
-
- s = val2.ToString("c", NfiUser);
- AssertEquals("Currency value type 1 is not what we want to try to parse", sval2UserCur1, s);
- v = Int64.Parse(s, NumberStyles.Currency, NfiUser);
- Assert(v == val2);
- }
-
- public void TestUserPercent()
- {
- string s;
-
- s = val1.ToString("p", NfiUser);
- Assert(s.Equals(sval1UserPercent1));
-
- s = val2.ToString("p", NfiUser);
- Assert(s.Equals(sval2UserPercent1));
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/IntegerFormatterTest.cs b/mcs/class/corlib/Test/System/IntegerFormatterTest.cs
deleted file mode 100644
index d1ba1550823..00000000000
--- a/mcs/class/corlib/Test/System/IntegerFormatterTest.cs
+++ /dev/null
@@ -1,385 +0,0 @@
-//
-// IntegerFormatterTest.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-//
-// (C) Derek Holden dholden@draper.com
-//
-
-//
-// Simple test for IntegerFormatter.
-//
-// Pull out IntegerFormatter.cs and NumberFormatInfo.cs and compile w/
-// csc /nowarn:1595 /nowarn:0168 /out:test.exe *.cs
-//
-
-using System;
-using System.Globalization;
-
-namespace System {
-
- public class Test {
-
- public static void Main() {
-
- bool checkShorts = true; // false;
- bool checkInts = true; // false;
- bool checkLongs = true; // false;
- bool checkUShorts = true; // false;
- bool checkUInts = true; // false;
- bool checkULongs = true; // false;
- bool checkBytes = true; // false;
- bool checkSBytes = true; // false;
-
- string[] formats = {
- "C", "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10", "C99",
- "D", "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D99",
- "E", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "E10", "E99",
- "F", "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F99",
- "G", "G0", "G1", "G2", "G3", "G4", "G5", "G6", "G7", "G8", "G9", "G10", "G99",
- "N", "N0", "N1", "N2", "N3", "N4", "N5", "N6", "N7", "N8", "N9", "N10", "N99",
- "P", "P0", "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9", "P10", "P99",
- //"R", "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8", "R9", "R10", "R99",
- "X", "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8", "X9", "X10", "X99"
- };
-
- short[] shortBoundries = { Int16.MinValue, Int16.MaxValue };
- int[] intBoundries = { Int32.MinValue, Int32.MaxValue };
- long[] longBoundries = { Int64.MinValue, Int64.MaxValue };
- ushort[] ushortBoundries = { UInt16.MinValue, UInt16.MaxValue };
- uint[] uintBoundries = { UInt32.MinValue, UInt32.MaxValue };
- ulong[] ulongBoundries = { UInt64.MinValue, UInt64.MaxValue };
- byte[] byteBoundries = { Byte.MinValue, Byte.MaxValue };
- sbyte[] sbyteBoundries = { SByte.MinValue, SByte.MaxValue };
-
- int count;
- string s1, s2;
- NumberFormatInfo nfi = new NumberFormatInfo();
-
- // shorts
-
- if (checkShorts) {
- count = 0;
- Console.WriteLine ("Checking shorts...");
- for (short n = -1000; n < 1000; n++) {
- for (int idx = 0; idx < formats.Length; idx++) {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- }
- }
-
- Console.WriteLine ("Checking boundries...");
- foreach (short n in shortBoundries) {
- for (int idx = 0; idx < formats.Length; idx++) {
- try {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- } catch (Exception e) {
- Console.WriteLine ("Exception Caught! Number: {0} Format: {1}", n, formats[idx]);
- count++;
- }
- }
- }
-
- if (count == 0)
- Console.WriteLine ("Passed all tests\n");
- else Console.WriteLine ("Failed on {0} tests\n", count);
- }
-
- // ints
-
- if (checkInts) {
- count = 0;
- Console.WriteLine ("Checking ints...");
- for (int n = -10000; n < 10000; n++) {
- for (int idx = 0; idx < formats.Length; idx++) {
- try {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- } catch (Exception e) {
- Console.WriteLine ("Exception Caught! Number: {0} Format: {1}", n, formats[idx]);
- }
- }
- }
-
- Console.WriteLine ("Checking boundries...");
- foreach (int n in intBoundries) {
- for (int idx = 0; idx < formats.Length; idx++) {
- try {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- } catch (Exception e) {
- Console.WriteLine ("Exception Caught! Number: {0} Format: {1}", n, formats[idx]);
- count++;
- }
- }
- }
-
- if (count == 0)
- Console.WriteLine ("Passed all tests\n");
- else Console.WriteLine ("Failed on {0} tests\n", count);
- }
-
- // longs
-
- if (checkLongs) {
- count = 0;
- Console.WriteLine ("Checking longs...");
- for (long n = -10000; n < 10000; n++) {
- for (int idx = 0; idx < formats.Length; idx++) {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- }
- }
-
- Console.WriteLine ("Checking boundries...");
- foreach (long n in longBoundries) {
- for (int idx = 0; idx < formats.Length; idx++) {
- try {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- } catch (Exception e) {
- Console.WriteLine ("Exception Caught! Number: {0} Format: {1}", n, formats[idx]);
- count++;
- }
- }
- }
-
- if (count == 0)
- Console.WriteLine ("Passed all tests\n");
- else Console.WriteLine ("Failed on {0} tests\n", count);
- }
-
- // ushorts
-
- if (checkUShorts) {
- count = 0;
- Console.WriteLine ("Checking ushorts...");
- for (ushort n = 0; n < 1000; n++) {
- for (int idx = 0; idx < formats.Length; idx++) {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- }
- }
-
- Console.WriteLine ("Checking boundries...");
- foreach (ushort n in shortBoundries) {
- for (int idx = 0; idx < formats.Length; idx++) {
- try {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- } catch (Exception e) {
- Console.WriteLine ("Exception Caught! Number: {0} Format: {1}", n, formats[idx]);
- count++;
- }
- }
- }
-
- if (count == 0)
- Console.WriteLine ("Passed all tests\n");
- else Console.WriteLine ("Failed on {0} tests\n", count);
- }
-
- // uint
-
- if (checkUInts) {
- count = 0;
- Console.WriteLine ("Checking uints...");
- for (uint n = 0; n < 10000; n++) {
- for (int idx = 0; idx < formats.Length; idx++) {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- }
- }
-
- Console.WriteLine ("Checking boundries...");
- foreach (uint n in uintBoundries) {
- for (int idx = 0; idx < formats.Length; idx++) {
- try {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- } catch (Exception e) {
- Console.WriteLine ("Exception Caught! Number: {0} Format: {1}", n, formats[idx]);
- count++;
- }
- }
- }
-
- if (count == 0)
- Console.WriteLine ("Passed all tests\n");
- else Console.WriteLine ("Failed on {0} tests\n", count);
- }
-
- // ulong
-
- if (checkULongs) {
- count = 0;
- Console.WriteLine ("Checking ulongs...");
- for (ulong n = 0; n < 10000; n++) {
- for (int idx = 0; idx < formats.Length; idx++) {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- }
- }
-
- Console.WriteLine ("Checking boundries...");
- foreach (ulong n in ulongBoundries) {
- for (int idx = 0; idx < formats.Length; idx++) {
- try {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- } catch (Exception e) {
- Console.WriteLine ("Exception Caught! Number: {0} Format: {1}", n, formats[idx]);
- count++;
- }
- }
- }
-
- if (count == 0)
- Console.WriteLine ("Passed all tests\n");
- else Console.WriteLine ("Failed on {0} tests\n", count);
- }
-
- // bytes
-
- if (checkBytes) {
- count = 0;
- Console.WriteLine ("Checking bytes...");
- for (byte n = 0; n < 100; n++) {
- for (int idx = 0; idx < formats.Length; idx++) {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- }
- }
-
- Console.WriteLine ("Checking boundries...");
- foreach (byte n in byteBoundries) {
- for (int idx = 0; idx < formats.Length; idx++) {
- try {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- } catch (Exception e) {
- Console.WriteLine ("Exception Caught! Number: {0} Format: {1}", n, formats[idx]);
- count++;
- }
- }
- }
-
- if (count == 0)
- Console.WriteLine ("Passed all tests\n");
- else Console.WriteLine ("Failed on {0} tests\n", count);
- }
-
- // sbytes
-
- if (checkSBytes) {
- count = 0;
- Console.WriteLine ("Checking sbytes...");
- for (sbyte n = -100; n < 100; n++) {
- for (int idx = 0; idx < formats.Length; idx++) {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- }
- }
-
- Console.WriteLine ("Checking boundries...");
- foreach (sbyte n in sbyteBoundries) {
- for (int idx = 0; idx < formats.Length; idx++) {
- try {
- s1 = n.ToString (formats[idx]);
- s2 = IntegerFormatter.NumberToString (formats[idx], nfi, n);
- if (!s2.Equals (s1)) {
- Console.WriteLine ("Number: {0} Format: {1} MS: ({2}) Me: ({3})",
- n, formats[idx], s1, s2);
- count++;
- }
- } catch (Exception e) {
- Console.WriteLine ("Exception Caught! Number: {0} Format: {1}", n, formats[idx]);
- count++;
- }
- }
- }
-
- if (count == 0)
- Console.WriteLine ("Passed all tests\n");
- else Console.WriteLine ("Failed on {0} tests\n", count);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System/MartinTests.cs b/mcs/class/corlib/Test/System/MartinTests.cs
deleted file mode 100755
index fd940bad1e7..00000000000
--- a/mcs/class/corlib/Test/System/MartinTests.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// Testsuite.System.MartinSystemTests.cs
-//
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Martin Baulig
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class MartinTests : TestCase {
- public MartinTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(BooleanTest.Suite);
- suite.AddTest(StringTest.Suite);
- suite.AddTest(TimeSpanTest.Suite);
- suite.AddTest(DoubleTest.Suite);
- suite.AddTest(TimeZoneTest.Suite);
- suite.AddTest(DateTimeTest.Suite);
-
- //suite.AddTest(RandomTest.Suite);
- //suite.AddTest(ArrayTest.Suite);
- //suite.AddTest(BitConverterTest.Suite);
- //suite.AddTest(ByteTest.Suite);
- //suite.AddTest(CharTest.Suite);
- //suite.AddTest(ConsoleTest.Suite);
- //suite.AddTest(EnumTest.Suite);
- //suite.AddTest(GuidTest.Suite);
- //suite.AddTest(ObjectTest.Suite);
- //suite.AddTest(ResolveEventArgsTest.Suite);
- //suite.AddTest(SByteTest.Suite);
-
-
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System/ObjectTest.cs b/mcs/class/corlib/Test/System/ObjectTest.cs
deleted file mode 100644
index 5a9545f390a..00000000000
--- a/mcs/class/corlib/Test/System/ObjectTest.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-// ObjectTest.cs - NUnit Test Cases for the System.Object struct
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class ObjectTest : TestCase
-{
- public ObjectTest() : base ("MonoTests.System.ObjectTest testsuite") {}
- public ObjectTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ObjectTest));
- }
- }
-
- public void TestCtor() {
- Object o = new Object();
- AssertNotNull("Can I at least get an _Object_, please?", o);
- }
-
- public void TestEquals1() {
- {
- Object x = new Object();
- Object y = new Object();
- Assert("Object should equal itself",
- x.Equals(x));
- Assert("object should not equal null",
- !x.Equals(null));
- Assert("Different objects should not equal 1",
- !x.Equals(y));
- Assert("Different objects should not equal 2",
- !y.Equals(x));
- }
- {
- double x = Double.NaN;
- double y = Double.NaN;
- Assert("NaNs should always equal each other",
- ((Object)x).Equals(y));
- }
- }
- public void TestEquals2() {
- {
- Object x = new Object();
- Object y = new Object();
- Assert("Object should equal itself",
- Object.Equals(x,x));
- Assert("object should not equal null",
- !Object.Equals(x,null));
- Assert("null should not equal object",
- !Object.Equals(null,x));
- Assert("Different objects should not equal 1",
- !Object.Equals(x,y));
- Assert("Different objects should not equal 2",
- !Object.Equals(y,x));
- Assert("null should not equal null",
- Object.Equals(null,null));
- }
- {
- double x = Double.NaN;
- double y = Double.NaN;
- Assert("NaNs should always equal each other",
- Object.Equals(x,y));
- }
- }
-
- public void TestGetHashCode() {
- Object x = new Object();
- AssertEquals("Object's hash code should not change",
- x.GetHashCode(), x.GetHashCode());
- }
-
- public void TestGetType() {
- Object x = new Object();
- AssertNotNull("Should get a type for Object", x.GetType());
- AssertEquals("Bad name for Object type", "System.Object",
- x.GetType().ToString());
- }
-
- public void TestReferenceEquals() {
- Object x = new Object();
- Object y = new Object();
- Assert("Object should equal itself",
- Object.ReferenceEquals(x,x));
- Assert("object should not equal null",
- !Object.ReferenceEquals(x,null));
- Assert("null should not equal object",
- !Object.ReferenceEquals(null,x));
- Assert("Different objects should not equal 1",
- !Object.ReferenceEquals(x,y));
- Assert("Different objects should not equal 2",
- !Object.ReferenceEquals(y,x));
- Assert("null should not equal null",
- Object.ReferenceEquals(null,null));
- }
-
- public void TestToString() {
- Object x = new Object();
- Object y = new Object();
- AssertEquals("All Objects should have same string rep",
- x.ToString(), y.ToString());
- }
-}
-}
diff --git a/mcs/class/corlib/Test/System/RandomTest.cs b/mcs/class/corlib/Test/System/RandomTest.cs
deleted file mode 100644
index faf07306a0a..00000000000
--- a/mcs/class/corlib/Test/System/RandomTest.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// System.Random Test Cases
-//
-// Author: Bob Smith <bob@thestuff.net>
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System {
-
-public class RandomTest : TestCase
-{
- public static ITest Suite {
- get {
- return new TestSuite(typeof(RandomTest));
- }
- }
-
- public RandomTest() : base ("MonoTests.System.RandomTest testcase") {}
- public RandomTest(string name): base(name){}
- public void TestDouble()
- {
- Random r = new Random();
- int i;
- double c=0;
- for (i=0; i<20; i++) c+=r.NextDouble();
- c/=i;
- Assert (c.ToString() + " is out of range.", c < .7 && c > .3);
- }
- public void TestSeed()
- {
- Random r = new Random(42);
- Random r2 = new Random(42);
- int i;
- double c=0, c2=0;
- for (i=0; i<20; i++)
- {
- c += r.NextDouble();
- c2 += r2.NextDouble();
- }
- AssertEquals(c, c2);
- }
- public void TestNext()
- {
- Random r = new Random();
- int i;
- long c;
- for (i=0; i<20; i++)
- {
- c = r.Next();
- Assert (c < Int32.MaxValue && c >= 0);
- }
- }
- public void TestNextMax()
- {
- Random r = new Random();
- int i;
- long c;
- for (i=0; i<20; i++)
- {
- c = r.Next(10);
- Assert (c < 10 && c >= 0);
- }
- }
- public void TestNextMinMax()
- {
- Random r = new Random();
- int i;
- long c;
- for (i=0; i<20; i++)
- {
- c = r.Next(1, 10);
- Assert (c < 10 && c >= 1);
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ResolveEventArgsTest.cs b/mcs/class/corlib/Test/System/ResolveEventArgsTest.cs
deleted file mode 100644
index 728408b3b1d..00000000000
--- a/mcs/class/corlib/Test/System/ResolveEventArgsTest.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.ResolveEventArgs Test Cases
-//
-// Author: Nick Drochak <ndrochak@gol.com>
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System {
-
-public class ResolveEventArgsTest : TestCase
-{
- public static ITest Suite {
- get {
- return new TestSuite(typeof(RandomTest));
- }
- }
-
- public ResolveEventArgsTest() : base ("MonoTests.System.ResolveEventArgsTest testcase") {}
- public ResolveEventArgsTest(string name): base(name){}
-
- public void TestTheWholeThing()
- {
- ResolveEventArgs REA = new ResolveEventArgs("REA_Name");
- Assert ("Name property not correct", REA.Name == "REA_Name");
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/SByteTest.cs b/mcs/class/corlib/Test/System/SByteTest.cs
deleted file mode 100644
index 611d3e4b812..00000000000
--- a/mcs/class/corlib/Test/System/SByteTest.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-// SByteTest.cs - NUnit Test Cases for the System.SByte struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class SByteTest : TestCase
-{
- private const SByte MySByte1 = -42;
- private const SByte MySByte2 = -128;
- private const SByte MySByte3 = 127;
- private const string MyString1 = "-42";
- private const string MyString2 = "-128";
- private const string MyString3 = "127";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"$128.00)",
- "-128", "-1.280000e+002", "-128.00",
- "-128", "-128.00", "-12,800.00 %", "80"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"127.00000",
- "00127", "1.27000e+002", "127.00000",
- "127", "127.00000", "12,700.00000 %", "0007f"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"128.00)",
- "-128", "-1.280000e+002", "-128.00",
- "-128", "-128.00", "-12,800.00 %", "80"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"127.00000",
- "00127", "1.27000e+002", "127.00000",
- "127", "127.00000", "12,700.00000 %", "0007f"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public SByteTest() : base ("MonoTests.System.SByteTest testcase") {}
- public SByteTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(SByteTest));
- }
- }
-
- public void TestMinMax()
- {
- AssertEquals(SByte.MinValue, MySByte2);
- AssertEquals(SByte.MaxValue, MySByte3);
- }
-
- public void TestCompareTo()
- {
- Assert(MySByte3.CompareTo(MySByte2) > 0);
- Assert(MySByte2.CompareTo(MySByte2) == 0);
- Assert(MySByte1.CompareTo((SByte)(-42)) == 0);
- Assert(MySByte2.CompareTo(MySByte3) < 0);
- try {
- MySByte2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MySByte1.Equals(MySByte1));
- Assert(MySByte1.Equals((SByte)(-42)));
- Assert(MySByte1.Equals((Int16)(-42)) == false);
- Assert(MySByte1.Equals(MySByte2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MySByte1.GetHashCode();
- MySByte2.GetHashCode();
- MySByte3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MySByte1 == SByte.Parse(MyString1));
- Assert(MySByte2 == SByte.Parse(MyString2));
- Assert(MySByte3 == SByte.Parse(MyString3));
- try {
- SByte.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- SByte.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = SByte.MaxValue + 1;
- SByte.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == SByte.Parse(" $42 ", NumberStyles.Currency));
- try {
- SByte.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == SByte.Parse(" -42 ", Nfi));
- try {
- SByte.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == SByte.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- SByte.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- Assert("MyString1, MySByte1.ToString()", String.Compare(MyString1, MySByte1.ToString()) == 0);
- Assert("MyString2, MySByte2.ToString()", String.Compare(MyString2, MySByte2.ToString()) == 0);
- Assert("MyString3, MySByte3.ToString()", String.Compare(MyString3, MySByte3.ToString()) == 0);
- //test ToString(string format)
- /*
- TODO: These tests depend on the culture of the system running the test.
- So, this needs to be tested in a different way.
- for (int i=0; i < Formats1.Length; i++) {
- Assert("i="+i+", Results1[i]="+Results1[i]+", MySByte2.ToString(Formats1[i])="+MySByte2.ToString(Formats1[i]), String.Compare(Results1[i], MySByte2.ToString(Formats1[i])) == 0);
- Assert("Results2[i], MySByte3.ToString(Formats2[i])", String.Compare(Results2[i], MySByte3.ToString(Formats2[i])) == 0);
- }
- */
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MySByte2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MySByte2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MySByte2.ToString(Formats1[i], Nfi)) == 0);
- Assert("ResultsNfi2[i], MySByte3.ToString(Formats2[i], Nfi):"+ResultsNfi2[i]+"<==>"+MySByte3.ToString(Formats2[i], Nfi), String.Compare(ResultsNfi2[i], MySByte3.ToString(Formats2[i], Nfi)) == 0);
- }
- try {
- MySByte1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("typeof(FormatException) == e.GetType()", typeof(FormatException) == e.GetType());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/StringTest.cs b/mcs/class/corlib/Test/System/StringTest.cs
deleted file mode 100644
index 5e8c7c3cd95..00000000000
--- a/mcs/class/corlib/Test/System/StringTest.cs
+++ /dev/null
@@ -1,987 +0,0 @@
-// StringTest.cs - NUnit Test Cases for the System.String class
-//
-// Jeffrey Stedfast <fejj@ximian.com>
-// David Brandt <bucky@keystreams.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class StringTest : TestCase
-{
- public StringTest() : base ("MonoTests.System.StringTest testcase") {}
- public StringTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (StringTest));
- }
- }
-
- public void TestLength ()
- {
- string str = "test string";
-
- AssertEquals("wrong length", 11, str.Length);
- }
-
- public void TestCompare ()
- {
- string lesser = "abc";
- string medium = "abcd";
- string greater = "xyz";
- string caps = "ABC";
-
- AssertEquals(0, String.Compare(null, null));
- AssertEquals(1, String.Compare(lesser, null));
-
- Assert (String.Compare (lesser, greater) < 0);
- Assert (String.Compare (greater, lesser) > 0);
- Assert (String.Compare (lesser, lesser) == 0);
- Assert (String.Compare (lesser, medium) < 0);
-
- Assert (String.Compare (lesser, caps, true) == 0);
- Assert (String.Compare (lesser, caps, false) != 0);
-
- // TODO - test with CultureInfo
-
- string needle = "ab";
- string haystack = "abbcbacab";
- AssertEquals("basic substring check", 0,
- String.Compare(needle, 0, haystack, 0, 2));
- AssertEquals("basic substring miss", -1,
- String.Compare(needle, 0, haystack, 0, 3));
- for (int i = 1; i <= (haystack.Length - needle.Length); i++) {
- if (i != 7) {
- Assert("loop substring check " + i, String.Compare(needle, 0, haystack, i, 2) != 0);
- Assert("loop substring check " + i, String.Compare(needle, 0, haystack, i, 3) != 0);
- } else {
- AssertEquals("loop substring check " + i, 0, String.Compare(needle, 0, haystack, i, 2));
- AssertEquals("loop substring check " + i, 0, String.Compare(needle, 0, haystack, i, 3));
- }
- }
-
- needle = "AB";
- AssertEquals("basic substring check", 0,
- String.Compare(needle, 0, haystack, 0, 2, true));
- AssertEquals("basic substring check", 1,
- String.Compare(needle, 0, haystack, 0, 2, false));
- for (int i = 1; i <= (haystack.Length - needle.Length); i++) {
- if (i != 7) {
- Assert("loop substring check " + i, String.Compare(needle, 0, haystack, i, 2, true) != 0);
- Assert("loop substring check " + i, String.Compare(needle, 0, haystack, i, 2, false) != 0);
- } else {
- AssertEquals("loop substring check " + i, 0, String.Compare(needle, 0, haystack, i, 2, true));
- AssertEquals("loop substring check " + i, 1, String.Compare(needle, 0, haystack, i, 2, false));
- }
- }
-
- // TODO - extended format call with CultureInfo
- }
-
- public void TestCompareOrdinal ()
- {
- string lesser = "abc";
- string medium = "abcd";
- string greater = "xyz";
-
- AssertEquals(0, String.CompareOrdinal(null, null));
- AssertEquals(1, String.CompareOrdinal(lesser, null));
-
- Assert (String.CompareOrdinal (lesser, greater) < 0);
- Assert (String.CompareOrdinal (greater, lesser) > 0);
- Assert (String.CompareOrdinal (lesser, lesser) == 0);
- Assert (String.CompareOrdinal (lesser, medium) < 0);
-
- string needle = "ab";
- string haystack = "abbcbacab";
- AssertEquals("basic substring check", 0,
- String.CompareOrdinal(needle, 0, haystack, 0, 2));
- AssertEquals("basic substring miss", -1,
- String.CompareOrdinal(needle, 0, haystack, 0, 3));
- for (int i = 1; i <= (haystack.Length - needle.Length); i++) {
- if (i != 7) {
- Assert("loop substring check " + i, String.CompareOrdinal(needle, 0, haystack, i, 2) != 0);
- Assert("loop substring check " + i, String.CompareOrdinal(needle, 0, haystack, i, 3) != 0);
- } else {
- AssertEquals("loop substring check " + i, 0, String.CompareOrdinal(needle, 0, haystack, i, 2));
- AssertEquals("loop substring check " + i, 0, String.CompareOrdinal(needle, 0, haystack, i, 3));
- }
- }
- }
-
- public void TestCompareTo ()
- {
- string lower = "abc";
- string greater = "xyz";
- string lesser = "abc";
-
- Assert (lower.CompareTo (greater) < 0);
- Assert (lower.CompareTo (lower) == 0);
- Assert (greater.CompareTo (lesser) > 0);
- }
-
- public void TestConcat ()
- {
- string string1 = "string1";
- string string2 = "string2";
- string concat = "string1string2";
-
- Assert (String.Concat (string1, string2) == concat);
- }
-
- public void TestCopy()
- {
- string s1 = "original";
- string s2 = String.Copy(s1);
- AssertEquals("String copy no good", s1, s2);
-
- bool errorThrown = false;
- try {
- string s = String.Copy(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null copy shouldn't be good", errorThrown);
- }
-
- public void TestCopyTo()
- {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- s1.CopyTo(0, (char[])null, 0, s1.Length);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null CopyTo shouldn't be good", errorThrown);
-
- char[] c1 = new char[s1.Length];
- string s2 = new String(c1);
- Assert("char string not bad to start", !s1.Equals(s2));
- for (int i = 0; i < s1.Length; i++) {
- s1.CopyTo(i, c1, i, 1);
- }
- s2 = new String(c1);
- AssertEquals("char-by-char copy bad", s1, s2);
- }
-
- public void TestEndsWith()
- {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- bool huh = s1.EndsWith(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null EndsWith shouldn't be good", errorThrown);
-
- Assert("should match", s1.EndsWith("l"));
- Assert("should match 2", s1.EndsWith("inal"));
- Assert("should fail", !s1.EndsWith("ina"));
- }
-
- public void TestEquals()
- {
- string s1 = "original";
- string yes = "original";
- object y = yes;
- string no = "copy";
-
- Assert("No match for null", !s1.Equals(null));
- Assert("Should match object", s1.Equals(y));
- Assert("Should match", s1.Equals(yes));
- Assert("Shouldn't match", !s1.Equals(no));
-
- Assert("Static nulls should match", String.Equals(null, null));
- Assert("Should match", String.Equals(s1, yes));
- Assert("Shouldn't match", !String.Equals(s1, no));
- }
-
- public void TestFormat ()
- {
- Assert ("Empty format string.", String.Format ("", 0) == "");
- Assert ("Single argument.", String.Format ("{0}", 100) == "100");
- Assert ("Single argument, right justified.", String.Format ("X{0,5}X", 37) == "X 37X");
- Assert ("Single argument, left justified.", String.Format ("X{0,-5}X", 37) == "X37 X");
- Assert ("Two arguments.", String.Format ("The {0} wise {1}.", 3, "men") == "The 3 wise men.");
- Assert ("Three arguments.", String.Format ("{0} re {1} fa {2}.", "do", "me", "so") == "do re me fa so.");
- Assert ("Formatted argument.", String.Format ("###{0:x8}#", 0xc0ffee) == "###00c0ffee#");
- Assert ("Formatted argument, right justified.", String.Format ("#{0,5:x3}#", 0x33) == "# 033#");
- Assert ("Formatted argument, left justified.", String.Format ("#{0,-5:x3}#", 0x33) == "#033 #");
- Assert ("Escaped bracket", String.Format ("typedef struct _{0} {{ ... }} MonoObject;", "MonoObject") == "typedef struct _MonoObject { ... } MonoObject;");
-
- // TODO test format exceptions
-
- // TODO test argument null exceptions
- // This should work, but it doesn't currently.
- // I think I broke the spec...
- //bool errorThrown = false;
- //try {
- //string s = String.Format(null, " ");
- //} catch (ArgumentNullException) {
- //errorThrown = true;
- //}
- //Assert("error not thrown 1", errorThrown);
- //errorThrown = false;
- //try {
- //string s = String.Format(null, " ", " ");
- //} catch (ArgumentNullException) {
- //errorThrown = true;
- //}
- //Assert("error not thrown 2", errorThrown);
- //errorThrown = false;
- //try {
- //string s = String.Format(" ", null);
- //} catch (ArgumentNullException) {
- //errorThrown = true;
- //}
- //Assert("error not thrown 3", errorThrown);
- }
-
- public void TestGetEnumerator()
- {
- string s1 = "original";
- char[] c1 = new char[s1.Length];
- string s2 = new String(c1);
- Assert("pre-enumerated string should not match", !s1.Equals(s2));
- CharEnumerator en = s1.GetEnumerator();
- AssertNotNull("null enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- c1[i] = en.Current;
- }
- s2 = new String(c1);
- AssertEquals("enumerated string should match", s1, s2);
- }
-
- public void TestGetHashCode()
- {
- string s1 = "original";
- // TODO - weak test, currently. Just verifies determinicity.
- AssertEquals("same string, same hash code",
- s1.GetHashCode(), s1.GetHashCode());
- }
-
- public void TestGetType() {
- string s1 = "original";
- AssertEquals("String type", "System.String", s1.GetType().ToString());
- }
-
- public void TestGetTypeCode() {
- string s1 = "original";
- Assert(s1.GetTypeCode().Equals(TypeCode.String));
- }
-
- public void TestIndexOf() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- int i = s1.IndexOf('q', s1.Length + 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf('q', s1.Length + 1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf("huh", s1.Length + 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf("huh", s1.Length + 1, 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- AssertEquals("basic char index", 1, s1.IndexOf('r'));
- AssertEquals("basic char index", 2, s1.IndexOf('i'));
- AssertEquals("basic char index - no", -1, s1.IndexOf('q'));
-
- AssertEquals("basic string index", 1, s1.IndexOf("rig"));
- AssertEquals("basic string index", 2, s1.IndexOf("i"));
- AssertEquals("basic string index - no", -1, s1.IndexOf("rag"));
-
- AssertEquals("stepped char index", 1, s1.IndexOf('r', 1));
- AssertEquals("stepped char index", 2, s1.IndexOf('i', 1));
- AssertEquals("stepped char index", 4, s1.IndexOf('i', 3));
- AssertEquals("stepped char index", -1, s1.IndexOf('i', 5));
-
- AssertEquals("stepped limited char index",
- 1, s1.IndexOf('r', 1, 1));
- AssertEquals("stepped limited char index",
- -1, s1.IndexOf('r', 0, 1));
- AssertEquals("stepped limited char index",
- 2, s1.IndexOf('i', 1, 3));
- AssertEquals("stepped limited char index",
- 4, s1.IndexOf('i', 3, 3));
- AssertEquals("stepped limited char index",
- -1, s1.IndexOf('i', 5, 3));
-
- s1 = "original original";
- AssertEquals("stepped string index",
- 0, s1.IndexOf("original", 0));
- AssertEquals("stepped string index",
- 9, s1.IndexOf("original", 1));
- AssertEquals("stepped string index",
- -1, s1.IndexOf("original", 10));
- AssertEquals("stepped limited string index",
- 1, s1.IndexOf("rig", 0, 5));
- AssertEquals("stepped limited string index",
- -1, s1.IndexOf("rig", 0, 3));
- AssertEquals("stepped limited string index",
- 10, s1.IndexOf("rig", 2, 15));
- AssertEquals("stepped limited string index",
- -1, s1.IndexOf("rig", 2, 3));
- }
-
- public void TestIndexOfAny() {
- string s1 = "abcdefghijklm";
-
- bool errorThrown = false;
- try {
- int i = s1.IndexOfAny(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- char[] c1 = {'a', 'e', 'i', 'o', 'u'};
- AssertEquals("first vowel", 0, s1.IndexOfAny(c1));
- AssertEquals("second vowel", 4, s1.IndexOfAny(c1, 1));
- AssertEquals("out of vowels", -1, s1.IndexOfAny(c1, 9));
- AssertEquals("second vowel in range",
- 4, s1.IndexOfAny(c1, 1, 4));
- AssertEquals("second vowel out of range",
- -1, s1.IndexOfAny(c1, 1, 3));
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(c1, s1.Length+1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(c1, s1.Length+1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
- }
-
- public void TestInsert() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- string result = s1.Insert(0, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("Null arg error", errorThrown);
-
- errorThrown = false;
- try {
- string result = s1.Insert(s1.Length+1, "Hi!");
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
-
- AssertEquals("front insert",
- "Hi!original", s1.Insert(0, "Hi!"));
- AssertEquals("back insert",
- "originalHi!", s1.Insert(s1.Length, "Hi!"));
- AssertEquals("middle insert",
- "origHi!inal", s1.Insert(4, "Hi!"));
- }
-
- public void TestIntern() {
- bool errorThrown = false;
- try {
- string s = String.Intern(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error", errorThrown);
-
- string s1 = "original";
- AssertEquals("One string's reps are both the same",
- String.Intern(s1), String.Intern(s1));
-
- string s2 = "originally";
- Assert("Different strings, different reps",
- String.Intern(s1) != String.Intern(s2));
- }
-
- public void TestIsInterned() {
- bool errorThrown = false;
- try {
- string s = String.IsInterned(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error", errorThrown);
-
- // FIXME - it seems like this should work, but no.
- // I don't know how it's possible to get a null
- // returned from IsInterned.
- //Assert("no intern for regular string",
- //String.IsInterned("original") == null);
-
- string s1 = "original";
- AssertEquals("is interned", s1, String.IsInterned(s1));
- }
-
- public void TestJoin() {
- bool errorThrown = false;
- try {
- string s = String.Join(" ", null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error", errorThrown);
-
- string[] chunks = {"this", "is", "a", "test"};
- AssertEquals("Basic join", "this is a test",
- String.Join(" ", chunks));
- AssertEquals("Basic join", "this.is.a.test",
- String.Join(".", chunks));
-
- AssertEquals("Subset join", "is a",
- String.Join(" ", chunks, 1, 2));
- AssertEquals("Subset join", "is.a",
- String.Join(".", chunks, 1, 2));
- AssertEquals("Subset join", "is a test",
- String.Join(" ", chunks, 1, 3));
-
- errorThrown = false;
- try {
- string s = String.Join(" ", chunks, 2, 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
- }
-
- public void TestLastIndexOf() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- int i = s1.LastIndexOf('q', -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf('q', -1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf("huh", s1.Length + 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf("huh", s1.Length + 1, 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- AssertEquals("basic char index", 1, s1.LastIndexOf('r'));
- AssertEquals("basic char index", 4, s1.LastIndexOf('i'));
- AssertEquals("basic char index - no", -1, s1.LastIndexOf('q'));
-
- AssertEquals("basic string index", 1, s1.LastIndexOf("rig"));
- AssertEquals("basic string index", 4, s1.LastIndexOf("i"));
- AssertEquals("basic string index - no", -1,
- s1.LastIndexOf("rag"));
-
- AssertEquals("stepped char index", 1,
- s1.LastIndexOf('r', s1.Length-1));
- AssertEquals("stepped char index", 4,
- s1.LastIndexOf('i', s1.Length-1));
- AssertEquals("stepped char index", 2,
- s1.LastIndexOf('i', 3));
- AssertEquals("stepped char index", -1,
- s1.LastIndexOf('i', 1));
-
- AssertEquals("stepped limited char index",
- 1, s1.LastIndexOf('r', 1, 1));
- AssertEquals("stepped limited char index",
- -1, s1.LastIndexOf('r', 0, 1));
- AssertEquals("stepped limited char index",
- 4, s1.LastIndexOf('i', 6, 3));
- AssertEquals("stepped limited char index",
- 2, s1.LastIndexOf('i', 3, 3));
- AssertEquals("stepped limited char index",
- -1, s1.LastIndexOf('i', 1, 2));
-
- s1 = "original original";
- AssertEquals("stepped string index",
- 9, s1.LastIndexOf("original", s1.Length));
- AssertEquals("stepped string index",
- 0, s1.LastIndexOf("original", s1.Length-2));
- AssertEquals("stepped string index",
- -1, s1.LastIndexOf("original", s1.Length-11));
- AssertEquals("stepped limited string index",
- 10, s1.LastIndexOf("rig", s1.Length-1, 10));
- AssertEquals("stepped limited string index",
- -1, s1.LastIndexOf("rig", s1.Length, 3));
- AssertEquals("stepped limited string index",
- 10, s1.LastIndexOf("rig", s1.Length-2, 15));
- AssertEquals("stepped limited string index",
- -1, s1.LastIndexOf("rig", s1.Length-2, 3));
- }
-
- public void TestLastIndexOfAny() {
- string s1 = ".bcdefghijklm";
-
- bool errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(null, s1.Length);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(null, s1.Length, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- char[] c1 = {'a', 'e', 'i', 'o', 'u'};
- AssertEquals("first vowel", 8, s1.LastIndexOfAny(c1));
- AssertEquals("second vowel", 4, s1.LastIndexOfAny(c1, 7));
- AssertEquals("out of vowels", -1, s1.LastIndexOfAny(c1, 3));
- AssertEquals("second vowel in range",
- 4, s1.LastIndexOfAny(c1, s1.Length-6, 4));
- AssertEquals("second vowel out of range",
- -1, s1.LastIndexOfAny(c1, s1.Length-6, 3));
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(c1, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(c1, -1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
- }
-
- public void TestPadLeft() {
- string s1 = "Hi!";
-
- bool errorThrown = false;
- try {
- string s = s1.PadLeft(-1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("Bad argument error", errorThrown);
-
- AssertEquals("Too little padding",
- s1, s1.PadLeft(s1.Length-1));
- AssertEquals("Some padding",
- " Hi!", s1.PadLeft(5));
- }
-
- public void TestPadRight() {
- string s1 = "Hi!";
-
- bool errorThrown = false;
- try {
- string s = s1.PadRight(-1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("Bad argument error", errorThrown);
-
- AssertEquals("Too little padding",
- s1, s1.PadRight(s1.Length-1));
- AssertEquals("Some padding",
- "Hi! ", s1.PadRight(5));
- }
-
- public void TestRemove() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- s1.Remove(-1,1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
- errorThrown = false;
- try {
- s1.Remove(1,-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
- errorThrown = false;
- try {
- s1.Remove(s1.Length,s1.Length);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
-
- AssertEquals("basic remove", "oinal",
- s1.Remove(1, 3));
- }
-
- public void TestReplace() {
- string s1 = "original";
-
- AssertEquals("non-hit char", s1, s1.Replace('q','s'));
- AssertEquals("single char", "oxiginal", s1.Replace('r', 'x'));
- AssertEquals("double char", "orxgxnal", s1.Replace('i', 'x'));
-
- bool errorThrown = false;
- try {
- string s = s1.Replace(null, "feh");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("should get null arg exception", errorThrown);
-
- AssertEquals("replace as remove", "ornal",
- s1.Replace("igi", null));
- AssertEquals("non-hit string", s1, s1.Replace("spam", "eggs"));
- AssertEquals("single string", "orirumal",
- s1.Replace("gin", "rum"));
- AssertEquals("double string", "oreigeinal",
- s1.Replace("i", "ei"));
- }
-
- public void TestSplit() {
- string s1 = "abcdefghijklm";
- char[] c1 = {'q', 'r'};
- AssertEquals("No splitters", s1, (s1.Split(c1))[0]);
-
- char[] c2 = {'a', 'e', 'i', 'o', 'u'};
- string[] chunks = s1.Split(c2);
- AssertEquals("First chunk", "", chunks[0]);
- AssertEquals("Second chunk", "bcd", chunks[1]);
- AssertEquals("Third chunk", "fgh", chunks[2]);
- AssertEquals("Fourth chunk", "jklm", chunks[3]);
-
- chunks = s1.Split(c2, 2);
- AssertEquals("First limited chunk", "", chunks[0]);
- AssertEquals("Second limited chunk", "bcdefghijklm", chunks[1]);
- }
-
- public void TestStartsWith() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- bool huh = s1.StartsWith(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null StartsWith shouldn't be good", errorThrown);
-
- Assert("should match", s1.StartsWith("o"));
- Assert("should match 2", s1.StartsWith("orig"));
- Assert("should fail", !s1.StartsWith("rig"));
- }
-
- public void TestSubstring() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- string s = s1.Substring(s1.Length+1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- errorThrown = false;
- try {
- string s = s1.Substring(1, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(-1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(s1.Length, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(1, s1.Length);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- AssertEquals("basic substring", "inal",
- s1.Substring(4));
- AssertEquals("midstring", "igin",
- s1.Substring(2, 4));
- }
-
- public void TestToCharArray() {
- string s1 = "original";
- char[] c1 = s1.ToCharArray();
- AssertEquals("right array size", s1.Length, c1.Length);
- AssertEquals("basic char array", s1,
- new String(c1));
-
- bool errorThrown = false;
- try {
- s1.ToCharArray(s1.Length, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- s1.ToCharArray(1, s1.Length);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- s1.ToCharArray(-1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- s1.ToCharArray(1, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- c1 = s1.ToCharArray(0, 3);
- AssertEquals("Starting char array", "ori", new String(c1));
- }
-
- public void TestToLower() {
- string s1 = "OrIgInAl";
- AssertEquals("lowercase failed", "original", s1.ToLower());
-
- // TODO - Again, with CultureInfo
- }
-
- public void TestToString() {
- string s1 = "original";
- AssertEquals("ToString failed!", s1, s1.ToString());
- }
-
- public void TestToUpper() {
- string s1 = "OrIgInAl";
- AssertEquals("uppercase failed", "ORIGINAL", s1.ToUpper());
-
- // TODO - Again, with CultureInfo
- }
-
- public void TestTrim() {
- string s1 = " original\t\n";
- AssertEquals("basic trim failed", "original", s1.Trim());
- AssertEquals("basic trim failed", "original", s1.Trim(null));
-
- s1 = "original";
- AssertEquals("basic trim failed", "original", s1.Trim());
- AssertEquals("basic trim failed", "original", s1.Trim(null));
-
- s1 = " \t \n ";
- AssertEquals("empty trim failed", "", s1.Trim());
- AssertEquals("empty trim failed", "", s1.Trim(null));
-
- s1 = "aaaoriginalbbb";
- char[] delims = {'a', 'b'};
- AssertEquals("custom trim failed",
- "original", s1.Trim(delims));
- }
-
- public void TestTrimEnd() {
- string s1 = " original\t\n";
- AssertEquals("basic TrimEnd failed",
- " original", s1.TrimEnd(null));
-
- s1 = " original";
- AssertEquals("basic TrimEnd failed",
- " original", s1.TrimEnd(null));
-
- s1 = " \t \n \n ";
- AssertEquals("empty TrimEnd failed",
- "", s1.TrimEnd(null));
-
- s1 = "aaaoriginalbbb";
- char[] delims = {'a', 'b'};
- AssertEquals("custom TrimEnd failed",
- "aaaoriginal", s1.TrimEnd(delims));
- }
-
- public void TestTrimStart() {
- string s1 = " original\t\n";
- AssertEquals("basic TrimStart failed",
- "original\t\n", s1.TrimStart(null));
-
- s1 = "original\t\n";
- AssertEquals("basic TrimStart failed",
- "original\t\n", s1.TrimStart(null));
-
- s1 = " \t \n \n ";
- AssertEquals("empty TrimStart failed",
- "", s1.TrimStart(null));
-
- s1 = "aaaoriginalbbb";
- char[] delims = {'a', 'b'};
- AssertEquals("custom TrimStart failed",
- "originalbbb", s1.TrimStart(delims));
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/TimeSpanTest.cs b/mcs/class/corlib/Test/System/TimeSpanTest.cs
deleted file mode 100755
index dc90a545c70..00000000000
--- a/mcs/class/corlib/Test/System/TimeSpanTest.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-//
-// TimeSpanTest.cs - NUnit Test Cases for the System.TimeSpan struct
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2001 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class TimeSpanTest : TestCase
-{
- public TimeSpanTest() : base ("MonoTests.System.TimeSpanTest testcase") {}
- public TimeSpanTest (string name): base(name) {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(TimeSpanTest));
- }
- }
-
- public void TestCtors ()
- {
- TimeSpan t1 = new TimeSpan(1234567890);
-
- AssertEquals("A1", "00:02:03.4567890", t1.ToString());
- t1 = new TimeSpan(1,2,3);
- AssertEquals("A2", "01:02:03", t1.ToString());
- t1 = new TimeSpan(1,2,3,4);
- AssertEquals("A3", "1.02:03:04", t1.ToString());
- t1 = new TimeSpan(1,2,3,4,5);
- AssertEquals("A4", "1.02:03:04.0050000", t1.ToString());
- t1 = new TimeSpan(-1,2,-3,4,-5);
- AssertEquals("A5", "-22:02:56.0050000", t1.ToString());
- t1 = new TimeSpan(0,25,0,0,0);
- AssertEquals("A6", "1.01:00:00", t1.ToString());
- }
-
- public void TestProperties ()
- {
- TimeSpan t1 = new TimeSpan(1,2,3,4,5);
- TimeSpan t2 = -t1;
-
- AssertEquals("A1", 1, t1.Days);
- AssertEquals("A2", 2, t1.Hours);
- AssertEquals("A3", 3, t1.Minutes);
- AssertEquals("A4", 4, t1.Seconds);
- AssertEquals("A5", 5, t1.Milliseconds);
- AssertEquals("A6", -1, t2.Days);
- AssertEquals("A7", -2, t2.Hours);
- AssertEquals("A8", -3, t2.Minutes);
- AssertEquals("A9", -4, t2.Seconds);
- AssertEquals("A10", -5, t2.Milliseconds);
- }
-
- public void TestAdd()
- {
- TimeSpan t1 = new TimeSpan(2,3,4,5,6);
- TimeSpan t2 = new TimeSpan(1,2,3,4,5);
- TimeSpan t3 = t1 + t2;
- TimeSpan t4 = t1.Add(t2);
- TimeSpan t5;
- bool exception;
-
- AssertEquals("A1", 3, t3.Days);
- AssertEquals("A2", 5, t3.Hours);
- AssertEquals("A3", 7, t3.Minutes);
- AssertEquals("A4", 9, t3.Seconds);
- AssertEquals("A5", 11, t3.Milliseconds);
- AssertEquals("A6", "3.05:07:09.0110000", t4.ToString());
- try
- {
- t5 = TimeSpan.MaxValue + new TimeSpan(1);
- exception = false;
- }
- catch (OverflowException)
- {
- exception = true;
- }
- AssertEquals("A7", true, exception);
- }
-
- public void TestCompare()
- {
- TimeSpan t1 = new TimeSpan(-1);
- TimeSpan t2 = new TimeSpan(1);
- int res;
- bool exception;
-
- AssertEquals("A1", -1, TimeSpan.Compare(t1, t2));
- AssertEquals("A2", 1, TimeSpan.Compare(t2, t1));
- AssertEquals("A3", 0, TimeSpan.Compare(t2, t2));
- AssertEquals("A4", -1, TimeSpan.Compare(TimeSpan.MinValue, TimeSpan.MaxValue));
- AssertEquals("A5", -1, t1.CompareTo(t2));
- AssertEquals("A6", 1, t2.CompareTo(t1));
- AssertEquals("A7", 0, t2.CompareTo(t2));
- AssertEquals("A8", -1, TimeSpan.Compare(TimeSpan.MinValue, TimeSpan.MaxValue));
-
- AssertEquals("A9", 1, TimeSpan.Zero.CompareTo(null));
-
- try
- {
- res = TimeSpan.Zero.CompareTo("");
- exception = false;
- }
- catch (ArgumentException)
- {
- exception = true;
- }
- AssertEquals("A10", true, exception);
-
- AssertEquals("A11", false, t1 == t2);
- AssertEquals("A12", false, t1 > t2);
- AssertEquals("A13", false, t1 >= t2);
- AssertEquals("A14", true, t1 != t2);
- AssertEquals("A15", true, t1 < t2);
- AssertEquals("A16", true, t1 <= t2);
- }
-
- public void TestNegateAndDuration()
- {
- TimeSpan t1;
- bool exception;
-
- AssertEquals("A1", "-00:00:00.0012345", new TimeSpan(12345).Negate().ToString());
- AssertEquals("A2", "00:00:00.0012345", new TimeSpan(-12345).Duration().ToString());
-
- try
- {
- t1 = TimeSpan.MinValue.Negate();
- exception = false;
- }
- catch (OverflowException)
- {
- exception = true;
- }
- AssertEquals("A3", true, exception);
-
- try
- {
- t1 = TimeSpan.MinValue.Duration();
- exception = false;
- }
- catch (OverflowException) {
- exception = true;
- }
- AssertEquals("A4", true, exception);
-
- AssertEquals("A5", "-00:00:00.0000077", (-(new TimeSpan(77))).ToString());
- AssertEquals("A6", "00:00:00.0000077", (+(new TimeSpan(77))).ToString());
- }
-
- public void TestEquals ()
- {
- TimeSpan t1 = new TimeSpan(1);
- TimeSpan t2 = new TimeSpan(2);
- string s = "justastring";
-
- AssertEquals("A1", true, t1.Equals(t1));
- AssertEquals("A2", false, t1.Equals(t2));
- AssertEquals("A3", false, t1.Equals(s));
- AssertEquals("A4", false, t1.Equals(null));
- AssertEquals("A5", true, TimeSpan.Equals(t1, t1));
- AssertEquals("A6", false, TimeSpan.Equals(t1, t2));
- AssertEquals("A7", false, TimeSpan.Equals(t1, null));
- AssertEquals("A8", false, TimeSpan.Equals(t1, s));
- AssertEquals("A9", false, TimeSpan.Equals(s, t2));
- AssertEquals("A10", true, TimeSpan.Equals(null,null));
- }
-
- public void TestFromXXXX()
- {
- AssertEquals("A1", "12.08:16:48", TimeSpan.FromDays(12.345).ToString());
- AssertEquals("A2", "12:20:42", TimeSpan.FromHours(12.345).ToString());
- AssertEquals("A3", "00:12:20.7000000", TimeSpan.FromMinutes(12.345).ToString());
- AssertEquals("A4", "00:00:12.3450000", TimeSpan.FromSeconds(12.345).ToString());
- AssertEquals("A5", "00:00:00.0120000", TimeSpan.FromMilliseconds(12.345).ToString());
- AssertEquals("A6", "00:00:00.0012345", TimeSpan.FromTicks(12345).ToString());
- }
-
- public void TestGetHashCode()
- {
- AssertEquals("A1", 77, new TimeSpan(77).GetHashCode());
- }
-
- private void TestParseHelper( string s, bool expectformat, bool expectoverflow, string expect )
- {
- bool formatexception = false;
- bool overflowexception = false;
- string result = "junk ";
-
- try {
- result = TimeSpan.Parse(s).ToString();
- }
- catch ( OverflowException ) {
- overflowexception = true;
- }
- catch ( FormatException ) {
- formatexception = true;
- }
- AssertEquals("A1", expectformat, formatexception);
- AssertEquals("A2", expectoverflow, overflowexception);
- if (!expectoverflow && !expectformat) {
- AssertEquals("A3", expect, result);
- }
- }
-
- public void TestParse()
- {
- TestParseHelper(" 13:45:15 ", false, false, "13:45:15");
- TestParseHelper(" -1:2:3 ", false, false, "-01:02:03");
-
- TestParseHelper(" 25:0:0 ", false, true, "dontcare");
- TestParseHelper("aaa", true, false, "dontcare");
-
- TestParseHelper("-21.23:59:59.9999999", false, false, "-21.23:59:59.9999999");
-
- TestParseHelper("100000000000000.1:1:1", false, true, "dontcare");
- TestParseHelper("24:60:60", false, true, "dontcare");
- TestParseHelper("0001:0002:0003.12 ", false, false, "01:02:03.1200000");
-
- TestParseHelper(" 1:2:3:12345678 ", true, false, "dontcare");
- }
-
- public void TestSubstract()
- {
- TimeSpan t1 = new TimeSpan(2,3,4,5,6);
- TimeSpan t2 = new TimeSpan(1,2,3,4,5);
- TimeSpan t3 = t1 - t2;
- TimeSpan t4 = t1.Subtract(t2);
- TimeSpan t5;
- bool exception;
-
- AssertEquals("A1", "1.01:01:01.0010000", t3.ToString());
- AssertEquals("A2", "1.01:01:01.0010000", t4.ToString());
- try {
- t5 = TimeSpan.MinValue - new TimeSpan(1);
- exception = false;
- }
- catch (OverflowException) {
- exception = true;
- }
- AssertEquals("A3", true, exception);
- }
-
- public void TestToString()
- {
- TimeSpan t1 = new TimeSpan(1,2,3,4,5);
- TimeSpan t2 = -t1;
-
- AssertEquals("A1", "1.02:03:04.0050000", t1.ToString());
- AssertEquals("A2", "-1.02:03:04.0050000", t2.ToString());
- AssertEquals("A3", "10675199.02:48:05.4775807", TimeSpan.MaxValue.ToString());
- AssertEquals("A4", "-10675199.02:48:05.4775808", TimeSpan.MinValue.ToString());
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/TimeZoneTest.cs b/mcs/class/corlib/Test/System/TimeZoneTest.cs
deleted file mode 100644
index 1fb301b474d..00000000000
--- a/mcs/class/corlib/Test/System/TimeZoneTest.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// TimeZoneTest.cs - NUnit Test Cases for the System.TimeZone struct
-//
-// author:
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Martin Baulig
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class TimeZoneTest : TestCase
-{
- public TimeZoneTest() : base ("MonoTests.System.TimeZoneTest testcase") {}
- public TimeZoneTest (string name): base(name) {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(TimeZoneTest));
- }
- }
-
- public void TestCtors ()
- {
- TimeZone t1 = TimeZone.CurrentTimeZone;
- AssertEquals("A01", "CET", t1.StandardName);
- AssertEquals("A02", "CEST", t1.DaylightName);
-
- DaylightTime d1 = t1.GetDaylightChanges (2002);
- AssertEquals("A03", "03/31/2002 01:00:00", d1.Start.ToString ("G"));
- AssertEquals("A04", "10/27/2002 01:00:00", d1.End.ToString ("G"));
- AssertEquals("A05", 36000000000L, d1.Delta.Ticks);
-
- DaylightTime d2 = t1.GetDaylightChanges (1996);
- AssertEquals("A06", "03/31/1996 01:00:00", d2.Start.ToString ("G"));
- AssertEquals("A07", "10/27/1996 01:00:00", d2.End.ToString ("G"));
- AssertEquals("A08", 36000000000L, d2.Delta.Ticks);
-
- DateTime d3 = new DateTime (2002,2,25);
- AssertEquals("A09", false, t1.IsDaylightSavingTime (d3));
- DateTime d4 = new DateTime (2002,4,2);
- AssertEquals("A10", true, t1.IsDaylightSavingTime (d4));
- DateTime d5 = new DateTime (2002,11,4);
- AssertEquals("A11", false, t1.IsDaylightSavingTime (d5));
-
- AssertEquals("A12", 36000000000L, t1.GetUtcOffset (d3).Ticks);
- AssertEquals("A13", 72000000000L, t1.GetUtcOffset (d4).Ticks);
- AssertEquals("A14", 36000000000L, t1.GetUtcOffset (d5).Ticks);
- }
-
- protected override void RunTest ()
- {
- CultureInfo oldcult = Thread.CurrentThread.CurrentCulture;
-
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("");
-
- TestCtors ();
-
- Thread.CurrentThread.CurrentCulture = oldcult;
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/UInt16Test.cs b/mcs/class/corlib/Test/System/UInt16Test.cs
deleted file mode 100644
index 05ba7b9325a..00000000000
--- a/mcs/class/corlib/Test/System/UInt16Test.cs
+++ /dev/null
@@ -1,179 +0,0 @@
-// UInt16Test.cs - NUnit Test Cases for the System.UInt16 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class UInt16Test : TestCase
-{
- private const UInt16 MyUInt16_1 = 42;
- private const UInt16 MyUInt16_2 = 0;
- private const UInt16 MyUInt16_3 = 65535;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "65535";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] ResultsNfi1 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"65,535.00000",
- "65535", "6.55350e+004", "65535.00000",
- "65535", "65,535.00000", "6,553,500.00000 %", "0ffff"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"65,535.00000",
- "65535", "6.55350e+004", "65535.00000",
- "65535", "65,535.00000", "6,553,500.00000 %", "0ffff"};
-
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public UInt16Test() : base ("MonoTests.System.UInt16Test testcase") {}
- public UInt16Test(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(UInt16Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(UInt16.MinValue, MyUInt16_2);
- AssertEquals(UInt16.MaxValue, MyUInt16_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyUInt16_3.CompareTo(MyUInt16_2) > 0);
- Assert(MyUInt16_2.CompareTo(MyUInt16_2) == 0);
- Assert(MyUInt16_1.CompareTo((UInt16)(42)) == 0);
- Assert(MyUInt16_2.CompareTo(MyUInt16_3) < 0);
- try {
- MyUInt16_2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyUInt16_1.Equals(MyUInt16_1));
- Assert(MyUInt16_1.Equals((UInt16)(42)));
- Assert(MyUInt16_1.Equals((SByte)(42)) == false);
- Assert(MyUInt16_1.Equals(MyUInt16_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyUInt16_1.GetHashCode();
- MyUInt16_2.GetHashCode();
- MyUInt16_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyUInt16_1 == UInt16.Parse(MyString1));
- Assert(MyUInt16_2 == UInt16.Parse(MyString2));
- Assert(MyUInt16_3 == UInt16.Parse(MyString3));
- try {
- UInt16.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- UInt16.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = UInt16.MaxValue + 1;
- UInt16.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == UInt16.Parse(" $42 ", NumberStyles.Currency));
- try {
- UInt16.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(42 == UInt16.Parse(" 42 ", Nfi));
- try {
- UInt16.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == UInt16.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- UInt16.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals(MyString1, MyUInt16_1.ToString());
- AssertEquals(MyString2, MyUInt16_2.ToString());
- AssertEquals(MyString3, MyUInt16_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(Results1[i], MyUInt16_2.ToString(Formats1[i]));
- AssertEquals(Results2[i], MyUInt16_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(ResultsNfi1[i], MyUInt16_2.ToString(Formats1[i], Nfi));
- AssertEquals(ResultsNfi2[i], MyUInt16_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyUInt16_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-
-}
diff --git a/mcs/class/corlib/Test/System/UInt32Test.cs b/mcs/class/corlib/Test/System/UInt32Test.cs
deleted file mode 100644
index eb3dd0bf848..00000000000
--- a/mcs/class/corlib/Test/System/UInt32Test.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-// UInt32Test.cs - NUnit Test Cases for the System.UInt32 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class UInt32Test : TestCase
-{
- private const UInt32 MyUInt32_1 = 42;
- private const UInt32 MyUInt32_2 = 0;
- private const UInt32 MyUInt32_3 = 4294967295;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "4294967295";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] ResultsNfi1 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"4,294,967,295.00000",
- "4294967295", "4.29497e+009", "4294967295.00000",
- "4.295e+09", "4,294,967,295.00000", "429,496,729,500.00000 %", "ffffffff"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"4,294,967,295.00000",
- "4294967295", "4.29497e+009", "4294967295.00000",
- "4.295e+09", "4,294,967,295.00000", "429,496,729,500.00000 %", "ffffffff"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public UInt32Test() : base ("MonoTests.System.UInt32Test testcase") {}
- public UInt32Test(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(UInt32Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(UInt32.MinValue, MyUInt32_2);
- AssertEquals(UInt32.MaxValue, MyUInt32_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyUInt32_3.CompareTo(MyUInt32_2) > 0);
- Assert(MyUInt32_2.CompareTo(MyUInt32_2) == 0);
- Assert(MyUInt32_1.CompareTo((UInt32)(42)) == 0);
- Assert(MyUInt32_2.CompareTo(MyUInt32_3) < 0);
- Assert (1 == UInt32.Parse ("1"));
- Assert (1 == UInt32.Parse (" 1"));
- Assert (1 == UInt32.Parse (" 1"));
- Assert (1 == UInt32.Parse ("1 "));
- Assert (1 == UInt32.Parse ("+1"));
-
- try {
- UInt32.Parse (" + 1 ");
- Fail ("Should raise FormatException1");
- } catch (Exception e){
- Assert (typeof (FormatException) == e.GetType ());
- }
-
- try {
- UInt32.Parse (" + ");
- Fail ("Should raise FormatException");
- } catch (Exception e){
- Assert (typeof (FormatException) == e.GetType ());
- }
- try {
- MyUInt32_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyUInt32_1.Equals(MyUInt32_1));
- Assert(MyUInt32_1.Equals((UInt32)(42)));
- Assert(MyUInt32_1.Equals((SByte)(42)) == false);
- Assert(MyUInt32_1.Equals(MyUInt32_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyUInt32_1.GetHashCode();
- MyUInt32_2.GetHashCode();
- MyUInt32_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert("Parse problem on \""+MyString1+"\"", MyUInt32_1 == UInt32.Parse(MyString1));
- Assert("Parse problem on \""+MyString2+"\"", MyUInt32_2 == UInt32.Parse(MyString2));
- Assert("Parse problem on \""+MyString3+"\"", MyUInt32_3 == UInt32.Parse(MyString3));
- try {
- UInt32.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Did not get ArgumentNullException type", typeof(ArgumentNullException) == e.GetType());
- }
- try {
- UInt32.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("Did not get FormatException type", typeof(FormatException) == e.GetType());
- }
- try {
- // TODO: Use this after ToString() is completed. For now, hard code string that generates
- // exception.
- //double OverInt = (double)UInt32.MaxValue + 1;
- //UInt32.Parse(OverInt.ToString());
- UInt32.Parse("4294967296");
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert("Did not get OverflowException type on '"+"4294967296"+"'. Instead, got: '"+e.GetType()+"'", typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == UInt32.Parse(" $42 ", NumberStyles.Currency));
- try {
- UInt32.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(42 == UInt32.Parse(" 42 ", Nfi));
- try {
- UInt32.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == UInt32.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- UInt32.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals(MyString1, MyUInt32_1.ToString());
- AssertEquals(MyString2, MyUInt32_2.ToString());
- AssertEquals(MyString3, MyUInt32_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(Results1[i], MyUInt32_2.ToString(Formats1[i]));
- AssertEquals(Results2[i], MyUInt32_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(ResultsNfi1[i], MyUInt32_2.ToString(Formats1[i], Nfi));
- AssertEquals(ResultsNfi2[i], MyUInt32_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyUInt32_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-
-}
diff --git a/mcs/class/corlib/Test/System/UInt64Test.cs b/mcs/class/corlib/Test/System/UInt64Test.cs
deleted file mode 100644
index 0c64e01c3c4..00000000000
--- a/mcs/class/corlib/Test/System/UInt64Test.cs
+++ /dev/null
@@ -1,188 +0,0 @@
-// UInt64Test.cs - NUnit Test Cases for the System.UInt64 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class UInt64Test : TestCase
-{
- private const UInt64 MyUInt64_1 = 42;
- private const UInt64 MyUInt64_2 = 0;
- private const UInt64 MyUInt64_3 = 18446744073709551615;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "18446744073709551615";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] ResultsNfi1 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"18,446,744,073,709,551,615.00000",
- "18446744073709551615", "1.84467e+019", "18446744073709551615.00000",
- "1.8447e+19", "18,446,744,073,709,551,615.00000",
- "1,844,674,407,370,955,161,500.00000 %", "ffffffffffffffff"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"18,446,744,073,709,551,615.00000",
- "18446744073709551615", "1.84467e+019", "18446744073709551615.00000",
- "1.8447e+19", "18,446,744,073,709,551,615.00000",
- "1,844,674,407,370,955,161,500.00000 %", "ffffffffffffffff"};
-
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public UInt64Test() : base ("MonoTests.System.UInt64Test testcase") {}
- public UInt64Test(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(UInt64Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(UInt64.MinValue, MyUInt64_2);
- AssertEquals(UInt64.MaxValue, MyUInt64_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyUInt64_3.CompareTo(MyUInt64_2) > 0);
- Assert(MyUInt64_2.CompareTo(MyUInt64_2) == 0);
- Assert(MyUInt64_1.CompareTo((UInt64)(42)) == 0);
- Assert(MyUInt64_2.CompareTo(MyUInt64_3) < 0);
- try {
- MyUInt64_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyUInt64_1.Equals(MyUInt64_1));
- Assert(MyUInt64_1.Equals((UInt64)(42)));
- Assert(MyUInt64_1.Equals((SByte)(42)) == false);
- Assert(MyUInt64_1.Equals(MyUInt64_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyUInt64_1.GetHashCode();
- MyUInt64_2.GetHashCode();
- MyUInt64_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyUInt64_1 == UInt64.Parse(MyString1));
- Assert(MyUInt64_2 == UInt64.Parse(MyString2));
- Assert(MyUInt64_3 == UInt64.Parse(MyString3));
- try {
- UInt64.Parse(null);
- Fail("Should raise a ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- UInt64.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- try {
- double OverInt = (double)UInt64.MaxValue + 1;
- UInt64.Parse(OverInt.ToString(), NumberStyles.Float);
- Fail("Should raise a OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- try {
- double OverInt = (double)UInt64.MaxValue + 1;
- UInt64.Parse(OverInt.ToString(), NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- Assert(42 == UInt64.Parse(" $42 ", NumberStyles.Currency));
- try {
- UInt64.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(42 == UInt64.Parse(" 42 ", Nfi));
- try {
- UInt64.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == UInt64.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- UInt64.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals(MyString1, MyUInt64_1.ToString());
- AssertEquals(MyString2, MyUInt64_2.ToString());
- AssertEquals(MyString3, MyUInt64_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(Results1[i], MyUInt64_2.ToString(Formats1[i]));
- AssertEquals(Results2[i], MyUInt64_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(ResultsNfi1[i], MyUInt64_2.ToString(Formats1[i], Nfi));
- AssertEquals(ResultsNfi2[i], MyUInt64_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyUInt64_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/TheTests.cs b/mcs/class/corlib/Test/TheTests.cs
deleted file mode 100755
index 6d9c3f018ce..00000000000
--- a/mcs/class/corlib/Test/TheTests.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
- public class RunBooleanTest : BooleanTest
- {
- protected override void RunTest ()
- {
- TestStrings ();
- TestCompareTo ();
- TestEquals ();
- TestGetHashCode ();
- TestGetType ();
- TestGetTypeCode ();
- TestParse ();
- TestToString ();
- }
- }
- public class RunStringTest : StringTest
- {
- protected override void RunTest ()
- {
- TestLength ();
- TestCompare ();
- TestCompareOrdinal ();
- TestCompareTo ();
- TestConcat ();
- TestCopy ();
- TestCopyTo ();
- TestEndsWith ();
- TestEquals ();
- TestFormat ();
- TestGetEnumerator ();
- TestGetHashCode ();
- TestGetType ();
- TestGetTypeCode ();
- TestIndexOf ();
- TestIndexOfAny ();
- TestInsert ();
- TestIntern ();
- TestIsInterned ();
- TestJoin ();
- TestLastIndexOf ();
- TestLastIndexOfAny ();
- TestPadLeft ();
- TestPadRight ();
- TestRemove ();
- TestReplace ();
- TestSplit ();
- TestStartsWith ();
- TestSubstring ();
- TestToCharArray ();
- TestToLower ();
- TestToString ();
- TestToUpper ();
- TestTrim ();
- TestTrimEnd ();
- TestTrimStart ();
- }
- }
- public class RunTimeSpanTest : TimeSpanTest
- {
- protected override void RunTest ()
- {
- TestCtors ();
- TestProperties ();
- TestAdd ();
- TestCompare ();
- TestNegateAndDuration ();
- TestEquals ();
- TestFromXXXX ();
- TestGetHashCode ();
- TestParse ();
- TestSubstract ();
- TestToString ();
- }
- }
- public class RunDoubleTest : DoubleTest
- {
- protected override void RunTest ()
- {
- TestPublicFields ();
- TestCompareTo ();
- TestEquals ();
- TestGetHasCode ();
- TestTypeCode ();
- TestIsInfinity ();
- TestIsNan ();
- TestIsNegativeInfinity ();
- TestIsPositiveInfinity ();
- TestParse ();
- TestToString ();
- }
- }
- public class RunTimeZoneTest : TimeZoneTest
- {
- protected override void RunTest ()
- {
- TestCtors ();
- }
- }
- public class RunDateTimeTest : DateTimeTest
- {
- protected override void RunTest ()
- {
- TestCtors ();
- TestToString ();
- TestParse ();
- }
- }
-}
-
-namespace MonoTests
-{
- public class RunAllTests
-{
- public static void AddAllTests (TestSuite suite)
- {
- suite.AddTest (new MonoTests.System.RunBooleanTest ());
- suite.AddTest (new MonoTests.System.RunStringTest ());
- suite.AddTest (new MonoTests.System.RunTimeSpanTest ());
- suite.AddTest (new MonoTests.System.RunDoubleTest ());
- suite.AddTest (new MonoTests.System.RunTimeZoneTest ());
- suite.AddTest (new MonoTests.System.RunDateTimeTest ());
- }
- }
-}
diff --git a/mcs/class/corlib/Test/corlib_test.build b/mcs/class/corlib/Test/corlib_test.build
deleted file mode 100644
index 31ddc2be614..00000000000
--- a/mcs/class/corlib/Test/corlib_test.build
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for corlib_test.dll -->
-<!-- Target build (default) builds tests -->
-<!-- Target test runs tests -->
-
-<project name="corlib_test" default="build">
- <property name="debug" value="false"/>
- <property name="nunit_home" value="..\..\..\nunit"/>
-
- <target name="build">
- <csc target="library" output="corlib_test.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="System/IntegerFormatterTest.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/r:corlib_res.dll"/>
- <arg value="/nowarn:1595"/>
- </csc>
-
- <csc target="library" output="corlib_reference.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="System/IntegerFormatterTest.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/nowarn:1595"/>
- </csc>
-
- <csc target="exe" output="RunTests.exe" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="System/IntegerFormatterTest.cs"/>
- <excludes name="System.Collections/StackTest.cs"/>
- <excludes name="**/AllTests.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/nowarn:1595"/>
- </csc>
- </target>
-
-
- <target name="test" depends="build">
- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.AllTests,corlib_test.dll" failonerror="false"/>
- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.AllTests,corlib_reference.dll" failonerror="false"/>
- </target>
-
- <target name="clean">
- <delete file="corlib_test.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/corlib/Test/scan-tests.pl b/mcs/class/corlib/Test/scan-tests.pl
deleted file mode 100755
index d1915d6181f..00000000000
--- a/mcs/class/corlib/Test/scan-tests.pl
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use Carp;
-
-my @alltests;
-my @allsuites;
-
-while (defined ($_ = <>)) {
- next unless /^\s*suite\.AddTest\s*\((.*)\.(.*?)\.Suite\)/;
-
- push @alltests, [$1,$2];
-}
-
-print qq[using NUnit.Framework;\n];
-print qq[using System;\n];
-print qq[using System.Threading;\n];
-print qq[using System.Globalization;\n\n];
-
-
-my $alltest;
-foreach $alltest (@alltests) {
-
- my @suites;
-
- my $testname = $alltest->[0];
- my $filename = $alltest->[0]."/".$alltest->[1].".cs";
-
- open ALLTEST, $filename or croak "open ($filename): $!";
- while (defined ($_ = <ALLTEST>)) {
- next unless /^\s*suite\.AddTest\s*\((.*)\.Suite\)/;
- next if $1 eq 'HashtableTest'; # broken
- next if $1 eq 'PathTest'; # broken
- push @suites, $1;
- push @allsuites, qq[$testname.Run$1];
- }
- close ALLTEST;
-
- print qq[namespace MonoTests.$testname\n\{\n];
-
- my $suite;
- foreach $suite (@suites) {
-
- my @tests;
-
- open SUITE, qq[$testname/$suite.cs] or
- croak "open ($testname/$suite.cs): $!";
- while (defined ($_ = <SUITE>)) {
- next unless /^\s*public\s+void\s+(Test.*?)\s*\(\s*\)/;
- push @tests, $1;
- }
- close SUITE;
-
- print qq[\tpublic class Run$suite : $suite\n\t\{\n];
- print qq[\t\tprotected override void RunTest ()\n\t\t\{\n];
- foreach (@tests) {
- print qq[\t\t\t$_ ();\n];
- }
- print qq[\t\t\}\n\t\}\n];
- }
- print qq[\}\n\n];
-}
-
-print qq[namespace MonoTests\n\{\n];
-print qq[\tpublic class RunAllTests\n\{\n];
-print qq[\t\tpublic static void AddAllTests (TestSuite suite)\n];
-print qq[\t\t\{\n];
-
-my $suite;
-foreach $suite (@allsuites) {
- print qq[\t\t\tsuite.AddTest (new MonoTests.$suite ());\n];
-}
-
-print qq[\t\t\}\n\t\}\n\}\n];
-
diff --git a/mcs/class/corlib/Unix/Errno.cs b/mcs/class/corlib/Unix/Errno.cs
deleted file mode 100755
index 36c3b4bc698..00000000000
--- a/mcs/class/corlib/Unix/Errno.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// Errno.cs: used to provide better information
-//
-
-namespace System.Private {
-
- internal class Errno {
-
- internal static string Message (int code)
- {
- switch (code){
- case Wrapper.EPERM:
- return "No permission";
- case Wrapper.ENOENT:
- return "The name does not exist";
- case Wrapper.EISDIR:
- return "error: Is a directory";
- case Wrapper.EBADF:
- return "Bad file descriptor";
- case Wrapper.ENOMEM:
- return "Out of memory";
- case Wrapper.EEXIST:
- return "File already exists";
- case Wrapper.ENOTEMPTY:
- return "Directory is not empty";
-
- case Wrapper.ESRCH:
- case Wrapper.EINTR:
- case Wrapper.EIO:
- case Wrapper.ENXIO:
- case Wrapper.E2BIG:
- case Wrapper.ENOEXEC:
- case Wrapper.ECHILD:
- case Wrapper.EAGAIN:
- case Wrapper.EACCES:
- case Wrapper.EFAULT:
- case Wrapper.ENOTBLK:
- case Wrapper.EBUSY:
- case Wrapper.EXDEV:
- case Wrapper.ENODEV:
- case Wrapper.EINVAL:
- case Wrapper.ENFILE:
- case Wrapper.EMFILE:
- case Wrapper.ENOTTY:
- case Wrapper.ETXTBSY:
- case Wrapper.EFBIG:
- case Wrapper.ENOSPC:
- case Wrapper.ESPIPE:
- case Wrapper.EROFS:
- case Wrapper.EMLINK:
- case Wrapper.EPIPE:
- case Wrapper.EDOM:
- case Wrapper.ERANGE:
- case Wrapper.EDEADLK:
- case Wrapper.ENAMETOOLONG:
- case Wrapper.ENOLCK:
- case Wrapper.ENOSYS:
- case Wrapper.ELOOP:
- case Wrapper.ENOMSG:
- case Wrapper.EIDRM:
- case Wrapper.ECHRNG:
- case Wrapper.EL2NSYNC:
- case Wrapper.EL3HLT:
- case Wrapper.EL3RST:
- case Wrapper.ELNRNG:
- case Wrapper.EUNATCH:
- case Wrapper.ENOCSI:
- case Wrapper.EL2HLT:
- case Wrapper.EBADE:
- case Wrapper.EBADR:
- case Wrapper.EXFULL:
- case Wrapper.ENOANO:
- case Wrapper.EBADRQC:
- case Wrapper.EBADSLT:
- case Wrapper.EBFONT:
- case Wrapper.ENOSTR:
- case Wrapper.ENODATA:
- case Wrapper.ETIME:
- case Wrapper.ENOSR:
- case Wrapper.ENONET:
- case Wrapper.ENOPKG:
- case Wrapper.EREMOTE:
- case Wrapper.ENOLINK:
- case Wrapper.EADV:
- case Wrapper.ESRMNT:
- case Wrapper.ECOMM:
- case Wrapper.EPROTO:
- case Wrapper.EMULTIHOP:
- case Wrapper.EDOTDOT:
- case Wrapper.EBADMSG:
- case Wrapper.ENOTUNIQ:
- case Wrapper.EBADFD:
- case Wrapper.EREMCHG:
- case Wrapper.ELIBACC:
- case Wrapper.ELIBBAD:
- case Wrapper.ELIBSCN:
- case Wrapper.ELIBMAX:
- case Wrapper.ELIBEXEC:
- case Wrapper.EUSERS:
- case Wrapper.ENOTSOCK:
- case Wrapper.EDESTADDRREQ:
- case Wrapper.EMSGSIZE:
- case Wrapper.EPROTOTYPE:
- case Wrapper.ENOPROTOOPT:
- case Wrapper.EPROTONOSUPPORT:
- case Wrapper.ESOCKTNOSUPPORT:
- case Wrapper.EOPNOTSUPP:
- case Wrapper.EPFNOSUPPORT:
- case Wrapper.EAFNOSUPPORT:
- case Wrapper.EADDRINUSE:
- case Wrapper.EADDRNOTAVAIL:
- case Wrapper.ENETDOWN:
- case Wrapper.ENETUNREACH:
- case Wrapper.ENETRESET:
- case Wrapper.ECONNABORTED:
- case Wrapper.ECONNRESET:
- case Wrapper.ENOBUFS:
- case Wrapper.EISCONN:
- case Wrapper.ENOTCONN:
- case Wrapper.ESHUTDOWN:
- case Wrapper.ETOOMANYREFS:
- case Wrapper.ETIMEDOUT:
- case Wrapper.ECONNREFUSED:
- case Wrapper.EHOSTDOWN:
- case Wrapper.EHOSTUNREACH:
- case Wrapper.EALREADY:
- case Wrapper.EINPROGRESS:
- case Wrapper.ESTALE:
- case Wrapper.EDQUOT:
- case Wrapper.ENOMEDIUM:
- break;
-
- case Wrapper.ENOTDIR:
- return "Not a directory";
- }
- return String.Format ("Errno code={0}", code);
- }
- }
-}
diff --git a/mcs/class/corlib/Unix/Wrapper.cs b/mcs/class/corlib/Unix/Wrapper.cs
deleted file mode 100644
index c170ac4c37e..00000000000
--- a/mcs/class/corlib/Unix/Wrapper.cs
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Generated automatically: do not edit this file.
- */
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace System.Private {
-
-[CLSCompliant(false)]
-public struct stat {
- public uint st_dev;
- public uint st_mode;
- public uint st_nlink;
- public uint st_uid;
- public uint st_gid;
- public long st_size;
- public uint st_atime;
- public uint st_mtime;
- public uint st_ctime;
-};
-
-public class Wrapper {
-
- public const int SEEK_SET = 0;
- public const int SEEK_CUR = 1;
- public const int SEEK_END = 2;
- public const int O_RDONLY = 0x00000000;
- public const int O_WRONLY = 0x00000001;
- public const int O_RDWR = 0x00000002;
- public const int O_CREAT = 0x00000040;
- public const int O_EXCL = 0x00000080;
- public const int O_NOCTTY = 0x00000100;
- public const int O_TRUNC = 0x00000200;
- public const int O_SYNC = 0x00001000;
- public const int O_APPEND = 0x00000400;
- public const int STDIN_FILENO = 0x00000000;
- public const int STDOUT_FILENO = 0x00000001;
- public const int STDERR_FILENO = 0x00000002;
- public const int S_IFMT = 0x0000f000;
- public const int S_IFSOCK = 0x0000c000;
- public const int S_IFLNK = 0x0000a000;
- public const int S_IFREG = 0x00008000;
- public const int S_IFBLK = 0x00006000;
- public const int S_IFDIR = 0x00004000;
- public const int S_IFCHR = 0x00002000;
- public const int S_IFIFO = 0x00001000;
- public const int S_ISUID = 0x00000800;
- public const int S_ISGID = 0x00000400;
- public const int S_ISVTX = 0x00000200;
- public const int S_IRWXU = 0x000001c0;
- public const int S_IRUSR = 0x00000100;
- public const int S_IWUSR = 0x00000080;
- public const int S_IXUSR = 0x00000040;
- public const int S_IRWXG = 0x00000038;
- public const int S_IRGRP = 0x00000020;
- public const int S_IWGRP = 0x00000010;
- public const int S_IXGRP = 0x00000008;
- public const int S_IRWXO = 0x00000007;
- public const int S_IROTH = 0x00000004;
- public const int S_IWOTH = 0x00000002;
- public const int S_IXOTH = 0x00000001;
- public const int EPERM = 1;
- public const int ENOENT = 2;
- public const int ESRCH = 3;
- public const int EINTR = 4;
- public const int EIO = 5;
- public const int ENXIO = 6;
- public const int E2BIG = 7;
- public const int ENOEXEC = 8;
- public const int EBADF = 9;
- public const int ECHILD = 10;
- public const int EAGAIN = 11;
- public const int ENOMEM = 12;
- public const int EACCES = 13;
- public const int EFAULT = 14;
- public const int ENOTBLK = 15;
- public const int EBUSY = 16;
- public const int EEXIST = 17;
- public const int EXDEV = 18;
- public const int ENODEV = 19;
- public const int EISDIR = 21;
- public const int EINVAL = 22;
- public const int ENFILE = 23;
- public const int EMFILE = 24;
- public const int ENOTTY = 25;
- public const int ETXTBSY = 26;
- public const int EFBIG = 27;
- public const int ENOSPC = 28;
- public const int ESPIPE = 29;
- public const int EROFS = 30;
- public const int EMLINK = 31;
- public const int EPIPE = 32;
- public const int EDOM = 33;
- public const int ERANGE = 34;
- public const int EDEADLK = 35;
- public const int ENAMETOOLONG = 36;
- public const int ENOLCK = 37;
- public const int ENOSYS = 38;
- public const int ENOTEMPTY = 39;
- public const int ELOOP = 40;
- public const int EWOULDBLOCK = 11;
- public const int ENOMSG = 42;
- public const int EIDRM = 43;
- public const int ECHRNG = 44;
- public const int EL2NSYNC = 45;
- public const int EL3HLT = 46;
- public const int EL3RST = 47;
- public const int ELNRNG = 48;
- public const int EUNATCH = 49;
- public const int ENOCSI = 50;
- public const int EL2HLT = 51;
- public const int EBADE = 52;
- public const int EBADR = 53;
- public const int EXFULL = 54;
- public const int ENOANO = 55;
- public const int EBADRQC = 56;
- public const int EBADSLT = 57;
- public const int EDEADLOCK = 35;
- public const int EBFONT = 59;
- public const int ENOSTR = 60;
- public const int ENODATA = 61;
- public const int ETIME = 62;
- public const int ENOSR = 63;
- public const int ENONET = 64;
- public const int ENOPKG = 65;
- public const int EREMOTE = 66;
- public const int ENOLINK = 67;
- public const int EADV = 68;
- public const int ESRMNT = 69;
- public const int ECOMM = 70;
- public const int EPROTO = 71;
- public const int EMULTIHOP = 72;
- public const int EDOTDOT = 73;
- public const int EBADMSG = 74;
- public const int ENOTUNIQ = 76;
- public const int EBADFD = 77;
- public const int EREMCHG = 78;
- public const int ELIBACC = 79;
- public const int ELIBBAD = 80;
- public const int ELIBSCN = 81;
- public const int ELIBMAX = 82;
- public const int ELIBEXEC = 83;
- public const int EUSERS = 87;
- public const int ENOTSOCK = 88;
- public const int EDESTADDRREQ = 89;
- public const int EMSGSIZE = 90;
- public const int EPROTOTYPE = 91;
- public const int ENOPROTOOPT = 92;
- public const int EPROTONOSUPPORT = 93;
- public const int ESOCKTNOSUPPORT = 94;
- public const int EOPNOTSUPP = 95;
- public const int EPFNOSUPPORT = 96;
- public const int EAFNOSUPPORT = 97;
- public const int EADDRINUSE = 98;
- public const int EADDRNOTAVAIL = 99;
- public const int ENETDOWN = 100;
- public const int ENETUNREACH = 101;
- public const int ENETRESET = 102;
- public const int ECONNABORTED = 103;
- public const int ECONNRESET = 104;
- public const int ENOBUFS = 105;
- public const int EISCONN = 106;
- public const int ENOTCONN = 107;
- public const int ESHUTDOWN = 108;
- public const int ETOOMANYREFS = 109;
- public const int ETIMEDOUT = 110;
- public const int ECONNREFUSED = 111;
- public const int EHOSTDOWN = 112;
- public const int EHOSTUNREACH = 113;
- public const int EALREADY = 114;
- public const int EINPROGRESS = 115;
- public const int ESTALE = 116;
- public const int EDQUOT = 122;
- public const int ENOMEDIUM = 123;
- public const int ENOTDIR = 20;
-
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_seek", CharSet=CharSet.Ansi)]
- public unsafe static extern long seek (IntPtr fd, long offset, int whence);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_mkdir", CharSet=CharSet.Ansi)]
- public unsafe static extern int mkdir (string path, int mode);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_rmdir", CharSet=CharSet.Ansi)]
- public unsafe static extern int rmdir (string path);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_read", CharSet=CharSet.Ansi)]
- [CLSCompliant(false)]
- public unsafe static extern int read (IntPtr fd, void * buf, int count);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_write", CharSet=CharSet.Ansi)]
- [CLSCompliant(false)]
- public unsafe static extern int write (IntPtr fd, void * buf, int count);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_fstat", CharSet=CharSet.Ansi)]
- [CLSCompliant(false)]
- public unsafe static extern int fstat (IntPtr fd, stat * buf);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_ftruncate", CharSet=CharSet.Ansi)]
- public unsafe static extern int ftruncate (IntPtr fd, long length);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_open", CharSet=CharSet.Ansi)]
- public unsafe static extern IntPtr open (string path, int flags, int mode);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_close", CharSet=CharSet.Ansi)]
- public unsafe static extern int close (IntPtr fd);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_stat", CharSet=CharSet.Ansi)]
- [CLSCompliant(false)]
- public unsafe static extern int stat (string path, stat * buf);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_unlink", CharSet=CharSet.Ansi)]
- public unsafe static extern int unlink (string path);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_opendir", CharSet=CharSet.Ansi)]
- public unsafe static extern IntPtr opendir (string path);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_readdir", CharSet=CharSet.Ansi)]
- public unsafe static extern string readdir (IntPtr dir);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_closedir", CharSet=CharSet.Ansi)]
- public unsafe static extern int closedir (IntPtr dir);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_getenv", CharSet=CharSet.Ansi)]
- public unsafe static extern IntPtr getenv (string variable);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_environ", CharSet=CharSet.Ansi)]
- public unsafe static extern IntPtr environ ();
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_rename", CharSet=CharSet.Ansi)]
- public unsafe static extern int rename (string source, string target);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_utime", CharSet=CharSet.Ansi)]
- public unsafe static extern int utime (string path, int atime, int mtime);
-
- [DllImport("monowrapper", EntryPoint="mono_glob_compile", CharSet=CharSet.Ansi)]
- public unsafe static extern IntPtr mono_glob_compile (string glob);
-
- [DllImport("monowrapper", EntryPoint="mono_glob_match", CharSet=CharSet.Ansi)]
- public unsafe static extern int mono_glob_match (IntPtr handle, string str);
-
- [DllImport("monowrapper", EntryPoint="mono_glob_dispose", CharSet=CharSet.Ansi)]
- public unsafe static extern void mono_glob_dispose (IntPtr handle);
-
-}
-}
diff --git a/mcs/class/corlib/Unix/common.src b/mcs/class/corlib/Unix/common.src
deleted file mode 100644
index 14f9533ef75..00000000000
--- a/mcs/class/corlib/Unix/common.src
+++ /dev/null
@@ -1 +0,0 @@
-Wrapper.cs \ No newline at end of file
diff --git a/mcs/class/corlib/Unix/mono.src b/mcs/class/corlib/Unix/mono.src
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mcs/class/corlib/Unix/mono.src
+++ /dev/null
diff --git a/mcs/class/corlib/Unix/windows.src b/mcs/class/corlib/Unix/windows.src
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mcs/class/corlib/Unix/windows.src
+++ /dev/null
diff --git a/mcs/class/corlib/Windows/Windows.cs b/mcs/class/corlib/Windows/Windows.cs
deleted file mode 100644
index 891c26f0b68..00000000000
--- a/mcs/class/corlib/Windows/Windows.cs
+++ /dev/null
@@ -1,694 +0,0 @@
-/*---------------------------------------------------------------------
-
- XX X XXX
- XX XX
- XXX XX XXX XXXXX XX
- XX XXX XX XX XX
- XX XX XX XX XXXXX XX
- XX XX XX XX XX XX X XX
- XXXX XX XX XXX XXXXXXX XXXX
- XX
- XXXXX
-
-Copyright (c) 2001 Intel Corporation. All Rights Reserved.
-
-CREATED: August 15, 2001
-OWNER: Scott D Smith, Joel Marcey
-VERSION: 1.0
----------------------------------------------------------------------*/
-
-using System;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.IO;
-using System.Collections;
-
-namespace System.PAL
-{
- /// <summary>
- /// Class that implements IOperatingSystem, providing the requested functionality through calls into APIs available in Windows (this class is a work in progress).
- /// </summary>
- internal class OpSys
- {
-
- //OS Calls (P/Invoke)
-
-
- /*DWORD GetFullPathName(
- LPCTSTR lpFileName, // file name
- DWORD nBufferLength, // size of path buffer
- LPTSTR lpBuffer, // path buffer
- LPTSTR *lpFilePart // address of file name in path
- );*/
-
- [DllImport("kernel32.dll")]
- private static extern uint GetFullPathName(string path, uint bufLength, System.Text.StringBuilder buffer, ref System.Text.StringBuilder fNameAddr);
-
- /*UINT GetTempFileName(
- LPCTSTR lpPathName, // directory name
- LPCTSTR lpPrefixString, // file name prefix
- UINT uUnique, // integer
- LPTSTR lpTempFileName // file name buffer
- );*/
-
- [DllImport("kernel32.dll")]
- private static extern uint GetTempFileName(string path, string prefix, uint unique, System.Text.StringBuilder buffer);
-
- /*DWORD GetTempPath(
- DWORD nBufferLength, // size of buffer
- LPTSTR lpBuffer // path buffer
- );*/
-
- [DllImport("kernel32.dll")]
- private static extern int GetTempPath(int bufferLength, System.Text.StringBuilder buffer);
-
-
-
-
- // Class Constants
-
- private const int EOF = -1; // In stdio.h, EOF is defined as -1
-
-
-
- // For StdInputStream and StdOutputStream
-
- private const int STDOUT = 1; // In stdio.h, the handle to standard out is 1
- private const int STDIN = 0; // In stdio.h, the standard input handle is defined as 0. Will this always be true?
-
-
- // Class Fields
-
- private static bool isNextCharacterResidualNewline = false;
- private static byte residualNewlineByte = 0;
-
-
-
- // Class Constructor
-
- public OpSys()
- {
- }
-
-
- // System.Environment Services
-
- public string NewLineSequence
- {
- get
- {
- return "\r\n";
- }
- }
-
- public char DirectorySeparator
- {
- get
- {
- return (char) 0x005C; // This is a \
- }
- }
-
- public char AltDirectorySeparator
- {
- get
- {
- return (char) 0x002F; // This is a /
- }
- }
-
- public char VolumeSeparator
- {
- get
- {
- return (char) 0x003A; // This is a :
- }
- }
-
- public char PathSeparator
- {
- get
- {
- return (char) 0x003B; // This is a ;
- }
- }
-
- public char[] InvalidPathChars
- {
- get
- {
- char[] ipc = {'"', '<', '>', '|', '\0'};
- return ipc;
- }
- }
-
- public char[] DirVolSeparatorChars
- {
- get
- {
- char[] dsc = new char[] {this.DirectorySeparator, this.AltDirectorySeparator, this.VolumeSeparator};
- return dsc;
- }
- }
- public char ExtensionCharacter
- {
- get
- {
- return (char) 0x002E; // This is a .
- }
- }
-
- public string GetEnvironmentVariable(string eVar)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetEnvironmentVariable(System.String): Stub Method");
- // Call Windows API to get environment variable;
- return null;
- }
-
- public string CommandLine
- {
- get
- {
- return null;
- }
- }
-
- public IDictionary EnvironmentVariables
- {
- get
- {
- return null;
- }
- }
-
- public string MachineName
- {
- get
- {
- return null;
- }
- }
-
- public OperatingSystem OSVersion
- {
- get
- {
- return null;
- }
- }
-
- // System.Path services
-
- public string ChangeExtension(string path, string extension)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:ChangeExtension(System.String, System.String): Stub Method");
- if (path == null || path.Equals(string.Empty))
- {
- return path;
- }
- if (!this.HasExtension(path) && extension != null)
- {
- return string.Concat(path, extension);
- }
- string pathNoExt = path.Substring(0, path.LastIndexOf(this.ExtensionCharacter));
- // If extension is null, concat replaces it with string.Empty
- return string.Concat(pathNoExt, extension);
- }
-
- public string GetExtension(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetExtension(System.String): Stub Method");
- if (path == null)
- {
- return path;
- }
- if (!this.HasExtension(path))
- {
- return string.Empty;
- }
- // It has an extension
- return path.Substring(path.LastIndexOf(this.ExtensionCharacter));
- }
-
- public string GetFileName(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetFileName(System.String): Stub Method");
- if (path == null)
- {
- return null;
- }
- int dvLast = path.LastIndexOfAny(this.DirVolSeparatorChars);
- if (dvLast == -1)
- {
- return path;
- }
- return dvLast + 1 == path.Length ? string.Empty : path.Substring(dvLast + 1);
- }
-
- public long FileLength(string path)
- {
- return 0;
- }
-
- public long FileLength(IntPtr handle)
- {
- return 0;
- }
-
- public string GetFileNameWithoutExtension(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetFileNameWithoutExtension(System.String): Stub Method");
- return this.ChangeExtension(this.GetFileName(path), null);
- }
-
- // TODO: Windows: GetFullPath: Verify logic here. This seems TOO simplistic
- public string GetFullPath(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetFullPath(System.String): Stub Method");
- if (path == null)
- {
- return null;
- }
- // TODO: GetFullPath: What should the size of the buffer be?
- System.Text.StringBuilder buffer = new System.Text.StringBuilder(256);
- // Just temporary to pass in as final parameter
- System.Text.StringBuilder temp = new System.Text.StringBuilder();
- // TODO: GetFullPath: ECMA spec says that an ArgumentException is thrown if system can not retrieve the path. That does not seem right. Returning null for now
- return GetFullPathName(path, (uint) buffer.Capacity, buffer, ref temp) != 0 ? buffer.ToString() : null;
- }
-
- public string GetPathRoot(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetPathRoot(System.String): Stub Method");
- if (path == null)
- {
- return null;
- }
- // TODO: Windows: GetPathRoot: Check logic. Assuming that if there is not dir or vol separators in the first three characters, then relative.
- int dvFirst = path.IndexOfAny(this.DirVolSeparatorChars, 0, 3);
- if (dvFirst == -1)
- {
- return string.Empty;
- }
- if (dvFirst == 0 && path[dvFirst].Equals(this.VolumeSeparator))
- {
- return string.Empty;
- }
- return dvFirst == 1 && path[dvFirst].Equals(this.VolumeSeparator) && (path[dvFirst+1].Equals(this.DirectorySeparator) || path[dvFirst+1].Equals(this.AltDirectorySeparator)) ? path.Substring(0, dvFirst+2) : path.Substring(0, dvFirst+1);
-
- }
-
- public string GetTempFileName()
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetTempFileName(): Stub Method");
- string tPath = this.GetTempPath();
- string prefix = "tmp";
- // TODO: Windows: GetTempFileName: Remove System once our implementation of StringBuilder is done. Same for parameter to P/Invoke
- // TODO: Windows: GetTempFileName: What is the proper length?
- System.Text.StringBuilder buffer = new System.Text.StringBuilder(256);
- // TODO: Windows: GetTempFileName: If an error is returned, what should we do? Right now return null;
- return GetTempFileName(tPath, prefix, 0, buffer) != 0 ? buffer.ToString() : null;
- }
-
- public string GetTempPath()
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetTempPath(): Stub Method");
- // TODO: Windows: GetTempPath: Remove System once our implementation of StringBuilder is done. Same for parameter to P/Invoke
- // According to docs, LPTSTR maps to StringBuilder for In/Out
- System.Text.StringBuilder buffer = new System.Text.StringBuilder(256);
- // TODO: Windows: GetTempPath: What is the proper length?
- // TODO: Windows: GetTempPath: If an error is returned, what should we do? Right now return null;
- return GetTempPath(buffer.Capacity, buffer) != 0 ? buffer.ToString() : null;
- }
-
- public bool HasExtension(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:HasExtension(System.String): Stub Method");
- int dvLast = path.LastIndexOfAny(this.DirVolSeparatorChars);
- int exLast = path.LastIndexOf(this.ExtensionCharacter);
- if (exLast > dvLast)
- {
- return true;
- }
- return false;
- }
-
- public bool IsPathRooted(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:IsPathRooted(System.String): Stub Method");
- return (this.GetPathRoot(path) == null) || (this.GetPathRoot(path).Equals(string.Empty)) ? false : true;
- }
-
-
- // System.Directory service
-
- public void DeleteDirectory(string path, bool recursive)
- {
- System.Diagnostics.Debug.WriteLine("Windows:DeleteDirectory(System.String, System.Boolean): Stub Method");
- }
-
- public bool ExistsDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:ExistsDirectory(System.String): Stub Method");
- return false;
- }
-
- public DateTime GetCreationTimeDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetCreationTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public string GetCurrentDirectory()
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetCurrentDirectory(): Stub Method");
- return null;
- }
-
- public string[] GetDirectories(string path, string searchPattern)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetDirectories(System.String,System.String): Stub Method");
- return null;
- }
-
- public string[] GetFiles(string path, string searchPattern)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetFiles(System.String, System.String): Stub Method");
- return null;
- }
-
- public string[] GetFileSystemEntries(string path, string searchPattern)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetFileSystemEntries(System.String, System.String): Stub Method");
- return null;
- }
-
- public DateTime GetLastAccessTimeDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetLastAccessTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public DateTime GetLastWriteTimeDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetLastWriteTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public void MoveDirectory(string sourceDirName, string destDirName)
- {
- System.Diagnostics.Debug.WriteLine("Windows:MoveDirectory(System.String, System.String): Stub Method");
- }
-
- public void SetCreationTimeDirectory(string path, DateTime creationTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetCreationTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- public void SetCurrentDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetCurrentDirectory(System.String): Stub Method");
- }
-
- public void SetLastAccessTimeDirectory(string path, DateTime lastAccessTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetLastAccessTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- public void SetLastWriteTimeDirectory(string path, DateTime lastWriteTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetLastWriteTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
-
- // I/O Services
-
-
- public int ReadStdInput(byte[] buffer, int offset, int count)
- {
- return ReadFile(new IntPtr(STDIN), buffer, offset, count);
- }
-
- public void FlushStdOutput(byte[] byteBuf)
- {
- FlushFile (new IntPtr(STDOUT), byteBuf);
- }
-
- public unsafe int ReadFile(IntPtr handle, byte[] buffer, int offset, int count)
- {
- int res;
-
- fixed (void *p = &buffer[offset]) {
- res = _read(handle, p, count);
- }
- return res;
- }
-
- public unsafe int WriteFile(IntPtr handle, byte[] buffer, int offset, int count)
- {
- int res;
-
- fixed (void *p = &buffer [offset]) {
- res = _write(handle, p, count);
- }
- return res;
- }
-
- public int SetLengthFile(IntPtr handle, long length)
- {
- return _ftruncate (handle, (int)length);
- }
-
- public void FlushFile(IntPtr handle, byte[] byteBuf)
- {
- WriteFile (handle, byteBuf, 0, byteBuf.Length);
- }
-
- public IntPtr OpenFile(string path, FileMode mode, FileAccess access, FileShare share)
- {
- int flags = _getUnixFlags (mode, access);
-
- return _open (path, flags, 0x1a4);
- }
-
- public void CloseFile(IntPtr handle)
- {
- _close (handle);
- }
-
- public long SeekFile(IntPtr handle, long offset, SeekOrigin origin)
- {
- switch (origin) {
- case SeekOrigin.End:
- return _lseek (handle, (int)offset, SEEK_END);
- case SeekOrigin.Current:
- return _lseek (handle, (int)offset, SEEK_CUR);
- default:
- return _lseek (handle, (int)offset, SEEK_SET);
- }
- }
-
- public IntPtr CreateFile(string path, FileMode mode, FileAccess access, FileShare share)
- {
- return OpenFile(path, FileMode.CreateNew, access, share);
- }
-
- public void DeleteFile(string path)
- {
- _unlink(path);
- }
-
- public bool ExistsFile(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:ExistsFile(System.String): Stub Method");
- return false;
- }
-
- public DateTime GetCreationTimeFile(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetCreationTimeFile(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public DateTime GetLastAccessTimeFile(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetLastAccessTimeFile(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public DateTime GetLastWriteTimeFile(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetLastWriteFile(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public void SetCreationTimeFile(string path, DateTime creationTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetCreationTimeFile(System.String, System.DateTime): Stub Method");
- }
-
- public void SetLastAccessTimeFile(string path, DateTime lastAccessTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetLastAccessTimeFile(System.String, System.DateTime): Stub Method");
- }
-
- public void SetLastWriteTimeFile(string path, DateTime lastWriteTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetCLastWriteTimeFile(System.String, System.DateTime): Stub Method");
- }
-
- // DONE: Determine if this should be in a utility class
- /// <summary>
- /// Determines if a byte is part of the newline sequence
- /// </summary>
- /// <param name="c">The byte to compare</param>
- /// <returns>A System.Boolean stating whether the byte is part of the newline</returns>
- private static bool IsPartOfNewlineSequence(byte c)
- {
- char[] newLineArray = System.Environment.NewLine.ToCharArray();
- for (int i = 0; i < newLineArray.Length; i++)
- {
- if (c == (byte) newLineArray[i]) // Or do I need Equals()
- {
- return true;
- }
- }
- return false;
- }
-
- /// <summary>
- /// Determines if a character is a newline character
- /// </summary>
- /// <param name="c">The character to check to see if it is a newline character</param>
- /// <returns></returns>
- public static bool IsPartOfNewlineSequence(char c)
- {
- // DONE: Determine if this method can be moved into TextReader or maybe a utility class (a class with a bunch of static methods...System.IO.IOUtility)
- char[] newLineArray = System.Environment.NewLine.ToCharArray();
- for (int i = 0; i < newLineArray.Length; i++)
- {
- if (c == newLineArray[i]) // TODO: Determine if .Equals() should be used here.
- {
- return true;
- }
- }
- return false;
- }
-
- [ DllImport("msvcrt", EntryPoint="acos") ]
- public extern static double Acos(double d);
-
- [ DllImport("msvcrt", EntryPoint="asin") ]
- public extern static double Asin(double d);
-
- [ DllImport("msvcrt", EntryPoint="atan") ]
- public extern static double Atan(double d);
-
- [ DllImport("msvcrt", EntryPoint="atan2") ]
- public extern static double Atan2(double y, double x);
-
- [ DllImport("msvcrt", EntryPoint="cos") ]
- public extern static double Cos(double d);
-
- [ DllImport("msvcrt", EntryPoint="cosh") ]
- public extern static double Cosh(double d);
-
- [ DllImport("msvcrt", EntryPoint="exp") ]
- public extern static double Exp(double d);
-
- [ DllImport("msvcrt", EntryPoint="log") ]
- public extern static double Log(double d);
-
- [ DllImport("msvcrt", EntryPoint="log10") ]
- public extern static double Log10(double d);
-
- [ DllImport("msvcrt", EntryPoint="pow") ]
- public extern static double Pow(double x, double y);
-
- [ DllImport("msvcrt", EntryPoint="sin") ]
- public extern static double Sin(double d);
-
- [ DllImport("msvcrt", EntryPoint="sinh") ]
- public extern static double Sinh(double d);
-
- [ DllImport("msvcrt", EntryPoint="sqrt") ]
- public extern static double Sqrt(double d);
-
- [ DllImport("msvcrt", EntryPoint="tan") ]
- public extern static double Tan(double d);
-
- [ DllImport("msvcrt", EntryPoint="tanh") ]
- public extern static double Tanh(double d);
-
- [ DllImport("msvcrt", EntryPoint="_read", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _read(IntPtr fd, void *buf, int count);
-
- [ DllImport("msvcrt", EntryPoint="_write", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _write(IntPtr fd, void *buf, int count);
-
- [ DllImport("msvcrt", EntryPoint="_lseek", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _lseek(IntPtr fd, int offset, int whence);
-
- [ DllImport("msvcrt", EntryPoint="_chsize", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _ftruncate (IntPtr fd, int count);
-
- [ DllImport("msvcrt", EntryPoint="_close", CharSet=CharSet.Ansi) ]
- private unsafe static extern void _close(IntPtr fd);
-
- [ DllImport("msvcrt", EntryPoint="_open", CharSet=CharSet.Ansi) ]
- private unsafe static extern IntPtr _open(string path, int flags, int mode);
-
- [ DllImport("msvcrt", EntryPoint="_unlink", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _unlink(string path);
-
- private const int O_RDONLY = 0x000;
- private const int O_WRONLY = 0x001;
- private const int O_RDWR = 0x002;
- private const int O_CREAT = 0x040;
- private const int O_EXCL = 0x080;
- private const int O_TRUNC = 0x200;
- private const int O_APPEND = 0x400;
-
- private const int SEEK_SET = 0;
- private const int SEEK_CUR = 1;
- private const int SEEK_END = 2;
-
- private int _getUnixFlags (FileMode mode, FileAccess access)
- {
- int flags = 0;
- switch (access) {
- case FileAccess.Read:
- flags = O_RDONLY;
- break;
- case FileAccess.Write:
- flags = O_WRONLY;
- break;
- case FileAccess.ReadWrite:
- flags = O_RDWR;
- break;
- }
-
- switch (mode) {
- case FileMode.Append:
- flags |= O_APPEND;
- break;
- case FileMode.Create:
- flags |= O_CREAT;
- break;
- case FileMode.CreateNew:
- flags |= O_CREAT | O_EXCL;
- break;
- case FileMode.Open:
- break;
- case FileMode.OpenOrCreate:
- flags |= O_CREAT;
- break;
- case FileMode.Truncate:
- flags |= O_TRUNC;
- break;
- }
-
- return flags;
- }
- }
-}
diff --git a/mcs/class/corlib/corlib.build b/mcs/class/corlib/corlib.build
deleted file mode 100644
index f4fc17027a5..00000000000
--- a/mcs/class/corlib/corlib.build
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for corlib.dll -->
-<!-- Target windows builds libraries _for_ windows -->
-<!-- Target linux builds libraries _for_ linux -->
-
-<project name="corlib" default="linux">
- <property name="debug" value="true"/>
-
- <target name="linux">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/corlib.dll" debug="${debug}">
- <!-- keep in sync with corlib_cmp.dll below -->
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0649"/> <!-- field never assigned to -->
- <arg value="/nowarn:0169"/> <!-- field never used -->
- <arg value="/unsafe"/>
-
- <arg value="/nostdlib"/> <!-- don't reference mscorlib -->
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
-
- <sources>
- <includes name="**/*.cs"/>
-
- <excludes name="Test/**"/>
- <excludes name="Windows/**"/>
- <excludes name="System.Security.Permissions/SecurityPermissionAttribute.cs"/> <!-- custom security attributes problem -->
- <excludes name="System.PAL/IOperatingSystem.cs"/>
- </sources>
- </csc>
- <csc target="library" output="../lib/corlib_cmp.dll" debug="${debug}">
- <!-- This dll is used to compare with mscorlib -->
- <!-- It should be the same as corlib.dll minus Object and ValueTyp -->
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0649"/> <!-- field never assigned to -->
- <arg value="/nowarn:0169"/> <!-- field never used -->
- <arg value="/unsafe"/>
-
- <arg value="/nostdlib"/>
- <arg value="/noconfig"/>
- <arg value="/r:mscorlib.dll"/>
-
- <sources>
- <includes name="**/*.cs"/>
-
- <excludes name="Test/**"/>
- <excludes name="Windows/**"/>
- <excludes name="System.Security.Permissions/SecurityPermissionAttribute.cs"/>
- <excludes name="System.PAL/IOperatingSystem.cs"/>
-
- <excludes name="System/Object.cs"/>
- <excludes name="System/ValueType.cs"/>
- <excludes name="System/Enum.cs"/>
- <excludes name="System/Delegate.cs"/>
- <excludes name="System/MulticastDelegate.cs"/>
- <excludes name="System/Exception.cs"/>
- </sources>
- </csc>
- <!-- NUnit can only run under windows right now, so build for windows
- even though this is inside the linux target -->
- <csc target="library" output="Test/corlib_res.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0649"/> <!-- field never assigned to -->
- <arg value="/nowarn:0169"/> <!-- field never used -->
- <arg value="/unsafe"/>
- <sources>
- <includes name="**/*.cs"/>
-
- <excludes name="Test/**"/>
- <excludes name="Linux/**"/>
- <excludes name="System.Security.Permissions/SecurityPermissionAttribute.cs"/>
- <excludes name="System.PAL/IOperatingSystem.cs"/>
-
- <excludes name="System/Object.cs"/>
- <excludes name="System/ValueType.cs"/>
- <excludes name="System/Enum.cs"/>
- <excludes name="System/Delegate.cs"/>
- <excludes name="System/MulticastDelegate.cs"/>
- <excludes name="System/Exception.cs"/>
-
- <excludes name="System/Type.cs"/>
- <excludes name="System/MonoType.cs"/>
- <excludes name="System/Array.cs"/>
- <excludes name="System/String.cs"/>
- <excludes name="System/Console.cs"/>
- <excludes name="System/AppDomain.cs"/>
- <excludes name="System.Reflection.Emit/**"/>
- <excludes name="System/RuntimeTypeHandle.cs"/>
- <excludes name="System.Collections/Queue.cs"/>
- </sources>
- </csc>
- <nant basedir="Test" target="build"/>
- </target>
-
- <target name="test" depends="linux">
- <nant basedir="Test" target="test"/>
- </target>
-
- <target name="windows">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/corlib.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0649"/> <!-- field never assigned to -->
- <arg value="/nowarn:0169"/> <!-- field never used -->
- <arg value="/unsafe"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- <excludes name="Linux/**"/>
- <excludes name="System.PAL/IOperatingSystem.cs"/>
- </sources>
- </csc>
- <csc target="library" output="Test/corlib_res.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0649"/> <!-- field never assigned to -->
- <arg value="/nowarn:0169"/> <!-- field never used -->
- <arg value="/unsafe"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- <excludes name="Linux/**"/>
- <excludes name="System/Object.cs"/>
- <excludes name="System/ValueType.cs"/>
- <excludes name="System/Type.cs"/>
- <excludes name="System/Array.cs"/>
- <excludes name="System/String.cs"/>
- <excludes name="System/Console.cs"/>
- <excludes name="System/AppDomain.cs"/>
- <excludes name="System.Reflection.Emit/**"/>
- <excludes name="System/RuntimeTypeHandle.cs"/>
- <excludes name="System.PAL/IOperatingSystem.cs"/>
- <excludes name="System.Collections/Queue.cs"/>
- <excludes name="System.Security/CodeAccessPermission.cs"/>
- </sources>
- </csc>
- <nant basedir="Test" target="build"/>
- </target>
-
- <target name="clean">
- <delete file="../lib/corlib.dll" failonerror="false"/>
- <delete file="../lib/corlib.pdb" failonerror="false"/>
- <delete file="../lib/corlib_cmp.dll" failonerror="false"/>
- <delete file="../lib/corlib_cmp.pdb" failonerror="false"/>
- <delete file="Test/corlib_res.dll" failonerror="false"/>
- <delete file="Test/corlib_res.pdb" failonerror="false"/>
- <nant basedir="Test" target="clean"/>
- </target>
-</project>
diff --git a/mcs/class/library.build b/mcs/class/library.build
deleted file mode 100644
index 749691939a5..00000000000
--- a/mcs/class/library.build
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for class libraries -->
-<!-- Target windows builds libraries _for_ windows -->
-<!-- Target linux builds libraries _for_ linux -->
-
-<project name="corlib" default="linux">
- <property name="debug" value="false"/>
-
- <target name="windows">
- <nant basedir="corlib" target="windows"/>
- <nant basedir="System" target="build"/>
- <nant basedir="System.Data" target="build"/>
- <!--nant basedir="System.Drawing" target="build"/-->
- <nant basedir="System.XML" target="build"/>
- <!--nant basedir="System.Web" target="build"/-->
- </target>
-
- <target name="linux">
- <nant basedir="corlib" target="linux"/>
- <nant basedir="System" target="build"/>
- <!--nant basedir="System.Drawing" target="build"/-->
- <nant basedir="System.XML" target="build"/>
- <nant basedir="System.Data" target="build"/>
- <!--nant basedir="System.Web" target="build"/-->
- </target>
-
- <target name="test">
- <nant basedir="corlib" target="test"/>
- <nant basedir="System" target="test"/>
- <nant basedir="System.XML" target="test"/>
- </target>
-
- <target name="clean">
- <delete failonerror="false">
- <fileset basedir="lib">
- <includes name="*.dll"/>
- </fileset>
- </delete>
- <nant basedir="corlib" target="clean"/>
- <nant basedir="System" target="clean"/>
- <nant basedir="System.XML" target="clean"/>
- <nant basedir="System.Data" target="clean"/>
- </target>
-</project>
diff --git a/mcs/class/makefile b/mcs/class/makefile
deleted file mode 100644
index 1f5eebb6e52..00000000000
--- a/mcs/class/makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-all:
- @echo "You must use 'make windows' or 'make linux'."
-
-windows:
- ../nant/NAnt.exe windows
-
-unix: linux
-
-linux:
- ../nant/NAnt.exe linux
-
-push:
- scp lib/*.dll mono-cvs:libs
-
-test:
- ../nant/NAnt.exe test
-
-clean:
- ../nant/NAnt.exe clean
diff --git a/mcs/class/notes/BitVecto32.txt b/mcs/class/notes/BitVecto32.txt
deleted file mode 100644
index fad747dfe76..00000000000
--- a/mcs/class/notes/BitVecto32.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-* Why does CreateSection take a short for the range number?
-
- It would seem like it should be possible to have numbers between 0
- and UInt32.MaxValue in there. Why is the API limiting things to 16
- bits?
-
diff --git a/mcs/docs/clr-abi.txt b/mcs/docs/clr-abi.txt
deleted file mode 100755
index 99cce56c71f..00000000000
--- a/mcs/docs/clr-abi.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-* The generated code from the JIT by Microsoft uses registers
- to pass arguments to functions rather than pushing then on the
- stack. \ No newline at end of file
diff --git a/mcs/docs/order.txt b/mcs/docs/order.txt
deleted file mode 100755
index fb23b66c014..00000000000
--- a/mcs/docs/order.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-The plans:
-
- Currently types and base classes are being registered. \ No newline at end of file
diff --git a/mcs/doctools/ChangeLog b/mcs/doctools/ChangeLog
deleted file mode 100644
index 897be0bab31..00000000000
--- a/mcs/doctools/ChangeLog
+++ /dev/null
@@ -1,7 +0,0 @@
-2002-02-24 Nick Drochak <ndrochak@gol.com>
-
- * makefile: have 'clean' target remove the build directory
-
-2002-02-14 Nick Drochak <ndrochak@gol.com>
-
- * doctools.build: Fix build script so doctools will compile (doesn't run yet though)
diff --git a/mcs/doctools/MonoDocStub.DTD b/mcs/doctools/MonoDocStub.DTD
deleted file mode 100644
index 4bf126db706..00000000000
--- a/mcs/doctools/MonoDocStub.DTD
+++ /dev/null
@@ -1,19 +0,0 @@
-<!ELEMENT assembly (class)>
-<!ELEMENT class (name,inherit,inheritfull,attribute*,member*)>
-<!ELEMENT name (#PCDATA)>
-<!ELEMENT inherit (#PCDATA)>
-<!ELEMENT inheritfull (#PCDATA)>
-<!ELEMENT attribute (#PCDATA)>
-<!ELEMENT member (name,type,attribute*,return,inherit,inheritfull,param*,property*)>
-<!ELEMENT name (#PCDATA)>
-<!ELEMENT type (#PCDATA)>
-<!ELEMENT attribute (#PCDATA)>
-<!ELEMENT return (#PCDATA)>
-<!ELEMENT inherit (#PCDATA)>
-<!ELEMENT inheritfull (#PCDATA)>
-<!ELEMENT param (name,type,position,default)>
-<!ELEMENT name (#PCDATA)>
-<!ELEMENT type (#PCDATA)>
-<!ELEMENT postition (#PCDATA)>
-<!ELEMENT default (#PCDATA)>
-<!ELEMENT property (#PCDATA)>
diff --git a/mcs/doctools/MonoDocToHtml.xsl b/mcs/doctools/MonoDocToHtml.xsl
deleted file mode 100644
index 68590dbd78e..00000000000
--- a/mcs/doctools/MonoDocToHtml.xsl
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <html>
- <body>
- <table width="600">
- <tr>
- <td>
- <xsl:apply-templates/>
- </td>
- </tr>
- </table>
- </body>
- </html>
- </xsl:template>
- <xsl:template match="class">
- <h2>Class: <xsl:value-of select="name"/></h2>
- <h3>Inherits from: <xsl:value-of select="inheritfull"/></h3>
- <h3>Attributes:
- <xsl:for-each select="attribute">
- <xsl:value-of select="."/><xsl:if test="position()!=last()">, </xsl:if>
- </xsl:for-each>
- </h3>
- <hr></hr>
- <h3>Members:</h3>
- <h4>Constructors:</h4>
- <xsl:apply-templates select="member" mode="constructors">
- <xsl:sort select="name"/>
- </xsl:apply-templates>
- <h4>Methods:</h4>
- <xsl:apply-templates select="member" mode="methods">
- <xsl:sort select="name"/>
- </xsl:apply-templates>
- <h4>Properties:</h4>
- <xsl:apply-templates select="member" mode="properties">
- <xsl:sort select="name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="member" mode="constructors">
- <xsl:if test="type='constructor'">
- <xsl:value-of select="name"/>(<xsl:apply-templates select="param"/>)<br/>
- <dl>
- <xsl:apply-templates select="attribute"/>
- <xsl:apply-templates select="inheritfull"/>
- </dl>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="member" mode="methods">
- <xsl:if test="type='method'">
- <xsl:value-of select="name"/>(<xsl:apply-templates select="param"/>)<br/>
- <dl>
- <xsl:apply-templates select="attribute"/>
- <xsl:apply-templates select="inheritfull"/>
- <xsl:apply-templates select="return"/>
- </dl>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="member" mode="properties">
- <xsl:if test="type='property'">
- <xsl:value-of select="name"/><br/>
- <dl>
- <xsl:apply-templates select="attribute"/>
- <xsl:apply-templates select="inheritfull"/>
- <xsl:apply-templates select="property"/>
- </dl>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="param">
- <xsl:value-of select="type"/>&#160;&#160;<xsl:value-of select="name"/>
- <xsl:if test="position()!=last()">, </xsl:if>
- </xsl:template>
-
- <xsl:template match="attribute">
- <xsl:if test="position() = 1"><dd>Attributes:</dd></xsl:if>
- <dd><dl>
- <dd><xsl:value-of select="."/></dd>
- </dl>
- </dd>
- </xsl:template>
-
- <xsl:template match="inheritfull">
- <xsl:if test="position() = 1"><dd>Inherits from:</dd></xsl:if>
- <dd><dl>
- <dd><xsl:value-of select="."/></dd>
- </dl>
- </dd>
- </xsl:template>
-
- <xsl:template match="return">
- <xsl:if test="position() = 1"><dd>Return Type:</dd></xsl:if>
- <dd><dl>
- <dd><xsl:value-of select="."/></dd>
- </dl>
- </dd>
- </xsl:template>
-
- <xsl:template match="property">
- <xsl:if test="position() = 1"><dd>Property:</dd></xsl:if>
- <dd><dl>
- <dd><xsl:value-of select="."/></dd>
- </dl>
- </dd>
- </xsl:template>
-</xsl:stylesheet>
diff --git a/mcs/doctools/docconv.cs b/mcs/doctools/docconv.cs
deleted file mode 100644
index 44fdfd6551d..00000000000
--- a/mcs/doctools/docconv.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// docconv.cs
-//
-// Adam Treat (manyoso@yahoo.com)
-//
-// (C) 2002 Adam Treat
-//
-// Licensed under the terms of the GNU GPL
-
-using System;
-using System.Text;
-using System.IO;
-using System.Xml;
-using System.Xml.XPath;
-using System.Xml.Xsl;
-
-namespace Mono.Util
-{
- public class DocConv
- {
- public static void Main(string[] args)
- {
- string xmlfile = null;
- string xslfile = null;
- string htmlfile = null;
-
- if(args.Length < 2)
- {
- Console.Write("Usage: docconv <xmlfile> <xslfile> <htmlout>\n");
- return;
- }
-
- if(!File.Exists(args[0]))
- {
- Console.WriteLine("\n No Xml file at {0}\n", args[0]);
- return;
- }
-
- if(!File.Exists(args[1]))
- {
- Console.WriteLine("\n No Xsl file at {0}\n", args[1]);
- return;
- }
-
- if(args.Length > 2)
- {
- htmlfile = args[2];
- }
-
- xmlfile = args[0];
- xslfile = args[1];
- htmlfile = args[2];
-
- try
- {
- // All this does is apply a transform to an xml file using an xsl stylesheet
- // Not to complicated. The real magic is in the xsl stylesheet.
- XslTransform xslt = new XslTransform();
- xslt.Load(xslfile);
- XmlDocument xml = new XmlDocument();
- xml.PreserveWhitespace = true;
- xml.Load(xmlfile);
- XmlTextWriter writer = new XmlTextWriter(htmlfile, null);
- writer.Formatting = Formatting.Indented;
- xslt.Transform(((IXPathNavigable)xml).CreateNavigator(),null,writer);
- writer.Close();
- }
- catch(XmlException e)
- {
- throw(e);
- }
- catch(Exception e)
- {
- throw(e);
- }
- }
- }
-}
diff --git a/mcs/doctools/docgen.cs b/mcs/doctools/docgen.cs
deleted file mode 100644
index d558687301f..00000000000
--- a/mcs/doctools/docgen.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-// docgen.cs
-//
-// Adam Treat (manyoso@yahoo.com)
-//
-// (C) 2002 Adam Treat
-//
-// Licensed under the terms of the GNU GPL
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Xml;
-
-namespace Mono.Util
-{
- public class DocGen
- {
- public static void Main(string[] args)
- {
- string stubfile = null;
- string externfile = null;
- string monofile = null;
-
- if(args.Length < 2)
- {
- Console.Write("Usage: docgen <stubfile> <externfile> <outputfile>\n");
- return;
- }
-
- if(!File.Exists(args[0]))
- {
- Console.WriteLine("\n No stub.xml file at {0}\n", args[0]);
- return;
- }
-
- if(!File.Exists(args[1]))
- {
- Console.WriteLine("\n No extern.xml file at {0}\n", args[1]);
- return;
- }
-
- if(args.Length > 2)
- {
- stubfile = args[0];
- externfile = args[1];
- monofile = args[2];
- }
-
- try
- {
- XmlDocument stubxml = new XmlDocument();
- stubxml.PreserveWhitespace = true;
- stubxml.Load(stubfile);
-
- XmlDocument externxml = new XmlDocument();
- externxml.PreserveWhitespace = true;
- externxml.Load(externfile);
-
- XmlDocument monoxml = new XmlDocument();
- monoxml.PreserveWhitespace = true;
-
- XmlNode stubassembly = stubxml.DocumentElement;
- XmlNode stubclass = stubassembly["class"];
- IEnumerator stubenum = stubclass.GetEnumerator();
- XmlNode stubtarget;
-
- XmlNode externassembly = externxml.DocumentElement;
- XmlNode externclass = externassembly["class"];
- IEnumerator externenum = externclass.GetEnumerator();
- XmlNode externtarget;
-
- // This is an ugly ugly UGLY hack. I know. It is just here to prove
- // a point and will be replaced shortly.
- while(stubenum.MoveNext())
- {
- stubtarget = (XmlNode)stubenum.Current;
- if(stubtarget.Name == "member")
- {
- XmlNode stubmember = (XmlNode)stubenum.Current;
- XmlNode stubmembername = stubmember["name"];
- //Console.WriteLine(stubmembername.InnerText);
- while(externenum.MoveNext())
- {
- externtarget = (XmlNode)externenum.Current;
- if(externtarget.Name == "member")
- {
- XmlNode externmember = (XmlNode)externenum.Current;
- XmlAttributeCollection attrColl = externmember.Attributes;
- if(attrColl["name"].InnerText == stubmembername.InnerText)
- {
- if (externmember.HasChildNodes)
- {
- for (int i=0; i<externmember.ChildNodes.Count; i++)
- {
- string w ="#whitespace";
- if(externmember.ChildNodes[i].Name != w)
- {
- XmlNode child = stubxml.ImportNode(
- externmember.ChildNodes[i], true);
- stubmember.AppendChild(child);
- }
- }
- }
- }
- }
- }
- // This resets the enumerator for the next go round
- externenum.Reset();
- }
- }
- XmlTextWriter writer = new XmlTextWriter(monofile, null);
- writer.Formatting = Formatting.Indented;
- stubxml.WriteContentTo(writer);
- writer.Flush();
- writer.Close();
- }
- catch(XmlException e)
- {
- throw(e);
- }
- catch(Exception e)
- {
- throw(e);
- }
- }
- }
-}
diff --git a/mcs/doctools/docstub.cs b/mcs/doctools/docstub.cs
deleted file mode 100644
index 9b94248c7e9..00000000000
--- a/mcs/doctools/docstub.cs
+++ /dev/null
@@ -1,634 +0,0 @@
-// docstub.cs
-//
-// Adam Treat (manyoso@yahoo.com)
-//
-// (C) 2002 Adam Treat
-//
-// Licensed under the terms of the GNU GPL
-
-using System;
-using System.Reflection;
-using System.Collections;
-using System.IO;
-using System.Xml;
-
-namespace Mono.Util
-{
-
- class DocStub
- {
- Type currentType;
- MemberInfo[] members;
- XmlTextWriter writer;
- //XmlDocument xmldoc;
- string output_file, assembly_file, directory;
-
- void Usage()
- {
- Console.Write (
- "docstub (-d <directory> || -o <file>) -a <assembly>\n\n" +
- " -d || --dir <directory> The directory to write the xml files to.\n" +
- " -o || --output <file> Specifies that docstub should write to one large output file.\n" +
- " -a || --assembly <assembly> Specifies the target assembly to load and parse.\n\n");
- }
-
- public static void Main(string[] args)
- {
- DocStub stub = new DocStub(args);
- }
-
- public DocStub(string [] args)
- {
- output_file = null;
- assembly_file = null;
- directory = null;
- int argc = args.Length;
-
- for(int i = 0; i < argc; i++)
- {
- string arg = args[i];
-
- // The "/" switch is there for wine users, like me ;-)
- if(arg.StartsWith("-") || arg.StartsWith("/"))
- {
- switch(arg)
- {
-
- case "-d": case "/-d": case "--directory":
- if((i + 1) >= argc)
- {
- Usage();
- return;
- }
- directory = args[++i];
- continue;
-
- case "-o": case "/-o": case "--output":
- if((i + 1) >= argc)
- {
- Usage();
- return;
- }
- output_file = args[++i];
- continue;
-
- case "-a": case "/-a": case "--assembly":
- if((i + 1) >= argc)
- {
- Usage();
- return;
- }
- assembly_file = args[++i];
- continue;
-
- default:
- Usage();
- return;
- }
- }
- }
-
- if(assembly_file == null)
- {
- Usage();
- return;
- } else if(directory == null && output_file == null)
- {
- Usage();
- return;
- }
-
- if(directory != null)
- {
- // This specifies that writing to a directory is the default behavior
- // If someone attempts to write to both a directory and an output file
- // Only the directory will be written to...
- output_file = null;
- }
-
- if (!Directory.Exists(directory) && directory != null)
- {
- Directory.CreateDirectory(directory);
- }
-
- // Call the main driver to get some things done
- MainDriver();
- }
-
- //
- // This method loads the assembly and generates a types list
- // It also takes care of the end product, ie writing the xml
- // to the given filename, or filenames...
- //
- void MainDriver()
- {
- Type[] assemblyTypes;
- Assembly assembly = null;
- ArrayList TypesList = new ArrayList();
-
- assembly = LoadAssembly(Path.GetFullPath(assembly_file));
-
- // GetTypes() doesn't seem to like loading some dll's, but then
- // the exception holds all the types in the dll anyway, some
- // are in Types and some are in the LoaderExceptions array.
- try
- {
- assemblyTypes = assembly.GetTypes();
- }
- catch(ReflectionTypeLoadException e)
- {
- assemblyTypes = e.Types;
- foreach(TypeLoadException loadException in e.LoaderExceptions)
- {
- TypesList.Add(loadException.TypeName);
- }
- }
-
- // Create an xml document to check the output [debugging purposes]
- //xmldoc = new XmlDocument();
- //xmldoc.PreserveWhitespace = true;
-
-
- // GenerateXML will take care of converting all the Types info
- // into XML and return a string for writing out to file, files
-
- if(output_file != null)
- {
- writer = new XmlTextWriter (output_file, null);
- writer.Formatting = Formatting.Indented;
- writer.WriteStartDocument();
- writer.WriteDocType("MonoDocStub", null, null, null);
- writer.WriteStartElement("assembly");
-
- foreach(Type name in assemblyTypes)
- {
- if (name != null)
- {
- GenerateXML(name);
- }
- }
-
- writer.WriteEndElement();
- writer.WriteEndDocument();
- writer.Flush();
- writer.Close();
- // Load the file and check it is wellformed [debugging purposes]
- //xmldoc.Load(output_file);
-
- }
- else if (directory != null)
- {
- foreach(Type name in assemblyTypes)
- {
- if (name != null)
- {
- string filename = directory+"/"+name+".xml";
- writer = new XmlTextWriter (filename, null);
- writer.Formatting = Formatting.Indented;
- writer.WriteStartDocument();
- writer.WriteDocType("MonoDocStub", null, null, null);
- writer.WriteStartElement("assembly");
- GenerateXML(name);
- writer.WriteEndElement();
- writer.WriteEndDocument();
- writer.Flush();
- writer.Close();
- // Load the file and check it is wellformed [debugging purposes]
- //xmldoc.Load(filename);
- }
- }
- }
- return;
- }
-
- // This method loads an assembly into memory. If you
- // use Assembly.Load or Assembly.LoadFrom the assembly file locks.
- // This method doesn't lock the assembly file.
- Assembly LoadAssembly(string filename)
- {
- try
- {
- FileStream fs = File.Open(filename, FileMode.Open, FileAccess.Read);
- byte[] buffer = new byte[fs.Length];
- fs.Read(buffer, 0, (int)fs.Length);
- fs.Close();
-
- return Assembly.Load(buffer);
- }
- catch(FileNotFoundException)
- {
- Console.WriteLine("Could not find assembly file: {0}", assembly_file);
- return null;
- }
- }
-
- //
- // The main xml generation method!
- //
- void GenerateXML(Type name)
- {
- try
- {
- currentType = name;
- //This is what the try block is for
- members = currentType.GetMembers();
- // This is where we generate xml for the class/type
- writer.WriteStartElement("class");
- writer.WriteStartElement("name");
- writer.WriteString(currentType.FullName);
- writer.WriteEndElement();
- getTypeInfoXml();
-
- // Generate xml for members (constructors, fields, methods etc)
- if(members.Length > 0)
- {
- foreach(MemberInfo m in members)
- {
- if (m is ConstructorInfo)
- {
- writer.WriteStartElement("member");
- writer.WriteStartElement("name");
- writer.WriteString(currentType.Name);
- writer.WriteEndElement();
- writer.WriteStartElement("type");
- writer.WriteString("constructor");
- writer.WriteEndElement();
- getConstructorXml((ConstructorInfo)m);
- writer.WriteEndElement();
- }
- else if (m is EventInfo)
- {
- writer.WriteStartElement("member");
- writer.WriteStartElement("name");
- writer.WriteString(m.Name);
- writer.WriteEndElement();
- writer.WriteStartElement("type");
- writer.WriteString("event");
- writer.WriteEndElement();
- getEventXml((EventInfo)m);
- writer.WriteEndElement();
- }
- else if (m is FieldInfo)
- {
- writer.WriteStartElement("member");
- writer.WriteStartElement("name");
- writer.WriteString(m.Name);
- writer.WriteEndElement();
- writer.WriteStartElement("type");
- writer.WriteString("field");
- writer.WriteEndElement();
- getFieldXml((FieldInfo)m);
- writer.WriteEndElement();
- }
- else if (m is PropertyInfo)
- {
- writer.WriteStartElement("member");
- writer.WriteStartElement("name");
- writer.WriteString(m.Name);
- writer.WriteEndElement();
- writer.WriteStartElement("type");
- writer.WriteString("property");
- writer.WriteEndElement();
- getPropertyXml((PropertyInfo)m);
- writer.WriteEndElement();
- }
- else if (m is MethodInfo)
- {
- writer.WriteStartElement("member");
- writer.WriteStartElement("name");
- writer.WriteString(m.Name);
- writer.WriteEndElement();
- writer.WriteStartElement("type");
- writer.WriteString("method");
- writer.WriteEndElement();
- getMethodXml((MethodInfo)m);
- writer.WriteEndElement();
- }
- else{}
- }
- }
- // Don't forget to close the xml ;-)
- writer.WriteEndElement();
- }
- catch(TypeLoadException e)
- {
- // Todo Mono's corlib keeps failing here because System.Object
- // Doesn't have any parents
- Console.WriteLine("Class: "+e.TypeName+" has caused a TypeLoad Exception."
- +" No XML will be generated for this type.");
- }
- }
-
- //
- // This just calls the methods for elements within a constructor
- //
- void getConstructorXml(ConstructorInfo construct)
- {
- getMethodBaseInfoXml(construct);
- getParameterInfoXml(construct);
- getInheritInfoXml(construct);
- }
-
- //
- // Calls the methods for elements within an event member
- //
- void getEventXml(EventInfo eve)
- {
- getEventInfoXml(eve);
- getInheritInfoXml(eve);
- }
-
- //
- // Calls the methods for xml elements within a field
- //
- void getFieldXml(FieldInfo field)
- {
- writer.WriteStartElement("field_type");
- writer.WriteString(field.FieldType.Name);
- writer.WriteEndElement();
- getFieldInfoXml(field);
- getInheritInfoXml(field);
- }
-
- //
- // Calls the methods for xml elements within a property
- //
- void getPropertyXml(PropertyInfo property)
- {
- writer.WriteStartElement("property_type");
- writer.WriteString(property.PropertyType.Name);
- writer.WriteEndElement();
- getPropertyInfoXml(property);
- getInheritInfoXml(property);
- }
-
- //
- // Calls the methods for xml elements within a method
- //
- void getMethodXml(MethodInfo method)
- {
- getMethodBaseInfoXml(method);
- getParameterInfoXml(method);
- getReturnInfoXml(method);
- getInheritInfoXml(method);
- }
-
- //
- // Probably should just go in the getMethodXml, but here for asthetic reasons ;-)
- //
- void getReturnInfoXml(MethodInfo method)
- {
- try
- {
- writer.WriteStartElement("return");
- writer.WriteString(method.ReturnType.Name);
- writer.WriteEndElement();
- }
- catch(Exception)
- {
- // Mysteriously this is also causing some corlib types
- // to spit out some Object doesn't have a parent errors
- //Console.WriteLine(e.Message);
- writer.WriteEndElement();
- }
- }
-
- //
- // Checks to see if a member is inherited and output xml
- //
- void getInheritInfoXml(MemberInfo member)
- {
- if(member.DeclaringType != currentType)
- {
- writer.WriteStartElement("inherit");
- writer.WriteString(member.DeclaringType.Name);
- writer.WriteEndElement();
- writer.WriteStartElement("inheritfull");
- writer.WriteString(member.DeclaringType.FullName);
- writer.WriteEndElement();
- }
- }
-
- //
- // Checks for get or set in properties
- //
- void getPropertyInfoXml(PropertyInfo property)
- {
- if(property.CanRead)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("get");
- writer.WriteEndElement();
- }
- if(property.CanWrite)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("set");
- writer.WriteEndElement();
- }
- }
-
- //
- // Self explanatory
- //
- void getParameterInfoXml(MethodBase method)
- {
- try
- {
- ParameterInfo[] parameters = method.GetParameters();
- if(parameters.Length != 0)
- {
- foreach(ParameterInfo p in parameters)
- {
- writer.WriteStartElement("param");
- writer.WriteStartElement("name");
- writer.WriteString(p.Name);
- writer.WriteEndElement();
- writer.WriteStartElement("type");
- writer.WriteString(p.ParameterType.Name);
- writer.WriteEndElement();
- if(p.DefaultValue != DBNull.Value)
- {
- writer.WriteStartElement("default");
- writer.WriteString(p.DefaultValue.ToString());
- writer.WriteEndElement();
- }
- writer.WriteStartElement("position");
- writer.WriteString(p.Position.ToString());
- writer.WriteEndElement();
- writer.WriteEndElement();
- }
- }
- }
- catch(Exception)
- {
- // Mysteriously this is also causing some corlib types
- // to spit out some Object doesn't have a parent errors
- //Console.WriteLine(e.Message);
- }
- }
-
- //
- // Find Attributes for events
- //
- void getEventInfoXml(EventInfo _obj)
- {
- if(_obj.IsMulticast)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("multicast");
- writer.WriteEndElement();
- }
- writer.WriteStartElement("eventhandler");
- writer.WriteString(_obj.EventHandlerType.Name);
- writer.WriteEndElement();
- }
-
- //
- // Find Attributes for fields
- //
- void getFieldInfoXml(FieldInfo _obj)
- {
- if(_obj.IsPrivate)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("private");
- writer.WriteEndElement();
- }
-
- if(_obj.IsPublic)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("public");
- writer.WriteEndElement();
- }
-
- if(_obj.IsStatic)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("static");
- writer.WriteEndElement();
- }
- }
-
- //
- // Find Attributes for constructors and methods
- //
- void getMethodBaseInfoXml(MethodBase _obj)
- {
-
- if(_obj.IsAbstract)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("abstract");
- writer.WriteEndElement();
- }
-
- if(_obj.IsFinal)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("final");
- writer.WriteEndElement();
- }
-
- if(_obj.IsPrivate)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("private");
- writer.WriteEndElement();
- }
-
- if(_obj.IsPublic)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("public");
- writer.WriteEndElement();
- }
-
- if(_obj.IsStatic)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("static");
- writer.WriteEndElement();
- }
-
- if(_obj.IsVirtual)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("virtual");
- writer.WriteEndElement();
- }
- }
-
- //
- // Put this at the end because it's ugly, but gets the job done
- //
- void getTypeInfoXml()
- {
- try
- {
- writer.WriteStartElement("inherit");
- writer.WriteString(currentType.BaseType.Name);
- writer.WriteEndElement();
- writer.WriteStartElement("inheritfull");
- writer.WriteString(currentType.BaseType.FullName);
- writer.WriteEndElement();
-
- if(currentType.IsAbstract)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("abstract");
- writer.WriteEndElement();
- }
-
- if(currentType.IsEnum)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("enum");
- writer.WriteEndElement();
- }
-
- if(currentType.IsInterface)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("interface");
- writer.WriteEndElement();
- }
-
- if(currentType.IsPrimitive)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("primitive");
- writer.WriteEndElement();
- }
-
- if(currentType.IsPublic)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("public");
- writer.WriteEndElement();
- }
-
- if(currentType.IsSealed)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("sealed");
- writer.WriteEndElement();
- }
-
- if(currentType.IsSerializable)
- {
- writer.WriteStartElement("attribute");
- writer.WriteString("serializable");
- writer.WriteEndElement();
- }
-
- }
- catch(Exception) {
- Console.WriteLine("A Class has caused an Exception."
- +" This occurred whilst trying to retrieve said types inheritable information.");
- writer.WriteEndElement();
- }
- }
- }
-}
diff --git a/mcs/doctools/doctools.build b/mcs/doctools/doctools.build
deleted file mode 100644
index eeaa82a9785..00000000000
--- a/mcs/doctools/doctools.build
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<project name="doctools" default="status">
- <target name="shared">
- <mkdir dir="./build" />
- <csc target="library" output="./build/Mono.Doc.Utils.dll">
- <sources>
- <includes name="src/shared/*.cs" />
- </sources>
- </csc>
- </target>
-
- <target name="status" depends="shared">
- <csc target="exe" output="./build/statusgen.exe">
- <arg value="/r:./build/Mono.Doc.Utils.dll" />
-
- <sources>
- <includes name="src/statusgen/*.cs" />
- </sources>
- </csc>
- </target>
- <target name="linux" depends="status"></target>
- <target name="clean">
- </target>
-</project>
diff --git a/mcs/doctools/makefile b/mcs/doctools/makefile
deleted file mode 100755
index 8a3d9142edb..00000000000
--- a/mcs/doctools/makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-
-all: linux
-
-windows: linux
-
-linux:
- ../nant/NAnt.exe linux
-
-clean:
- rm -rf build
diff --git a/mcs/doctools/src/shared/AssemblyLoadException.cs b/mcs/doctools/src/shared/AssemblyLoadException.cs
deleted file mode 100644
index 651dfec3893..00000000000
--- a/mcs/doctools/src/shared/AssemblyLoadException.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-
-namespace Mono.Doc.Utils
-{
- /// <summary>
- /// Thrown by AssemblyLoader.Load() in the event of a problem.
- /// </summary>
- public class AssemblyLoadException : ApplicationException
- {
- public AssemblyLoadException() : base() {}
- public AssemblyLoadException(string message) : base(message) {}
- public AssemblyLoadException(string message, Exception nested) : base(message, nested) {}
- }
-}
diff --git a/mcs/doctools/src/shared/AssemblyLoader.cs b/mcs/doctools/src/shared/AssemblyLoader.cs
deleted file mode 100644
index 0ba4323dc7d..00000000000
--- a/mcs/doctools/src/shared/AssemblyLoader.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using System;
-using System.IO;
-using System.Reflection;
-
-
-namespace Mono.Doc.Utils
-{
- /// <summary>
- /// Provides a convenient way for programs that want to load assemblies
- /// both from files and from the current AppDomain to do so through
- /// the same interface.
- /// </summary>
- public sealed class AssemblyLoader
- {
- private const string INTERNAL_PREFIX = "int:";
-
-
- private AssemblyLoader()
- {
- // Can't instantiate this class
- }
-
-
- /// <summary>
- /// Given an assembly string, loads the specified assembly.
- /// </summary>
- /// <param name="assemblyString">
- /// The assembly to load. If assemblyString matches "int:ASSEMBLYNAME" the
- /// assembly will be loaded through the current AppDomain rather than
- /// from a file on disk.
- /// </param>
- /// <returns>The loaded assembly</returns>
- public static Assembly Load(string assemblyString)
- {
- Assembly loadedAssembly = null;
-
- if (assemblyString == null || assemblyString == string.Empty) {
- throw new ArgumentException("assemblyString", "Invalid assembly specified for load.");
- }
-
- if (assemblyString.StartsWith(INTERNAL_PREFIX)) {
- string assemblyName = assemblyString.Substring(INTERNAL_PREFIX.Length);
-
- // load this assembly from the current AppDomain
- Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
- foreach (Assembly assem in loadedAssemblies) {
- if (assem.GetName().Name == assemblyName) {
- loadedAssembly = assem;
- break;
- }
- }
-
- if (loadedAssembly == null) {
- throw new AssemblyLoadException("Unable to load " + assemblyString);
- }
- } else {
- // load this assembly from a file
- try {
- loadedAssembly = Assembly.LoadFrom(assemblyString);
- } catch (FileNotFoundException) {
- throw new AssemblyLoadException("Unable to load: " + assemblyString);
- }
- }
-
- return loadedAssembly;
- }
- }
-}
diff --git a/mcs/doctools/src/shared/NameGenerator.cs b/mcs/doctools/src/shared/NameGenerator.cs
deleted file mode 100644
index 410cea69e1f..00000000000
--- a/mcs/doctools/src/shared/NameGenerator.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-using System;
-using System.Reflection;
-using System.Text;
-
-namespace Mono.Doc.Utils
-{
- /// <summary>
- /// Generates friendly names for types.
- /// </summary>
- public sealed class NameGenerator
- {
- private NameGenerator()
- {
- // can't instantiate this class
- }
-
-
- /// <summary>
- /// Given a MemberInfo object, creates a friendly string name without
- /// full qualifiers or a type prefix.
- /// </summary>
- /// <param name="m">The MemberInfo to name</param>
- /// <returns>A friendly name</returns>
- public static string GetNameForMemberInfo(MemberInfo m) {
- return GetNameForMemberInfo(m, NamingFlags.None);
- }
-
-
- /// <summary>
- /// Given a MemberInfo object, creates a friendly string name.
- /// </summary>
- /// <param name="m">The MemberInfo to name</param>
- /// <param name="flags">NamingFlags can be combined to alter the output</param>
- /// <returns>A friendly name</returns>
- public static string GetNameForMemberInfo(MemberInfo m, NamingFlags flags)
- {
- StringBuilder name = new StringBuilder();
-
- // type specifier
- if ((flags & NamingFlags.TypeSpecifier) != 0) {
- // append a type specifier to this name
- string type = null;
-
- if (m is ConstructorInfo) {
- type = "C";
- } else if (m is EventInfo) {
- type = "E";
- } else if (m is FieldInfo) {
- type = "F";
- } else if (m is PropertyInfo) {
- type = "P";
- } else if (m is Type) {
- type = "T";
- } else {
- type = "!";
- }
-
- name.Append(type + ":");
- }
-
- // first-class types
- if (m.DeclaringType == null && m is Type) {
- return name.Append((m as Type).FullName).ToString();
- }
-
- // full name
- if (((flags & NamingFlags.FullName) != 0) && m.DeclaringType != null) {
- name.Append(m.DeclaringType.FullName + ".");
- }
-
- // normal name
- name.Append(m.Name.Replace(".", "#")); // for #ctor
-
- // for methods and constructors, params are part of the name
- if (m is MethodBase) {
- MethodBase method = m as MethodBase;
- ParameterInfo[] parameters = method.GetParameters();
-
- if (parameters.Length > 0) {
- bool first = true;
- name.Append("(");
-
- foreach (ParameterInfo p in parameters) {
- if (!first) name.Append(",");
- first = false;
- name.Append(p.ParameterType.FullName);
- }
-
- name.Append(")");
- } else if ((flags & NamingFlags.ForceMethodParams) != 0) {
- name.Append("()");
- }
- }
-
- return name.ToString();
- }
-
-
- public static string GetKindNameForType(Type t)
- {
- string kind = null;
-
- if (t.IsClass) {
- kind = "class";
- } else if (t.IsInterface) {
- kind = "interface";
- } else if (t.IsValueType) {
- if (t.BaseType.FullName == "System.Enum") {
- kind = "enum";
- } else {
- kind = "struct";
- }
- } else {
- kind = "UNKNOWN";
- }
-
- return kind;
- }
- }
-}
diff --git a/mcs/doctools/src/shared/NamingFlags.cs b/mcs/doctools/src/shared/NamingFlags.cs
deleted file mode 100644
index 2f62c8248a5..00000000000
--- a/mcs/doctools/src/shared/NamingFlags.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace Mono.Doc.Utils
-{
- [Flags]
- public enum NamingFlags
- {
- None = 1,
- FullName = 2,
- TypeSpecifier = 4,
- ForceMethodParams = 8
- }
-} \ No newline at end of file
diff --git a/mcs/doctools/src/statusgen/StatusGenDriver.cs b/mcs/doctools/src/statusgen/StatusGenDriver.cs
deleted file mode 100644
index 5bf70f04465..00000000000
--- a/mcs/doctools/src/statusgen/StatusGenDriver.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System;
-using System.Collections;
-using System.IO;
-using System.Reflection;
-using System.Xml;
-using Mono.Doc.Utils;
-
-namespace Mono.Doc.StatusGen
-{
- class StatusGenDriver
- {
- private const string DEFAULT_OUTPUT_FILE = "out.xml";
-
-
- private StatusGenDriver()
- {
- // can't instantiate this class
- }
-
-
- public static void Main(string[] args)
- {
- string outFile = DEFAULT_OUTPUT_FILE;
- string classFile = null;
- string statAssem = null;
- string diffAssem = null;
-
- if (args.Length < 2) {
- Usage();
- return;
- }
-
- for (int i = 0; i < args.Length; i++) {
- string arg = args[i];
-
- if (arg.StartsWith("-") && ((i + 1) < args.Length)) {
- if (arg == "--diff") {
- diffAssem = args[++i];
- } else if (arg == "--out") {
- outFile = args[++i];
- } else {
- Usage();
- return;
- }
- } else {
- if ((i + 1) >= args.Length) {
- Usage();
- return;
- } else {
- classFile = arg;
- statAssem = args[++i];
- }
- }
- }
-
- StatusGenerator generator =
- new StatusGenerator(statAssem, diffAssem, classFile, outFile);
-
- generator.Create();
- }
-
-
- private static void Usage()
- {
- Console.WriteLine(
- "Mono Assembly Status Generator\n" +
- "statusgen [options] CLASSXML ASSEMBLYFILE\n\n" +
- " --out FILE Specifies an output file\n" +
- " --diff ASSEMBLYFILE Specifies an assembly to diff against\n\n" +
- "CLASSXML is an XML file of the type used to generate Mono's maintainer list,\n" +
- "and is used to insert test suite and maintainer information.\n\n" +
- "ASSEMBLYFILE represents an assembly, either a file or, if in the format\n" +
- "'int:ASSEMBLYNAME', an assembly to be loaded from the current AppDomain.\n\n"
- );
- }
- }
-}
diff --git a/mcs/doctools/src/statusgen/StatusGenerator.cs b/mcs/doctools/src/statusgen/StatusGenerator.cs
deleted file mode 100644
index 2857a9417db..00000000000
--- a/mcs/doctools/src/statusgen/StatusGenerator.cs
+++ /dev/null
@@ -1,268 +0,0 @@
-using System;
-using System.Collections;
-using System.IO;
-using System.Reflection;
-using System.Xml;
-using Mono.Doc.Utils;
-
-namespace Mono.Doc.StatusGen
-{
- public class StatusGenerator
- {
- private const string DEFAULT_MAINTAINER = "mono-list@ximian.com";
-
- private Assembly statusAssem;
- private Assembly diffAssem;
- private XmlDocument outDoc;
- private XmlDocument classDoc;
- private string outFile;
-
- public StatusGenerator(string statusAssemName, string diffAssemName, string classFile, string outFile)
- {
- if (statusAssemName == null) {
- throw new ArgumentNullException(
- "statusAssemName",
- "An assembly to process must be specified."
- );
- }
-
- if (outFile == null) {
- throw new ArgumentNullException(
- "outFile",
- "An XML output file must be specified."
- );
- }
-
- if (classFile == null) {
- throw new ArgumentNullException(
- "classFile",
- "An XML file with maintainer information must be specified."
- );
- }
-
- this.statusAssem = AssemblyLoader.Load(statusAssemName);
- this.outFile = outFile;
- outDoc = new XmlDocument();
- classDoc = new XmlDocument();
-
- try {
- classDoc.Load(classFile);
- } catch {
- throw new ArgumentException(
- "classFile",
- "Unable to load class information XML file: " + classFile
- );
- }
-
- if (diffAssemName != null) {
- this.diffAssem = AssemblyLoader.Load(diffAssemName);
- }
- }
-
-
- public void Create()
- {
- outDoc.AppendChild(outDoc.CreateXmlDeclaration("1.0", null, null));
-
- // <assembly>
- XmlElement assemblyElem = outDoc.CreateElement("assembly");
- assemblyElem.SetAttribute("name", statusAssem.GetName().Name);
- outDoc.AppendChild(assemblyElem);
-
- // <types>
- XmlElement typesElem = outDoc.CreateElement("types");
- assemblyElem.AppendChild(typesElem);
-
- // <type>
- Type[] types = statusAssem.GetTypes();
- foreach (Type type in types) {
- if (type.IsPublic) {
- XmlElement typeElem = CreateTypeElement(type);
- typesElem.AppendChild(typeElem);
- }
- }
-
- // <missing-types>
- XmlElement missingTypesElem = CreateMissingTypesElement();
- if (missingTypesElem != null) {
- assemblyElem.AppendChild(missingTypesElem);
- }
-
- // save
- try {
- outDoc.Save(new StreamWriter(outFile));
- } catch (Exception e) {
- throw new ApplicationException("Unable to write to '" + outFile + "'.", e);
- }
- }
-
-
- #region Private Implementation Methods
-
- private XmlElement CreateTypeElement(Type t)
- {
- XmlElement typeElem = outDoc.CreateElement("type");
- typeElem.SetAttribute("name", t.FullName);
- typeElem.SetAttribute("kind", NameGenerator.GetKindNameForType(t));
-
- // information from class info file
- XmlNode classNode = classDoc.SelectSingleNode("/classes/class[@name='"+ t.FullName + "']");
- ArrayList maintainers = new ArrayList();
- bool hasTestSuite = false;
-
- if (classNode != null) {
- XmlNodeList maintNodes = classNode.SelectNodes("maintainers/maintainer");
- foreach (XmlNode maintNode in maintNodes) {
- maintainers.Add(maintNode.InnerText);
- }
-
- XmlNode testSuiteNode = classNode.SelectSingleNode("test-suite");
- if (testSuiteNode != null) {
- string testText = testSuiteNode.InnerText;
- hasTestSuite = testText == "yes" ? true : false;
- } else {
- // redundant
- hasTestSuite = false;
- }
- }
-
- if (maintainers.Count == 0) {
- maintainers.Add(DEFAULT_MAINTAINER);
- }
-
- // <extended-info>
- XmlElement infoElem = outDoc.CreateElement("extended-info");
- typeElem.PrependChild(infoElem);
-
- foreach (string maintainer in maintainers) {
- infoElem.AppendChild(CreateItem("maintainer", maintainer));
- }
-
- infoElem.AppendChild(CreateItem("test-suite", hasTestSuite.ToString().ToLower()));
-
- // todo
- bool complete = true;
-
- // class may be marked
- if (HasTodo(t)) {
- complete = false;
- }
-
- // now check members
- BindingFlags flags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.DeclaredOnly;
-
- ArrayList incompleteMembers = new ArrayList();
- int total = 0;
-
- // methods
- MethodInfo[] methods = t.GetMethods(flags);
-
- foreach (MethodInfo method in methods) {
- total++;
-
- if (HasTodo(method)) {
- incompleteMembers.Add(
- NameGenerator.GetNameForMemberInfo(method, NamingFlags.ForceMethodParams)
- );
- }
- }
-
- // write out all the incomplete members
- if (incompleteMembers.Count > 0) {
- complete = false;
- XmlElement todoElem = outDoc.CreateElement("todo");
-
- int pctComplete = Convert.ToInt32(
- ((float) (total - incompleteMembers.Count) / (float) total) *100f);
-
- todoElem.SetAttribute("percent", pctComplete.ToString());
-
- incompleteMembers.Sort();
-
- foreach (string memberName in incompleteMembers) {
- XmlElement memberElem = outDoc.CreateElement("member");
- memberElem.SetAttribute("name", memberName);
- todoElem.AppendChild(memberElem);
- }
-
- typeElem.AppendChild(todoElem);
- }
-
- typeElem.SetAttribute("complete", complete.ToString().ToLower());
-
- return typeElem;
- }
-
-
- private bool HasTodo(MemberInfo m) {
- object[] attrs = null;
-
- try {
- attrs = m.GetCustomAttributes(false);
- } catch (CustomAttributeFormatException) {
- Console.Error.WriteLine("WARNING: Unable to look for MonoTODO in " +
- NameGenerator.GetNameForMemberInfo(m,
- NamingFlags.TypeSpecifier | NamingFlags.FullName));
- return false;
- }
-
- foreach (object attr in attrs) {
- if (attr.GetType().FullName == "System.MonoTODOAttribute") {
- return true;
- }
- }
-
- return false;
- }
-
-
- private XmlElement CreateItem(string key, string value)
- {
- XmlElement itemElem = outDoc.CreateElement("item");
- itemElem.SetAttribute("key", key);
- itemElem.SetAttribute("value", value);
-
- return itemElem;
- }
-
-
- private XmlElement CreateMissingTypesElement()
- {
- if (diffAssem != null) {
- Type[] diffTypes = diffAssem.GetTypes();
- ArrayList missingTypes = new ArrayList();
- XmlElement missingTypesElem = null;
-
- foreach (Type type in diffTypes) {
- if (type.IsPublic) {
- string name = type.FullName;
- if (statusAssem.GetType(name) == null) {
- missingTypes.Add(name);
- }
- }
- }
-
- if (missingTypes.Count > 0) {
- missingTypesElem = outDoc.CreateElement("missing-types");
- missingTypes.Sort();
-
- foreach (string typeName in missingTypes) {
- XmlElement typeElem = outDoc.CreateElement("type");
- typeElem.SetAttribute("name", typeName);
- missingTypesElem.AppendChild(typeElem);
- }
- }
-
- return missingTypesElem;
- } else {
- return null;
- }
- }
-
- #endregion
- }
-}
diff --git a/mcs/errors/1529.cs b/mcs/errors/1529.cs
deleted file mode 100755
index 06dd1f74a89..00000000000
--- a/mcs/errors/1529.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs1529.cs: Using clause must precede all other namespace elements
-// Line:
-class X { }
-using System;
diff --git a/mcs/errors/bug1.cs b/mcs/errors/bug1.cs
deleted file mode 100755
index 934f0f9bce2..00000000000
--- a/mcs/errors/bug1.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// FIXED
-//
-interface A {
- void B ();
-}
-
-interface X {
- void B ();
-}
-
-
-class B : A, X {
- void X.B () {}
- void A.B () {}
-
-}
diff --git a/mcs/errors/bug10.cs b/mcs/errors/bug10.cs
deleted file mode 100644
index 5b2ff627ffa..00000000000
--- a/mcs/errors/bug10.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// fixed
-//
-using System;
-
-public class Blah {
-
- public void Connect ()
- {
- }
-
- public void Button1_Click (int i, int j)
- {
- Console.WriteLine ("Button1 was clicked !");
- Console.WriteLine ("Answer : " + (i+j));
- }
-
- public static int Main ()
- {
- Blah b = new Blah ();
-
- b.Connect ();
-
- b.OnClick ();
-
- Console.WriteLine ("Test passes");
- return 0;
- }
-
-}
diff --git a/mcs/errors/bug11.cs b/mcs/errors/bug11.cs
deleted file mode 100755
index b48bc1893f7..00000000000
--- a/mcs/errors/bug11.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// fixed
-//
-class Location {
- static public int Null {
- get {
- return 1;
- }
- }
-}
-
-class X {
- Location Location;
- X ()
- {
- int a = Location.Null;
- }
-
- static void Main () {}
-}
-
-
-
diff --git a/mcs/errors/bug12.cs b/mcs/errors/bug12.cs
deleted file mode 100755
index 27c24e93eb7..00000000000
--- a/mcs/errors/bug12.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Collections;
-
- class PtrHashtable : Hashtable {
- class PtrComparer : IComparer {
- public int Compare (object x, object y)
- {
- if (x == y)
- return 0;
- else
- return 1;
- }
- }
-
- public PtrHashtable ()
- {
- comparer = new PtrComparer ();
- }
- }
-
diff --git a/mcs/errors/bug13.cs b/mcs/errors/bug13.cs
deleted file mode 100755
index 91016d0a7c7..00000000000
--- a/mcs/errors/bug13.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-
-class X {
- static void Main ()
- {
- Type t = null;
-
- if (t.GetType () == null)
- return;
- }
-}
diff --git a/mcs/errors/bug14.cs b/mcs/errors/bug14.cs
deleted file mode 100755
index 9167d9afbbf..00000000000
--- a/mcs/errors/bug14.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// fixed
-//
-using System;
-
-class X {
-
- static void Main ()
- {
- string msg = String.Format ("{0} {1} {2} {3}", "one", 3, 3, "two");
-
- Console.WriteLine (msg);
- }
-}
-
diff --git a/mcs/errors/bug15.cs b/mcs/errors/bug15.cs
deleted file mode 100755
index d233407af32..00000000000
--- a/mcs/errors/bug15.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// fixed
-//
-using System;
-
-class X {
-
- void A ()
- {
- }
-
- static void Main ()
- {
- int loop = 0;
-
- goto a;
- b:
- loop++;
- a:
- Console.WriteLine ("Hello");
- for (;;){
- goto b;
- }
- }
-}
diff --git a/mcs/errors/bug16.cs b/mcs/errors/bug16.cs
deleted file mode 100644
index 4b8503cf127..00000000000
--- a/mcs/errors/bug16.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Fixed
-//
-
-using System;
-
-public class Blah {
-
- public static void Main ()
- {
- ushort i;
- sbyte j;
-
- i = 10;
- j = 20;
-
- Console.WriteLine (i);
- Console.WriteLine (j);
-
- Console.WriteLine ("Hello there !");
- }
-}
-
-
diff --git a/mcs/errors/bug17.cs b/mcs/errors/bug17.cs
deleted file mode 100755
index d922487cf34..00000000000
--- a/mcs/errors/bug17.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-//
-// Fixed
-//
-class X {
- static void Main ()
- {
-double x = 64.0;
-System.Console.WriteLine("x = " + x.ToBoolean(null));
-}
-}
diff --git a/mcs/errors/bug18.cs b/mcs/errors/bug18.cs
deleted file mode 100755
index 61e0f0af006..00000000000
--- a/mcs/errors/bug18.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace A {
- interface B {
- }
-}
-
-class X {
- static void A (object A)
- {
- object x = (A.B) A;
- }
-
- static void Main ()
- {
- }
-}
-
diff --git a/mcs/errors/bug19.cs b/mcs/errors/bug19.cs
deleted file mode 100755
index 15755b6faaa..00000000000
--- a/mcs/errors/bug19.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace N1
-{
- public enum A
- {
- A_1, A_2, A_3
- }
-
- public class B
- {
- const A b = A.A_1;
- }
-}
-
-
-
-
-
-
diff --git a/mcs/errors/bug2.cs b/mcs/errors/bug2.cs
deleted file mode 100755
index 61f6eea2bce..00000000000
--- a/mcs/errors/bug2.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// fixed
-//
-class X {
-
- static void A (ref int a)
- {
- a++;
- }
-
- // Int32&
- static void B (ref int a)
- {
- // Int32&&
- A (ref a);
- }
-
- static int Main ()
- {
- int a = 10;
-
- B (ref a);
-
- if (a == 11)
- return 0;
- else
- return 1;
- }
-}
diff --git a/mcs/errors/bug3.cs b/mcs/errors/bug3.cs
deleted file mode 100755
index af24ecc011b..00000000000
--- a/mcs/errors/bug3.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Fixed, incorporated into test
-//
-using System;
-
-using System.Runtime.InteropServices;
-
-[StructLayout (LayoutKind.Explicit)]
-struct A {
- [FieldOffset (0)]
- public int a;
- [FieldOffset (0)]
- public byte b1;
- [FieldOffset (1)]
- public byte b2;
- [FieldOffset (2)]
- public byte b3;
- [FieldOffset (3)]
- public byte b4;
-}
-
-class X {
- static void Main ()
- {
- A a = new A ();
-
- a.a = 0x12345678;
-
- Console.WriteLine ("b1: " + a.b1);
- Console.WriteLine ("b2: " + a.b2);
- Console.WriteLine ("b3: " + a.b3);
- Console.WriteLine ("b4: " + a.b4);
-
- }
-}
-
diff --git a/mcs/errors/bug4.cs b/mcs/errors/bug4.cs
deleted file mode 100755
index 775cfe30349..00000000000
--- a/mcs/errors/bug4.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// Fixed
-//
-using System;
-
-class X {
- static void Main ()
- {
- try {
- throw new Exception ();
- } catch (Exception e) {
- Console.WriteLine ("Caught");
- throw;
- } catch {
- Console.WriteLine ("Again");
- }
- }
-}
diff --git a/mcs/errors/bug5.cs b/mcs/errors/bug5.cs
deleted file mode 100755
index 03fce159750..00000000000
--- a/mcs/errors/bug5.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// fixed
-//
-interface I {
- void a ();
-}
-
-abstract class X : I {
- public abstract void a ();
-}
-
-class Y : X {
- override public void a () {
- System.Console.WriteLine ("Hello!");
- return;
- }
-
- static void Main () {
- Y y = new Y ();
-
- ((I) y ).a ();
- }
-}
diff --git a/mcs/errors/bug6.cs b/mcs/errors/bug6.cs
deleted file mode 100755
index 9cbf071393d..00000000000
--- a/mcs/errors/bug6.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// fixed
-//
-public class X {
-
- public enum Blah { A }
-
-}
-
-public class Y : X {
-
- Blah x;
-
-}
diff --git a/mcs/errors/bug7.cs b/mcs/errors/bug7.cs
deleted file mode 100755
index fcd35bc6cdb..00000000000
--- a/mcs/errors/bug7.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-public enum X :byte {
- a, b
-}
-
-public class Y {
-
- const X myconst = X.a;
-
- static void Main ()
- {
- }
-}
-
diff --git a/mcs/errors/bug8.cs b/mcs/errors/bug8.cs
deleted file mode 100755
index 47846f7c4c9..00000000000
--- a/mcs/errors/bug8.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-//
-// The problem here is that `(Type)' is being recognized as a Property
-// but inside a Cast expression this is invalid.
-//
-class X {
-
- int Type {
- get {
- return 1;
- }
- }
-
- static void Main ()
- {
- Type t = (Type) null;
- }
-
-}
diff --git a/mcs/errors/bug9.cs b/mcs/errors/bug9.cs
deleted file mode 100755
index f0c436a1ad0..00000000000
--- a/mcs/errors/bug9.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-enum A {
-a, b
-}
-
-class X {
- const A a = A.a;
-}
diff --git a/mcs/errors/cs-11.cs b/mcs/errors/cs-11.cs
deleted file mode 100644
index 5adc40a2573..00000000000
--- a/mcs/errors/cs-11.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// cs-11.cs : Delegate creation expression takes only one argument
-// Line : 17
-
-public class Blah {
-
- public delegate int MyDelegate (int i, int j);
-
- public int Foo (int i, int j)
- {
- return i+j;
- }
-
- public static void Main ()
- {
- Blah i = new Blah ();
-
- MyDelegate del = new MyDelegate ();
- }
-}
-
diff --git a/mcs/errors/cs-12.cs b/mcs/errors/cs-12.cs
deleted file mode 100755
index fe4b09b37a2..00000000000
--- a/mcs/errors/cs-12.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-class Y {
- byte b;
-
- public static implicit operator int (Y i)
- {
- return i.b;
- }
-
-// public static implicit operator byte (Y i)
-// {
-// return i.b;
-// }
-
- public Y (byte b)
- {
- this.b = b;
- }
-}
-
-class X {
- static void Main ()
- {
- Y y = new Y (1);
-
- switch (y){
- case 0:
- break;
- case 1:
- break;
- }
-
- int a = y;
- }
-}
diff --git a/mcs/errors/cs0017.cs b/mcs/errors/cs0017.cs
deleted file mode 100755
index 7942594be2f..00000000000
--- a/mcs/errors/cs0017.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0017.cs: Program has more than one entry point
-// Line: 7
-class X {
-static void Main () {}
-}
-class Y {
-static void Main () {
-}
-}
diff --git a/mcs/errors/cs0019.cs b/mcs/errors/cs0019.cs
deleted file mode 100644
index c3dbd4f9b93..00000000000
--- a/mcs/errors/cs0019.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0019.cs : Operator + cannot be applied to operands of type `Foo' and `int'
-// Line : 11
-
-public class Foo {
-
- public static void Main ()
- {
-
- Foo k = new Foo ();
-
- int i = k + 6;
-
- }
-}
diff --git a/mcs/errors/cs0023.cs b/mcs/errors/cs0023.cs
deleted file mode 100644
index 6a2cd5518c9..00000000000
--- a/mcs/errors/cs0023.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0023.cs : Operator ~ cannot be applied to operand of type `Foo'
-// Line : 10
-
-public class Foo {
-
- public static void Main ()
- {
- Foo k = new Foo ();
-
- int i = ~ k;
-
- }
-}
diff --git a/mcs/errors/cs0026-2.cs b/mcs/errors/cs0026-2.cs
deleted file mode 100755
index a4f41cdb51d..00000000000
--- a/mcs/errors/cs0026-2.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0026: use of this is not allowed in a static field initializer
-//
-class X {
- static object o = this;
-
- static int Main ()
- {
- return 1;
- }
-}
diff --git a/mcs/errors/cs0026.cs b/mcs/errors/cs0026.cs
deleted file mode 100755
index e4b5ca7e580..00000000000
--- a/mcs/errors/cs0026.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0026: use of this is not allowed in static methods
-// Line: 6
-class X {
- static void A ()
- {
- this = null;
- }
-}
diff --git a/mcs/errors/cs0029.cs b/mcs/errors/cs0029.cs
deleted file mode 100755
index 4f701c4e085..00000000000
--- a/mcs/errors/cs0029.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0029: cannot implicitly conver type `double' to `decimal'
-// Line: 7
-
-class T {
- public static int Main (string [] args)
- {
- decimal d = 100d;
-
- return 1;
- }
-}
-
diff --git a/mcs/errors/cs0030.cs b/mcs/errors/cs0030.cs
deleted file mode 100644
index 7226eb2855c..00000000000
--- a/mcs/errors/cs0030.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0030.cs : Cannot convert type 'Blah' to 'float'
-// Line : 12
-
-public class Blah {
-
- public static int Main ()
- {
- Blah k;
-
- k = new Blah ();
-
- float f = (float) k;
-
- }
-}
diff --git a/mcs/errors/cs0031.cs b/mcs/errors/cs0031.cs
deleted file mode 100644
index c79ba6975de..00000000000
--- a/mcs/errors/cs0031.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0031.cs : Constant value '256' cannot be converted to a byte
-// Line : 7
-
-public class Blah {
-
- public enum MyEnum : byte {
- Foo = 256,
- Bar
- }
-
- public static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0034.cs b/mcs/errors/cs0034.cs
deleted file mode 100755
index 2d5917abee5..00000000000
--- a/mcs/errors/cs0034.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0034: operator >= is ambiguous on types ulong and sbyte
-// Line: 7
-class X {
-
- bool ret (ulong u, sbyte s)
- {
- return (u >= s);
- }
-
- bool ret (ulong u, short s)
- {
- return (u >= s);
- }
-
-}
diff --git a/mcs/errors/cs0051.cs b/mcs/errors/cs0051.cs
deleted file mode 100755
index 177c0028638..00000000000
--- a/mcs/errors/cs0051.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0051.cs: Inconsistent accessibility: parameter type `MyClass.X' is less accessible than method MyClass.method(MyClass.X)
-// Line: 12
-
-public class MyClass {
-
- //
- // To fix change the next line to "public enum X {
- enum X {
- a, b
- }
-
- public void method (X arg)
- {
- }
-}
diff --git a/mcs/errors/cs0060.cs b/mcs/errors/cs0060.cs
deleted file mode 100755
index 0e571b72987..00000000000
--- a/mcs/errors/cs0060.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0060.cs: Incosistent accessability between X and Y.X
-// Line: 6
-class X {
-}
-
-public class Y : X {
-}
diff --git a/mcs/errors/cs0066.cs b/mcs/errors/cs0066.cs
deleted file mode 100644
index e7e6f5e3479..00000000000
--- a/mcs/errors/cs0066.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// cs0066.cs : 'Button.Click' : event must be of a delegate type
-// Line : 10
-
-using System;
-
-public delegate void EventHandler (object sender, EventArgs e);
-
-public class Button {
-
- public event Blah Click;
-
- public void Reset ()
- {
- Click = null;
- }
-}
-
-public class Blah {
-
- public static void Main ()
- {
- Blah b = new Blah ();
- }
-
-}
diff --git a/mcs/errors/cs0070.cs b/mcs/errors/cs0070.cs
deleted file mode 100644
index 826c97b301a..00000000000
--- a/mcs/errors/cs0070.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// cs0070.cs : The event 'Click' can only appear on the left-side of a += or -= (except when used from within the type 'Button')
-// Line : 20
-
-using System;
-
-public delegate void EventHandler (int i, int j);
-
-public class Button {
-
- public event EventHandler Click;
-
-}
-
-public class Blah {
-
- Button Button1 = new Button ();
-
- public void Connect ()
- {
- Button1.Click = new EventHandler (Button1_Click);
- }
-
- public void Button1_Click (int i, int j)
- {
- }
-
- public static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0107.cs b/mcs/errors/cs0107.cs
deleted file mode 100755
index fd02f7e2c2a..00000000000
--- a/mcs/errors/cs0107.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-// cs0107.cs: More than one protection modifier
-// Line: 4
-class X {
- public private class X {
- }
-}
diff --git a/mcs/errors/cs0108.cs b/mcs/errors/cs0108.cs
deleted file mode 100755
index a516acc7d38..00000000000
--- a/mcs/errors/cs0108.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0108.cs: The new keyword is required on MEMBER because it hides MEMBER2
-// Line:
-
-class Base {
- public void F () {}
-}
-
-class Derived : Base {
- void F () {}
-}
diff --git a/mcs/errors/cs0110.cs b/mcs/errors/cs0110.cs
deleted file mode 100755
index 81abb2390f3..00000000000
--- a/mcs/errors/cs0110.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-class A {
- int a;
-
- class B {
- int b;
-
- class C {
- int c;
-
- void m ()
- {
- c = 1;
- }
-
- enum F {
- A, B, C, D = X, E
- }
-
- const int X = Y + 1;
- const int Y = 1 + (int) F.E;
- }
- }
-
- static int Main (string [] args)
- {
- return 0;
- }
-
-}
diff --git a/mcs/errors/cs0111.cs b/mcs/errors/cs0111.cs
deleted file mode 100644
index 968e204f64a..00000000000
--- a/mcs/errors/cs0111.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// cs111.cs : Class `Blah' already contains a definition with the same return value and parameter types for method `Foo'
-// Line : 10
-
-public class Blah {
-
- static public void Foo (int i, int j)
- {
- }
-
- static public void Foo (int i, int j)
- {
- }
-
- public static void Main ()
- {
- int i = 1;
- int j = 2;
-
- Foo (i, j);
- }
-}
diff --git a/mcs/errors/cs0113.cs b/mcs/errors/cs0113.cs
deleted file mode 100755
index 6ddf367cf5d..00000000000
--- a/mcs/errors/cs0113.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-class X {
- public virtual override void Y () {}
-}
diff --git a/mcs/errors/cs0114.cs b/mcs/errors/cs0114.cs
deleted file mode 100755
index a617710997d..00000000000
--- a/mcs/errors/cs0114.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0114.cs: Y.XX hides inherited member X.XX. Must use `override' or `new' keyword
-// Line: 8
-public abstract class X {
- public abstract void XX ();
-}
-
-class Y : X {
- void XX () {}
-}
diff --git a/mcs/errors/cs0115.cs b/mcs/errors/cs0115.cs
deleted file mode 100755
index f3ae9aa468d..00000000000
--- a/mcs/errors/cs0115.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-class X {
- public override void Bla ()
- {
- }
-}
diff --git a/mcs/errors/cs0117.cs b/mcs/errors/cs0117.cs
deleted file mode 100755
index 7b942b47625..00000000000
--- a/mcs/errors/cs0117.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0117: `int' does not contain a definition for 'E'.
-// Line: 7
-
-class T {
- public static int Main (string [] args )
- {
- int x = 1.E;
- return 0;
- }
-}
diff --git a/mcs/errors/cs0118.cs b/mcs/errors/cs0118.cs
deleted file mode 100755
index bd3afe1a62a..00000000000
--- a/mcs/errors/cs0118.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0118.cs: X.s denotes a 'field' where a class was expected
-// Line: 6
-class X {
- string s;
-
- s MyProperty {
- get {
- return s;
- }
- }
-}
diff --git a/mcs/errors/cs0120.cs b/mcs/errors/cs0120.cs
deleted file mode 100755
index 817b2d5ea35..00000000000
--- a/mcs/errors/cs0120.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0120: Ie, a static method invoking a non-static method
-// `An object reference is required for the nonstatic field, method or property test.method()
-// Line: 11
-
-class test {
-
- void method ()
- {
- }
-
- public static int Main (string [] args){
- method ();
- return 1;
- }
-}
diff --git a/mcs/errors/cs0121.cs b/mcs/errors/cs0121.cs
deleted file mode 100755
index 7a8797ee680..00000000000
--- a/mcs/errors/cs0121.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// cs0121.cs: ambigous call when selecting function due to implicit casts
-// Line: 15
-
-class X {
- static void a (int i, double d)
- {
- }
-
- static void a (double d, int i)
- {
- }
-
- public static void Main ()
- {
- a (0, 0);
- }
-}
diff --git a/mcs/errors/cs0126.cs b/mcs/errors/cs0126.cs
deleted file mode 100644
index 2742abfdb09..00000000000
--- a/mcs/errors/cs0126.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0126: an object of type `int' is expected in the return statement
-// Line: 7
-
-class X {
- int X ()
- {
- return;
- }
-}
diff --git a/mcs/errors/cs0127.cs b/mcs/errors/cs0127.cs
deleted file mode 100755
index 2a72c6a1a3d..00000000000
--- a/mcs/errors/cs0127.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0127.cs: Since 'X.fn' returns void, a return keyword must not be followed by an object expression
-// Line: 6
-class X {
- void fn ()
- {
- return 1;
- }
-}
diff --git a/mcs/errors/cs0128.cs b/mcs/errors/cs0128.cs
deleted file mode 100755
index 09a3d042f99..00000000000
--- a/mcs/errors/cs0128.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0128: a local variable named `x' is already defined in this scope
-// Line:
-
-class x {
- static int y ()
- {
- int x = 1;
- int x = 2;
-
- return x + x;
- }
-}
diff --git a/mcs/errors/cs0131.cs b/mcs/errors/cs0131.cs
deleted file mode 100755
index ef025a2039a..00000000000
--- a/mcs/errors/cs0131.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0131.cs: left hand side of an assignment must be variable, property access or indexer
-// Line:
-class X {
- void A ()
- {
- 5 = 4;
- }
-}
diff --git a/mcs/errors/cs0132.cs b/mcs/errors/cs0132.cs
deleted file mode 100755
index 1b4ebf2c7b4..00000000000
--- a/mcs/errors/cs0132.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0132.cs: A static parameter must not have any parameters
-// Line: 4
-class X {
- static X (int x)
- {
- }
-}
diff --git a/mcs/errors/cs0133.cs b/mcs/errors/cs0133.cs
deleted file mode 100755
index a8d0e08abe7..00000000000
--- a/mcs/errors/cs0133.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0133.cs: the expression being assigned to `x' must be constant
-// Line: 6
-class X {
- X (int arg)
- {
- const int x = arg;
- }
-}
diff --git a/mcs/errors/cs0136-2.cs b/mcs/errors/cs0136-2.cs
deleted file mode 100755
index 4dc9d547e32..00000000000
--- a/mcs/errors/cs0136-2.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0136.cs: local variable j can not be declared, because there is something with that name already
-// Line: 5
-class X {
- public static void Bar (int j, params int [] args)
- {
- foreach (int j in args)
- ;
- }
-}
diff --git a/mcs/errors/cs0136.cs b/mcs/errors/cs0136.cs
deleted file mode 100755
index 3927a72616b..00000000000
--- a/mcs/errors/cs0136.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0136: A local variable named 'i' cannot be declared in this scope because it would give a different meaning to 'i'
-// Line: 8
-class X {
- void b ()
- {
- int i;
- {
- string i;
- }
- }
-}
-
-
diff --git a/mcs/errors/cs0139.cs b/mcs/errors/cs0139.cs
deleted file mode 100644
index 11eb5d7f750..00000000000
--- a/mcs/errors/cs0139.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0139.cs: No loop to exit to in continue or break.
-// Line: 6
-class X {
- void A ()
- {
- continue;
- }
-}
diff --git a/mcs/errors/cs0146.cs b/mcs/errors/cs0146.cs
deleted file mode 100644
index 8b81c046864..00000000000
--- a/mcs/errors/cs0146.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0146.cs: circular class definition
-// Line: 6
-class A : B {
-}
-
-class B : A {
-}
diff --git a/mcs/errors/cs0150.cs b/mcs/errors/cs0150.cs
deleted file mode 100644
index fc67a91086e..00000000000
--- a/mcs/errors/cs0150.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0150.cs :
-// Line :
-
-using System;
-
-public class Blah {
-
- public static void Main ()
- {
- int foo = 6;
-
- int [] i = new int [foo] { 0, 1, 2, 3, 4, 5 };
- }
-}
diff --git a/mcs/errors/cs0151.cs b/mcs/errors/cs0151.cs
deleted file mode 100755
index 03ef7c2e9a9..00000000000
--- a/mcs/errors/cs0151.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// cs0151.cs: An integral value expected
-// Line: 12
-class Y {
- byte b;
-}
-
-class X {
- static void Main ()
- {
- Y y = new Y ();
-
- switch (y){
- case 0:
- break;
- case 1:
- break;
- }
- }
-}
diff --git a/mcs/errors/cs0152.cs b/mcs/errors/cs0152.cs
deleted file mode 100755
index bf2c3e520ec..00000000000
--- a/mcs/errors/cs0152.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0152.cs: The label `case X:' already occurs in this switch statement
-// Line: 9
-class X {
- void f (int i)
- {
- switch (i){
- case 1:
- break;
- case 1:
- break;
- }
- }
-}
diff --git a/mcs/errors/cs0153.cs b/mcs/errors/cs0153.cs
deleted file mode 100755
index c102bfa4672..00000000000
--- a/mcs/errors/cs0153.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0153.cs: goto default only allowed in switch statement
-// Line:
-class X {
- void Main ()
- {
- goto default;
- }
-}
diff --git a/mcs/errors/cs0157.cs b/mcs/errors/cs0157.cs
deleted file mode 100755
index a56dd964da0..00000000000
--- a/mcs/errors/cs0157.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0157.cs: Control can not leave the body of a finally clause
-// Line: 9
-
-class X {
- void A ()
- {
- try {
- } finally {
- return;
- }
- }
-}
diff --git a/mcs/errors/cs0159-2.cs b/mcs/errors/cs0159-2.cs
deleted file mode 100755
index aeb30d78a35..00000000000
--- a/mcs/errors/cs0159-2.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// cs0159-2.cs: No such case 20
-
-class y {
- enum X { A = 1, B = 1, C = 1 }
-
- static void Main ()
- {
- int x = 1;
-
- switch (x){
- case 1: break;
- case 2: goto case 20;
- }
- }
-}
-
diff --git a/mcs/errors/cs0159.cs b/mcs/errors/cs0159.cs
deleted file mode 100755
index 65aa5cb2dfb..00000000000
--- a/mcs/errors/cs0159.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// cs0159.cs: No default target for goto default
-// Line:
-
-class X {
-
- static int m (int n)
- {
- switch (n){
- case 0:
- goto default;
-
- case 1:
- return 1;
- }
-
- return 10;
- }
-
- static void Main ()
- {
- m (1);
- }
-}
diff --git a/mcs/errors/cs0164.cs b/mcs/errors/cs0164.cs
deleted file mode 100755
index dbb530460a9..00000000000
--- a/mcs/errors/cs0164.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0164.cs: This label has not been referenced
-// Line: 5
-class X {
- void D () {
- a:
-
- return;
- }
-}
diff --git a/mcs/errors/cs0165-2.cs b/mcs/errors/cs0165-2.cs
deleted file mode 100755
index 3d0d3a9e2af..00000000000
--- a/mcs/errors/cs0165-2.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-class T {
- void fun (ref int a)
- {
- if (a == 3)
- a = 2;
- }
-
- void x ()
- {
- int x;
-
- if (System.Console.Read () == 1)
- x = 1;
- fun (ref x);
- }
-}
diff --git a/mcs/errors/cs0165.cs b/mcs/errors/cs0165.cs
deleted file mode 100755
index 48b7c52558d..00000000000
--- a/mcs/errors/cs0165.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0165.cs: Use of unassigned local variable
-// Line: 9
-
-class T {
- public T ()
- {
- int errors;
-
- errors += 1;
- }
-}
diff --git a/mcs/errors/cs0169.cs b/mcs/errors/cs0169.cs
deleted file mode 100755
index bcd47c81491..00000000000
--- a/mcs/errors/cs0169.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0169.cs: warning, private field `prv' is never used
-// Line: 4
-class X {
- int x;
-
- void blah ()
- {
- }
-
- static void Main () {}
-}
diff --git a/mcs/errors/cs0171.cs b/mcs/errors/cs0171.cs
deleted file mode 100755
index 5b2b2343b2a..00000000000
--- a/mcs/errors/cs0171.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0171.cs: field x must be initialized before constructor X ends.
-// Line:
-struct X {
- public readonly int x;
-
- X (int a)
- {
- }
-
- static void Main () {}
-}
diff --git a/mcs/errors/cs0172.cs b/mcs/errors/cs0172.cs
deleted file mode 100755
index c0496e9b83f..00000000000
--- a/mcs/errors/cs0172.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-class X {
- public static implicit operator X (Y y)
- {
- return null;
- }
-}
-
-class Y {
- public static implicit operator Y (X x)
- {
- return null;
- }
-}
-
-class Main
-{
- static void Main ()
- {
- X x = new X ();
- Y y = new Y ();
-
- object d = (x == x) ? x : y;
- }
-
-}
diff --git a/mcs/errors/cs0176.cs b/mcs/errors/cs0176.cs
deleted file mode 100755
index 160d301788e..00000000000
--- a/mcs/errors/cs0176.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0176.cs: cannot be accessed with an instance reference, use typename instead
-// Line: 12
-class X {
- static void void_method ()
- {
- }
-}
-
-class Y {
- void m (X arg)
- {
- arg.void_method ();
- }
-}
diff --git a/mcs/errors/cs0178.cs b/mcs/errors/cs0178.cs
deleted file mode 100644
index 47be8ec08a7..00000000000
--- a/mcs/errors/cs0178.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0178.cs :
-// Line :
-
-using System;
-
-public class Blah {
-
- public static void Main ()
- {
- int [,] i = new int [4,2] { 0, 1, 2, 3, 4, 5 };
- }
-}
diff --git a/mcs/errors/cs0179.cs b/mcs/errors/cs0179.cs
deleted file mode 100755
index ed7eee8895b..00000000000
--- a/mcs/errors/cs0179.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0179.cs: member can not be declared extern and have a body
-// Line:
-
-class X {
-
- public extern int extern_method ()
- {
- }
-
- public static void Main ()
- {
- }
-}
-
diff --git a/mcs/errors/cs0180.cs b/mcs/errors/cs0180.cs
deleted file mode 100755
index 7f1714e7331..00000000000
--- a/mcs/errors/cs0180.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0179.cs: member can not be declared extern and abstract
-// Line:
-
-class X {
-
- public extern abstract int extern_method ();
-
- public static void Main ()
- {
- }
-}
-
diff --git a/mcs/errors/cs0183.cs b/mcs/errors/cs0183.cs
deleted file mode 100755
index 228445ff6b7..00000000000
--- a/mcs/errors/cs0183.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0183.cs: the expression is always of the type `x'
-// Line:
-
-class X {
-
- static void Main ()
- {
- int i;
-
- if (i is int){
- }
- }
-}
diff --git a/mcs/errors/cs0184.cs b/mcs/errors/cs0184.cs
deleted file mode 100755
index 014b945f21b..00000000000
--- a/mcs/errors/cs0184.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0184.cs: The expression is never of the provided type
-// Line:
-
-class X {
-
- static void Main ()
- {
- int a;
-
- if (a is byte){
- }
- }
-}
diff --git a/mcs/errors/cs0185.cs b/mcs/errors/cs0185.cs
deleted file mode 100755
index 6efb95560a6..00000000000
--- a/mcs/errors/cs0185.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0185.cs: object is not a reference type (as expected by lock)
-// Line:
-
-class X {
- static void Main ()
- {
- lock (5) {
- }
- }
-}
-
diff --git a/mcs/errors/cs0187.cs b/mcs/errors/cs0187.cs
deleted file mode 100755
index dd9562abd70..00000000000
--- a/mcs/errors/cs0187.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-class X {
- static void Main ()
- {
- X x = new X();
-
- x++;
- }
-}
diff --git a/mcs/errors/cs0196.cs b/mcs/errors/cs0196.cs
deleted file mode 100755
index edf4e6fd54e..00000000000
--- a/mcs/errors/cs0196.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0196.cs: pointers must be indexed by a single value
-// line: 8
-using System;
-unsafe class ZZ {
- static void Main () {
- int *p = null;
-
- if (p [10,4] == 4)
- ;
- }
-}
diff --git a/mcs/errors/cs0200.cs b/mcs/errors/cs0200.cs
deleted file mode 100755
index 87ec5c6786f..00000000000
--- a/mcs/errors/cs0200.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0200: can not assign to property X.P -- it is readonly
-// line: 12
-class X {
- static int P {
- get {
- return 1;
- }
- }
-
- static int Main ()
- {
- P = 10;
- return 1;
- }
-}
diff --git a/mcs/errors/cs0206.cs b/mcs/errors/cs0206.cs
deleted file mode 100755
index 03c79bf1a9a..00000000000
--- a/mcs/errors/cs0206.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// cs0206.cs: indexers or properties can not be used as ref or out arguments
-// Line:
-class X {
- static int P { get { return 1; } set { } }
-
- static int m (out int v)
- {
- v = 1;
- return 1;
- }
-
- static void Main ()
- {
- m (out P);
- }
-}
diff --git a/mcs/errors/cs0214.cs b/mcs/errors/cs0214.cs
deleted file mode 100644
index 08eb088af39..00000000000
--- a/mcs/errors/cs0214.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-// cs0214: Pointer can only be used in unsafe context
-// Line: 4
-class X {
- void *a;
-}
diff --git a/mcs/errors/cs0215.cs b/mcs/errors/cs0215.cs
deleted file mode 100644
index 3c875505e94..00000000000
--- a/mcs/errors/cs0215.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0215.cs : The return type of operator True or False must be bool
-// Line : 11
-
-class Blah {
-
- public static void Main ()
- {
-
- }
-
- public static int operator true (Blah i) {}
-
-}
diff --git a/mcs/errors/cs0216.cs b/mcs/errors/cs0216.cs
deleted file mode 100644
index c218c51f20d..00000000000
--- a/mcs/errors/cs0216.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0216.cs: If you define operator <, you also need to define >
-// Line:
-class X {
- public static X operator < (X a, int b)
- {
- return null;
- }
-}
-
diff --git a/mcs/errors/cs0234.cs b/mcs/errors/cs0234.cs
deleted file mode 100755
index 3ef7cfab0bc..00000000000
--- a/mcs/errors/cs0234.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-//cs0243: NonExistant does not exist in this namespace
-
-using Nonexistant;
-
diff --git a/mcs/errors/cs0239.cs b/mcs/errors/cs0239.cs
deleted file mode 100644
index 0f3608643bc..00000000000
--- a/mcs/errors/cs0239.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// cs0239.cs : `X.MyMethod' : cannot override inherited member `Bar.MyMethod' because it is sealed.
-// Line : 25
-
-using System;
-
-public class Foo {
-
- public virtual void MyMethod ()
- {
- Console.WriteLine ("This is me !");
- }
-}
-
-public class Bar : Foo {
-
- public sealed override void MyMethod ()
- {
-
- }
-
-}
-
-public class X : Bar {
-
- public override void MyMethod ()
- {
-
- }
-
- public static void Main ()
- {
-
- }
-}
diff --git a/mcs/errors/cs0242.cs b/mcs/errors/cs0242.cs
deleted file mode 100755
index 2a927d86b6e..00000000000
--- a/mcs/errors/cs0242.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0242: operation is not defined for void *
-// Line: 8
-using System;
-unsafe class ZZ {
- static void Main () {
- void *p = null;
-
- if (p [10] == 4)
- ;
- }
-}
diff --git a/mcs/errors/cs0246.cs b/mcs/errors/cs0246.cs
deleted file mode 100644
index 8cf6b9a081d..00000000000
--- a/mcs/errors/cs0246.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs0246.cs: can not find type `B'
-// Line: 4
-interface A : B {
-}
diff --git a/mcs/errors/cs0255.cs b/mcs/errors/cs0255.cs
deleted file mode 100755
index 10e2045385e..00000000000
--- a/mcs/errors/cs0255.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0255.cs: Can not use stackalloc in finally or catch
-// Line: 10
-unsafe class X {
- string s;
-
- static void Main ()
- {
- try {
- } catch {
- char *ptr = stackalloc char [10U];
-}
- }
-}
diff --git a/mcs/errors/cs0501.cs b/mcs/errors/cs0501.cs
deleted file mode 100755
index 1448d79e91e..00000000000
--- a/mcs/errors/cs0501.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-// cs0501.cs: `Class.X' must declare a body because it is not marked abstract or extern
-// Line: 4
-class Class {
- virtual public void X ();
-}
diff --git a/mcs/errors/cs0503.cs b/mcs/errors/cs0503.cs
deleted file mode 100755
index e8e8e048568..00000000000
--- a/mcs/errors/cs0503.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-// cs0503.cs: The abstract method `Class.X' cannot be marked virtual
-// Line: 4
-abstract class Class {
- virtual abstract public void X ();
-}
diff --git a/mcs/errors/cs0509.cs b/mcs/errors/cs0509.cs
deleted file mode 100644
index f89988f2cb3..00000000000
--- a/mcs/errors/cs0509.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0509.cs: base class is sealed
-// Line: 7
-struct V {
- int v;
-}
-
-class X : V {
-}
diff --git a/mcs/errors/cs0513.cs b/mcs/errors/cs0513.cs
deleted file mode 100755
index d2664371b04..00000000000
--- a/mcs/errors/cs0513.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0513.cs: X.myAbstract is abstract but it is contained in non-abstract class
-// Line: 5
-
-class X {
- public abstract void myAbstract ();
-}
-
-class Y : X {
-}
-
diff --git a/mcs/errors/cs0515.cs b/mcs/errors/cs0515.cs
deleted file mode 100755
index 3ffb5c7b0bd..00000000000
--- a/mcs/errors/cs0515.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0515.cs: access modifiers are not allowed on static constructors
-// Line: 4
-class X {
- public static X ()
- {
- }
-}
diff --git a/mcs/errors/cs0523.cs b/mcs/errors/cs0523.cs
deleted file mode 100755
index 43b016e6264..00000000000
--- a/mcs/errors/cs0523.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0523.cs: circular structure definition
-//
-
-struct A {
- B b;
-}
-
-struct B {
- A a;
-}
-
-class Y { static void Main () {} }
diff --git a/mcs/errors/cs0527-2.cs b/mcs/errors/cs0527-2.cs
deleted file mode 100644
index e312377061b..00000000000
--- a/mcs/errors/cs0527-2.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-class A1 {
-}
-
-class A2 {
-}
-
-class B : A1, A2 {
-}
diff --git a/mcs/errors/cs0527.cs b/mcs/errors/cs0527.cs
deleted file mode 100644
index 994add02c67..00000000000
--- a/mcs/errors/cs0527.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0527: type in interface list is not an interface
-// Line: 6
-class X {
-}
-
-interface A : X {
-}
diff --git a/mcs/errors/cs0529.cs b/mcs/errors/cs0529.cs
deleted file mode 100644
index 52e725162d0..00000000000
--- a/mcs/errors/cs0529.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0529: Recursive interface definition
-// Line: 3
-interface A : B {
-}
-
-interface B : A {
-}
diff --git a/mcs/errors/cs0534.cs b/mcs/errors/cs0534.cs
deleted file mode 100755
index fe865887ce1..00000000000
--- a/mcs/errors/cs0534.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0534.cs: `Y' does not implement inherited abstract member `myAbstract'
-// Line: 5
-
-abstract class X {
- public abstract void myAbstract ();
-}
-
-class Y : X {
-static void Main (){}
-}
-
diff --git a/mcs/errors/cs0542.cs b/mcs/errors/cs0542.cs
deleted file mode 100755
index 61bcdcd88e3..00000000000
--- a/mcs/errors/cs0542.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-// cs0542.cs: member names can not be the same as their enclosing type
-// Line: 4
-class X {
- int X;
-}
-
diff --git a/mcs/errors/cs0543.cs b/mcs/errors/cs0543.cs
deleted file mode 100644
index b59d0e834f5..00000000000
--- a/mcs/errors/cs0543.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1008.cs : Enumerator value for 'Bar' is too large to fit in its type
-// Line : 9
-
-public class Blah {
-
- public enum MyEnum : byte {
- Foo = 255,
- Bar
- }
-
- public static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0552.cs b/mcs/errors/cs0552.cs
deleted file mode 100755
index 7fe395005de..00000000000
--- a/mcs/errors/cs0552.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// cs0552.cs: user-defined conversion to/from interface
-// Line: 12
-//
-using System;
-using System.IO;
-
-//
-//
-// Implicit conversion to an interface is not permitted
-//
-class NoIDispose {
- public static implicit operator IDisposable (NoIDispose a)
- {
- return a.x;
- }
-}
-
diff --git a/mcs/errors/cs0555.cs b/mcs/errors/cs0555.cs
deleted file mode 100644
index 110f952d25f..00000000000
--- a/mcs/errors/cs0555.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0555.cs : User-defined conversion cannot take an object of the enclosing type
-// and convert to an object of the enclosing type
-// Line : 8
-
-class Blah {
-
- public static void Main () {}
-
- public static implicit operator Blah (Blah i) {}
-
-}
diff --git a/mcs/errors/cs0556.cs b/mcs/errors/cs0556.cs
deleted file mode 100644
index 36ff437d65b..00000000000
--- a/mcs/errors/cs0556.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0556.cs : User-defined conversion must convert to or from the enclosing type
-// Line : 8
-
-class Blah {
-
- public static void Main () {}
-
- public static implicit operator int (int i) {}
-
-}
diff --git a/mcs/errors/cs0563.cs b/mcs/errors/cs0563.cs
deleted file mode 100644
index af369883b2c..00000000000
--- a/mcs/errors/cs0563.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0563.cs: One of the parameters to the binary operator should be the containing type
-// Line: 4
-class X {
- public static int operator + (int a, int b)
- {
- }
-}
diff --git a/mcs/errors/cs0574.cs b/mcs/errors/cs0574.cs
deleted file mode 100755
index 1b88bf0173f..00000000000
--- a/mcs/errors/cs0574.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0574.cs: Name of destructor must match name of class:
-// Line: 6
-
-class X {
-
- ~Y ()
- {
- }
-
- static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0575.cs b/mcs/errors/cs0575.cs
deleted file mode 100755
index 16d0b7aa49e..00000000000
--- a/mcs/errors/cs0575.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0575.cs: destructors are only allowed in class types
-// Line: 5
-struct X {
-
- ~X ()
- {
- }
-
- static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0592.cs b/mcs/errors/cs0592.cs
deleted file mode 100644
index 02dd459cdbe..00000000000
--- a/mcs/errors/cs0592.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// cs0592.cs : Attribute 'Simple' is not valid on this declaration type. It is valid on 'constructor' declarations only.
-// Line : 22
-
-using System;
-
-[AttributeUsage (AttributeTargets.Constructor, AllowMultiple = true)]
- public class SimpleAttribute : Attribute {
-
- string name = null;
-
- public string MyNamedArg;
-
- public SimpleAttribute (string name)
- {
- this.name = name;
- }
-
-
- }
-
-[Simple ("Dummy", MyNamedArg = "Dude!")]
- public class Blah {
-
- public static void Main ()
- {
- }
- }
-
-
diff --git a/mcs/errors/cs0617.cs b/mcs/errors/cs0617.cs
deleted file mode 100644
index e75266d9d1f..00000000000
--- a/mcs/errors/cs0617.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// cs0617,cs : 'MyNamedArg' is not a valid named attribute argument. Named attribute arguments must be fields which are not readonly, static or const, or properties with a set accessor which are not static.
-// Line : 20
-
-using System;
-
-[AttributeUsage (AttributeTargets.Class, AllowMultiple = true)]
- public class SimpleAttribute : Attribute {
-
- string name = null;
-
- public readonly string MyNamedArg;
-
- public SimpleAttribute (string name)
- {
- this.name = name;
- }
-
- }
-
-[Simple ("Dummy", MyNamedArg = "Dude!")]
- public class Blah {
-
- public static void Main ()
- {
- }
- }
diff --git a/mcs/errors/cs0621.cs b/mcs/errors/cs0621.cs
deleted file mode 100755
index 87bc932088c..00000000000
--- a/mcs/errors/cs0621.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-// cs0621.cs: X.method virtual or abstract methods can not be private
-// Line:
-class X {
- virtual void method () {}
-}
diff --git a/mcs/errors/cs0642.cs b/mcs/errors/cs0642.cs
deleted file mode 100755
index 9c73cd6baf1..00000000000
--- a/mcs/errors/cs0642.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-class X{
- static void Main ()
- {
- if (true);
- }
-}
diff --git a/mcs/errors/cs0644.cs b/mcs/errors/cs0644.cs
deleted file mode 100755
index 5e93f4ef509..00000000000
--- a/mcs/errors/cs0644.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs0644.cs: Cannot inherit from special class
-// Line: 3
-class X : System.ValueType {
-}
diff --git a/mcs/errors/cs0645.cs b/mcs/errors/cs0645.cs
deleted file mode 100755
index ff866d9dcad..00000000000
--- a/mcs/errors/cs0645.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs0645.cs: identifier too long
-// Line: 3
-class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa {
-}
diff --git a/mcs/errors/cs0646.cs b/mcs/errors/cs0646.cs
deleted file mode 100644
index 78b7f4e3c77..00000000000
--- a/mcs/errors/cs0646.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// cs0646.cs : Cannot specify the DefaultMember attribute on a type containing an indexer
-// Line : 8
-
-using System;
-using System.Reflection;
-
-[DefaultMember ("Item")]
-public class Foo {
-
- string bar;
-
- public static void Main ()
- {
- Console.WriteLine ("foo");
- }
-
- string this [int idx] {
- get {
- return "foo";
- }
- set {
- bar = value;
- }
- }
-}
-
diff --git a/mcs/errors/cs0649.cs b/mcs/errors/cs0649.cs
deleted file mode 100755
index 1642edd35bb..00000000000
--- a/mcs/errors/cs0649.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0649.cs: Field `X.s' is never assigned to, and will always have its default value null
-// Line: 4
-class X {
- string s;
-
- string Value {
- get {
- return s;
- }
- }
-}
diff --git a/mcs/errors/cs0654.cs b/mcs/errors/cs0654.cs
deleted file mode 100755
index 9622867128b..00000000000
--- a/mcs/errors/cs0654.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0654.cs: Method referenced without argument list.
-// Line: 12
-class X {
- int a (int a)
- {
- return 0;
- }
-
- void b ()
- {
- int x = a;
- }
-}
diff --git a/mcs/errors/cs0658.cs b/mcs/errors/cs0658.cs
deleted file mode 100644
index e4da1e82b72..00000000000
--- a/mcs/errors/cs0658.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// cs0658.cs : Invalid attribute location "blah"
-// Line : 8
-
-public class MyClass {
-
- delegate int MyDelegate (int i, int j);
-
- [blah:Help("blah")]
- public static MyClass operator/ (MyClass i, MyClass j)
- {
-
- }
-
- public static implicit operator MyClass (Object o)
- {
-
- }
-}
diff --git a/mcs/errors/cs0664.cs b/mcs/errors/cs0664.cs
deleted file mode 100755
index daa1f39b717..00000000000
--- a/mcs/errors/cs0664.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0664.cs: Literal of type double cannot be implicity converted to Float, use F suffix
-// Line: 6
-class X {
- void A ()
- {
- float f = 2.0;
- }
-}
diff --git a/mcs/errors/cs0677.cs b/mcs/errors/cs0677.cs
deleted file mode 100755
index 822724a9b53..00000000000
--- a/mcs/errors/cs0677.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0677.cs: X.a volatile field can not be of type "A"
-// Line: 8
-using System;
-
-struct A { int a; }
-
-class X {
- public volatile A a;
- static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs1001.cs b/mcs/errors/cs1001.cs
deleted file mode 100755
index d9fa6b29d28..00000000000
--- a/mcs/errors/cs1001.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// cs1001: identifier expected
-// Line: 8
-
-class T {
-
- // Change (args) to (string args) to fix it
- public static int Main (args)
- {
- }
-}
diff --git a/mcs/errors/cs1002.cs b/mcs/errors/cs1002.cs
deleted file mode 100755
index 65de1280ea9..00000000000
--- a/mcs/errors/cs1002.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs1002.cs: ; expected
-// Line: 8
-
-class T {
- void member ()
- {
- int a = 1 | 2
- int b;
- }
-}
diff --git a/mcs/errors/cs1008.cs b/mcs/errors/cs1008.cs
deleted file mode 100644
index 3c49e166dd8..00000000000
--- a/mcs/errors/cs1008.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1008.cs : Type byte, sbyte, short, ushort, int, uint, long, or ulong expected
-// Line : 7
-
-public class Blah {
-
- public enum MyEnum {
- Foo = "foo",
- Bar
- }
-
- public static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs1011.cs b/mcs/errors/cs1011.cs
deleted file mode 100755
index ce78e701617..00000000000
--- a/mcs/errors/cs1011.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-// cs1011: Empty character literal
-// Line: 5
-
-class T {
- char c = '';
-}
diff --git a/mcs/errors/cs1012.cs b/mcs/errors/cs1012.cs
deleted file mode 100755
index 61e65b63a88..00000000000
--- a/mcs/errors/cs1012.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-// cs1012: Too many characters in character literal
-// Line: 5
-
-class x {
- char x = 'xx';
-}
diff --git a/mcs/errors/cs1019.cs b/mcs/errors/cs1019.cs
deleted file mode 100644
index 4fe30f842f7..00000000000
--- a/mcs/errors/cs1019.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// cs1019.cs : Overloadable unary operator expected
-// Line : 18
-
-public class MyClass {
-
- public int this[int ndx]
- {
- get { }
- set { }
- }
-
- public event EventHandler Click
- {
- add { }
- remove { }
- }
-
- public static MyClass operator/ (MyClass i)
- {
-
- }
-
- public static implicit operator MyClass (Object o)
- {
-
- }
-}
diff --git a/mcs/errors/cs102.cs b/mcs/errors/cs102.cs
deleted file mode 100755
index 68f366156f3..00000000000
--- a/mcs/errors/cs102.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs102.cs: The class 'X' already contains a definition for 'A'
-// Line: 6
-class X {
- const int A = 10;
-
- int A () {}
-}
diff --git a/mcs/errors/cs1020.cs b/mcs/errors/cs1020.cs
deleted file mode 100644
index 891a613331f..00000000000
--- a/mcs/errors/cs1020.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// cs1020.cs : Overloadable binary operator expected
-// Line : 19
-
-
-public class MyClass {
-
- public int this[int ndx]
- {
- get { }
- set { }
- }
-
- public event EventHandler Click
- {
- add { }
- remove { }
- }
-
- public static MyClass operator++ (MyClass i, MyClass j)
- {
-
- }
-
- public static implicit operator MyClass (Object o)
- {
-
- }
-}
diff --git a/mcs/errors/cs1501.cs b/mcs/errors/cs1501.cs
deleted file mode 100755
index 10342181e28..00000000000
--- a/mcs/errors/cs1501.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs1501.cs: No overload for method `Base' takes `0' arguments
-// Line: 12
-class Base {
- Base (string x)
- {
- }
-}
-
-// Notice how there is no invocation to "base (something)"
-
-class Derived : Base {
- Derived ()
- {
- }
-}
diff --git a/mcs/errors/cs1510.cs b/mcs/errors/cs1510.cs
deleted file mode 100755
index 4feba3810f6..00000000000
--- a/mcs/errors/cs1510.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs1510: an lvalue is required for ref or out argument
-// Line: 11
-class X {
- public static void m (ref int i)
- {
- i++;
- }
-
- static void Main ()
- {
- m (ref 4);
- }
-}
diff --git a/mcs/errors/cs1511.cs b/mcs/errors/cs1511.cs
deleted file mode 100755
index 4ec26c689b4..00000000000
--- a/mcs/errors/cs1511.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1511.cs: Base modifier not allowed in static code
-// Line:
-
-class Y {
- public int a;
-}
-
-class X : Y {
-
- static void Main ()
- {
- base.a = 1;
- }
-}
diff --git a/mcs/errors/cs1513.cs b/mcs/errors/cs1513.cs
deleted file mode 100755
index 819528ced96..00000000000
--- a/mcs/errors/cs1513.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace X {
-
-
diff --git a/mcs/errors/cs1518.cs b/mcs/errors/cs1518.cs
deleted file mode 100755
index 89036e1ee62..00000000000
--- a/mcs/errors/cs1518.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-//cs1518.cs: namespace can only contain class, interface, enum, struct or delegate
-// Line: 5
-namespace X {
-
- sealed fe {}
-}
diff --git a/mcs/errors/cs1520.cs b/mcs/errors/cs1520.cs
deleted file mode 100755
index 23dbafd0fcc..00000000000
--- a/mcs/errors/cs1520.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// cs1520: Class, struct or interface method must have a return type
-// Line: 9
-
-class test {
-
- // To fix add a return type
-
- public static Main (string[] args)
- {
- }
-}
diff --git a/mcs/errors/cs1523.cs b/mcs/errors/cs1523.cs
deleted file mode 100755
index fda07fd98f6..00000000000
--- a/mcs/errors/cs1523.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1523: case or default must precede code in switch statement
-// Line: 11
-
-class X {
-
- static void Main ()
- {
- int i = 0;
-
- switch (i){
- i = 4;
- }
- }
-}
diff --git a/mcs/errors/cs1524.cs b/mcs/errors/cs1524.cs
deleted file mode 100755
index b43976cc0bd..00000000000
--- a/mcs/errors/cs1524.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs1524.cs: expected catch or finally
-// Line: 12
-
-namespace Test {
- public class Test {
- public static int Main () {
- int a;
- try {
- a = 1;
- }
-
- return 0;
- }
- }
-}
diff --git a/mcs/errors/cs1525.cs b/mcs/errors/cs1525.cs
deleted file mode 100755
index dc1459ceac0..00000000000
--- a/mcs/errors/cs1525.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs1525: Invalid expression term.
-// Line: 7
-class X {
- X ()
- {
- label1:
- }
-}
diff --git a/mcs/errors/cs1526.cs b/mcs/errors/cs1526.cs
deleted file mode 100755
index 582d451ea89..00000000000
--- a/mcs/errors/cs1526.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs1526: new expression requires () or [] after type
-// Line: 6
-class X {
- static void Main ()
- {
- X x = new X;
- }
-}
diff --git a/mcs/errors/cs1527.cs b/mcs/errors/cs1527.cs
deleted file mode 100755
index 663f880cd58..00000000000
--- a/mcs/errors/cs1527.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs1527.cs: namespace elements cant explicitly be declared protected or private
-// Line:
-private class X {
-}
diff --git a/mcs/errors/cs1528.cs b/mcs/errors/cs1528.cs
deleted file mode 100755
index 7223adc8f40..00000000000
--- a/mcs/errors/cs1528.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1528.cs: cant specify constructor arguments in declaration
-// Line:
-class X {
- X (int a)
- {
- }
-}
-
-class Y {
- static void Main ()
- {
- X x (4);
- }
-}
diff --git a/mcs/errors/cs1529.cs b/mcs/errors/cs1529.cs
deleted file mode 100755
index d822cb7cef1..00000000000
--- a/mcs/errors/cs1529.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs1529.cs: Using clause must precede all other namespace elements
-// Line: 4
-class X { }
-using System;
diff --git a/mcs/errors/cs1530.cs b/mcs/errors/cs1530.cs
deleted file mode 100755
index 7ed13b49dcf..00000000000
--- a/mcs/errors/cs1530.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs1530.cs: New not allowed on namespace declarations
-// Line:
-namespace A {
-
- new class X {
- }
-}
diff --git a/mcs/errors/cs1552.cs b/mcs/errors/cs1552.cs
deleted file mode 100755
index b64f87bf1c2..00000000000
--- a/mcs/errors/cs1552.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// cs1552.cs: Array type specified, [] must appear before parameter name
-// Line: 8
-
-class T {
- // To fix: change (string args[]) to (string [] args)
-
- public static int Main (string args[])
- {
- }
-}
diff --git a/mcs/errors/cs1579.cs b/mcs/errors/cs1579.cs
deleted file mode 100755
index 93fc43044af..00000000000
--- a/mcs/errors/cs1579.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs1579.cs: foreach statement cannot operate on variables of type X because X does not contain a definition for GetEnumerator or is not accessible
-// Line: 10
-class X {
-}
-
-class Y {
- void yy (X b)
- {
-
- foreach (object a in b)
- ;
- }
-}
diff --git a/mcs/errors/cs1593.cs b/mcs/errors/cs1593.cs
deleted file mode 100644
index 755cd703170..00000000000
--- a/mcs/errors/cs1593.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// cs1593.cs : Delegate 'Blah.MyDelegate' does not take '1' arguments
-// Line : 21
-
-using System;
-
-public class Blah {
-
- public delegate int MyDelegate (int i, int j);
-
- public int Foo (int i, int j)
- {
- return i+j;
- }
-
- public static int Main ()
- {
- Blah i = new Blah ();
-
- MyDelegate del = new MyDelegate (i.Foo);
-
- int number = del (2);
-
- if (number == 5)
- return 0;
- else
- return 1;
-
- }
-
-}
diff --git a/mcs/errors/cs1594.cs b/mcs/errors/cs1594.cs
deleted file mode 100644
index 0ffb3d9e761..00000000000
--- a/mcs/errors/cs1594.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// cs1594.cs : Delegate 'Blah.MyDelegate' has some invalid arguments.
-// Line : 21
-
-using System;
-
-public class Blah {
-
- public delegate int MyDelegate (int i, int j);
-
- public int Foo (int i, int j)
- {
- return i+j;
- }
-
- public static int Main ()
- {
- Blah i = new Blah ();
-
- MyDelegate del = new MyDelegate (i.Foo);
-
- int number = del (2, "a string");
-
- if (number == 5)
- return 0;
- else
- return 1;
-
- }
-
-}
diff --git a/mcs/errors/cs1604.cs b/mcs/errors/cs1604.cs
deleted file mode 100755
index 1e87da758a1..00000000000
--- a/mcs/errors/cs1604.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1604.cs: m is a readonly variable
-// line: 10
-using System.IO;
-
-class X {
-
- static void Main ()
- {
- using (MemoryStream m = new MemoryStream ()){
- m = null;
- }
- }
-}
-
diff --git a/mcs/errors/cs5001.cs b/mcs/errors/cs5001.cs
deleted file mode 100755
index 712760b76e0..00000000000
--- a/mcs/errors/cs5001.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-//cs5001: Program x does not have an entry point defined
-
-using System;
-using System.Collections;
-
-namespace Butt {
-}
-
diff --git a/mcs/errors/errors.txt b/mcs/errors/errors.txt
deleted file mode 100755
index 4974d39cdfe..00000000000
--- a/mcs/errors/errors.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-We use negative numbers for the compiler, and leave the possitive
-numbers to match the Microsoft numbers:
-
--1 An Primary Expression was parsed, when a Type was expected.
- This happens because my parser knowledge is limited, and I
- am not good at writing grammars. It is still an error,
- but if I were smarter, I would have found a Bison/Yacc way
- of handling it.
-
--2 Internal error, an interface is being defined inside an
- interface (This should never happen).
-
--3 Constant type is not one of sbyte, byte, short, ushort, int,
- uint, long, ulong, char, float, double, decimal, bool, string, enum
- or null type.
-
--5 A search for a name on a Type returned matches that contain
- methods and non-methods. They have the same name, and I do
- not know how this is possible to begin with.
-
--6 Generic internal compiler error.
-
--7 Internal compiler error/library error: no default constructor
- for a built-in type. Ie, decimal (int 32)
-
--8 User-defined conversion cannot convert from or to object type.
-
--9 User-defined conversion cannot convert from or to an interface type.
-
--10 User-defined conversion cannot convert between types that derive
- from each other.
-
--11 Delegate creation expression takes only one argument
-
--12 More than one integral conversion exists for the type on a
- switch statement.
-
--13 No return with a value found. Warning, since we currently
- do not perform flow analysis, and can not tell whether a
- ret is required or not.
-
--14 Invalid number passed to probe
-
--15 Can not locate default assembly path
-
--16 Can not use System.Enum.ToObject (type, ConstantValue) with
- user defined types. \ No newline at end of file
diff --git a/mcs/errors/fail b/mcs/errors/fail
deleted file mode 100755
index 511cec0bfcb..00000000000
--- a/mcs/errors/fail
+++ /dev/null
@@ -1,53 +0,0 @@
-The following tests failed:
-
-cs0051.cs, cs0060.cs, cs0111.cs
-
-cs0108.cs: We should re-enable the test code in the compiler
-cs0110.cs: Stack overflow in the compiler
-
-cs0118.cs:
- We report the error, but the CSC error gives more information.
-
-cs0121.cs: Function deambiguator does not work here
-cs0136-2.cs cs0136.cs: Similar error reported (reuse of variable name, 128)
-cs0157.cs: Internal compiler error (null pointer reference)
-cs0164.cs: We dont emit the warning for an unused label
-cs0165-2.cs cs0165.cs:
- We need data flow analysis
-
-cs0171.cs
- We do not track unassigned struct fields on struct constructors
-
-cs0216.cs:
- We do not report missing operators.
-
-cs0234.cs:
- Will be hard to fix;
-
-cs0654.cs:
- Compiler crash
-
-cs1001.cs:
- Compiler emits syntax error; Its ok.
-
- Compiler crashes
-cs1501.cs:
- Compiler crashes. Easy to fix
-
-cs1513.cs:
- Syntax error; We could provide better message
-
-cs1518.cs:
- Syntax error; We could provide better message
-
-cs1525.cs:
- Syntax error; We could provide better message
-
-cs1528.cs:
- Syntax error; We could provide better message
-
-cs1529.cs:
- Syntax error; We could provide better message
-
-cs1552.cs:
- Syntax error; We could provide better message
diff --git a/mcs/errors/makefile b/mcs/errors/makefile
deleted file mode 100755
index f51f021bc5f..00000000000
--- a/mcs/errors/makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Compile at the maximum warning level to probe for warnings
-#
-MCS=../mcs/mcs.exe --wlevel 4
-
-all:
- failed=false; \
- for i in cs*.cs; do \
- case $$i in \
- cs[0-9]*-[0-9]*cs) \
- error=`echo $$i | sed -e 's/cs*//' -e 's/.cs//' -e 's/-.*//'`; \
- ;;\
- cs[0-9-]*cs) \
- error=`echo $$i | sed -e 's/cs*//' -e 's/.cs//'`; \
- ;;\
- esac; \
- echo $(MCS) --probe $$error $$i; \
- $(MCS) --probe $$error 1 $$i > /dev/null; \
- code=$$?; \
- if test $$code != 123; then \
- echo Code is: $$code; \
- if [ x$$code = x124 ]; then \
- echo "Compiler failed to flag $$i"; \
- else \
- echo "Compiler failed to compile $$i"; \
- fi; \
- flist="$$flist $$i"; \
- failed=true; \
- else \
- echo test $$i ok; \
- fi; \
- done; \
- if $$failed; then \
- echo "The following tests failed: $$flist"; \
- else \
- echo All tests passed; \
- fi \ No newline at end of file
diff --git a/mcs/jay/.cvsignore b/mcs/jay/.cvsignore
deleted file mode 100755
index 75b36e0911d..00000000000
--- a/mcs/jay/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-jay
-jay.exe
diff --git a/mcs/jay/ACKNOWLEDGEMENTS b/mcs/jay/ACKNOWLEDGEMENTS
deleted file mode 100644
index b66bb250645..00000000000
--- a/mcs/jay/ACKNOWLEDGEMENTS
+++ /dev/null
@@ -1,25 +0,0 @@
- Berkeley Yacc owes much to the unflagging efforts of Keith Bostic.
-His badgering kept me working on it long after I was ready to quit.
-
- Berkeley Yacc is based on the excellent algorithm for computing LALR(1)
-lookaheads developed by Tom Pennello and Frank DeRemer. The algorithm is
-described in their almost impenetrable article in TOPLAS 4,4.
-
- Finally, much of the credit for the latest version must go to those
-who pointed out deficiencies of my earlier releases. Among the most
-prolific contributors were
-
- Benson I. Margulies
- Dave Gentzel
- Antoine Verheijen
- Peter S. Housel
- Dale Smith
- Ozan Yigit
- John Campbell
- Bill Sommerfeld
- Paul Hilfinger
- Gary Bridgewater
- Dave Bakken
- Dan Lanciani
- Richard Sargent
- Parag Patel
diff --git a/mcs/jay/ChangeLog b/mcs/jay/ChangeLog
deleted file mode 100755
index 20b2931583a..00000000000
--- a/mcs/jay/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * makefile: added windows and unix targets.
-
-2001-07-14 Sean MacIsaac <macisaac@ximian.com>
-
- * main.c: fixed error in command line flag -c if it was not first
- option.
-
diff --git a/mcs/jay/NEW_FEATURES b/mcs/jay/NEW_FEATURES
deleted file mode 100644
index b030c625b00..00000000000
--- a/mcs/jay/NEW_FEATURES
+++ /dev/null
@@ -1,46 +0,0 @@
- The -r option has been implemented. The -r option tells Yacc to
-put the read-only tables in y.tab.c and the code and variables in
-y.code.c. Keith Bostic asked for this option so that :yyfix could be
-eliminated.
-
- The -l and -t options have been implemented. The -l option tells
-Yacc not to include #line directives in the code it produces. The -t
-option causes debugging code to be included in the compiled parser.
-
- The code for error recovery has been changed to implement the same
-algorithm as AT&T Yacc. There will still be differences in the way
-error recovery works because AT&T Yacc uses more default reductions
-than Berkeley Yacc.
-
- The environment variable TMPDIR determines the directory where
-temporary files will be created. If TMPDIR is defined, temporary files
-will be created in the directory whose pathname is the value of TMPDIR.
-By default, temporary files are created in /tmp.
-
- The keywords are now case-insensitive. For example, %nonassoc,
-%NONASSOC, %NonAssoc, and %nOnAsSoC are all equivalent.
-
- Commas and semicolons that are not part of C code are treated as
-commentary.
-
- Line-end comments, as in BCPL, are permitted. Line-end comments
-begin with // and end at the next end-of-line. Line-end comments are
-permitted in C code; they are converted to C comments on output.
-
- The form of y.output files has been changed to look more like
-those produced by AT&T Yacc.
-
- A new kind of declaration has been added. The form of the declaration
-is
-
- %ident string
-
-where string is a sequence of characters begining with a double quote
-and ending with either a double quote or the next end-of-line, whichever
-comes first. The declaration will cause a #ident directive to be written
-near the start of the output file.
-
- If a parser has been compiled with debugging code, that code can be
-enabled by setting an environment variable. If the environment variable
-YYDEBUG is set to 0, debugging output is suppressed. If it is set to 1,
-debugging output is written to standard output.
diff --git a/mcs/jay/NOTES b/mcs/jay/NOTES
deleted file mode 100644
index 9db3c96ce1b..00000000000
--- a/mcs/jay/NOTES
+++ /dev/null
@@ -1,9 +0,0 @@
-Berkeley Yacc reflects its origins. The reason so many routines
-use exactly six register variables is that Berkeley Yacc was
-developed on a VAX using PCC. PCC placed at most six variables
-in registers. I went to considerable effort to find which six
-variables most belonged in registers. Changes in machines and
-compilers make that effort worthless, perhaps even harmful.
-
-The code contains many instances where address calculations are
-performed in particular ways to optimize the code for the VAX.
diff --git a/mcs/jay/README b/mcs/jay/README
deleted file mode 100644
index b261173398e..00000000000
--- a/mcs/jay/README
+++ /dev/null
@@ -1,10 +0,0 @@
-This is a port of Jay to C#, the original Jay can be found here:
- http://www.informatik.uni-osnabrueck.de/bernd/jay/
-
-This is a temporary solution as we move to a Bison-generated parser
-as it would provide better error recovery (and error productions
-are broken in my port of Jay).
-
-The original README from Jay is in `README.jay'
-
-Miguel
diff --git a/mcs/jay/README.jay b/mcs/jay/README.jay
deleted file mode 100644
index 94b7b72e6e4..00000000000
--- a/mcs/jay/README.jay
+++ /dev/null
@@ -1,55 +0,0 @@
- This version of Berkeley Yacc was taken from the BSD-Lite CD and targeted
-to Java by
-
- axel.schreiner@informatik.uni-osnabrueck.de
-
-Makefile -> makefile removed Berkeleyisms, call it jay
-defs.h eliminate -dlpr options, %union, output_file, #ident
- eliminate sekeleton.c references
-error.c eliminate %union
-main.c eliminate -dlpr options, %union, output_file
-output.c eliminate -dlpr options, %union, output_file
- fix #define, short, -t/yyDebug
- respell YYERRCODE, YYTABLESIZE, YYFINAL, YYMAXTOKEN
- output trailer last
- switch to filter behaviour
-reader.c eliminate output_file, #ident
- #line -> // line, pass //
- yyvsp[] -> yyVals[yyTop], yyval -> yyVal
-skeleton.c -> skeleton Java skeleton
-test removed
-yacc.1 -> jay.1 adapted
-yyfix.* removed
-
-Types: there is a significant difference. yacc uses %union to cast the value
-stack and <tag> to select alternatives. This works for l- and r-values alike.
-jay uses Object as the value stack and <tag> to set a class. l-values must not
-be cast. $n should not be assigned to, but $$ usually is. $n is referenced,
-but $$ usually is not. Consequently jay casts $n and $<tag>$ but not $<>n
-and $$. This makes assignment to $n references to $$ kludgily possible.
-As another kludge, to prevent 'untyped' messages and to avoid unnecessary
-casts, casts to "Object" are not emitted.
--------------------------------------------------------------------------------
- Berkeley Yacc is an LALR(1) parser generator. Berkeley Yacc has been made
-as compatible as possible with AT&T Yacc. Berkeley Yacc can accept any input
-specification that conforms to the AT&T Yacc documentation. Specifications
-that take advantage of undocumented features of AT&T Yacc will probably be
-rejected.
-
- Berkeley Yacc is distributed with no warranty whatever. The code is certain
-to contain errors. Neither the author nor any contributor takes responsibility
-for any consequences of its use.
-
- Berkeley Yacc is in the public domain. The data structures and algorithms
-used in Berkeley Yacc are all either taken from documents available to the
-general public or are inventions of the author. Anyone may freely distribute
-source or binary forms of Berkeley Yacc whether unchanged or modified.
-Distributers may charge whatever fees they can obtain for Berkeley Yacc.
-Programs generated by Berkeley Yacc may be distributed freely.
-
- Please report bugs to
-
- robert.corbett@eng.Sun.COM
-
-Include a small example if possible. Please include the banner string from
-skeleton.c with the bug report. Do not expect rapid responses.
diff --git a/mcs/jay/closure.c b/mcs/jay/closure.c
deleted file mode 100644
index 5f63c5f32cd..00000000000
--- a/mcs/jay/closure.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)closure.c 5.3 (Berkeley) 5/24/93";
-#endif /* not lint */
-
-#include "defs.h"
-
-short *itemset;
-short *itemsetend;
-unsigned *ruleset;
-
-static unsigned *first_derives;
-static unsigned *EFF;
-
-
-set_EFF()
-{
- register unsigned *row;
- register int symbol;
- register short *sp;
- register int rowsize;
- register int i;
- register int rule;
-
- rowsize = WORDSIZE(nvars);
- EFF = NEW2(nvars * rowsize, unsigned);
-
- row = EFF;
- for (i = start_symbol; i < nsyms; i++)
- {
- sp = derives[i];
- for (rule = *sp; rule > 0; rule = *++sp)
- {
- symbol = ritem[rrhs[rule]];
- if (ISVAR(symbol))
- {
- symbol -= start_symbol;
- SETBIT(row, symbol);
- }
- }
- row += rowsize;
- }
-
- reflexive_transitive_closure(EFF, nvars);
-
-#ifdef DEBUG
- print_EFF();
-#endif
-}
-
-
-set_first_derives()
-{
- register unsigned *rrow;
- register unsigned *vrow;
- register int j;
- register unsigned k;
- register unsigned cword;
- register short *rp;
-
- int rule;
- int i;
- int rulesetsize;
- int varsetsize;
-
- rulesetsize = WORDSIZE(nrules);
- varsetsize = WORDSIZE(nvars);
- first_derives = NEW2(nvars * rulesetsize, unsigned) - ntokens * rulesetsize;
-
- set_EFF();
-
- rrow = first_derives + ntokens * rulesetsize;
- for (i = start_symbol; i < nsyms; i++)
- {
- vrow = EFF + ((i - ntokens) * varsetsize);
- k = BITS_PER_WORD;
- for (j = start_symbol; j < nsyms; k++, j++)
- {
- if (k >= BITS_PER_WORD)
- {
- cword = *vrow++;
- k = 0;
- }
-
- if (cword & (1 << k))
- {
- rp = derives[j];
- while ((rule = *rp++) >= 0)
- {
- SETBIT(rrow, rule);
- }
- }
- }
-
- vrow += varsetsize;
- rrow += rulesetsize;
- }
-
-#ifdef DEBUG
- print_first_derives();
-#endif
-
- FREE(EFF);
-}
-
-
-closure(nucleus, n)
-short *nucleus;
-int n;
-{
- register int ruleno;
- register unsigned word;
- register unsigned i;
- register short *csp;
- register unsigned *dsp;
- register unsigned *rsp;
- register int rulesetsize;
-
- short *csend;
- unsigned *rsend;
- int symbol;
- int itemno;
-
- rulesetsize = WORDSIZE(nrules);
- rsp = ruleset;
- rsend = ruleset + rulesetsize;
- for (rsp = ruleset; rsp < rsend; rsp++)
- *rsp = 0;
-
- csend = nucleus + n;
- for (csp = nucleus; csp < csend; ++csp)
- {
- symbol = ritem[*csp];
- if (ISVAR(symbol))
- {
- dsp = first_derives + symbol * rulesetsize;
- rsp = ruleset;
- while (rsp < rsend)
- *rsp++ |= *dsp++;
- }
- }
-
- ruleno = 0;
- itemsetend = itemset;
- csp = nucleus;
- for (rsp = ruleset; rsp < rsend; ++rsp)
- {
- word = *rsp;
- if (word)
- {
- for (i = 0; i < BITS_PER_WORD; ++i)
- {
- if (word & (1 << i))
- {
- itemno = rrhs[ruleno+i];
- while (csp < csend && *csp < itemno)
- *itemsetend++ = *csp++;
- *itemsetend++ = itemno;
- while (csp < csend && *csp == itemno)
- ++csp;
- }
- }
- }
- ruleno += BITS_PER_WORD;
- }
-
- while (csp < csend)
- *itemsetend++ = *csp++;
-
-#ifdef DEBUG
- print_closure(n);
-#endif
-}
-
-
-
-finalize_closure()
-{
- FREE(itemset);
- FREE(ruleset);
- FREE(first_derives + ntokens * WORDSIZE(nrules));
-}
-
-
-#ifdef DEBUG
-
-print_closure(n)
-int n;
-{
- register short *isp;
-
- printf("\n\nn = %d\n\n", n);
- for (isp = itemset; isp < itemsetend; isp++)
- printf(" %d\n", *isp);
-}
-
-
-print_EFF()
-{
- register int i, j;
- register unsigned *rowp;
- register unsigned word;
- register unsigned k;
-
- printf("\n\nEpsilon Free Firsts\n");
-
- for (i = start_symbol; i < nsyms; i++)
- {
- printf("\n%s", symbol_name[i]);
- rowp = EFF + ((i - start_symbol) * WORDSIZE(nvars));
- word = *rowp++;
-
- k = BITS_PER_WORD;
- for (j = 0; j < nvars; k++, j++)
- {
- if (k >= BITS_PER_WORD)
- {
- word = *rowp++;
- k = 0;
- }
-
- if (word & (1 << k))
- printf(" %s", symbol_name[start_symbol + j]);
- }
- }
-}
-
-
-print_first_derives()
-{
- register int i;
- register int j;
- register unsigned *rp;
- register unsigned cword;
- register unsigned k;
-
- printf("\n\n\nFirst Derives\n");
-
- for (i = start_symbol; i < nsyms; i++)
- {
- printf("\n%s derives\n", symbol_name[i]);
- rp = first_derives + i * WORDSIZE(nrules);
- k = BITS_PER_WORD;
- for (j = 0; j <= nrules; k++, j++)
- {
- if (k >= BITS_PER_WORD)
- {
- cword = *rp++;
- k = 0;
- }
-
- if (cword & (1 << k))
- printf(" %d\n", j);
- }
- }
-
- fflush(stdout);
-}
-
-#endif
diff --git a/mcs/jay/defs.h b/mcs/jay/defs.h
deleted file mode 100644
index ac1d63f53a3..00000000000
--- a/mcs/jay/defs.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)defs.h 5.6 (Berkeley) 5/24/93
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-
-
-/* machine-dependent definitions */
-/* the following definitions are for the Tahoe */
-/* they might have to be changed for other machines */
-
-/* MAXCHAR is the largest unsigned character value */
-/* MAXSHORT is the largest value of a C short */
-/* MINSHORT is the most negative value of a C short */
-/* MAXTABLE is the maximum table size */
-/* BITS_PER_WORD is the number of bits in a C unsigned */
-/* WORDSIZE computes the number of words needed to */
-/* store n bits */
-/* BIT returns the value of the n-th bit starting */
-/* from r (0-indexed) */
-/* SETBIT sets the n-th bit starting from r */
-
-#define MAXCHAR 255
-#define MAXSHORT 32767
-#define MINSHORT -32768
-#define MAXTABLE 32500
-#define BITS_PER_WORD 32
-#define WORDSIZE(n) (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
-#define BIT(r, n) ((((r)[(n)>>5])>>((n)&31))&1)
-#define SETBIT(r, n) ((r)[(n)>>5]|=((unsigned)1<<((n)&31)))
-
-
-/* character names */
-
-#define NUL '\0' /* the null character */
-#define NEWLINE '\n' /* line feed */
-#define SP ' ' /* space */
-#define BS '\b' /* backspace */
-#define HT '\t' /* horizontal tab */
-#define VT '\013' /* vertical tab */
-#define CR '\r' /* carriage return */
-#define FF '\f' /* form feed */
-#define QUOTE '\'' /* single quote */
-#define DOUBLE_QUOTE '\"' /* double quote */
-#define BACKSLASH '\\' /* backslash */
-
-
-/* defines for constructing filenames */
-
-#define CODE_SUFFIX ".code.c"
-#define DEFINES_SUFFIX ".tab.h"
-#define OUTPUT_SUFFIX ".tab.c"
-#define VERBOSE_SUFFIX ".output"
-
-
-/* keyword codes */
-
-#define TOKEN 0
-#define LEFT 1
-#define RIGHT 2
-#define NONASSOC 3
-#define MARK 4
-#define TEXT 5
-#define TYPE 6
-#define START 7
-
-
-/* symbol classes */
-
-#define UNKNOWN 0
-#define TERM 1
-#define NONTERM 2
-
-
-/* the undefined value */
-
-#define UNDEFINED (-1)
-
-
-/* action codes */
-
-#define SHIFT 1
-#define REDUCE 2
-
-
-/* character macros */
-
-#define IS_IDENT(c) (isalnum(c) || (c) == '_' || (c) == '.' || (c) == '$')
-#define IS_OCTAL(c) ((c) >= '0' && (c) <= '7')
-#define NUMERIC_VALUE(c) ((c) - '0')
-
-
-/* symbol macros */
-
-#define ISTOKEN(s) ((s) < start_symbol)
-#define ISVAR(s) ((s) >= start_symbol)
-
-
-/* storage allocation macros */
-
-#define CALLOC(k,n) (calloc((unsigned)(k),(unsigned)(n)))
-#define FREE(x) (free((char*)(x)))
-#define MALLOC(n) (malloc((unsigned)(n)))
-#define NEW(t) ((t*)allocate(sizeof(t)))
-#define NEW2(n,t) ((t*)allocate((unsigned)((n)*sizeof(t))))
-#define REALLOC(p,n) (realloc((char*)(p),(unsigned)(n)))
-
-
-/* the structure of a symbol table entry */
-
-typedef struct bucket bucket;
-struct bucket
-{
- struct bucket *link;
- struct bucket *next;
- char *name;
- char *tag;
- short value;
- short index;
- short prec;
- char class;
- char assoc;
-};
-
-
-/* the structure of the LR(0) state machine */
-
-typedef struct core core;
-struct core
-{
- struct core *next;
- struct core *link;
- short number;
- short accessing_symbol;
- short nitems;
- short items[1];
-};
-
-
-/* the structure used to record shifts */
-
-typedef struct shifts shifts;
-struct shifts
-{
- struct shifts *next;
- short number;
- short nshifts;
- short shift[1];
-};
-
-
-/* the structure used to store reductions */
-
-typedef struct reductions reductions;
-struct reductions
-{
- struct reductions *next;
- short number;
- short nreds;
- short rules[1];
-};
-
-
-/* the structure used to represent parser actions */
-
-typedef struct action action;
-struct action
-{
- struct action *next;
- short symbol;
- short number;
- short prec;
- char action_code;
- char assoc;
- char suppressed;
-};
-
-
-/* global variables */
-
-extern char tflag;
-extern char vflag;
-
-extern char *myname;
-extern char *cptr;
-extern char *line;
-extern int lineno;
-extern int outline;
-
-extern char *action_file_name;
-extern char *input_file_name;
-extern char *prolog_file_name;
-extern char *local_file_name;
-extern char *verbose_file_name;
-
-extern FILE *action_file;
-extern FILE *input_file;
-extern FILE *prolog_file;
-extern FILE *local_file;
-extern FILE *verbose_file;
-
-extern int nitems;
-extern int nrules;
-extern int nsyms;
-extern int ntokens;
-extern int nvars;
-extern int ntags;
-
-extern char *line_format;
-
-extern int start_symbol;
-extern char **symbol_name;
-extern short *symbol_value;
-extern short *symbol_prec;
-extern char *symbol_assoc;
-
-extern short *ritem;
-extern short *rlhs;
-extern short *rrhs;
-extern short *rprec;
-extern char *rassoc;
-
-extern short **derives;
-extern char *nullable;
-
-extern bucket *first_symbol;
-extern bucket *last_symbol;
-
-extern int nstates;
-extern core *first_state;
-extern shifts *first_shift;
-extern reductions *first_reduction;
-extern short *accessing_symbol;
-extern core **state_table;
-extern shifts **shift_table;
-extern reductions **reduction_table;
-extern unsigned *LA;
-extern short *LAruleno;
-extern short *lookaheads;
-extern short *goto_map;
-extern short *from_state;
-extern short *to_state;
-
-extern action **parser;
-extern int SRtotal;
-extern int RRtotal;
-extern short *SRconflicts;
-extern short *RRconflicts;
-extern short *defred;
-extern short *rules_used;
-extern short nunused;
-extern short final_state;
-
-/* global functions */
-
-extern char *allocate();
-extern bucket *lookup();
-extern bucket *make_bucket();
-
-
-/* system variables */
-
-extern int errno;
-
-
-/* system functions */
-
-extern void free();
-extern char *calloc();
-extern char *malloc();
-extern char *realloc();
-extern char *strcpy();
diff --git a/mcs/jay/depend b/mcs/jay/depend
deleted file mode 100644
index 134445ffddd..00000000000
--- a/mcs/jay/depend
+++ /dev/null
@@ -1,11 +0,0 @@
-closure.o: closure.c defs.h
-error.o: error.c defs.h
-lalr.o: lalr.c defs.h
-lr0.o: lr0.c defs.h
-main.o: main.c defs.h
-mkpar.o: mkpar.c defs.h
-output.o: output.c defs.h
-reader.o: reader.c defs.h
-symtab.o: symtab.c defs.h
-verbose.o: verbose.c defs.h
-warshall.o: warshall.c defs.h
diff --git a/mcs/jay/error.c b/mcs/jay/error.c
deleted file mode 100644
index dd8bf291c20..00000000000
--- a/mcs/jay/error.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)error.c 5.3 (Berkeley) 6/1/90";
-#endif /* not lint */
-
-/* routines for printing error messages */
-
-#include "defs.h"
-
-
-fatal(msg)
-char *msg;
-{
- fprintf(stderr, "%s: f - %s\n", myname, msg);
- done(2);
-}
-
-
-no_space()
-{
- fprintf(stderr, "%s: f - out of space\n", myname);
- done(2);
-}
-
-
-open_error(filename)
-char *filename;
-{
- fprintf(stderr, "%s: f - cannot open \"%s\"\n", myname, filename);
- done(2);
-}
-
-
-unexpected_EOF()
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unexpected end-of-file\n",
- myname, lineno, input_file_name);
- done(1);
-}
-
-
-print_pos(st_line, st_cptr)
-char *st_line;
-char *st_cptr;
-{
- register char *s;
-
- if (st_line == 0) return;
- for (s = st_line; *s != '\n'; ++s)
- {
- if (isprint(*s) || *s == '\t')
- putc(*s, stderr);
- else
- putc('?', stderr);
- }
- putc('\n', stderr);
- for (s = st_line; s < st_cptr; ++s)
- {
- if (*s == '\t')
- putc('\t', stderr);
- else
- putc(' ', stderr);
- }
- putc('^', stderr);
- putc('\n', stderr);
-}
-
-
-syntax_error(st_lineno, st_line, st_cptr)
-int st_lineno;
-char *st_line;
-char *st_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", syntax error\n",
- myname, st_lineno, input_file_name);
- print_pos(st_line, st_cptr);
- done(1);
-}
-
-
-unterminated_comment(c_lineno, c_line, c_cptr)
-int c_lineno;
-char *c_line;
-char *c_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unmatched /*\n",
- myname, c_lineno, input_file_name);
- print_pos(c_line, c_cptr);
- done(1);
-}
-
-
-unterminated_string(s_lineno, s_line, s_cptr)
-int s_lineno;
-char *s_line;
-char *s_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unterminated string\n",
- myname, s_lineno, input_file_name);
- print_pos(s_line, s_cptr);
- done(1);
-}
-
-
-unterminated_text(t_lineno, t_line, t_cptr)
-int t_lineno;
-char *t_line;
-char *t_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unmatched %%{\n",
- myname, t_lineno, input_file_name);
- print_pos(t_line, t_cptr);
- done(1);
-}
-
-
-illegal_tag(t_lineno, t_line, t_cptr)
-int t_lineno;
-char *t_line;
-char *t_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", illegal tag\n",
- myname, t_lineno, input_file_name);
- print_pos(t_line, t_cptr);
- done(1);
-}
-
-
-illegal_character(c_cptr)
-char *c_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", illegal character\n",
- myname, lineno, input_file_name);
- print_pos(line, c_cptr);
- done(1);
-}
-
-
-used_reserved(s)
-char *s;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", illegal use of reserved symbol \
-%s\n", myname, lineno, input_file_name, s);
- done(1);
-}
-
-
-tokenized_start(s)
-char *s;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s cannot be \
-declared to be a token\n", myname, lineno, input_file_name, s);
- done(1);
-}
-
-
-retyped_warning(s)
-char *s;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the type of %s has been \
-redeclared\n", myname, lineno, input_file_name, s);
-}
-
-
-reprec_warning(s)
-char *s;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the precedence of %s has been \
-redeclared\n", myname, lineno, input_file_name, s);
-}
-
-
-revalued_warning(s)
-char *s;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the value of %s has been \
-redeclared\n", myname, lineno, input_file_name, s);
-}
-
-
-terminal_start(s)
-char *s;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s is a \
-token\n", myname, lineno, input_file_name, s);
- done(1);
-}
-
-
-restarted_warning()
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the start symbol has been \
-redeclared\n", myname, lineno, input_file_name);
-}
-
-
-no_grammar()
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", no grammar has been \
-specified\n", myname, lineno, input_file_name);
- done(1);
-}
-
-
-terminal_lhs(s_lineno)
-int s_lineno;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", a token appears on the lhs \
-of a production\n", myname, s_lineno, input_file_name);
- done(1);
-}
-
-
-prec_redeclared()
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", conflicting %%prec \
-specifiers\n", myname, lineno, input_file_name);
-}
-
-
-unterminated_action(a_lineno, a_line, a_cptr)
-int a_lineno;
-char *a_line;
-char *a_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unterminated action\n",
- myname, a_lineno, input_file_name);
- print_pos(a_line, a_cptr);
- done(1);
-}
-
-
-dollar_warning(a_lineno, i)
-int a_lineno;
-int i;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", $%d references beyond the \
-end of the current rule\n", myname, a_lineno, input_file_name, i);
-}
-
-
-dollar_error(a_lineno, a_line, a_cptr)
-int a_lineno;
-char *a_line;
-char *a_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", illegal $-name\n",
- myname, a_lineno, input_file_name);
- print_pos(a_line, a_cptr);
- done(1);
-}
-
-
-untyped_lhs()
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", $$ is untyped\n",
- myname, lineno, input_file_name);
- /** done(1); */
-}
-
-
-untyped_rhs(i, s)
-int i;
-char *s;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", $%d (%s) is untyped\n",
- myname, lineno, input_file_name, i, s);
- /** done(1); */
-}
-
-
-unknown_rhs(i)
-int i;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", $%d is untyped\n",
- myname, lineno, input_file_name, i);
- done(1);
-}
-
-
-default_action_warning()
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the default action assigns an \
-undefined value to $$\n", myname, lineno, input_file_name);
-}
-
-
-undefined_goal(s)
-char *s;
-{
- fprintf(stderr, "%s: e - the start symbol %s is undefined\n", myname, s);
- done(1);
-}
-
-
-undefined_symbol_warning(s)
-char *s;
-{
- fprintf(stderr, "%s: w - the symbol %s is undefined\n", myname, s);
-}
diff --git a/mcs/jay/jay.1 b/mcs/jay/jay.1
deleted file mode 100644
index 85040fd5694..00000000000
--- a/mcs/jay/jay.1
+++ /dev/null
@@ -1,120 +0,0 @@
-.\" Copyright (c) 1989, 1990 The Regents of the University of California.
-.\" All rights reserved.
-.\"
-.\" This code is derived from software contributed to Berkeley by
-.\" Robert Paul Corbett.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)yacc.1 5.8 (Berkeley) 5/24/93
-.\"
-.TH JAY 1 "May 24, 1993 / July 8, 1998"
-.UC 6
-.SH NAME
-jay \- an LALR(1) parser generator for Java and C#
-.SH SYNOPSIS
-.B jay [ -tv ] [ -c ] [ -b
-.I file_prefix
-.B ] [ -V
-.I yyValue
-.B ]
-.I filename
-.B <
-.I skeleton
-.SH DESCRIPTION
-.I Jay
-reads the grammar specification in the file
-.I filename
-and generates an LR(1) parser for it.
-The parsers consist of a set of LALR(1) parsing tables and a driver routine
-from the file
-.I skeleton
-written in the Java programming language.
-.I Jay
-writes the parse tables and the driver routine to standard output.
-.PP
-The following options are available:
-.RS
-.TP
-\fB-b \fIfile_prefix\fR
-The
-.B -b
-option changes the prefix prepended to the output file names to
-the string denoted by
-.IR file_prefix.
-The default prefix is the character
-.IR y.
-.TP
-.B -c
-The
-.B -c
-option makes jay generate C# code instead of the default Java.
-.TP
-.B -t
-The
-.B -t
-option arranges for
-debugging information to be incorporated in the compiled code.
-.TP
-.B -v
-The
-.B -v
-option causes a human-readable description of the generated parser to
-be written to the file
-.IR y.output.
-.RE
-.PP
-If the environment variable TMPDIR is set, the string denoted by
-TMPDIR will be used as the name of the directory where the temporary
-files are created.
-.SH FILES
-.IR skeleton
-.br
-.IR y.output
-.br
-.IR /tmp/yacc.aXXXXXX
-.br
-.IR /tmp/yacc.tXXXXXX
-.br
-.IR /tmp/yacc.uXXXXXX
-.SH DIAGNOSTICS
-If there are rules that are never reduced, the number of such rules is
-reported on standard error.
-If there are any LALR(1) conflicts, the number of conflicts is reported
-on standard error.
-.SH HISTORY
-.I Jay
-is derived from Berkeley
-.I yacc .
-Input conventions closely follow those of
-.I yacc ;
-for details,
-consult the parser
-.I skeleton
-file and the commented example included with the sources.
diff --git a/mcs/jay/lalr.c b/mcs/jay/lalr.c
deleted file mode 100644
index bf9aec846b7..00000000000
--- a/mcs/jay/lalr.c
+++ /dev/null
@@ -1,678 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)lalr.c 5.3 (Berkeley) 6/1/90";
-#endif /* not lint */
-
-#include "defs.h"
-
-typedef
- struct shorts
- {
- struct shorts *next;
- short value;
- }
- shorts;
-
-int tokensetsize;
-short *lookaheads;
-short *LAruleno;
-unsigned *LA;
-short *accessing_symbol;
-core **state_table;
-shifts **shift_table;
-reductions **reduction_table;
-short *goto_map;
-short *from_state;
-short *to_state;
-
-short **transpose();
-
-static int infinity;
-static int maxrhs;
-static int ngotos;
-static unsigned *F;
-static short **includes;
-static shorts **lookback;
-static short **R;
-static short *INDEX;
-static short *VERTICES;
-static int top;
-
-
-lalr()
-{
- tokensetsize = WORDSIZE(ntokens);
-
- set_state_table();
- set_accessing_symbol();
- set_shift_table();
- set_reduction_table();
- set_maxrhs();
- initialize_LA();
- set_goto_map();
- initialize_F();
- build_relations();
- compute_FOLLOWS();
- compute_lookaheads();
-}
-
-
-
-set_state_table()
-{
- register core *sp;
-
- state_table = NEW2(nstates, core *);
- for (sp = first_state; sp; sp = sp->next)
- state_table[sp->number] = sp;
-}
-
-
-
-set_accessing_symbol()
-{
- register core *sp;
-
- accessing_symbol = NEW2(nstates, short);
- for (sp = first_state; sp; sp = sp->next)
- accessing_symbol[sp->number] = sp->accessing_symbol;
-}
-
-
-
-set_shift_table()
-{
- register shifts *sp;
-
- shift_table = NEW2(nstates, shifts *);
- for (sp = first_shift; sp; sp = sp->next)
- shift_table[sp->number] = sp;
-}
-
-
-
-set_reduction_table()
-{
- register reductions *rp;
-
- reduction_table = NEW2(nstates, reductions *);
- for (rp = first_reduction; rp; rp = rp->next)
- reduction_table[rp->number] = rp;
-}
-
-
-
-set_maxrhs()
-{
- register short *itemp;
- register short *item_end;
- register int length;
- register int max;
-
- length = 0;
- max = 0;
- item_end = ritem + nitems;
- for (itemp = ritem; itemp < item_end; itemp++)
- {
- if (*itemp >= 0)
- {
- length++;
- }
- else
- {
- if (length > max) max = length;
- length = 0;
- }
- }
-
- maxrhs = max;
-}
-
-
-
-initialize_LA()
-{
- register int i, j, k;
- register reductions *rp;
-
- lookaheads = NEW2(nstates + 1, short);
-
- k = 0;
- for (i = 0; i < nstates; i++)
- {
- lookaheads[i] = k;
- rp = reduction_table[i];
- if (rp)
- k += rp->nreds;
- }
- lookaheads[nstates] = k;
-
- LA = NEW2(k * tokensetsize, unsigned);
- LAruleno = NEW2(k, short);
- lookback = NEW2(k, shorts *);
-
- k = 0;
- for (i = 0; i < nstates; i++)
- {
- rp = reduction_table[i];
- if (rp)
- {
- for (j = 0; j < rp->nreds; j++)
- {
- LAruleno[k] = rp->rules[j];
- k++;
- }
- }
- }
-}
-
-
-set_goto_map()
-{
- register shifts *sp;
- register int i;
- register int symbol;
- register int k;
- register short *temp_map;
- register int state2;
- register int state1;
-
- goto_map = NEW2(nvars + 1, short) - ntokens;
- temp_map = NEW2(nvars + 1, short) - ntokens;
-
- ngotos = 0;
- for (sp = first_shift; sp; sp = sp->next)
- {
- for (i = sp->nshifts - 1; i >= 0; i--)
- {
- symbol = accessing_symbol[sp->shift[i]];
-
- if (ISTOKEN(symbol)) break;
-
- if (ngotos == MAXSHORT)
- fatal("too many gotos");
-
- ngotos++;
- goto_map[symbol]++;
- }
- }
-
- k = 0;
- for (i = ntokens; i < nsyms; i++)
- {
- temp_map[i] = k;
- k += goto_map[i];
- }
-
- for (i = ntokens; i < nsyms; i++)
- goto_map[i] = temp_map[i];
-
- goto_map[nsyms] = ngotos;
- temp_map[nsyms] = ngotos;
-
- from_state = NEW2(ngotos, short);
- to_state = NEW2(ngotos, short);
-
- for (sp = first_shift; sp; sp = sp->next)
- {
- state1 = sp->number;
- for (i = sp->nshifts - 1; i >= 0; i--)
- {
- state2 = sp->shift[i];
- symbol = accessing_symbol[state2];
-
- if (ISTOKEN(symbol)) break;
-
- k = temp_map[symbol]++;
- from_state[k] = state1;
- to_state[k] = state2;
- }
- }
-
- FREE(temp_map + ntokens);
-}
-
-
-
-/* Map_goto maps a state/symbol pair into its numeric representation. */
-
-int
-map_goto(state, symbol)
-int state;
-int symbol;
-{
- register int high;
- register int low;
- register int middle;
- register int s;
-
- low = goto_map[symbol];
- high = goto_map[symbol + 1];
-
- for (;;)
- {
- assert(low <= high);
- middle = (low + high) >> 1;
- s = from_state[middle];
- if (s == state)
- return (middle);
- else if (s < state)
- low = middle + 1;
- else
- high = middle - 1;
- }
-}
-
-
-
-initialize_F()
-{
- register int i;
- register int j;
- register int k;
- register shifts *sp;
- register short *edge;
- register unsigned *rowp;
- register short *rp;
- register short **reads;
- register int nedges;
- register int stateno;
- register int symbol;
- register int nwords;
-
- nwords = ngotos * tokensetsize;
- F = NEW2(nwords, unsigned);
-
- reads = NEW2(ngotos, short *);
- edge = NEW2(ngotos + 1, short);
- nedges = 0;
-
- rowp = F;
- for (i = 0; i < ngotos; i++)
- {
- stateno = to_state[i];
- sp = shift_table[stateno];
-
- if (sp)
- {
- k = sp->nshifts;
-
- for (j = 0; j < k; j++)
- {
- symbol = accessing_symbol[sp->shift[j]];
- if (ISVAR(symbol))
- break;
- SETBIT(rowp, symbol);
- }
-
- for (; j < k; j++)
- {
- symbol = accessing_symbol[sp->shift[j]];
- if (nullable[symbol])
- edge[nedges++] = map_goto(stateno, symbol);
- }
-
- if (nedges)
- {
- reads[i] = rp = NEW2(nedges + 1, short);
-
- for (j = 0; j < nedges; j++)
- rp[j] = edge[j];
-
- rp[nedges] = -1;
- nedges = 0;
- }
- }
-
- rowp += tokensetsize;
- }
-
- SETBIT(F, 0);
- digraph(reads);
-
- for (i = 0; i < ngotos; i++)
- {
- if (reads[i])
- FREE(reads[i]);
- }
-
- FREE(reads);
- FREE(edge);
-}
-
-
-
-build_relations()
-{
- register int i;
- register int j;
- register int k;
- register short *rulep;
- register short *rp;
- register shifts *sp;
- register int length;
- register int nedges;
- register int done;
- register int state1;
- register int stateno;
- register int symbol1;
- register int symbol2;
- register short *shortp;
- register short *edge;
- register short *states;
- register short **new_includes;
-
- includes = NEW2(ngotos, short *);
- edge = NEW2(ngotos + 1, short);
- states = NEW2(maxrhs + 1, short);
-
- for (i = 0; i < ngotos; i++)
- {
- nedges = 0;
- state1 = from_state[i];
- symbol1 = accessing_symbol[to_state[i]];
-
- for (rulep = derives[symbol1]; *rulep >= 0; rulep++)
- {
- length = 1;
- states[0] = state1;
- stateno = state1;
-
- for (rp = ritem + rrhs[*rulep]; *rp >= 0; rp++)
- {
- symbol2 = *rp;
- sp = shift_table[stateno];
- k = sp->nshifts;
-
- for (j = 0; j < k; j++)
- {
- stateno = sp->shift[j];
- if (accessing_symbol[stateno] == symbol2) break;
- }
-
- states[length++] = stateno;
- }
-
- add_lookback_edge(stateno, *rulep, i);
-
- length--;
- done = 0;
- while (!done)
- {
- done = 1;
- rp--;
- if (ISVAR(*rp))
- {
- stateno = states[--length];
- edge[nedges++] = map_goto(stateno, *rp);
- if (nullable[*rp] && length > 0) done = 0;
- }
- }
- }
-
- if (nedges)
- {
- includes[i] = shortp = NEW2(nedges + 1, short);
- for (j = 0; j < nedges; j++)
- shortp[j] = edge[j];
- shortp[nedges] = -1;
- }
- }
-
- new_includes = transpose(includes, ngotos);
-
- for (i = 0; i < ngotos; i++)
- if (includes[i])
- FREE(includes[i]);
-
- FREE(includes);
-
- includes = new_includes;
-
- FREE(edge);
- FREE(states);
-}
-
-
-add_lookback_edge(stateno, ruleno, gotono)
-int stateno, ruleno, gotono;
-{
- register int i, k;
- register int found;
- register shorts *sp;
-
- i = lookaheads[stateno];
- k = lookaheads[stateno + 1];
- found = 0;
- while (!found && i < k)
- {
- if (LAruleno[i] == ruleno)
- found = 1;
- else
- ++i;
- }
- assert(found);
-
- sp = NEW(shorts);
- sp->next = lookback[i];
- sp->value = gotono;
- lookback[i] = sp;
-}
-
-
-
-short **
-transpose(R, n)
-short **R;
-int n;
-{
- register short **new_R;
- register short **temp_R;
- register short *nedges;
- register short *sp;
- register int i;
- register int k;
-
- nedges = NEW2(n, short);
-
- for (i = 0; i < n; i++)
- {
- sp = R[i];
- if (sp)
- {
- while (*sp >= 0)
- nedges[*sp++]++;
- }
- }
-
- new_R = NEW2(n, short *);
- temp_R = NEW2(n, short *);
-
- for (i = 0; i < n; i++)
- {
- k = nedges[i];
- if (k > 0)
- {
- sp = NEW2(k + 1, short);
- new_R[i] = sp;
- temp_R[i] = sp;
- sp[k] = -1;
- }
- }
-
- FREE(nedges);
-
- for (i = 0; i < n; i++)
- {
- sp = R[i];
- if (sp)
- {
- while (*sp >= 0)
- *temp_R[*sp++]++ = i;
- }
- }
-
- FREE(temp_R);
-
- return (new_R);
-}
-
-
-
-compute_FOLLOWS()
-{
- digraph(includes);
-}
-
-
-compute_lookaheads()
-{
- register int i, n;
- register unsigned *fp1, *fp2, *fp3;
- register shorts *sp, *next;
- register unsigned *rowp;
-
- rowp = LA;
- n = lookaheads[nstates];
- for (i = 0; i < n; i++)
- {
- fp3 = rowp + tokensetsize;
- for (sp = lookback[i]; sp; sp = sp->next)
- {
- fp1 = rowp;
- fp2 = F + tokensetsize * sp->value;
- while (fp1 < fp3)
- *fp1++ |= *fp2++;
- }
- rowp = fp3;
- }
-
- for (i = 0; i < n; i++)
- for (sp = lookback[i]; sp; sp = next)
- {
- next = sp->next;
- FREE(sp);
- }
-
- FREE(lookback);
- FREE(F);
-}
-
-
-digraph(relation)
-short **relation;
-{
- register int i;
-
- infinity = ngotos + 2;
- INDEX = NEW2(ngotos + 1, short);
- VERTICES = NEW2(ngotos + 1, short);
- top = 0;
-
- R = relation;
-
- for (i = 0; i < ngotos; i++)
- INDEX[i] = 0;
-
- for (i = 0; i < ngotos; i++)
- {
- if (INDEX[i] == 0 && R[i])
- traverse(i);
- }
-
- FREE(INDEX);
- FREE(VERTICES);
-}
-
-
-
-traverse(i)
-register int i;
-{
- register unsigned *fp1;
- register unsigned *fp2;
- register unsigned *fp3;
- register int j;
- register short *rp;
-
- int height;
- unsigned *base;
-
- VERTICES[++top] = i;
- INDEX[i] = height = top;
-
- base = F + i * tokensetsize;
- fp3 = base + tokensetsize;
-
- rp = R[i];
- if (rp)
- {
- while ((j = *rp++) >= 0)
- {
- if (INDEX[j] == 0)
- traverse(j);
-
- if (INDEX[i] > INDEX[j])
- INDEX[i] = INDEX[j];
-
- fp1 = base;
- fp2 = F + j * tokensetsize;
-
- while (fp1 < fp3)
- *fp1++ |= *fp2++;
- }
- }
-
- if (INDEX[i] == height)
- {
- for (;;)
- {
- j = VERTICES[top--];
- INDEX[j] = infinity;
-
- if (i == j)
- break;
-
- fp1 = base;
- fp2 = F + j * tokensetsize;
-
- while (fp1 < fp3)
- *fp2++ = *fp1++;
- }
- }
-}
diff --git a/mcs/jay/lr0.c b/mcs/jay/lr0.c
deleted file mode 100644
index 43106ea6cf3..00000000000
--- a/mcs/jay/lr0.c
+++ /dev/null
@@ -1,637 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)lr0.c 5.3 (Berkeley) 1/20/91";
-#endif /* not lint */
-
-#include "defs.h"
-
-extern short *itemset;
-extern short *itemsetend;
-extern unsigned *ruleset;
-
-int nstates;
-core *first_state;
-shifts *first_shift;
-reductions *first_reduction;
-
-int get_state();
-core *new_state();
-
-static core **state_set;
-static core *this_state;
-static core *last_state;
-static shifts *last_shift;
-static reductions *last_reduction;
-
-static int nshifts;
-static short *shift_symbol;
-
-static short *redset;
-static short *shiftset;
-
-static short **kernel_base;
-static short **kernel_end;
-static short *kernel_items;
-
-
-allocate_itemsets()
-{
- register short *itemp;
- register short *item_end;
- register int symbol;
- register int i;
- register int count;
- register int max;
- register short *symbol_count;
-
- count = 0;
- symbol_count = NEW2(nsyms, short);
-
- item_end = ritem + nitems;
- for (itemp = ritem; itemp < item_end; itemp++)
- {
- symbol = *itemp;
- if (symbol >= 0)
- {
- count++;
- symbol_count[symbol]++;
- }
- }
-
- kernel_base = NEW2(nsyms, short *);
- kernel_items = NEW2(count, short);
-
- count = 0;
- max = 0;
- for (i = 0; i < nsyms; i++)
- {
- kernel_base[i] = kernel_items + count;
- count += symbol_count[i];
- if (max < symbol_count[i])
- max = symbol_count[i];
- }
-
- shift_symbol = symbol_count;
- kernel_end = NEW2(nsyms, short *);
-}
-
-
-allocate_storage()
-{
- allocate_itemsets();
- shiftset = NEW2(nsyms, short);
- redset = NEW2(nrules + 1, short);
- state_set = NEW2(nitems, core *);
-}
-
-
-append_states()
-{
- register int i;
- register int j;
- register int symbol;
-
-#ifdef TRACE
- fprintf(stderr, "Entering append_states()\n");
-#endif
- for (i = 1; i < nshifts; i++)
- {
- symbol = shift_symbol[i];
- j = i;
- while (j > 0 && shift_symbol[j - 1] > symbol)
- {
- shift_symbol[j] = shift_symbol[j - 1];
- j--;
- }
- shift_symbol[j] = symbol;
- }
-
- for (i = 0; i < nshifts; i++)
- {
- symbol = shift_symbol[i];
- shiftset[i] = get_state(symbol);
- }
-}
-
-
-free_storage()
-{
- FREE(shift_symbol);
- FREE(redset);
- FREE(shiftset);
- FREE(kernel_base);
- FREE(kernel_end);
- FREE(kernel_items);
- FREE(state_set);
-}
-
-
-
-generate_states()
-{
- allocate_storage();
- itemset = NEW2(nitems, short);
- ruleset = NEW2(WORDSIZE(nrules), unsigned);
- set_first_derives();
- initialize_states();
-
- while (this_state)
- {
- closure(this_state->items, this_state->nitems);
- save_reductions();
- new_itemsets();
- append_states();
-
- if (nshifts > 0)
- save_shifts();
-
- this_state = this_state->next;
- }
-
- finalize_closure();
- free_storage();
-}
-
-
-
-int
-get_state(symbol)
-int symbol;
-{
- register int key;
- register short *isp1;
- register short *isp2;
- register short *iend;
- register core *sp;
- register int found;
- register int n;
-
-#ifdef TRACE
- fprintf(stderr, "Entering get_state(%d)\n", symbol);
-#endif
-
- isp1 = kernel_base[symbol];
- iend = kernel_end[symbol];
- n = iend - isp1;
-
- key = *isp1;
- assert(0 <= key && key < nitems);
- sp = state_set[key];
- if (sp)
- {
- found = 0;
- while (!found)
- {
- if (sp->nitems == n)
- {
- found = 1;
- isp1 = kernel_base[symbol];
- isp2 = sp->items;
-
- while (found && isp1 < iend)
- {
- if (*isp1++ != *isp2++)
- found = 0;
- }
- }
-
- if (!found)
- {
- if (sp->link)
- {
- sp = sp->link;
- }
- else
- {
- sp = sp->link = new_state(symbol);
- found = 1;
- }
- }
- }
- }
- else
- {
- state_set[key] = sp = new_state(symbol);
- }
-
- return (sp->number);
-}
-
-
-
-initialize_states()
-{
- register int i;
- register short *start_derives;
- register core *p;
-
- start_derives = derives[start_symbol];
- for (i = 0; start_derives[i] >= 0; ++i)
- continue;
-
- p = (core *) MALLOC(sizeof(core) + i*sizeof(short));
- if (p == 0) no_space();
-
- p->next = 0;
- p->link = 0;
- p->number = 0;
- p->accessing_symbol = 0;
- p->nitems = i;
-
- for (i = 0; start_derives[i] >= 0; ++i)
- p->items[i] = rrhs[start_derives[i]];
-
- first_state = last_state = this_state = p;
- nstates = 1;
-}
-
-
-new_itemsets()
-{
- register int i;
- register int shiftcount;
- register short *isp;
- register short *ksp;
- register int symbol;
-
- for (i = 0; i < nsyms; i++)
- kernel_end[i] = 0;
-
- shiftcount = 0;
- isp = itemset;
- while (isp < itemsetend)
- {
- i = *isp++;
- symbol = ritem[i];
- if (symbol > 0)
- {
- ksp = kernel_end[symbol];
- if (!ksp)
- {
- shift_symbol[shiftcount++] = symbol;
- ksp = kernel_base[symbol];
- }
-
- *ksp++ = i + 1;
- kernel_end[symbol] = ksp;
- }
- }
-
- nshifts = shiftcount;
-}
-
-
-
-core *
-new_state(symbol)
-int symbol;
-{
- register int n;
- register core *p;
- register short *isp1;
- register short *isp2;
- register short *iend;
-
-#ifdef TRACE
- fprintf(stderr, "Entering new_state(%d)\n", symbol);
-#endif
-
- if (nstates >= MAXSHORT)
- fatal("too many states");
-
- isp1 = kernel_base[symbol];
- iend = kernel_end[symbol];
- n = iend - isp1;
-
- p = (core *) allocate((unsigned) (sizeof(core) + (n - 1) * sizeof(short)));
- p->accessing_symbol = symbol;
- p->number = nstates;
- p->nitems = n;
-
- isp2 = p->items;
- while (isp1 < iend)
- *isp2++ = *isp1++;
-
- last_state->next = p;
- last_state = p;
-
- nstates++;
-
- return (p);
-}
-
-
-/* show_cores is used for debugging */
-
-show_cores()
-{
- core *p;
- int i, j, k, n;
- int itemno;
-
- k = 0;
- for (p = first_state; p; ++k, p = p->next)
- {
- if (k) printf("\n");
- printf("state %d, number = %d, accessing symbol = %s\n",
- k, p->number, symbol_name[p->accessing_symbol]);
- n = p->nitems;
- for (i = 0; i < n; ++i)
- {
- itemno = p->items[i];
- printf("%4d ", itemno);
- j = itemno;
- while (ritem[j] >= 0) ++j;
- printf("%s :", symbol_name[rlhs[-ritem[j]]]);
- j = rrhs[-ritem[j]];
- while (j < itemno)
- printf(" %s", symbol_name[ritem[j++]]);
- printf(" .");
- while (ritem[j] >= 0)
- printf(" %s", symbol_name[ritem[j++]]);
- printf("\n");
- fflush(stdout);
- }
- }
-}
-
-
-/* show_ritems is used for debugging */
-
-show_ritems()
-{
- int i;
-
- for (i = 0; i < nitems; ++i)
- printf("ritem[%d] = %d\n", i, ritem[i]);
-}
-
-
-/* show_rrhs is used for debugging */
-show_rrhs()
-{
- int i;
-
- for (i = 0; i < nrules; ++i)
- printf("rrhs[%d] = %d\n", i, rrhs[i]);
-}
-
-
-/* show_shifts is used for debugging */
-
-show_shifts()
-{
- shifts *p;
- int i, j, k;
-
- k = 0;
- for (p = first_shift; p; ++k, p = p->next)
- {
- if (k) printf("\n");
- printf("shift %d, number = %d, nshifts = %d\n", k, p->number,
- p->nshifts);
- j = p->nshifts;
- for (i = 0; i < j; ++i)
- printf("\t%d\n", p->shift[i]);
- }
-}
-
-
-save_shifts()
-{
- register shifts *p;
- register short *sp1;
- register short *sp2;
- register short *send;
-
- p = (shifts *) allocate((unsigned) (sizeof(shifts) +
- (nshifts - 1) * sizeof(short)));
-
- p->number = this_state->number;
- p->nshifts = nshifts;
-
- sp1 = shiftset;
- sp2 = p->shift;
- send = shiftset + nshifts;
-
- while (sp1 < send)
- *sp2++ = *sp1++;
-
- if (last_shift)
- {
- last_shift->next = p;
- last_shift = p;
- }
- else
- {
- first_shift = p;
- last_shift = p;
- }
-}
-
-
-
-save_reductions()
-{
- register short *isp;
- register short *rp1;
- register short *rp2;
- register int item;
- register int count;
- register reductions *p;
- register short *rend;
-
- count = 0;
- for (isp = itemset; isp < itemsetend; isp++)
- {
- item = ritem[*isp];
- if (item < 0)
- {
- redset[count++] = -item;
- }
- }
-
- if (count)
- {
- p = (reductions *) allocate((unsigned) (sizeof(reductions) +
- (count - 1) * sizeof(short)));
-
- p->number = this_state->number;
- p->nreds = count;
-
- rp1 = redset;
- rp2 = p->rules;
- rend = rp1 + count;
-
- while (rp1 < rend)
- *rp2++ = *rp1++;
-
- if (last_reduction)
- {
- last_reduction->next = p;
- last_reduction = p;
- }
- else
- {
- first_reduction = p;
- last_reduction = p;
- }
- }
-}
-
-
-set_derives()
-{
- register int i, k;
- register int lhs;
- register short *rules;
-
- derives = NEW2(nsyms, short *);
- rules = NEW2(nvars + nrules, short);
-
- k = 0;
- for (lhs = start_symbol; lhs < nsyms; lhs++)
- {
- derives[lhs] = rules + k;
- for (i = 0; i < nrules; i++)
- {
- if (rlhs[i] == lhs)
- {
- rules[k] = i;
- k++;
- }
- }
- rules[k] = -1;
- k++;
- }
-
-#ifdef DEBUG
- print_derives();
-#endif
-}
-
-free_derives()
-{
- FREE(derives[start_symbol]);
- FREE(derives);
-}
-
-#ifdef DEBUG
-print_derives()
-{
- register int i;
- register short *sp;
-
- printf("\nDERIVES\n\n");
-
- for (i = start_symbol; i < nsyms; i++)
- {
- printf("%s derives ", symbol_name[i]);
- for (sp = derives[i]; *sp >= 0; sp++)
- {
- printf(" %d", *sp);
- }
- putchar('\n');
- }
-
- putchar('\n');
-}
-#endif
-
-
-set_nullable()
-{
- register int i, j;
- register int empty;
- int done;
-
- nullable = MALLOC(nsyms);
- if (nullable == 0) no_space();
-
- for (i = 0; i < nsyms; ++i)
- nullable[i] = 0;
-
- done = 0;
- while (!done)
- {
- done = 1;
- for (i = 1; i < nitems; i++)
- {
- empty = 1;
- while ((j = ritem[i]) >= 0)
- {
- if (!nullable[j])
- empty = 0;
- ++i;
- }
- if (empty)
- {
- j = rlhs[-j];
- if (!nullable[j])
- {
- nullable[j] = 1;
- done = 0;
- }
- }
- }
- }
-
-#ifdef DEBUG
- for (i = 0; i < nsyms; i++)
- {
- if (nullable[i])
- printf("%s is nullable\n", symbol_name[i]);
- else
- printf("%s is not nullable\n", symbol_name[i]);
- }
-#endif
-}
-
-
-free_nullable()
-{
- FREE(nullable);
-}
-
-
-lr0()
-{
- set_derives();
- set_nullable();
- generate_states();
-}
diff --git a/mcs/jay/main.c b/mcs/jay/main.c
deleted file mode 100644
index c6954eb9285..00000000000
--- a/mcs/jay/main.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-static char sccsid[] = "@(#)main.c 5.5 (Berkeley) 5/24/93";
-#endif /* not lint */
-
-#include <signal.h>
-#include "defs.h"
-
-char tflag;
-char vflag;
-char csharp = 0;
-
-char *file_prefix = "y";
-char *myname = "yacc";
-char *temp_form = "yacc.XXXXXXX";
-
-int lineno;
-int outline;
-
-char *action_file_name;
-char *input_file_name = "";
-char *prolog_file_name;
-char *local_file_name;
-char *verbose_file_name;
-
-FILE *action_file; /* a temp file, used to save actions associated */
- /* with rules until the parser is written */
-FILE *input_file; /* the input file */
-FILE *prolog_file; /* temp files, used to save text until all */
-FILE *local_file; /* symbols have been defined */
-FILE *verbose_file; /* y.output */
-
-int nitems;
-int nrules;
-int nsyms;
-int ntokens;
-int nvars;
-
-int start_symbol;
-char **symbol_name;
-short *symbol_value;
-short *symbol_prec;
-char *symbol_assoc;
-
-short *ritem;
-short *rlhs;
-short *rrhs;
-short *rprec;
-char *rassoc;
-short **derives;
-char *nullable;
-
-extern char *mktemp();
-extern char *getenv();
-
-done(k)
-int k;
-{
- if (action_file) { fclose(action_file); unlink(action_file_name); }
- if (prolog_file) { fclose(prolog_file); unlink(prolog_file_name); }
- if (local_file) { fclose(local_file); unlink(local_file_name); }
- exit(k);
-}
-
-
-void
-onintr(signo)
- int signo;
-{
- done(1);
-}
-
-
-set_signals()
-{
-#ifdef SIGINT
- if (signal(SIGINT, SIG_IGN) != SIG_IGN)
- signal(SIGINT, onintr);
-#endif
-#ifdef SIGTERM
- if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
- signal(SIGTERM, onintr);
-#endif
-#ifdef SIGHUP
- if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
- signal(SIGHUP, onintr);
-#endif
-}
-
-
-usage()
-{
- fprintf(stderr, "usage: %s [-tvc] [-b file_prefix] filename\n", myname);
- exit(1);
-}
-
-
-getargs(argc, argv)
-int argc;
-char *argv[];
-{
- register int i;
- register char *s;
-
- if (argc > 0) myname = argv[0];
- for (i = 1; i < argc; ++i)
- {
- s = argv[i];
- if (*s != '-') break;
- switch (*++s)
- {
- case '\0':
- input_file = stdin;
- if (i + 1 < argc) usage();
- return;
-
- case '-':
- ++i;
- goto no_more_options;
-
- case 'b':
- if (*++s)
- file_prefix = s;
- else if (++i < argc)
- file_prefix = argv[i];
- else
- usage();
- continue;
-
- case 't':
- tflag = 1;
- break;
-
- case 'c':
- csharp = 1;
- line_format = "#line %d \"%s\"\n";
- break;
-
- case 'v':
- vflag = 1;
- break;
-
- default:
- usage();
- }
-
- for (;;)
- {
- switch (*++s)
- {
- case '\0':
- goto end_of_option;
-
- case 't':
- tflag = 1;
- break;
-
- case 'v':
- vflag = 1;
- break;
-
- case 'c':
- csharp = 1;
- break;
-
- default:
- usage();
- }
- }
-end_of_option:;
- }
-
-no_more_options:;
- if (i + 1 != argc) usage();
- input_file_name = argv[i];
-}
-
-
-char *
-allocate(n)
-unsigned n;
-{
- register char *p;
-
- p = NULL;
- if (n)
- {
- p = CALLOC(1, n);
- if (!p) no_space();
- }
- return (p);
-}
-
-
-create_file_names()
-{
- int i, len;
- char *tmpdir;
-
- tmpdir = getenv("TMPDIR");
- if (tmpdir == 0) tmpdir = "/tmp";
-
- len = strlen(tmpdir);
- i = len + 13;
- if (len && tmpdir[len-1] != '/')
- ++i;
-
- action_file_name = MALLOC(i);
- if (action_file_name == 0) no_space();
- prolog_file_name = MALLOC(i);
- if (prolog_file_name == 0) no_space();
- local_file_name = MALLOC(i);
- if (local_file_name == 0) no_space();
-
- strcpy(action_file_name, tmpdir);
- strcpy(prolog_file_name, tmpdir);
- strcpy(local_file_name, tmpdir);
-
- if (len && tmpdir[len - 1] != '/')
- {
- action_file_name[len] = '/';
- prolog_file_name[len] = '/';
- local_file_name[len] = '/';
- ++len;
- }
-
- strcpy(action_file_name + len, temp_form);
- strcpy(prolog_file_name + len, temp_form);
- strcpy(local_file_name + len, temp_form);
-
- action_file_name[len + 5] = 'a';
- prolog_file_name[len + 5] = 'p';
- local_file_name[len + 5] = 'l';
-
- mktemp(action_file_name);
- mktemp(prolog_file_name);
- mktemp(local_file_name);
-
- len = strlen(file_prefix);
-
- if (vflag)
- {
- verbose_file_name = MALLOC(len + 8);
- if (verbose_file_name == 0)
- no_space();
- strcpy(verbose_file_name, file_prefix);
- strcpy(verbose_file_name + len, VERBOSE_SUFFIX);
- }
-}
-
-
-open_files()
-{
- create_file_names();
-
- if (input_file == 0)
- {
- input_file = fopen(input_file_name, "r");
- if (input_file == 0)
- open_error(input_file_name);
- }
-
- action_file = fopen(action_file_name, "w");
- if (action_file == 0)
- open_error(action_file_name);
-
- prolog_file = fopen(prolog_file_name, "w");
- if (prolog_file == 0)
- open_error(prolog_file_name);
-
- local_file = fopen(local_file_name, "w");
- if (local_file == 0)
- open_error(local_file_name);
-
- if (vflag)
- {
- verbose_file = fopen(verbose_file_name, "w");
- if (verbose_file == 0)
- open_error(verbose_file_name);
- }
-}
-
-
-int
-main(argc, argv)
-int argc;
-char *argv[];
-{
- set_signals();
- getargs(argc, argv);
- open_files();
- reader();
- lr0();
- lalr();
- make_parser();
- verbose();
- output();
- done(0);
- /*NOTREACHED*/
-}
diff --git a/mcs/jay/makefile b/mcs/jay/makefile
deleted file mode 100644
index 10991a5435f..00000000000
--- a/mcs/jay/makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-all = jay
-c = closure.c error.c lalr.c lr0.c main.c mkpar.c output.c reader.c \
- symtab.c verbose.c warshall.c
-
-CFLAGS=#-g
-
-jay: $(c:.c=.o) ; $(CC) -o $@ $(CFLAGS) $(c:.c=.o)
-
-clean:
- rm -f jay *.o
-
-windows: jay
-
-linux: jay
diff --git a/mcs/jay/mkpar.c b/mcs/jay/mkpar.c
deleted file mode 100644
index 42ead14514d..00000000000
--- a/mcs/jay/mkpar.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)mkpar.c 5.3 (Berkeley) 1/20/91";
-#endif /* not lint */
-
-#include "defs.h"
-
-action **parser;
-int SRtotal;
-int RRtotal;
-short *SRconflicts;
-short *RRconflicts;
-short *defred;
-short *rules_used;
-short nunused;
-short final_state;
-
-static int SRcount;
-static int RRcount;
-
-extern action *parse_actions();
-extern action *get_shifts();
-extern action *add_reductions();
-extern action *add_reduce();
-
-
-make_parser()
-{
- register int i;
-
- parser = NEW2(nstates, action *);
- for (i = 0; i < nstates; i++)
- parser[i] = parse_actions(i);
-
- find_final_state();
- remove_conflicts();
- unused_rules();
- if (SRtotal + RRtotal > 0) total_conflicts();
- defreds();
-}
-
-
-action *
-parse_actions(stateno)
-register int stateno;
-{
- register action *actions;
-
- actions = get_shifts(stateno);
- actions = add_reductions(stateno, actions);
- return (actions);
-}
-
-
-action *
-get_shifts(stateno)
-int stateno;
-{
- register action *actions, *temp;
- register shifts *sp;
- register short *to_state;
- register int i, k;
- register int symbol;
-
- actions = 0;
- sp = shift_table[stateno];
- if (sp)
- {
- to_state = sp->shift;
- for (i = sp->nshifts - 1; i >= 0; i--)
- {
- k = to_state[i];
- symbol = accessing_symbol[k];
- if (ISTOKEN(symbol))
- {
- temp = NEW(action);
- temp->next = actions;
- temp->symbol = symbol;
- temp->number = k;
- temp->prec = symbol_prec[symbol];
- temp->action_code = SHIFT;
- temp->assoc = symbol_assoc[symbol];
- actions = temp;
- }
- }
- }
- return (actions);
-}
-
-action *
-add_reductions(stateno, actions)
-int stateno;
-register action *actions;
-{
- register int i, j, m, n;
- register int ruleno, tokensetsize;
- register unsigned *rowp;
-
- tokensetsize = WORDSIZE(ntokens);
- m = lookaheads[stateno];
- n = lookaheads[stateno + 1];
- for (i = m; i < n; i++)
- {
- ruleno = LAruleno[i];
- rowp = LA + i * tokensetsize;
- for (j = ntokens - 1; j >= 0; j--)
- {
- if (BIT(rowp, j))
- actions = add_reduce(actions, ruleno, j);
- }
- }
- return (actions);
-}
-
-
-action *
-add_reduce(actions, ruleno, symbol)
-register action *actions;
-register int ruleno, symbol;
-{
- register action *temp, *prev, *next;
-
- prev = 0;
- for (next = actions; next && next->symbol < symbol; next = next->next)
- prev = next;
-
- while (next && next->symbol == symbol && next->action_code == SHIFT)
- {
- prev = next;
- next = next->next;
- }
-
- while (next && next->symbol == symbol &&
- next->action_code == REDUCE && next->number < ruleno)
- {
- prev = next;
- next = next->next;
- }
-
- temp = NEW(action);
- temp->next = next;
- temp->symbol = symbol;
- temp->number = ruleno;
- temp->prec = rprec[ruleno];
- temp->action_code = REDUCE;
- temp->assoc = rassoc[ruleno];
-
- if (prev)
- prev->next = temp;
- else
- actions = temp;
-
- return (actions);
-}
-
-
-find_final_state()
-{
- register int goal, i;
- register short *to_state;
- register shifts *p;
-
- p = shift_table[0];
- to_state = p->shift;
- goal = ritem[1];
- for (i = p->nshifts - 1; i >= 0; --i)
- {
- final_state = to_state[i];
- if (accessing_symbol[final_state] == goal) break;
- }
-}
-
-
-unused_rules()
-{
- register int i;
- register action *p;
-
- rules_used = (short *) MALLOC(nrules*sizeof(short));
- if (rules_used == 0) no_space();
-
- for (i = 0; i < nrules; ++i)
- rules_used[i] = 0;
-
- for (i = 0; i < nstates; ++i)
- {
- for (p = parser[i]; p; p = p->next)
- {
- if (p->action_code == REDUCE && p->suppressed == 0)
- rules_used[p->number] = 1;
- }
- }
-
- nunused = 0;
- for (i = 3; i < nrules; ++i)
- if (!rules_used[i]) ++nunused;
-
- if (nunused)
- if (nunused == 1)
- fprintf(stderr, "%s: 1 rule never reduced\n", myname);
- else
- fprintf(stderr, "%s: %d rules never reduced\n", myname, nunused);
-}
-
-
-remove_conflicts()
-{
- register int i;
- register int symbol;
- register action *p, *pref;
-
- SRtotal = 0;
- RRtotal = 0;
- SRconflicts = NEW2(nstates, short);
- RRconflicts = NEW2(nstates, short);
- for (i = 0; i < nstates; i++)
- {
- SRcount = 0;
- RRcount = 0;
- symbol = -1;
- for (p = parser[i]; p; p = p->next)
- {
- if (p->symbol != symbol)
- {
- pref = p;
- symbol = p->symbol;
- }
- else if (i == final_state && symbol == 0)
- {
- SRcount++;
- p->suppressed = 1;
- }
- else if (pref->action_code == SHIFT)
- {
- if (pref->prec > 0 && p->prec > 0)
- {
- if (pref->prec < p->prec)
- {
- pref->suppressed = 2;
- pref = p;
- }
- else if (pref->prec > p->prec)
- {
- p->suppressed = 2;
- }
- else if (pref->assoc == LEFT)
- {
- pref->suppressed = 2;
- pref = p;
- }
- else if (pref->assoc == RIGHT)
- {
- p->suppressed = 2;
- }
- else
- {
- pref->suppressed = 2;
- p->suppressed = 2;
- }
- }
- else
- {
- SRcount++;
- p->suppressed = 1;
- }
- }
- else
- {
- RRcount++;
- p->suppressed = 1;
- }
- }
- SRtotal += SRcount;
- RRtotal += RRcount;
- SRconflicts[i] = SRcount;
- RRconflicts[i] = RRcount;
- }
-}
-
-
-total_conflicts()
-{
- fprintf(stderr, "%s: ", myname);
- if (SRtotal == 1)
- fprintf(stderr, "1 shift/reduce conflict");
- else if (SRtotal > 1)
- fprintf(stderr, "%d shift/reduce conflicts", SRtotal);
-
- if (SRtotal && RRtotal)
- fprintf(stderr, ", ");
-
- if (RRtotal == 1)
- fprintf(stderr, "1 reduce/reduce conflict");
- else if (RRtotal > 1)
- fprintf(stderr, "%d reduce/reduce conflicts", RRtotal);
-
- fprintf(stderr, ".\n");
-}
-
-
-int
-sole_reduction(stateno)
-int stateno;
-{
- register int count, ruleno;
- register action *p;
-
- count = 0;
- ruleno = 0;
- for (p = parser[stateno]; p; p = p->next)
- {
- if (p->action_code == SHIFT && p->suppressed == 0)
- return (0);
- else if (p->action_code == REDUCE && p->suppressed == 0)
- {
- if (ruleno > 0 && p->number != ruleno)
- return (0);
- if (p->symbol != 1)
- ++count;
- ruleno = p->number;
- }
- }
-
- if (count == 0)
- return (0);
- return (ruleno);
-}
-
-
-defreds()
-{
- register int i;
-
- defred = NEW2(nstates, short);
- for (i = 0; i < nstates; i++)
- defred[i] = sole_reduction(i);
-}
-
-free_action_row(p)
-register action *p;
-{
- register action *q;
-
- while (p)
- {
- q = p->next;
- FREE(p);
- p = q;
- }
-}
-
-free_parser()
-{
- register int i;
-
- for (i = 0; i < nstates; i++)
- free_action_row(parser[i]);
-
- FREE(parser);
-}
diff --git a/mcs/jay/output.c b/mcs/jay/output.c
deleted file mode 100644
index 81e4755c9cd..00000000000
--- a/mcs/jay/output.c
+++ /dev/null
@@ -1,1173 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)output.c 5.7 (Berkeley) 5/24/93";
-#endif /* not lint */
-
-#include "defs.h"
-#include <string.h>
-
-static int nvectors;
-static int nentries;
-static short **froms;
-static short **tos;
-static short *tally;
-static short *width;
-static short *state_count;
-static short *order;
-static short *base;
-static short *pos;
-static int maxtable;
-static short *table;
-static short *check;
-static int lowzero;
-static int high;
-extern int csharp;
-
-output () {
- int lno = 0;
- char buf [128];
-
- free_itemsets();
- free_shifts();
- free_reductions();
-
- while (fgets(buf, sizeof buf, stdin) != NULL) {
- char * cp;
- ++ lno;
- if (buf[strlen(buf)-1] != '\n')
- fprintf(stderr, "jay: line %d is too long\n", lno), done(1);
- switch (buf[0]) {
- case '#': continue;
- case 't': if (!tflag) fputs("//t", stdout);
- case '.': break;
- default:
- cp = strtok(buf, " \t\r\n");
- if (cp)
- if (strcmp(cp, "actions") == 0) output_semantic_actions();
- else if (strcmp(cp, "debug") == 0) output_debug();
- else if (strcmp(cp, "epilog") == 0) output_trailing_text();
- else if (strcmp(cp, "prolog") == 0)
- output_stored_text(prolog_file, prolog_file_name);
- else if (strcmp(cp, "local") == 0)
- output_stored_text(local_file, local_file_name);
- else if (strcmp(cp, "tables") == 0)
- output_rule_data(), output_yydefred(), output_actions();
- else if (strcmp(cp, "tokens") == 0)
- output_defines(strtok(NULL, "\r\n"));
- else
- fprintf(stderr, "jay: unknown call (%s) in line %d\n", cp, lno);
- continue;
- }
- fputs(buf+1, stdout), ++ outline;
- }
- free_parser();
-}
-
-output_rule_data()
-{
- register int i;
- register int j;
-
-
- printf(" %s static %s short [] yyLhs = {%16d,",
- csharp ? "" : " protected",
- csharp ? "" : " final",
- symbol_value[start_symbol]);
-
- j = 10;
- for (i = 3; i < nrules; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", symbol_value[rlhs[i]]);
- }
- outline += 2;
- printf("\n };\n");
-
- printf(" %s static %s short [] yyLen = {%12d,",
- csharp ? "" : "protected",
- csharp ? "" : "final",
- 2);
-
- j = 10;
- for (i = 3; i < nrules; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- j++;
-
- printf("%5d,", rrhs[i + 1] - rrhs[i] - 1);
- }
- outline += 2;
- printf("\n };\n");
-}
-
-
-output_yydefred()
-{
- register int i, j;
-
- printf(" %s static %s short [] yyDefRed = {%13d,",
- csharp ? "" : "protected",
- csharp ? "" : "final",
- (defred[0] ? defred[0] - 2 : 0));
-
- j = 10;
- for (i = 1; i < nstates; i++)
- {
- if (j < 10)
- ++j;
- else
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
-
- printf("%5d,", (defred[i] ? defred[i] - 2 : 0));
- }
-
- outline += 2;
- printf("\n };\n");
-}
-
-
-output_actions()
-{
- nvectors = 2*nstates + nvars;
-
- froms = NEW2(nvectors, short *);
- tos = NEW2(nvectors, short *);
- tally = NEW2(nvectors, short);
- width = NEW2(nvectors, short);
-
- token_actions();
- FREE(lookaheads);
- FREE(LA);
- FREE(LAruleno);
- FREE(accessing_symbol);
-
- goto_actions();
- FREE(goto_map + ntokens);
- FREE(from_state);
- FREE(to_state);
-
- sort_actions();
- pack_table();
- output_base();
- output_table();
- output_check();
-}
-
-
-token_actions()
-{
- register int i, j;
- register int shiftcount, reducecount;
- register int max, min;
- register short *actionrow, *r, *s;
- register action *p;
-
- actionrow = NEW2(2*ntokens, short);
- for (i = 0; i < nstates; ++i)
- {
- if (parser[i])
- {
- for (j = 0; j < 2*ntokens; ++j)
- actionrow[j] = 0;
-
- shiftcount = 0;
- reducecount = 0;
- for (p = parser[i]; p; p = p->next)
- {
- if (p->suppressed == 0)
- {
- if (p->action_code == SHIFT)
- {
- ++shiftcount;
- actionrow[p->symbol] = p->number;
- }
- else if (p->action_code == REDUCE && p->number != defred[i])
- {
- ++reducecount;
- actionrow[p->symbol + ntokens] = p->number;
- }
- }
- }
-
- tally[i] = shiftcount;
- tally[nstates+i] = reducecount;
- width[i] = 0;
- width[nstates+i] = 0;
- if (shiftcount > 0)
- {
- froms[i] = r = NEW2(shiftcount, short);
- tos[i] = s = NEW2(shiftcount, short);
- min = MAXSHORT;
- max = 0;
- for (j = 0; j < ntokens; ++j)
- {
- if (actionrow[j])
- {
- if (min > symbol_value[j])
- min = symbol_value[j];
- if (max < symbol_value[j])
- max = symbol_value[j];
- *r++ = symbol_value[j];
- *s++ = actionrow[j];
- }
- }
- width[i] = max - min + 1;
- }
- if (reducecount > 0)
- {
- froms[nstates+i] = r = NEW2(reducecount, short);
- tos[nstates+i] = s = NEW2(reducecount, short);
- min = MAXSHORT;
- max = 0;
- for (j = 0; j < ntokens; ++j)
- {
- if (actionrow[ntokens+j])
- {
- if (min > symbol_value[j])
- min = symbol_value[j];
- if (max < symbol_value[j])
- max = symbol_value[j];
- *r++ = symbol_value[j];
- *s++ = actionrow[ntokens+j] - 2;
- }
- }
- width[nstates+i] = max - min + 1;
- }
- }
- }
- FREE(actionrow);
-}
-
-goto_actions()
-{
- register int i, j, k;
-
- state_count = NEW2(nstates, short);
-
- k = default_goto(start_symbol + 1);
- printf(" protected static %s short [] yyDgoto = {%14d,", csharp ? "" : "final", k);
- save_column(start_symbol + 1, k);
-
- j = 10;
- for (i = start_symbol + 2; i < nsyms; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- k = default_goto(i);
- printf("%5d,", k);
- save_column(i, k);
- }
-
- outline += 2;
- printf("\n };\n");
- FREE(state_count);
-}
-
-int
-default_goto(symbol)
-int symbol;
-{
- register int i;
- register int m;
- register int n;
- register int default_state;
- register int max;
-
- m = goto_map[symbol];
- n = goto_map[symbol + 1];
-
- if (m == n) return (0);
-
- for (i = 0; i < nstates; i++)
- state_count[i] = 0;
-
- for (i = m; i < n; i++)
- state_count[to_state[i]]++;
-
- max = 0;
- default_state = 0;
- for (i = 0; i < nstates; i++)
- {
- if (state_count[i] > max)
- {
- max = state_count[i];
- default_state = i;
- }
- }
-
- return (default_state);
-}
-
-
-
-save_column(symbol, default_state)
-int symbol;
-int default_state;
-{
- register int i;
- register int m;
- register int n;
- register short *sp;
- register short *sp1;
- register short *sp2;
- register int count;
- register int symno;
-
- m = goto_map[symbol];
- n = goto_map[symbol + 1];
-
- count = 0;
- for (i = m; i < n; i++)
- {
- if (to_state[i] != default_state)
- ++count;
- }
- if (count == 0) return;
-
- symno = symbol_value[symbol] + 2*nstates;
-
- froms[symno] = sp1 = sp = NEW2(count, short);
- tos[symno] = sp2 = NEW2(count, short);
-
- for (i = m; i < n; i++)
- {
- if (to_state[i] != default_state)
- {
- *sp1++ = from_state[i];
- *sp2++ = to_state[i];
- }
- }
-
- tally[symno] = count;
- width[symno] = sp1[-1] - sp[0] + 1;
-}
-
-sort_actions()
-{
- register int i;
- register int j;
- register int k;
- register int t;
- register int w;
-
- order = NEW2(nvectors, short);
- nentries = 0;
-
- for (i = 0; i < nvectors; i++)
- {
- if (tally[i] > 0)
- {
- t = tally[i];
- w = width[i];
- j = nentries - 1;
-
- while (j >= 0 && (width[order[j]] < w))
- j--;
-
- while (j >= 0 && (width[order[j]] == w) && (tally[order[j]] < t))
- j--;
-
- for (k = nentries - 1; k > j; k--)
- order[k + 1] = order[k];
-
- order[j + 1] = i;
- nentries++;
- }
- }
-}
-
-
-pack_table()
-{
- register int i;
- register int place;
- register int state;
-
- base = NEW2(nvectors, short);
- pos = NEW2(nentries, short);
-
- maxtable = 1000;
- table = NEW2(maxtable, short);
- check = NEW2(maxtable, short);
-
- lowzero = 0;
- high = 0;
-
- for (i = 0; i < maxtable; i++)
- check[i] = -1;
-
- for (i = 0; i < nentries; i++)
- {
- state = matching_vector(i);
-
- if (state < 0)
- place = pack_vector(i);
- else
- place = base[state];
-
- pos[i] = place;
- base[order[i]] = place;
- }
-
- for (i = 0; i < nvectors; i++)
- {
- if (froms[i])
- FREE(froms[i]);
- if (tos[i])
- FREE(tos[i]);
- }
-
- FREE(froms);
- FREE(tos);
- FREE(pos);
-}
-
-
-/* The function matching_vector determines if the vector specified by */
-/* the input parameter matches a previously considered vector. The */
-/* test at the start of the function checks if the vector represents */
-/* a row of shifts over terminal symbols or a row of reductions, or a */
-/* column of shifts over a nonterminal symbol. Berkeley Yacc does not */
-/* check if a column of shifts over a nonterminal symbols matches a */
-/* previously considered vector. Because of the nature of LR parsing */
-/* tables, no two columns can match. Therefore, the only possible */
-/* match would be between a row and a column. Such matches are */
-/* unlikely. Therefore, to save time, no attempt is made to see if a */
-/* column matches a previously considered vector. */
-/* */
-/* Matching_vector is poorly designed. The test could easily be made */
-/* faster. Also, it depends on the vectors being in a specific */
-/* order. */
-
-int
-matching_vector(vector)
-int vector;
-{
- register int i;
- register int j;
- register int k;
- register int t;
- register int w;
- register int match;
- register int prev;
-
- i = order[vector];
- if (i >= 2*nstates)
- return (-1);
-
- t = tally[i];
- w = width[i];
-
- for (prev = vector - 1; prev >= 0; prev--)
- {
- j = order[prev];
- if (width[j] != w || tally[j] != t)
- return (-1);
-
- match = 1;
- for (k = 0; match && k < t; k++)
- {
- if (tos[j][k] != tos[i][k] || froms[j][k] != froms[i][k])
- match = 0;
- }
-
- if (match)
- return (j);
- }
-
- return (-1);
-}
-
-
-
-int
-pack_vector(vector)
-int vector;
-{
- register int i, j, k, l;
- register int t;
- register int loc;
- register int ok;
- register short *from;
- register short *to;
- int newmax;
-
- i = order[vector];
- t = tally[i];
- assert(t);
-
- from = froms[i];
- to = tos[i];
-
- j = lowzero - from[0];
- for (k = 1; k < t; ++k)
- if (lowzero - from[k] > j)
- j = lowzero - from[k];
- for (;; ++j)
- {
- if (j == 0)
- continue;
- ok = 1;
- for (k = 0; ok && k < t; k++)
- {
- loc = j + from[k];
- if (loc >= maxtable)
- {
- if (loc >= MAXTABLE)
- fatal("maximum table size exceeded");
-
- newmax = maxtable;
- do { newmax += 200; } while (newmax <= loc);
- table = (short *) REALLOC(table, newmax*sizeof(short));
- if (table == 0) no_space();
- check = (short *) REALLOC(check, newmax*sizeof(short));
- if (check == 0) no_space();
- for (l = maxtable; l < newmax; ++l)
- {
- table[l] = 0;
- check[l] = -1;
- }
- maxtable = newmax;
- }
-
- if (check[loc] != -1)
- ok = 0;
- }
- for (k = 0; ok && k < vector; k++)
- {
- if (pos[k] == j)
- ok = 0;
- }
- if (ok)
- {
- for (k = 0; k < t; k++)
- {
- loc = j + from[k];
- table[loc] = to[k];
- check[loc] = from[k];
- if (loc > high) high = loc;
- }
-
- while (check[lowzero] != -1)
- ++lowzero;
-
- return (j);
- }
- }
-}
-
-
-
-output_base()
-{
- register int i, j;
-
- printf(" protected static %s short [] yySindex = {%13d,", csharp?"":"final", base[0]);
-
- j = 10;
- for (i = 1; i < nstates; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", base[i]);
- }
-
- outline += 2;
- printf("\n };\n protected static %s short [] yyRindex = {%13d,",
- csharp ? "" : "final",
- base[nstates]);
-
- j = 10;
- for (i = nstates + 1; i < 2*nstates; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", base[i]);
- }
-
- outline += 2;
- printf("\n };\n protected static %s short [] yyGindex = {%13d,",
- csharp ? "" : "final",
- base[2*nstates]);
-
- j = 10;
- for (i = 2*nstates + 1; i < nvectors - 1; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", base[i]);
- }
-
- outline += 2;
- printf("\n };\n");
- FREE(base);
-}
-
-
-
-output_table()
-{
- register int i;
- register int j;
-
- printf(" protected static %s short [] yyTable = {%14d,", csharp ? "" : "final", table[0]);
-
- j = 10;
- for (i = 1; i <= high; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", table[i]);
- }
-
- outline += 2;
- printf("\n };\n");
- FREE(table);
-}
-
-
-
-output_check()
-{
- register int i;
- register int j;
-
- printf(" protected static %s short [] yyCheck = {%14d,",
- csharp ? "" : "final",
- check[0]);
-
- j = 10;
- for (i = 1; i <= high; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", check[i]);
- }
-
- outline += 2;
- printf("\n };\n");
- FREE(check);
-}
-
-
-int
-is_C_identifier(name)
-char *name;
-{
- register char *s;
- register int c;
-
- s = name;
- c = *s;
- if (c == '"')
- {
- c = *++s;
- if (!isalpha(c) && c != '_' && c != '$')
- return (0);
- while ((c = *++s) != '"')
- {
- if (!isalnum(c) && c != '_' && c != '$')
- return (0);
- }
- return (1);
- }
-
- if (!isalpha(c) && c != '_' && c != '$')
- return (0);
- while (c = *++s)
- {
- if (!isalnum(c) && c != '_' && c != '$')
- return (0);
- }
- return (1);
-}
-
-
-output_defines(prefix)
-char *prefix;
-{
- register int c, i;
- register char *s;
-
- for (i = 2; i < ntokens; ++i)
- {
- s = symbol_name[i];
- if (is_C_identifier(s))
- {
- if (prefix)
- printf(" %s ", prefix);
- c = *s;
- if (c == '"')
- {
- while ((c = *++s) != '"')
- {
- putchar(c);
- }
- }
- else
- {
- do
- {
- putchar(c);
- }
- while (c = *++s);
- }
- ++outline;
- printf(" = %d%s\n", symbol_value[i], csharp ? ";" : ";");
- }
- }
-
- ++outline;
- printf(" %s yyErrorCode = %d%s\n", prefix ? prefix : "", symbol_value[1], csharp ? ";" : ";");
-}
-
-
-output_stored_text(file, name)
-FILE *file;
-char *name;
-{
- register int c;
- register FILE *in;
-
- fflush(file);
- in = fopen(name, "r");
- if (in == NULL)
- open_error(name);
- if ((c = getc(in)) != EOF) {
- if (c == '\n')
- ++outline;
- putchar(c);
- while ((c = getc(in)) != EOF)
- {
- if (c == '\n')
- ++outline;
- putchar(c);
- }
- printf(line_format, ++outline + 1, "-");
- }
- fclose(in);
-}
-
-
-output_debug()
-{
- register int i, j, k, max;
- char **symnam, *s;
- char * prefix = tflag ? "" : "//t";
-
- ++outline;
- printf(" protected static %s int yyFinal = %d;\n", csharp ? "" : "final", final_state);
-
- ++outline;
- printf("%s public static %s string [] yyRule = {\n", prefix, csharp ? "" : "final");
- for (i = 2; i < nrules; ++i)
- {
- printf("%s \"%s :", prefix, symbol_name[rlhs[i]]);
- for (j = rrhs[i]; ritem[j] > 0; ++j)
- {
- s = symbol_name[ritem[j]];
- if (s[0] == '"')
- {
- printf(" \\\"");
- while (*++s != '"')
- {
- if (*s == '\\')
- {
- if (s[1] == '\\')
- printf("\\\\\\\\");
- else
- printf("\\\\%c", s[1]);
- ++s;
- }
- else
- putchar(*s);
- }
- printf("\\\"");
- }
- else if (s[0] == '\'')
- {
- if (s[1] == '"')
- printf(" '\\\"'");
- else if (s[1] == '\\')
- {
- if (s[2] == '\\')
- printf(" '\\\\\\\\");
- else
- printf(" '\\\\%c", s[2]);
- s += 2;
- while (*++s != '\'')
- putchar(*s);
- putchar('\'');
- }
- else
- printf(" '%c'", s[1]);
- }
- else
- printf(" %s", s);
- }
- ++outline;
- printf("\",\n");
- }
- ++ outline;
- printf("%s };\n", prefix);
-
- max = 0;
- for (i = 2; i < ntokens; ++i)
- if (symbol_value[i] > max)
- max = symbol_value[i];
-
- /* need yyName for yyExpecting() */
-
- printf(" protected static %s string [] yyName = {", csharp ? "" : "final");
- symnam = (char **) MALLOC((max+1)*sizeof(char *));
- if (symnam == 0) no_space();
-
- /* Note that it is not necessary to initialize the element */
- /* symnam[max]. */
- for (i = 0; i < max; ++i)
- symnam[i] = 0;
- for (i = ntokens - 1; i >= 2; --i)
- symnam[symbol_value[i]] = symbol_name[i];
- symnam[0] = "end-of-file";
-
- j = 70; fputs(" ", stdout);
- for (i = 0; i <= max; ++i)
- {
- if (s = symnam[i])
- {
- if (s[0] == '"')
- {
- k = 7;
- while (*++s != '"')
- {
- ++k;
- if (*s == '\\')
- {
- k += 2;
- if (*++s == '\\')
- ++k;
- }
- }
- j += k;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = k;
- }
- printf("\"\\\"");
- s = symnam[i];
- while (*++s != '"')
- {
- if (*s == '\\')
- {
- printf("\\\\");
- if (*++s == '\\')
- printf("\\\\");
- else
- putchar(*s);
- }
- else
- putchar(*s);
- }
- printf("\\\"\",");
- }
- else if (s[0] == '\'')
- {
- if (s[1] == '"')
- {
- j += 7;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = 7;
- }
- printf("\"'\\\"'\",");
- }
- else
- {
- k = 5;
- while (*++s != '\'')
- {
- ++k;
- if (*s == '\\')
- {
- k += 2;
- if (*++s == '\\')
- ++k;
- }
- }
- j += k;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = k;
- }
- printf("\"'");
- s = symnam[i];
- while (*++s != '\'')
- {
- if (*s == '\\')
- {
- printf("\\\\");
- if (*++s == '\\')
- printf("\\\\");
- else
- putchar(*s);
- }
- else
- putchar(*s);
- }
- printf("'\",");
- }
- }
- else
- {
- k = strlen(s) + 3;
- j += k;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = k;
- }
- putchar('"');
- do { putchar(*s); } while (*++s);
- printf("\",");
- }
- }
- else
- {
- j += 5;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = 5;
- }
- printf("null,");
- }
- }
- outline += 2;
- printf("\n };\n");
- FREE(symnam);
-}
-
-output_trailing_text()
-{
- register int c, last;
- register FILE *in;
-
- if (line == 0)
- return;
-
- in = input_file;
- c = *cptr;
- if (c == '\n')
- {
- ++lineno;
- if ((c = getc(in)) == EOF)
- return;
- ++outline;
- printf(line_format, lineno, input_file_name);
- if (c == '\n')
- ++outline;
- putchar(c);
- last = c;
- }
- else
- {
- ++outline;
- printf(line_format, lineno, input_file_name);
- do { putchar(c); } while ((c = *++cptr) != '\n');
- ++outline;
- putchar('\n');
- last = '\n';
- }
-
- while ((c = getc(in)) != EOF)
- {
- if (c == '\n')
- ++outline;
- putchar(c);
- last = c;
- }
-
- if (last != '\n')
- {
- ++outline;
- putchar('\n');
- }
- printf(line_format, ++outline + 1, "-");
-}
-
-
-output_semantic_actions()
-{
- register int c, last;
-
- fclose(action_file);
- action_file = fopen(action_file_name, "r");
- if (action_file == NULL)
- open_error(action_file_name);
-
- if ((c = getc(action_file)) == EOF)
- return;
-
- last = c;
- if (c == '\n')
- ++outline;
- putchar(c);
- while ((c = getc(action_file)) != EOF)
- {
- if (c == '\n')
- ++outline;
- putchar(c);
- last = c;
- }
-
- if (last != '\n')
- {
- ++outline;
- putchar('\n');
- }
-
- printf(line_format, ++outline + 1, "-");
-}
-
-
-free_itemsets()
-{
- register core *cp, *next;
-
- FREE(state_table);
- for (cp = first_state; cp; cp = next)
- {
- next = cp->next;
- FREE(cp);
- }
-}
-
-
-free_shifts()
-{
- register shifts *sp, *next;
-
- FREE(shift_table);
- for (sp = first_shift; sp; sp = next)
- {
- next = sp->next;
- FREE(sp);
- }
-}
-
-
-
-free_reductions()
-{
- register reductions *rp, *next;
-
- FREE(reduction_table);
- for (rp = first_reduction; rp; rp = next)
- {
- next = rp->next;
- FREE(rp);
- }
-}
diff --git a/mcs/jay/reader.c b/mcs/jay/reader.c
deleted file mode 100644
index f2cdd5af834..00000000000
--- a/mcs/jay/reader.c
+++ /dev/null
@@ -1,1627 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)reader.c 5.7 (Berkeley) 1/20/91";
-#endif /* not lint */
-
-#include "defs.h"
-
-/* The line size must be a positive integer. One hundred was chosen */
-/* because few lines in Yacc input grammars exceed 100 characters. */
-/* Note that if a line exceeds LINESIZE characters, the line buffer */
-/* will be expanded to accomodate it. */
-
-#define LINESIZE 100
-
-char *cache;
-int cinc, cache_size;
-
-int ntags, tagmax;
-char **tag_table;
-
-char saw_eof;
-char *cptr, *line;
-int linesize;
-
-bucket *goal;
-int prec;
-int gensym;
-char last_was_action;
-
-int maxitems;
-bucket **pitem;
-
-int maxrules;
-bucket **plhs;
-
-int name_pool_size;
-char *name_pool;
-
-char *line_format = "\t\t\t\t\t// line %d \"%s\"\n";
-
-
-cachec(c)
-int c;
-{
- assert(cinc >= 0);
- if (cinc >= cache_size)
- {
- cache_size += 256;
- cache = REALLOC(cache, cache_size);
- if (cache == 0) no_space();
- }
- cache[cinc] = c;
- ++cinc;
-}
-
-
-get_line()
-{
- register FILE *f = input_file;
- register int c;
- register int i;
-
- if (saw_eof || (c = getc(f)) == EOF)
- {
- if (line) { FREE(line); line = 0; }
- cptr = 0;
- saw_eof = 1;
- return;
- }
-
- if (line == 0 || linesize != (LINESIZE + 1))
- {
- if (line) FREE(line);
- linesize = LINESIZE + 1;
- line = MALLOC(linesize);
- if (line == 0) no_space();
- }
-
- i = 0;
- ++lineno;
- for (;;)
- {
- line[i] = c;
- if (c == '\n') { cptr = line; return; }
- if (++i >= linesize)
- {
- linesize += LINESIZE;
- line = REALLOC(line, linesize);
- if (line == 0) no_space();
- }
- c = getc(f);
- if (c == EOF)
- {
- line[i] = '\n';
- saw_eof = 1;
- cptr = line;
- return;
- }
- }
-}
-
-
-char *
-dup_line()
-{
- register char *p, *s, *t;
-
- if (line == 0) return (0);
- s = line;
- while (*s != '\n') ++s;
- p = MALLOC(s - line + 1);
- if (p == 0) no_space();
-
- s = line;
- t = p;
- while ((*t++ = *s++) != '\n') continue;
- return (p);
-}
-
-
-skip_comment()
-{
- register char *s;
-
- int st_lineno = lineno;
- char *st_line = dup_line();
- char *st_cptr = st_line + (cptr - line);
-
- s = cptr + 2;
- for (;;)
- {
- if (*s == '*' && s[1] == '/')
- {
- cptr = s + 2;
- FREE(st_line);
- return;
- }
- if (*s == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_comment(st_lineno, st_line, st_cptr);
- s = cptr;
- }
- else
- ++s;
- }
-}
-
-
-int
-nextc()
-{
- register char *s;
-
- if (line == 0)
- {
- get_line();
- if (line == 0)
- return (EOF);
- }
-
- s = cptr;
- for (;;)
- {
- switch (*s)
- {
- case '\n':
- get_line();
- if (line == 0) return (EOF);
- s = cptr;
- break;
-
- case ' ':
- case '\t':
- case '\f':
- case '\r':
- case '\v':
- case ',':
- case ';':
- ++s;
- break;
-
- case '\\':
- cptr = s;
- return ('%');
-
- case '/':
- if (s[1] == '*')
- {
- cptr = s;
- skip_comment();
- s = cptr;
- break;
- }
- else if (s[1] == '/')
- {
- get_line();
- if (line == 0) return (EOF);
- s = cptr;
- break;
- }
- /* fall through */
-
- default:
- cptr = s;
- return (*s);
- }
- }
-}
-
-
-int
-keyword()
-{
- register int c;
- char *t_cptr = cptr;
-
- c = *++cptr;
- if (isalpha(c))
- {
- cinc = 0;
- for (;;)
- {
- if (isalpha(c))
- {
- if (isupper(c)) c = tolower(c);
- cachec(c);
- }
- else if (isdigit(c) || c == '_' || c == '.' || c == '$')
- cachec(c);
- else
- break;
- c = *++cptr;
- }
- cachec(NUL);
-
- if (strcmp(cache, "token") == 0 || strcmp(cache, "term") == 0)
- return (TOKEN);
- if (strcmp(cache, "type") == 0)
- return (TYPE);
- if (strcmp(cache, "left") == 0)
- return (LEFT);
- if (strcmp(cache, "right") == 0)
- return (RIGHT);
- if (strcmp(cache, "nonassoc") == 0 || strcmp(cache, "binary") == 0)
- return (NONASSOC);
- if (strcmp(cache, "start") == 0)
- return (START);
- }
- else
- {
- ++cptr;
- if (c == '{')
- return (TEXT);
- if (c == '%' || c == '\\')
- return (MARK);
- if (c == '<')
- return (LEFT);
- if (c == '>')
- return (RIGHT);
- if (c == '0')
- return (TOKEN);
- if (c == '2')
- return (NONASSOC);
- }
- syntax_error(lineno, line, t_cptr);
- /*NOTREACHED*/
-}
-
-
-copy_text(f)
-FILE *f;
-{
- register int c;
- int quote;
- int need_newline = 0;
- int t_lineno = lineno;
- char *t_line = dup_line();
- char *t_cptr = t_line + (cptr - line - 2);
-
- if (*cptr == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_text(t_lineno, t_line, t_cptr);
- }
- fprintf(f, line_format, lineno, input_file_name);
-
-loop:
- c = *cptr++;
- switch (c)
- {
- case '\n':
- next_line:
- putc('\n', f);
- need_newline = 0;
- get_line();
- if (line) goto loop;
- unterminated_text(t_lineno, t_line, t_cptr);
-
- case '\'':
- case '"':
- {
- int s_lineno = lineno;
- char *s_line = dup_line();
- char *s_cptr = s_line + (cptr - line - 1);
-
- quote = c;
- putc(c, f);
- for (;;)
- {
- c = *cptr++;
- putc(c, f);
- if (c == quote)
- {
- need_newline = 1;
- FREE(s_line);
- goto loop;
- }
- if (c == '\n')
- unterminated_string(s_lineno, s_line, s_cptr);
- if (c == '\\')
- {
- c = *cptr++;
- putc(c, f);
- if (c == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_string(s_lineno, s_line, s_cptr);
- }
- }
- }
- }
-
- case '/':
- putc(c, f);
- need_newline = 1;
- c = *cptr;
- if (c == '/')
- {
- do putc(c, f); while ((c = *++cptr) != '\n');
- goto next_line;
- }
- if (c == '*')
- {
- int c_lineno = lineno;
- char *c_line = dup_line();
- char *c_cptr = c_line + (cptr - line - 1);
-
- putc('*', f);
- ++cptr;
- for (;;)
- {
- c = *cptr++;
- putc(c, f);
- if (c == '*' && *cptr == '/')
- {
- putc('/', f);
- ++cptr;
- FREE(c_line);
- goto loop;
- }
- if (c == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_comment(c_lineno, c_line, c_cptr);
- }
- }
- }
- need_newline = 1;
- goto loop;
-
- case '%':
- case '\\':
- if (*cptr == '}')
- {
- if (need_newline) putc('\n', f);
- ++cptr;
- FREE(t_line);
- return;
- }
- /* fall through */
-
- default:
- putc(c, f);
- need_newline = 1;
- goto loop;
- }
-}
-
-int
-hexval(c)
-int c;
-{
- if (c >= '0' && c <= '9')
- return (c - '0');
- if (c >= 'A' && c <= 'F')
- return (c - 'A' + 10);
- if (c >= 'a' && c <= 'f')
- return (c - 'a' + 10);
- return (-1);
-}
-
-
-bucket *
-get_literal()
-{
- register int c, quote;
- register int i;
- register int n;
- register char *s;
- register bucket *bp;
- int s_lineno = lineno;
- char *s_line = dup_line();
- char *s_cptr = s_line + (cptr - line);
-
- quote = *cptr++;
- cinc = 0;
- for (;;)
- {
- c = *cptr++;
- if (c == quote) break;
- if (c == '\n') unterminated_string(s_lineno, s_line, s_cptr);
- if (c == '\\')
- {
- char *c_cptr = cptr - 1;
-
- c = *cptr++;
- switch (c)
- {
- case '\n':
- get_line();
- if (line == 0) unterminated_string(s_lineno, s_line, s_cptr);
- continue;
-
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- n = c - '0';
- c = *cptr;
- if (IS_OCTAL(c))
- {
- n = (n << 3) + (c - '0');
- c = *++cptr;
- if (IS_OCTAL(c))
- {
- n = (n << 3) + (c - '0');
- ++cptr;
- }
- }
- if (n > MAXCHAR) illegal_character(c_cptr);
- c = n;
- break;
-
- case 'x':
- c = *cptr++;
- n = hexval(c);
- if (n < 0 || n >= 16)
- illegal_character(c_cptr);
- for (;;)
- {
- c = *cptr;
- i = hexval(c);
- if (i < 0 || i >= 16) break;
- ++cptr;
- n = (n << 4) + i;
- if (n > MAXCHAR) illegal_character(c_cptr);
- }
- c = n;
- break;
-
- case 'a': c = 7; break;
- case 'b': c = '\b'; break;
- case 'f': c = '\f'; break;
- case 'n': c = '\n'; break;
- case 'r': c = '\r'; break;
- case 't': c = '\t'; break;
- case 'v': c = '\v'; break;
- }
- }
- cachec(c);
- }
- FREE(s_line);
-
- n = cinc;
- s = MALLOC(n);
- if (s == 0) no_space();
-
- for (i = 0; i < n; ++i)
- s[i] = cache[i];
-
- cinc = 0;
- if (n == 1)
- cachec('\'');
- else
- cachec('"');
-
- for (i = 0; i < n; ++i)
- {
- c = ((unsigned char *)s)[i];
- if (c == '\\' || c == cache[0])
- {
- cachec('\\');
- cachec(c);
- }
- else if (isprint(c))
- cachec(c);
- else
- {
- cachec('\\');
- switch (c)
- {
- case 7: cachec('a'); break;
- case '\b': cachec('b'); break;
- case '\f': cachec('f'); break;
- case '\n': cachec('n'); break;
- case '\r': cachec('r'); break;
- case '\t': cachec('t'); break;
- case '\v': cachec('v'); break;
- default:
- cachec(((c >> 6) & 7) + '0');
- cachec(((c >> 3) & 7) + '0');
- cachec((c & 7) + '0');
- break;
- }
- }
- }
-
- if (n == 1)
- cachec('\'');
- else
- cachec('"');
-
- cachec(NUL);
- bp = lookup(cache);
- bp->class = TERM;
- if (n == 1 && bp->value == UNDEFINED)
- bp->value = *(unsigned char *)s;
- FREE(s);
-
- return (bp);
-}
-
-
-int
-is_reserved(name)
-char *name;
-{
- char *s;
-
- if (strcmp(name, ".") == 0 ||
- strcmp(name, "$accept") == 0 ||
- strcmp(name, "$end") == 0)
- return (1);
-
- if (name[0] == '$' && name[1] == '$' && isdigit(name[2]))
- {
- s = name + 3;
- while (isdigit(*s)) ++s;
- if (*s == NUL) return (1);
- }
-
- return (0);
-}
-
-
-bucket *
-get_name()
-{
- register int c;
-
- cinc = 0;
- for (c = *cptr; IS_IDENT(c); c = *++cptr)
- cachec(c);
- cachec(NUL);
-
- if (is_reserved(cache)) used_reserved(cache);
-
- return (lookup(cache));
-}
-
-
-int
-get_number()
-{
- register int c;
- register int n;
-
- n = 0;
- for (c = *cptr; isdigit(c); c = *++cptr)
- n = 10*n + (c - '0');
-
- return (n);
-}
-
-
-char *
-get_tag(int emptyOk)
-{
- register int c;
- register int i;
- register char *s;
- int t_lineno = lineno;
- char *t_line = dup_line();
- char *t_cptr = t_line + (cptr - line);
-
- ++cptr;
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (emptyOk && c == '>') {
- ++cptr; return 0; // 0 indicates empty tag if emptyOk
- }
- if (!isalpha(c) && c != '_' && c != '$')
- illegal_tag(t_lineno, t_line, t_cptr);
-
- cinc = 0;
- do { cachec(c); c = *++cptr; } while (IS_IDENT(c));
- cachec(NUL);
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c != '>')
- illegal_tag(t_lineno, t_line, t_cptr);
- ++cptr;
-
- for (i = 0; i < ntags; ++i)
- {
- if (strcmp(cache, tag_table[i]) == 0)
- return (tag_table[i]);
- }
-
- if (ntags >= tagmax)
- {
- tagmax += 16;
- tag_table = (char **)
- (tag_table ? REALLOC(tag_table, tagmax*sizeof(char *))
- : MALLOC(tagmax*sizeof(char *)));
- if (tag_table == 0) no_space();
- }
-
- s = MALLOC(cinc);
- if (s == 0) no_space();
- strcpy(s, cache);
- tag_table[ntags] = s;
- ++ntags;
- FREE(t_line);
- return (s);
-}
-
-
-declare_tokens(assoc)
-int assoc;
-{
- register int c;
- register bucket *bp;
- int value;
- char *tag = 0;
-
- if (assoc != TOKEN) ++prec;
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c == '<')
- {
- tag = get_tag(0);
- c = nextc();
- if (c == EOF) unexpected_EOF();
- }
-
- for (;;)
- {
- if (isalpha(c) || c == '_' || c == '.' || c == '$')
- bp = get_name();
- else if (c == '\'' || c == '"')
- bp = get_literal();
- else
- return;
-
- if (bp == goal) tokenized_start(bp->name);
- bp->class = TERM;
-
- if (tag)
- {
- if (bp->tag && tag != bp->tag)
- retyped_warning(bp->name);
- bp->tag = tag;
- }
-
- if (assoc != TOKEN)
- {
- if (bp->prec && prec != bp->prec)
- reprec_warning(bp->name);
- bp->assoc = assoc;
- bp->prec = prec;
- }
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- value = UNDEFINED;
- if (isdigit(c))
- {
- value = get_number();
- if (bp->value != UNDEFINED && value != bp->value)
- revalued_warning(bp->name);
- bp->value = value;
- c = nextc();
- if (c == EOF) unexpected_EOF();
- }
- }
-}
-
-
-declare_types()
-{
- register int c;
- register bucket *bp;
- char *tag;
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c != '<') syntax_error(lineno, line, cptr);
- tag = get_tag(0);
-
- for (;;)
- {
- c = nextc();
- if (isalpha(c) || c == '_' || c == '.' || c == '$')
- bp = get_name();
- else if (c == '\'' || c == '"')
- bp = get_literal();
- else
- return;
-
- if (bp->tag && tag != bp->tag)
- retyped_warning(bp->name);
- bp->tag = tag;
- }
-}
-
-
-declare_start()
-{
- register int c;
- register bucket *bp;
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (!isalpha(c) && c != '_' && c != '.' && c != '$')
- syntax_error(lineno, line, cptr);
- bp = get_name();
- if (bp->class == TERM)
- terminal_start(bp->name);
- if (goal && goal != bp)
- restarted_warning();
- goal = bp;
-}
-
-
-read_declarations()
-{
- register int c, k;
-
- cache_size = 256;
- cache = MALLOC(cache_size);
- if (cache == 0) no_space();
-
- for (;;)
- {
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c != '%') syntax_error(lineno, line, cptr);
- switch (k = keyword())
- {
- case MARK:
- return;
-
- case TEXT:
- copy_text(prolog_file);
- break;
-
- case TOKEN:
- case LEFT:
- case RIGHT:
- case NONASSOC:
- declare_tokens(k);
- break;
-
- case TYPE:
- declare_types();
- break;
-
- case START:
- declare_start();
- break;
- }
- }
-}
-
-
-initialize_grammar()
-{
- nitems = 4;
- maxitems = 300;
- pitem = (bucket **) MALLOC(maxitems*sizeof(bucket *));
- if (pitem == 0) no_space();
- pitem[0] = 0;
- pitem[1] = 0;
- pitem[2] = 0;
- pitem[3] = 0;
-
- nrules = 3;
- maxrules = 100;
- plhs = (bucket **) MALLOC(maxrules*sizeof(bucket *));
- if (plhs == 0) no_space();
- plhs[0] = 0;
- plhs[1] = 0;
- plhs[2] = 0;
- rprec = (short *) MALLOC(maxrules*sizeof(short));
- if (rprec == 0) no_space();
- rprec[0] = 0;
- rprec[1] = 0;
- rprec[2] = 0;
- rassoc = (char *) MALLOC(maxrules*sizeof(char));
- if (rassoc == 0) no_space();
- rassoc[0] = TOKEN;
- rassoc[1] = TOKEN;
- rassoc[2] = TOKEN;
-}
-
-
-expand_items()
-{
- maxitems += 300;
- pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *));
- if (pitem == 0) no_space();
-}
-
-
-expand_rules()
-{
- maxrules += 100;
- plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *));
- if (plhs == 0) no_space();
- rprec = (short *) REALLOC(rprec, maxrules*sizeof(short));
- if (rprec == 0) no_space();
- rassoc = (char *) REALLOC(rassoc, maxrules*sizeof(char));
- if (rassoc == 0) no_space();
-}
-
-
-advance_to_start()
-{
- register int c;
- register bucket *bp;
- char *s_cptr;
- int s_lineno;
-
- for (;;)
- {
- c = nextc();
- if (c != '%') break;
- s_cptr = cptr;
- switch (keyword())
- {
- case MARK:
- no_grammar();
-
- case TEXT:
- copy_text(local_file);
- break;
-
- case START:
- declare_start();
- break;
-
- default:
- syntax_error(lineno, line, s_cptr);
- }
- }
-
- c = nextc();
- if (!isalpha(c) && c != '_' && c != '.' && c != '_')
- syntax_error(lineno, line, cptr);
- bp = get_name();
- if (goal == 0)
- {
- if (bp->class == TERM)
- terminal_start(bp->name);
- goal = bp;
- }
-
- s_lineno = lineno;
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c != ':') syntax_error(lineno, line, cptr);
- start_rule(bp, s_lineno);
- ++cptr;
-}
-
-
-start_rule(bp, s_lineno)
-register bucket *bp;
-int s_lineno;
-{
- if (bp->class == TERM)
- terminal_lhs(s_lineno);
- bp->class = NONTERM;
- if (nrules >= maxrules)
- expand_rules();
- plhs[nrules] = bp;
- rprec[nrules] = UNDEFINED;
- rassoc[nrules] = TOKEN;
-}
-
-
-end_rule()
-{
- register int i;
-
- if (!last_was_action && plhs[nrules]->tag)
- {
- for (i = nitems - 1; pitem[i]; --i) continue;
- if (pitem[i+1] == 0 || pitem[i+1]->tag != plhs[nrules]->tag)
- default_action_warning(); /** if classes don't match exactly **/
- } /** bug: could be superclass... **/
-
- last_was_action = 0;
- if (nitems >= maxitems) expand_items();
- pitem[nitems] = 0;
- ++nitems;
- ++nrules;
-}
-
-
-insert_empty_rule()
-{
- register bucket *bp, **bpp;
-
- assert(cache);
- sprintf(cache, "$$%d", ++gensym);
- bp = make_bucket(cache);
- last_symbol->next = bp;
- last_symbol = bp;
- bp->tag = plhs[nrules]->tag;
- bp->class = NONTERM;
-
- if ((nitems += 2) > maxitems)
- expand_items();
- bpp = pitem + nitems - 1;
- *bpp-- = bp;
- while (bpp[0] = bpp[-1]) --bpp;
-
- if (++nrules >= maxrules)
- expand_rules();
- plhs[nrules] = plhs[nrules-1];
- plhs[nrules-1] = bp;
- rprec[nrules] = rprec[nrules-1];
- rprec[nrules-1] = 0;
- rassoc[nrules] = rassoc[nrules-1];
- rassoc[nrules-1] = TOKEN;
-}
-
-
-add_symbol()
-{
- register int c;
- register bucket *bp;
- int s_lineno = lineno;
-
- c = *cptr;
- if (c == '\'' || c == '"')
- bp = get_literal();
- else
- bp = get_name();
-
- c = nextc();
- if (c == ':')
- {
- end_rule();
- start_rule(bp, s_lineno);
- ++cptr;
- return;
- }
-
- if (last_was_action)
- insert_empty_rule();
- last_was_action = 0;
-
- if (++nitems > maxitems)
- expand_items();
- pitem[nitems-1] = bp;
-}
-
-
-copy_action()
-{
- register int c;
- register int i, n;
- int depth;
- int quote;
- char *tag;
- register FILE *f = action_file;
- int a_lineno = lineno;
- char *a_line = dup_line();
- char *a_cptr = a_line + (cptr - line);
-
- if (last_was_action)
- insert_empty_rule();
- last_was_action = 1;
-
- fprintf(f, "case %d:\n", nrules - 2);
- fprintf(f, line_format, lineno, input_file_name);
- putc(' ', f); putc(' ', f);
- if (*cptr == '=') ++cptr;
-
- n = 0;
- for (i = nitems - 1; pitem[i]; --i) ++n;
-
- depth = 0;
-loop:
- c = *cptr;
- if (c == '$')
- {
- if (cptr[1] == '<')
- {
- int d_lineno = lineno;
- char *d_line = dup_line();
- char *d_cptr = d_line + (cptr - line);
-
- ++cptr;
- tag = get_tag(1);
- c = *cptr;
- if (c == '$')
- { if (tag && strcmp(tag, "Object"))
- fprintf(f, "((%s)yyVal)", tag);
- else fprintf(f, "yyVal");
- ++cptr;
- FREE(d_line);
- goto loop;
- }
- else if (isdigit(c))
- {
- i = get_number();
- if (i > n) dollar_warning(d_lineno, i);
- if (tag && strcmp(tag, "Object"))
- fprintf(f, "((%s)yyVals[%d+yyTop])", tag, i - n);
- else fprintf(f, "yyVals[%d+yyTop]", i - n);
- FREE(d_line);
- goto loop;
- }
- else if (c == '-' && isdigit(cptr[1]))
- {
- ++cptr;
- i = -get_number() - n;
- if (tag && strcmp(tag, "Object"))
- fprintf(f, "((%s)yyVals[%d+yyTop])", tag, i);
- else fprintf(f, "yyVals[%d+yyTop]", tag, i);
- FREE(d_line);
- goto loop;
- }
- else
- dollar_error(d_lineno, d_line, d_cptr);
- }
- else if (cptr[1] == '$')
- {
- if (ntags && plhs[nrules]->tag == 0)
- untyped_lhs();
- fprintf(f, "yyVal");
- cptr += 2;
- goto loop;
- }
- else if (isdigit(cptr[1]))
- {
- ++cptr;
- i = get_number();
- if (ntags)
- {
- if (i <= 0 || i > n)
- unknown_rhs(i);
- tag = pitem[nitems + i - n - 1]->tag;
- if (tag == 0)
- untyped_rhs(i, pitem[nitems + i - n - 1]->name),
- fprintf(f, "yyVals[%d+yyTop]", i - n);
- else if (strcmp(tag, "Object"))
- fprintf(f, "((%s)yyVals[%d+yyTop])", tag, i - n);
- else
- fprintf(f, "yyVals[%d+yyTop]", i - n);
- }
- else
- {
- if (i > n)
- dollar_warning(lineno, i);
- fprintf(f, "yyVals[%d+yyTop]", i - n);
- }
- goto loop;
- }
- else if (cptr[1] == '-')
- {
- cptr += 2;
- i = get_number();
- if (ntags)
- unknown_rhs(-i);
- fprintf(f, "yyVals[%d+yyTop]", -i - n);
- goto loop;
- }
- }
- if (isalpha(c) || c == '_' || c == '$')
- {
- do
- {
- putc(c, f);
- c = *++cptr;
- } while (isalnum(c) || c == '_' || c == '$');
- goto loop;
- }
- putc(c, f);
- ++cptr;
- switch (c)
- {
- case '\n':
- next_line:
- get_line();
- if (line) goto loop;
- unterminated_action(a_lineno, a_line, a_cptr);
-
- case ';':
- if (depth > 0) goto loop;
- fprintf(f, "\nbreak;\n");
- return;
-
- case '{':
- ++depth;
- goto loop;
-
- case '}':
- if (--depth > 0) goto loop;
- fprintf(f, "\n break;\n");
- return;
-
- case '\'':
- case '"':
- {
- int s_lineno = lineno;
- char *s_line = dup_line();
- char *s_cptr = s_line + (cptr - line - 1);
-
- quote = c;
- for (;;)
- {
- c = *cptr++;
- putc(c, f);
- if (c == quote)
- {
- FREE(s_line);
- goto loop;
- }
- if (c == '\n')
- unterminated_string(s_lineno, s_line, s_cptr);
- if (c == '\\')
- {
- c = *cptr++;
- putc(c, f);
- if (c == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_string(s_lineno, s_line, s_cptr);
- }
- }
- }
- }
-
- case '/':
- c = *cptr;
- if (c == '/')
- {
- putc('*', f);
- while ((c = *++cptr) != '\n')
- {
- if (c == '*' && cptr[1] == '/')
- fprintf(f, "* ");
- else
- putc(c, f);
- }
- fprintf(f, "*/\n");
- goto next_line;
- }
- if (c == '*')
- {
- int c_lineno = lineno;
- char *c_line = dup_line();
- char *c_cptr = c_line + (cptr - line - 1);
-
- putc('*', f);
- ++cptr;
- for (;;)
- {
- c = *cptr++;
- putc(c, f);
- if (c == '*' && *cptr == '/')
- {
- putc('/', f);
- ++cptr;
- FREE(c_line);
- goto loop;
- }
- if (c == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_comment(c_lineno, c_line, c_cptr);
- }
- }
- }
- goto loop;
-
- default:
- goto loop;
- }
-}
-
-
-int
-mark_symbol()
-{
- register int c;
- register bucket *bp;
-
- c = cptr[1];
- if (c == '%' || c == '\\')
- {
- cptr += 2;
- return (1);
- }
-
- if (c == '=')
- cptr += 2;
- else if ((c == 'p' || c == 'P') &&
- ((c = cptr[2]) == 'r' || c == 'R') &&
- ((c = cptr[3]) == 'e' || c == 'E') &&
- ((c = cptr[4]) == 'c' || c == 'C') &&
- ((c = cptr[5], !IS_IDENT(c))))
- cptr += 5;
- else
- syntax_error(lineno, line, cptr);
-
- c = nextc();
- if (isalpha(c) || c == '_' || c == '.' || c == '$')
- bp = get_name();
- else if (c == '\'' || c == '"')
- bp = get_literal();
- else
- {
- syntax_error(lineno, line, cptr);
- /*NOTREACHED*/
- }
-
- if (rprec[nrules] != UNDEFINED && bp->prec != rprec[nrules])
- prec_redeclared();
-
- rprec[nrules] = bp->prec;
- rassoc[nrules] = bp->assoc;
- return (0);
-}
-
-
-read_grammar()
-{
- register int c;
-
- initialize_grammar();
- advance_to_start();
-
- for (;;)
- {
- c = nextc();
- if (c == EOF) break;
- if (isalpha(c) || c == '_' || c == '.' || c == '$' || c == '\'' ||
- c == '"')
- add_symbol();
- else if (c == '{' || c == '=')
- copy_action();
- else if (c == '|')
- {
- end_rule();
- start_rule(plhs[nrules-1], 0);
- ++cptr;
- }
- else if (c == '%')
- {
- if (mark_symbol()) break;
- }
- else
- syntax_error(lineno, line, cptr);
- }
- end_rule();
-}
-
-
-free_tags()
-{
- register int i;
-
- if (tag_table == 0) return;
-
- for (i = 0; i < ntags; ++i)
- {
- assert(tag_table[i]);
- FREE(tag_table[i]);
- }
- FREE(tag_table);
-}
-
-
-pack_names()
-{
- register bucket *bp;
- register char *p, *s, *t;
-
- name_pool_size = 13; /* 13 == sizeof("$end") + sizeof("$accept") */
- for (bp = first_symbol; bp; bp = bp->next)
- name_pool_size += strlen(bp->name) + 1;
- name_pool = MALLOC(name_pool_size);
- if (name_pool == 0) no_space();
-
- strcpy(name_pool, "$accept");
- strcpy(name_pool+8, "$end");
- t = name_pool + 13;
- for (bp = first_symbol; bp; bp = bp->next)
- {
- p = t;
- s = bp->name;
- while (*t++ = *s++) continue;
- FREE(bp->name);
- bp->name = p;
- }
-}
-
-
-check_symbols()
-{
- register bucket *bp;
-
- if (goal->class == UNKNOWN)
- undefined_goal(goal->name);
-
- for (bp = first_symbol; bp; bp = bp->next)
- {
- if (bp->class == UNKNOWN)
- {
- undefined_symbol_warning(bp->name);
- bp->class = TERM;
- }
- }
-}
-
-
-pack_symbols()
-{
- register bucket *bp;
- register bucket **v;
- register int i, j, k, n;
-
- nsyms = 2;
- ntokens = 1;
- for (bp = first_symbol; bp; bp = bp->next)
- {
- ++nsyms;
- if (bp->class == TERM) ++ntokens;
- }
- start_symbol = ntokens;
- nvars = nsyms - ntokens;
-
- symbol_name = (char **) MALLOC(nsyms*sizeof(char *));
- if (symbol_name == 0) no_space();
- symbol_value = (short *) MALLOC(nsyms*sizeof(short));
- if (symbol_value == 0) no_space();
- symbol_prec = (short *) MALLOC(nsyms*sizeof(short));
- if (symbol_prec == 0) no_space();
- symbol_assoc = MALLOC(nsyms);
- if (symbol_assoc == 0) no_space();
-
- v = (bucket **) MALLOC(nsyms*sizeof(bucket *));
- if (v == 0) no_space();
-
- v[0] = 0;
- v[start_symbol] = 0;
-
- i = 1;
- j = start_symbol + 1;
- for (bp = first_symbol; bp; bp = bp->next)
- {
- if (bp->class == TERM)
- v[i++] = bp;
- else
- v[j++] = bp;
- }
- assert(i == ntokens && j == nsyms);
-
- for (i = 1; i < ntokens; ++i)
- v[i]->index = i;
-
- goal->index = start_symbol + 1;
- k = start_symbol + 2;
- while (++i < nsyms)
- if (v[i] != goal)
- {
- v[i]->index = k;
- ++k;
- }
-
- goal->value = 0;
- k = 1;
- for (i = start_symbol + 1; i < nsyms; ++i)
- {
- if (v[i] != goal)
- {
- v[i]->value = k;
- ++k;
- }
- }
-
- k = 0;
- for (i = 1; i < ntokens; ++i)
- {
- n = v[i]->value;
- if (n > 256)
- {
- for (j = k++; j > 0 && symbol_value[j-1] > n; --j)
- symbol_value[j] = symbol_value[j-1];
- symbol_value[j] = n;
- }
- }
-
- if (v[1]->value == UNDEFINED)
- v[1]->value = 256;
-
- j = 0;
- n = 257;
- for (i = 2; i < ntokens; ++i)
- {
- if (v[i]->value == UNDEFINED)
- {
- while (j < k && n == symbol_value[j])
- {
- while (++j < k && n == symbol_value[j]) continue;
- ++n;
- }
- v[i]->value = n;
- ++n;
- }
- }
-
- symbol_name[0] = name_pool + 8;
- symbol_value[0] = 0;
- symbol_prec[0] = 0;
- symbol_assoc[0] = TOKEN;
- for (i = 1; i < ntokens; ++i)
- {
- symbol_name[i] = v[i]->name;
- symbol_value[i] = v[i]->value;
- symbol_prec[i] = v[i]->prec;
- symbol_assoc[i] = v[i]->assoc;
- }
- symbol_name[start_symbol] = name_pool;
- symbol_value[start_symbol] = -1;
- symbol_prec[start_symbol] = 0;
- symbol_assoc[start_symbol] = TOKEN;
- for (++i; i < nsyms; ++i)
- {
- k = v[i]->index;
- symbol_name[k] = v[i]->name;
- symbol_value[k] = v[i]->value;
- symbol_prec[k] = v[i]->prec;
- symbol_assoc[k] = v[i]->assoc;
- }
-
- FREE(v);
-}
-
-
-pack_grammar()
-{
- register int i, j;
- int assoc, prec;
-
- ritem = (short *) MALLOC(nitems*sizeof(short));
- if (ritem == 0) no_space();
- rlhs = (short *) MALLOC(nrules*sizeof(short));
- if (rlhs == 0) no_space();
- rrhs = (short *) MALLOC((nrules+1)*sizeof(short));
- if (rrhs == 0) no_space();
- rprec = (short *) REALLOC(rprec, nrules*sizeof(short));
- if (rprec == 0) no_space();
- rassoc = REALLOC(rassoc, nrules);
- if (rassoc == 0) no_space();
-
- ritem[0] = -1;
- ritem[1] = goal->index;
- ritem[2] = 0;
- ritem[3] = -2;
- rlhs[0] = 0;
- rlhs[1] = 0;
- rlhs[2] = start_symbol;
- rrhs[0] = 0;
- rrhs[1] = 0;
- rrhs[2] = 1;
-
- j = 4;
- for (i = 3; i < nrules; ++i)
- {
- rlhs[i] = plhs[i]->index;
- rrhs[i] = j;
- assoc = TOKEN;
- prec = 0;
- while (pitem[j])
- {
- ritem[j] = pitem[j]->index;
- if (pitem[j]->class == TERM)
- {
- prec = pitem[j]->prec;
- assoc = pitem[j]->assoc;
- }
- ++j;
- }
- ritem[j] = -i;
- ++j;
- if (rprec[i] == UNDEFINED)
- {
- rprec[i] = prec;
- rassoc[i] = assoc;
- }
- }
- rrhs[i] = j;
-
- FREE(plhs);
- FREE(pitem);
-}
-
-
-print_grammar()
-{
- register int i, j, k;
- int spacing;
- register FILE *f = verbose_file;
-
- if (!vflag) return;
-
- k = 1;
- for (i = 2; i < nrules; ++i)
- {
- if (rlhs[i] != rlhs[i-1])
- {
- if (i != 2) fprintf(f, "\n");
- fprintf(f, "%4d %s :", i - 2, symbol_name[rlhs[i]]);
- spacing = strlen(symbol_name[rlhs[i]]) + 1;
- }
- else
- {
- fprintf(f, "%4d ", i - 2);
- j = spacing;
- while (--j >= 0) putc(' ', f);
- putc('|', f);
- }
-
- while (ritem[k] >= 0)
- {
- fprintf(f, " %s", symbol_name[ritem[k]]);
- ++k;
- }
- ++k;
- putc('\n', f);
- }
-}
-
-
-reader()
-{
- create_symbol_table();
- read_declarations();
- read_grammar();
- free_symbol_table();
- free_tags();
- pack_names();
- check_symbols();
- pack_symbols();
- pack_grammar();
- free_symbols();
- print_grammar();
-}
diff --git a/mcs/jay/skeleton b/mcs/jay/skeleton
deleted file mode 100644
index 07135c082f2..00000000000
--- a/mcs/jay/skeleton
+++ /dev/null
@@ -1,268 +0,0 @@
-# jay skeleton
-
-# character in column 1 determines outcome...
-# # is a comment
-# . is copied
-# t is copied as //t if -t is set
-# other lines are interpreted to call jay procedures
-
-.// created by jay 0.7 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de
-.
- prolog ## %{ ... %} prior to the first %%
-
-.// %token constants
-.
- tokens public static final int
-.
-. /** thrown for irrecoverable syntax errors and stack overflow.
-. */
-. public static class yyException extends java.lang.Exception {
-. public yyException (String message) {
-. super(message);
-. }
-. }
-.
-. /** must be implemented by a scanner object to supply input to the parser.
-. */
-. public interface yyInput {
-. /** move on to next token.
-. @return false if positioned beyond tokens.
-. @throws IOException on input error.
-. */
-. boolean advance () throws java.io.IOException;
-. /** classifies current token.
-. Should not be called if advance() returned false.
-. @return current %token or single character.
-. */
-. int token ();
-. /** associated with current token.
-. Should not be called if advance() returned false.
-. @return value for token().
-. */
-. Object value ();
-. }
-.
-. /** simplified error message.
-. @see <a href="#yyerror(java.lang.String, java.lang.String[])">yyerror</a>
-. */
-. public void yyerror (String message) {
-. yyerror(message, null);
-. }
-.
-. /** (syntax) error message.
-. Can be overwritten to control message format.
-. @param message text to be displayed.
-. @param expected vector of acceptable tokens, if available.
-. */
-. public void yyerror (String message, String[] expected) {
-. if (expected != null && expected.length > 0) {
-. System.err.print(message+", expecting");
-. for (int n = 0; n < expected.length; ++ n)
-. System.err.print(" "+expected[n]);
-. System.err.println();
-. } else
-. System.err.println(message);
-. }
-.
-. /** debugging support, requires the package jay.yydebug.
-. Set to null to suppress debugging messages.
-. */
-t protected jay.yydebug.yyDebug yydebug;
-.
- debug ## tables for debugging support
-.
-. /** index-checked interface to yyName[].
-. @param token single character or %token value.
-. @return token name or [illegal] or [unknown].
-. */
-t public static final String yyname (int token) {
-t if (token < 0 || token > yyName.length) return "[illegal]";
-t String name;
-t if ((name = yyName[token]) != null) return name;
-t return "[unknown]";
-t }
-.
-. /** computes list of expected tokens on error by tracing the tables.
-. @param state for which to compute the list.
-. @return list of token names.
-. */
-. protected String[] yyExpecting (int state) {
-. int token, n, len = 0;
-. boolean[] ok = new boolean[yyName.length];
-.
-. if ((n = yySindex[state]) != 0)
-. for (token = n < 0 ? -n : 0;
-. token < yyName.length && n+token < yyTable.length; ++ token)
-. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
-. ++ len;
-. ok[token] = true;
-. }
-. if ((n = yyRindex[state]) != 0)
-. for (token = n < 0 ? -n : 0;
-. token < yyName.length && n+token < yyTable.length; ++ token)
-. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
-. ++ len;
-. ok[token] = true;
-. }
-.
-. String result[] = new String[len];
-. for (n = token = 0; n < len; ++ token)
-. if (ok[token]) result[n++] = yyName[token];
-. return result;
-. }
-.
-. /** the generated parser, with debugging messages.
-. Maintains a state and a value stack, currently with fixed maximum size.
-. @param yyLex scanner.
-. @param yydebug debug message writer implementing yyDebug, or null.
-. @return result of the last reduction, if any.
-. @throws yyException on irrecoverable parse error.
-. */
-. public Object yyparse (yyInput yyLex, Object yydebug)
-. throws java.io.IOException, yyException {
-t this.yydebug = (jay.yydebug.yyDebug)yydebug;
-. return yyparse(yyLex);
-. }
-.
-. /** initial size and increment of the state/value stack [default 256].
-. This is not final so that it can be overwritten outside of invocations
-. of yyparse().
-. */
-. protected int yyMax;
-.
-. /** executed at the beginning of a reduce action.
-. Used as $$ = yyDefault($1), prior to the user-specified action, if any.
-. Can be overwritten to provide deep copy, etc.
-. @param first value for $1, or null.
-. @return first.
-. */
-. protected Object yyDefault (Object first) {
-. return first;
-. }
-.
-. /** the generated parser.
-. Maintains a state and a value stack, currently with fixed maximum size.
-. @param yyLex scanner.
-. @return result of the last reduction, if any.
-. @throws yyException on irrecoverable parse error.
-. */
-. public Object yyparse (yyInput yyLex)
-. throws java.io.IOException, yyException {
-. if (yyMax <= 0) yyMax = 256; // initial size
-. int yyState = 0, yyStates[] = new int[yyMax]; // state stack
-. Object yyVal = null, yyVals[] = new Object[yyMax]; // value stack
-. int yyToken = -1; // current input
-. int yyErrorFlag = 0; // #tks to shift
-.
- local ## %{ ... %} after the first %%
-
-. yyLoop: for (int yyTop = 0;; ++ yyTop) {
-. if (yyTop >= yyStates.length) { // dynamically increase
-. int[] i = new int[yyStates.length+yyMax];
-. System.arraycopy(yyStates, 0, i, 0, yyStates.length);
-. yyStates = i;
-. Object[] o = new Object[yyVals.length+yyMax];
-. System.arraycopy(yyVals, 0, o, 0, yyVals.length);
-. yyVals = o;
-. }
-. yyStates[yyTop] = yyState;
-. yyVals[yyTop] = yyVal;
-t if (yydebug != null) yydebug.push(yyState, yyVal);
-.
-. yyDiscarded: for (;;) { // discarding a token does not change stack
-. int yyN;
-. if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN)
-. if (yyToken < 0) {
-. yyToken = yyLex.advance() ? yyLex.token() : 0;
-t if (yydebug != null)
-t yydebug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
-. }
-. if ((yyN = yySindex[yyState]) != 0 && (yyN += yyToken) >= 0
-. && yyN < yyTable.length && yyCheck[yyN] == yyToken) {
-t if (yydebug != null)
-t yydebug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
-. yyState = yyTable[yyN]; // shift to yyN
-. yyVal = yyLex.value();
-. yyToken = -1;
-. if (yyErrorFlag > 0) -- yyErrorFlag;
-. continue yyLoop;
-. }
-. if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
-. && yyN < yyTable.length && yyCheck[yyN] == yyToken)
-. yyN = yyTable[yyN]; // reduce (yyN)
-. else
-. switch (yyErrorFlag) {
-.
-. case 0:
-. yyerror("syntax error", yyExpecting(yyState));
-t if (yydebug != null) yydebug.error("syntax error");
-.
-. case 1: case 2:
-. yyErrorFlag = 3;
-. do {
-. if ((yyN = yySindex[yyStates[yyTop]]) != 0
-. && (yyN += yyErrorCode) >= 0 && yyN < yyTable.length
-. && yyCheck[yyN] == yyErrorCode) {
-t if (yydebug != null)
-t yydebug.shift(yyStates[yyTop], yyTable[yyN], 3);
-. yyState = yyTable[yyN];
-. yyVal = yyLex.value();
-. continue yyLoop;
-. }
-t if (yydebug != null) yydebug.pop(yyStates[yyTop]);
-. } while (-- yyTop >= 0);
-t if (yydebug != null) yydebug.reject();
-. throw new yyException("irrecoverable syntax error");
-.
-. case 3:
-. if (yyToken == 0) {
-t if (yydebug != null) yydebug.reject();
-. throw new yyException("irrecoverable syntax error at end-of-file");
-. }
-t if (yydebug != null)
-t yydebug.discard(yyState, yyToken, yyname(yyToken),
-t yyLex.value());
-. yyToken = -1;
-. continue yyDiscarded; // leave stack alone
-. }
-. }
-. int yyV = yyTop + 1-yyLen[yyN];
-t if (yydebug != null)
-t yydebug.reduce(yyState, yyStates[yyV-1], yyN, yyRule[yyN], yyLen[yyN]);
-. yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
-. switch (yyN) {
-
- actions ## code from the actions within the grammar
-
-. }
-. yyTop -= yyLen[yyN];
-. yyState = yyStates[yyTop];
-. int yyM = yyLhs[yyN];
-. if (yyState == 0 && yyM == 0) {
-t if (yydebug != null) yydebug.shift(0, yyFinal);
-. yyState = yyFinal;
-. if (yyToken < 0) {
-. yyToken = yyLex.advance() ? yyLex.token() : 0;
-t if (yydebug != null)
-t yydebug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
-. }
-. if (yyToken == 0) {
-t if (yydebug != null) yydebug.accept(yyVal);
-. return yyVal;
-. }
-. continue yyLoop;
-. }
-. if ((yyN = yyGindex[yyM]) != 0 && (yyN += yyState) >= 0
-. && yyN < yyTable.length && yyCheck[yyN] == yyState)
-. yyState = yyTable[yyN];
-. else
-. yyState = yyDgoto[yyM];
-t if (yydebug != null) yydebug.shift(yyStates[yyTop], yyState);
-. continue yyLoop;
-. }
-. }
-. }
-.
- tables ## tables for rules, default reduction, and action calls
-.
- epilog ## text following second %%
diff --git a/mcs/jay/skeleton.cs b/mcs/jay/skeleton.cs
deleted file mode 100644
index a2ed00734f7..00000000000
--- a/mcs/jay/skeleton.cs
+++ /dev/null
@@ -1,352 +0,0 @@
-# jay skeleton
-
-# character in column 1 determines outcome...
-# # is a comment
-# . is copied
-# t is copied as //t if -t is set
-# other lines are interpreted to call jay procedures
-
-.// created by jay 0.7 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de
-.
- prolog ## %{ ... %} prior to the first %%
-
-.
-. /** simplified error message.
-. @see <a href="#yyerror(java.lang.String, java.lang.String[])">yyerror</a>
-. */
-. public void yyerror (string message) {
-. yyerror(message, null);
-. }
-.
-. /** (syntax) error message.
-. Can be overwritten to control message format.
-. @param message text to be displayed.
-. @param expected vector of acceptable tokens, if available.
-. */
-. public void yyerror (string message, string[] expected) {
-. if ((expected != null) && (expected.Length > 0)) {
-. System.Console.Write (message+", expecting");
-. for (int n = 0; n < expected.Length; ++ n)
-. System.Console.Write (" "+expected[n]);
-. System.Console.WriteLine ();
-. } else
-. System.Console.WriteLine (message);
-. }
-.
-. /** debugging support, requires the package jay.yydebug.
-. Set to null to suppress debugging messages.
-. */
-t protected yydebug.yyDebug debug;
-.
- debug ## tables for debugging support
-.
-. /** index-checked interface to yyName[].
-. @param token single character or %token value.
-. @return token name or [illegal] or [unknown].
-. */
-t public static string yyname (int token) {
-t if ((token < 0) || (token > yyName.Length)) return "[illegal]";
-t string name;
-t if ((name = yyName[token]) != null) return name;
-t return "[unknown]";
-t }
-.
-. /** computes list of expected tokens on error by tracing the tables.
-. @param state for which to compute the list.
-. @return list of token names.
-. */
-. protected string[] yyExpecting (int state) {
-. int token, n, len = 0;
-. bool[] ok = new bool[yyName.Length];
-.
-. if ((n = yySindex[state]) != 0)
-. for (token = n < 0 ? -n : 0;
-. (token < yyName.Length) && (n+token < yyTable.Length); ++ token)
-. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
-. ++ len;
-. ok[token] = true;
-. }
-. if ((n = yyRindex[state]) != 0)
-. for (token = n < 0 ? -n : 0;
-. (token < yyName.Length) && (n+token < yyTable.Length); ++ token)
-. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
-. ++ len;
-. ok[token] = true;
-. }
-.
-. string [] result = new string[len];
-. for (n = token = 0; n < len; ++ token)
-. if (ok[token]) result[n++] = yyName[token];
-. return result;
-. }
-.
-. /** the generated parser, with debugging messages.
-. Maintains a state and a value stack, currently with fixed maximum size.
-. @param yyLex scanner.
-. @param yydebug debug message writer implementing yyDebug, or null.
-. @return result of the last reduction, if any.
-. @throws yyException on irrecoverable parse error.
-. */
-. public Object yyparse (yyParser.yyInput yyLex, Object yyd)
-. {
-t this.debug = (yydebug.yyDebug)yyd;
-. return yyparse(yyLex);
-. }
-.
-. /** initial size and increment of the state/value stack [default 256].
-. This is not final so that it can be overwritten outside of invocations
-. of yyparse().
-. */
-. protected int yyMax;
-.
-. /** executed at the beginning of a reduce action.
-. Used as $$ = yyDefault($1), prior to the user-specified action, if any.
-. Can be overwritten to provide deep copy, etc.
-. @param first value for $1, or null.
-. @return first.
-. */
-. protected Object yyDefault (Object first) {
-. return first;
-. }
-.
-. /** the generated parser.
-. Maintains a state and a value stack, currently with fixed maximum size.
-. @param yyLex scanner.
-. @return result of the last reduction, if any.
-. @throws yyException on irrecoverable parse error.
-. */
-. public Object yyparse (yyParser.yyInput yyLex)
-. {
-. if (yyMax <= 0) yyMax = 256; // initial size
-. int yyState = 0; // state stack ptr
-. int [] yyStates = new int[yyMax]; // state stack
-. Object yyVal = null; // value stack ptr
-. Object [] yyVals = new Object[yyMax]; // value stack
-. int yyToken = -1; // current input
-. int yyErrorFlag = 0; // #tks to shift
-.
- local ## %{ ... %} after the first %%
-
-. int yyTop = 0;
-. goto skip;
-. yyLoop:
-. yyTop++;
-. skip:
-. for (;; ++ yyTop) {
-. if (yyTop >= yyStates.Length) { // dynamically increase
-. int[] i = new int[yyStates.Length+yyMax];
-. System.Array.Copy(yyStates, i, 0);
-. yyStates = i;
-. Object[] o = new Object[yyVals.Length+yyMax];
-. System.Array.Copy(yyVals, o, 0);
-. yyVals = o;
-. }
-. yyStates[yyTop] = yyState;
-. yyVals[yyTop] = yyVal;
-t if (debug != null) debug.push(yyState, yyVal);
-.
-. yyDiscarded: for (;;) { // discarding a token does not change stack
-. int yyN;
-. if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN)
-. if (yyToken < 0) {
-. yyToken = yyLex.advance() ? yyLex.token() : 0;
-t if (debug != null)
-t debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
-. }
-. if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)
-. && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {
-t if (debug != null)
-t debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
-. yyState = yyTable[yyN]; // shift to yyN
-. yyVal = yyLex.value();
-. yyToken = -1;
-. if (yyErrorFlag > 0) -- yyErrorFlag;
-. goto yyLoop;
-. }
-. if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
-. && yyN < yyTable.Length && yyCheck[yyN] == yyToken)
-. yyN = yyTable[yyN]; // reduce (yyN)
-. else
-. switch (yyErrorFlag) {
-.
-. case 0:
-. yyerror("syntax error", yyExpecting(yyState));
-t if (debug != null) debug.error("syntax error");
-. goto case 1;
-. case 1: case 2:
-. yyErrorFlag = 3;
-. do {
-. if ((yyN = yySindex[yyStates[yyTop]]) != 0
-. && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length
-. && yyCheck[yyN] == Token.yyErrorCode) {
-t if (debug != null)
-t debug.shift(yyStates[yyTop], yyTable[yyN], 3);
-. yyState = yyTable[yyN];
-. yyVal = yyLex.value();
-. goto yyLoop;
-. }
-t if (debug != null) debug.pop(yyStates[yyTop]);
-. } while (-- yyTop >= 0);
-t if (debug != null) debug.reject();
-. throw new yyParser.yyException("irrecoverable syntax error");
-.
-. case 3:
-. if (yyToken == 0) {
-t if (debug != null) debug.reject();
-. throw new yyParser.yyException("irrecoverable syntax error at end-of-file");
-. }
-t if (debug != null)
-t debug.discard(yyState, yyToken, yyname(yyToken),
-t yyLex.value());
-. yyToken = -1;
-. goto yyDiscarded; // leave stack alone
-. }
-. }
-. int yyV = yyTop + 1-yyLen[yyN];
-t if (debug != null)
-t debug.reduce(yyState, yyStates[yyV-1], yyN, yyRule[yyN], yyLen[yyN]);
-. yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
-. switch (yyN) {
-
- actions ## code from the actions within the grammar
-
-. }
-. yyTop -= yyLen[yyN];
-. yyState = yyStates[yyTop];
-. int yyM = yyLhs[yyN];
-. if (yyState == 0 && yyM == 0) {
-t if (debug != null) debug.shift(0, yyFinal);
-. yyState = yyFinal;
-. if (yyToken < 0) {
-. yyToken = yyLex.advance() ? yyLex.token() : 0;
-t if (debug != null)
-t debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
-. }
-. if (yyToken == 0) {
-t if (debug != null) debug.accept(yyVal);
-. return yyVal;
-. }
-. goto yyLoop;
-. }
-. if (((yyN = yyGindex[yyM]) != 0) && ((yyN += yyState) >= 0)
-. && (yyN < yyTable.Length) && (yyCheck[yyN] == yyState))
-. yyState = yyTable[yyN];
-. else
-. yyState = yyDgoto[yyM];
-t if (debug != null) debug.shift(yyStates[yyTop], yyState);
-. goto yyLoop;
-. }
-. }
-. }
-.
- tables ## tables for rules, default reduction, and action calls
-.
- epilog ## text following second %%
-.namespace yydebug {
-. using System;
-. public interface yyDebug {
-. void push (int state, Object value);
-. void lex (int state, int token, string name, Object value);
-. void shift (int from, int to, int errorFlag);
-. void pop (int state);
-. void discard (int state, int token, string name, Object value);
-. void reduce (int from, int to, int rule, string text, int len);
-. void shift (int from, int to);
-. void accept (Object value);
-. void error (string message);
-. void reject ();
-. }
-.
-. class yyDebugSimple : yyDebug {
-. void println (string s){
-. Console.WriteLine (s);
-. }
-.
-. public void push (int state, Object value) {
-. println ("push\tstate "+state+"\tvalue "+value);
-. }
-.
-. public void lex (int state, int token, string name, Object value) {
-. println("lex\tstate "+state+"\treading "+name+"\tvalue "+value);
-. }
-.
-. public void shift (int from, int to, int errorFlag) {
-. switch (errorFlag) {
-. default: // normally
-. println("shift\tfrom state "+from+" to "+to);
-. break;
-. case 0: case 1: case 2: // in error recovery
-. println("shift\tfrom state "+from+" to "+to
-. +"\t"+errorFlag+" left to recover");
-. break;
-. case 3: // normally
-. println("shift\tfrom state "+from+" to "+to+"\ton error");
-. break;
-. }
-. }
-.
-. public void pop (int state) {
-. println("pop\tstate "+state+"\ton error");
-. }
-.
-. public void discard (int state, int token, string name, Object value) {
-. println("discard\tstate "+state+"\ttoken "+name+"\tvalue "+value);
-. }
-.
-. public void reduce (int from, int to, int rule, string text, int len) {
-. println("reduce\tstate "+from+"\tuncover "+to
-. +"\trule ("+rule+") "+text);
-. }
-.
-. public void shift (int from, int to) {
-. println("goto\tfrom state "+from+" to "+to);
-. }
-.
-. public void accept (Object value) {
-. println("accept\tvalue "+value);
-. }
-.
-. public void error (string message) {
-. println("error\t"+message);
-. }
-.
-. public void reject () {
-. println("reject");
-. }
-.
-. }
-.}
-.// %token constants
-. class Token {
- tokens public const int
-. }
-. namespace yyParser {
-. using System;
-. /** thrown for irrecoverable syntax errors and stack overflow.
-. */
-. public class yyException : System.Exception {
-. public yyException (string message) : base (message) {
-. }
-. }
-.
-. /** must be implemented by a scanner object to supply input to the parser.
-. */
-. public interface yyInput {
-. /** move on to next token.
-. @return false if positioned beyond tokens.
-. @throws IOException on input error.
-. */
-. bool advance (); // throws java.io.IOException;
-. /** classifies current token.
-. Should not be called if advance() returned false.
-. @return current %token or single character.
-. */
-. int token ();
-. /** associated with current token.
-. Should not be called if advance() returned false.
-. @return value for token().
-. */
-. Object value ();
-. }
-. }
-.} // close outermost namespace, that MUST HAVE BEEN opened in the prolog
diff --git a/mcs/jay/symtab.c b/mcs/jay/symtab.c
deleted file mode 100644
index 0c5f55c535b..00000000000
--- a/mcs/jay/symtab.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)symtab.c 5.3 (Berkeley) 6/1/90";
-#endif /* not lint */
-
-#include "defs.h"
-
-/* TABLE_SIZE is the number of entries in the symbol table. */
-/* TABLE_SIZE must be a power of two. */
-
-#define TABLE_SIZE 1024
-
-
-bucket **symbol_table;
-bucket *first_symbol;
-bucket *last_symbol;
-
-
-int
-hash(name)
-char *name;
-{
- register char *s;
- register int c, k;
-
- assert(name && *name);
- s = name;
- k = *s;
- while (c = *++s)
- k = (31*k + c) & (TABLE_SIZE - 1);
-
- return (k);
-}
-
-
-bucket *
-make_bucket(name)
-char *name;
-{
- register bucket *bp;
-
- assert(name);
- bp = (bucket *) MALLOC(sizeof(bucket));
- if (bp == 0) no_space();
- bp->link = 0;
- bp->next = 0;
- bp->name = MALLOC(strlen(name) + 1);
- if (bp->name == 0) no_space();
- bp->tag = 0;
- bp->value = UNDEFINED;
- bp->index = 0;
- bp->prec = 0;
- bp-> class = UNKNOWN;
- bp->assoc = TOKEN;
-
- if (bp->name == 0) no_space();
- strcpy(bp->name, name);
-
- return (bp);
-}
-
-
-bucket *
-lookup(name)
-char *name;
-{
- register bucket *bp, **bpp;
-
- bpp = symbol_table + hash(name);
- bp = *bpp;
-
- while (bp)
- {
- if (strcmp(name, bp->name) == 0) return (bp);
- bpp = &bp->link;
- bp = *bpp;
- }
-
- *bpp = bp = make_bucket(name);
- last_symbol->next = bp;
- last_symbol = bp;
-
- return (bp);
-}
-
-
-create_symbol_table()
-{
- register int i;
- register bucket *bp;
-
- symbol_table = (bucket **) MALLOC(TABLE_SIZE*sizeof(bucket *));
- if (symbol_table == 0) no_space();
- for (i = 0; i < TABLE_SIZE; i++)
- symbol_table[i] = 0;
-
- bp = make_bucket("error");
- bp->index = 1;
- bp->class = TERM;
-
- first_symbol = bp;
- last_symbol = bp;
- symbol_table[hash("error")] = bp;
-}
-
-
-free_symbol_table()
-{
- FREE(symbol_table);
- symbol_table = 0;
-}
-
-
-free_symbols()
-{
- register bucket *p, *q;
-
- for (p = first_symbol; p; p = q)
- {
- q = p->next;
- FREE(p);
- }
-}
diff --git a/mcs/jay/verbose.c b/mcs/jay/verbose.c
deleted file mode 100644
index 33ae265ee2e..00000000000
--- a/mcs/jay/verbose.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)verbose.c 5.3 (Berkeley) 1/20/91";
-#endif /* not lint */
-
-#include "defs.h"
-
-static short *null_rules;
-
-verbose()
-{
- register int i;
-
- if (!vflag) return;
-
- null_rules = (short *) MALLOC(nrules*sizeof(short));
- if (null_rules == 0) no_space();
- fprintf(verbose_file, "\f\n");
- for (i = 0; i < nstates; i++)
- print_state(i);
- FREE(null_rules);
-
- if (nunused)
- log_unused();
- if (SRtotal || RRtotal)
- log_conflicts();
-
- fprintf(verbose_file, "\n\n%d terminals, %d nonterminals\n", ntokens,
- nvars);
- fprintf(verbose_file, "%d grammar rules, %d states\n", nrules - 2, nstates);
-}
-
-
-log_unused()
-{
- register int i;
- register short *p;
-
- fprintf(verbose_file, "\n\nRules never reduced:\n");
- for (i = 3; i < nrules; ++i)
- {
- if (!rules_used[i])
- {
- fprintf(verbose_file, "\t%s :", symbol_name[rlhs[i]]);
- for (p = ritem + rrhs[i]; *p >= 0; ++p)
- fprintf(verbose_file, " %s", symbol_name[*p]);
- fprintf(verbose_file, " (%d)\n", i - 2);
- }
- }
-}
-
-
-log_conflicts()
-{
- register int i;
-
- fprintf(verbose_file, "\n\n");
- for (i = 0; i < nstates; i++)
- {
- if (SRconflicts[i] || RRconflicts[i])
- {
- fprintf(verbose_file, "State %d contains ", i);
- if (SRconflicts[i] == 1)
- fprintf(verbose_file, "1 shift/reduce conflict");
- else if (SRconflicts[i] > 1)
- fprintf(verbose_file, "%d shift/reduce conflicts",
- SRconflicts[i]);
- if (SRconflicts[i] && RRconflicts[i])
- fprintf(verbose_file, ", ");
- if (RRconflicts[i] == 1)
- fprintf(verbose_file, "1 reduce/reduce conflict");
- else if (RRconflicts[i] > 1)
- fprintf(verbose_file, "%d reduce/reduce conflicts",
- RRconflicts[i]);
- fprintf(verbose_file, ".\n");
- }
- }
-}
-
-
-print_state(state)
-int state;
-{
- if (state)
- fprintf(verbose_file, "\n\n");
- if (SRconflicts[state] || RRconflicts[state])
- print_conflicts(state);
- fprintf(verbose_file, "state %d\n", state);
- print_core(state);
- print_nulls(state);
- print_actions(state);
-}
-
-
-print_conflicts(state)
-int state;
-{
- register int symbol, act, number;
- register action *p;
-
- symbol = -1;
- for (p = parser[state]; p; p = p->next)
- {
- if (p->suppressed == 2)
- continue;
-
- if (p->symbol != symbol)
- {
- symbol = p->symbol;
- number = p->number;
- if (p->action_code == SHIFT)
- act = SHIFT;
- else
- act = REDUCE;
- }
- else if (p->suppressed == 1)
- {
- if (state == final_state && symbol == 0)
- {
- fprintf(verbose_file, "%d: shift/reduce conflict \
-(accept, reduce %d) on $end\n", state, p->number - 2);
- }
- else
- {
- if (act == SHIFT)
- {
- fprintf(verbose_file, "%d: shift/reduce conflict \
-(shift %d, reduce %d) on %s\n", state, number, p->number - 2,
- symbol_name[symbol]);
- }
- else
- {
- fprintf(verbose_file, "%d: reduce/reduce conflict \
-(reduce %d, reduce %d) on %s\n", state, number - 2, p->number - 2,
- symbol_name[symbol]);
- }
- }
- }
- }
-}
-
-
-print_core(state)
-int state;
-{
- register int i;
- register int k;
- register int rule;
- register core *statep;
- register short *sp;
- register short *sp1;
-
- statep = state_table[state];
- k = statep->nitems;
-
- for (i = 0; i < k; i++)
- {
- sp1 = sp = ritem + statep->items[i];
-
- while (*sp >= 0) ++sp;
- rule = -(*sp);
- fprintf(verbose_file, "\t%s : ", symbol_name[rlhs[rule]]);
-
- for (sp = ritem + rrhs[rule]; sp < sp1; sp++)
- fprintf(verbose_file, "%s ", symbol_name[*sp]);
-
- putc('.', verbose_file);
-
- while (*sp >= 0)
- {
- fprintf(verbose_file, " %s", symbol_name[*sp]);
- sp++;
- }
- fprintf(verbose_file, " (%d)\n", -2 - *sp);
- }
-}
-
-
-print_nulls(state)
-int state;
-{
- register action *p;
- register int i, j, k, nnulls;
-
- nnulls = 0;
- for (p = parser[state]; p; p = p->next)
- {
- if (p->action_code == REDUCE &&
- (p->suppressed == 0 || p->suppressed == 1))
- {
- i = p->number;
- if (rrhs[i] + 1 == rrhs[i+1])
- {
- for (j = 0; j < nnulls && i > null_rules[j]; ++j)
- continue;
-
- if (j == nnulls)
- {
- ++nnulls;
- null_rules[j] = i;
- }
- else if (i != null_rules[j])
- {
- ++nnulls;
- for (k = nnulls - 1; k > j; --k)
- null_rules[k] = null_rules[k-1];
- null_rules[j] = i;
- }
- }
- }
- }
-
- for (i = 0; i < nnulls; ++i)
- {
- j = null_rules[i];
- fprintf(verbose_file, "\t%s : . (%d)\n", symbol_name[rlhs[j]],
- j - 2);
- }
- fprintf(verbose_file, "\n");
-}
-
-
-print_actions(stateno)
-int stateno;
-{
- register action *p;
- register shifts *sp;
- register int as;
-
- if (stateno == final_state)
- fprintf(verbose_file, "\t$end accept\n");
-
- p = parser[stateno];
- if (p)
- {
- print_shifts(p);
- print_reductions(p, defred[stateno]);
- }
-
- sp = shift_table[stateno];
- if (sp && sp->nshifts > 0)
- {
- as = accessing_symbol[sp->shift[sp->nshifts - 1]];
- if (ISVAR(as))
- print_gotos(stateno);
- }
-}
-
-
-print_shifts(p)
-register action *p;
-{
- register int count;
- register action *q;
-
- count = 0;
- for (q = p; q; q = q->next)
- {
- if (q->suppressed < 2 && q->action_code == SHIFT)
- ++count;
- }
-
- if (count > 0)
- {
- for (; p; p = p->next)
- {
- if (p->action_code == SHIFT && p->suppressed == 0)
- fprintf(verbose_file, "\t%s shift %d\n",
- symbol_name[p->symbol], p->number);
- }
- }
-}
-
-
-print_reductions(p, defred)
-register action *p;
-register int defred;
-{
- register int k, anyreds;
- register action *q;
-
- anyreds = 0;
- for (q = p; q ; q = q->next)
- {
- if (q->action_code == REDUCE && q->suppressed < 2)
- {
- anyreds = 1;
- break;
- }
- }
-
- if (anyreds == 0)
- fprintf(verbose_file, "\t. error\n");
- else
- {
- for (; p; p = p->next)
- {
- if (p->action_code == REDUCE && p->number != defred)
- {
- k = p->number - 2;
- if (p->suppressed == 0)
- fprintf(verbose_file, "\t%s reduce %d\n",
- symbol_name[p->symbol], k);
- }
- }
-
- if (defred > 0)
- fprintf(verbose_file, "\t. reduce %d\n", defred - 2);
- }
-}
-
-
-print_gotos(stateno)
-int stateno;
-{
- register int i, k;
- register int as;
- register short *to_state;
- register shifts *sp;
-
- putc('\n', verbose_file);
- sp = shift_table[stateno];
- to_state = sp->shift;
- for (i = 0; i < sp->nshifts; ++i)
- {
- k = to_state[i];
- as = accessing_symbol[k];
- if (ISVAR(as))
- fprintf(verbose_file, "\t%s goto %d\n", symbol_name[as], k);
- }
-}
diff --git a/mcs/jay/warshall.c b/mcs/jay/warshall.c
deleted file mode 100644
index 4672244e368..00000000000
--- a/mcs/jay/warshall.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)warshall.c 5.4 (Berkeley) 5/24/93";
-#endif /* not lint */
-
-#include "defs.h"
-
-transitive_closure(R, n)
-unsigned *R;
-int n;
-{
- register int rowsize;
- register unsigned i;
- register unsigned *rowj;
- register unsigned *rp;
- register unsigned *rend;
- register unsigned *ccol;
- register unsigned *relend;
- register unsigned *cword;
- register unsigned *rowi;
-
- rowsize = WORDSIZE(n);
- relend = R + n*rowsize;
-
- cword = R;
- i = 0;
- rowi = R;
- while (rowi < relend)
- {
- ccol = cword;
- rowj = R;
-
- while (rowj < relend)
- {
- if (*ccol & (1 << i))
- {
- rp = rowi;
- rend = rowj + rowsize;
- while (rowj < rend)
- *rowj++ |= *rp++;
- }
- else
- {
- rowj += rowsize;
- }
-
- ccol += rowsize;
- }
-
- if (++i >= BITS_PER_WORD)
- {
- i = 0;
- cword++;
- }
-
- rowi += rowsize;
- }
-}
-
-reflexive_transitive_closure(R, n)
-unsigned *R;
-int n;
-{
- register int rowsize;
- register unsigned i;
- register unsigned *rp;
- register unsigned *relend;
-
- transitive_closure(R, n);
-
- rowsize = WORDSIZE(n);
- relend = R + n*rowsize;
-
- i = 0;
- rp = R;
- while (rp < relend)
- {
- *rp |= (1 << i);
- if (++i >= BITS_PER_WORD)
- {
- i = 0;
- rp++;
- }
-
- rp += rowsize;
- }
-}
diff --git a/mcs/makefile b/mcs/makefile
deleted file mode 100755
index b1dc9d6b98b..00000000000
--- a/mcs/makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-DIRS=jay nant nunit mcs class tools doctools
-
-all: linux
-
-windows:
- for i in $(DIRS); do \
- (cd $$i; make linux) \
- done
-
-linux:
- for i in $(DIRS); do \
- (cd $$i; make linux) \
- done
-
-test:
- (cd nunit; make)
- (cd class; make test)
-
-clean:
- for i in $(DIRS); do \
- (cd $$i; make clean) \
- done
-
diff --git a/mcs/mcs/.cvsignore b/mcs/mcs/.cvsignore
deleted file mode 100644
index 9c5f9364012..00000000000
--- a/mcs/mcs/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-compiler.pdb
-compiler.exe
-cs-parser.cs
-y.output
-*.pdb
diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog
deleted file mode 100755
index 6c4ce889434..00000000000
--- a/mcs/mcs/ChangeLog
+++ /dev/null
@@ -1,5391 +0,0 @@
-2002-02-26 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs: Special case the `null' object when trying to
- auto-compute the type, as anything can be explicitly converted to
- that.
-
- * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
- spotting this Paolo.
-
- (Expression.ImplicitNumericConversion): Perform comparissions of
- the type using the underlying type in the case of an enumeration
- rather than using the enumeration type for the compare.
-
- Cope with the underlying == type case, which is not possible to
- catch before.
-
- (Expression.ConvertNumericExplicit): Perform comparissions of
- the type using the underlying type in the case of an enumeration
- rather than using the enumeration type for the compare.
-
- * driver.cs: If the user does not supply an extension, assume .exe
-
- * cs-parser.jay (if_statement): Rewrote so that we can track the
- location for the if statement.
-
- * expression.cs (Binary.ConstantFold): Only concat strings when
- the operation is "+", not everything ;-)
-
- * statement.cs (Statement.EmitBoolExpression): Take a location
- argument.
- (If, While, Do): Track location.
-
- * expression.cs (Binary.ResolveOperator): In the object + string
- case, I was missing a call to ConvertImplicit
-
-2002-02-25 Ravi Pratap <ravi@ximian.com>
-
- * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
- Location arguments. Ensure we use RootContext.LookupType to do our work
- and not try to do a direct Type.GetType and ModuleBuilder.GetType
-
- * interface.cs (PopulateMethod): Handle the type of the parameter being
- null gracefully.
-
- * expression.cs (Invocation.BetterFunction): Handle the case when we
- have a params method with no fixed arguments and a call is made with no
- arguments.
-
-2002-02-25 Miguel de Icaza <miguel@ximian.com>
-
- * cs-tokenizer.cs: Add support for the quote-escape-sequence in
- the verbatim-string-literal
-
- * support.cs (InternalParameters.ParameterModifier): handle null
- fixed parameters.
- (InternalParameters.ParameterType): ditto.
-
- * parameter.cs (VerifyArgs): Also check if the fixed parameter is
- duplicating the name of the variable parameter.
- (GetParameterByName): Fix bug where we were not looking up array
- paramters if they were the only present (thanks Paolo!).
- (GetParameterInfo): We only have an empty set of types if both
- fixed and array are set to null.
- (GetParameterInfo-idx): Handle FixedParameter == null
-
- * cs-parser.jay: Handle the case where there is no catch
- statements (missing null test).
-
-2002-02-22 Miguel de Icaza <miguel@ximian.com>
-
- * driver.cs (MainDriver): Be conservative on our command line
- handling.
-
- Catch DirectoryNotFoundException when calling GetFiles.
-
- (SplitPathAndPattern): Used to split the input specification into
- a path and a pattern that we can feed to Directory.GetFiles.
-
-2002-02-21 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (Fixed): Implement the last case of the Fixed
- statement (string handling).
-
- * expression.cs (StringPtr): New class used to return a char * to
- a string; Used by the Fixed statement.
-
- * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
-
- * expression.cs (Binary.ResolveOperator): Remove redundant
- MemberLookup pn parent type.
- Optimize union call, we do not need a union if the types are the same.
- (Unary.ResolveOperator): REmove redundant MemberLookup on parent
- type.
-
- Specialize the use of MemberLookup everywhere, instead of using
- the default settings.
-
- (StackAlloc): Implement stackalloc keyword.
-
- * cs-parser.jay: Add rule to parse stackalloc.
-
- * driver.cs: Handle /h, /help, /?
-
- * expression.cs (MakeByteBlob): Removed the hacks we had in place
- before we supported unsafe code.
-
- * makefile: add --unsafe to the self compilation of mcs.
-
-2002-02-20 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (PointerArithmetic): New class that is used to
- perform pointer arithmetic.
- (Binary.Resolve): Handle pointer arithmetic
- Handle pointer comparission.
- (ArrayPtr): Utility expression class that is used to take the
- address of an array.
-
- (ElementAccess): Implement array access for pointers
-
- * statement.cs (Fixed): Implement fixed statement for arrays, we
- are missing one more case before we are done.
-
- * expression.cs (Indirection): Implement EmitAssign and set the
- ExprClass to Variable. This allows pointer dereferences to be
- treated as variables, and to have values assigned to them.
-
- * ecore.cs (Expression.StoreFromPtr): New utility function to
- store values dereferencing.
-
-2002-02-20 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Binary.ResolveOperator): Ensure that we are
- not trying to operate on a void type - this fixes the reported
- bug.
-
- * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
- the parent implementation is sealed.
-
- * ../errors/cs0239.cs : Add.
-
- * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
-
- * typemanager.cs (unverifiable_code_type): Corresponds to
- System.Security.UnverifiableCodeAttribute. We need to emit this for modules
- which have unsafe code in them.
-
- * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
- unsafe context.
-
-2002-02-19 Miguel de Icaza <miguel@ximian.com>
-
- * cs-tokenizer.cs: Add support for @"litreal strings"
-
- Make tokenizer accept pre-processor directives
- on any column (remove the old C-like limitation).
-
- * rootcontext.cs (EmitCode): Emit any global attributes.
- (AddGlobalAttributes): Used to keep track of assembly attributes.
-
- * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
-
- * cs-parser.jay: Add support for global attributes.
-
-2002-02-17 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (Indirection): New helper class. Unary will
- create Indirection classes to be able to implement the
- IMemoryLocation interface on it.
-
-2002-02-16 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay (fixed_statement): reference the right statement.
-
- * statement.cs (Fixed.Emit): Finish implementing the fixed
- statement for the &x case.
-
-2002-02-14 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs (Property.Define, Method.Define): Remove newslot when
- `implementing'.
-
- * modifiers.cs: My use of NewSlot when `Abstract' was set was
- wrong. NewSlot should only be used if the `new' keyword is present.
-
- * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
- locating our system dir. Sorry about this.
-
-2002-02-13 Miguel de Icaza <miguel@ximian.com>
-
- * driver.cs (GetSystemDir): Compute correctly the location of our
- system assemblies. I was using the compiler directory instead of
- the library directory.
-
-2002-02-13 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (BetterFunction): Put back in what Miguel commented out
- since it is the correct fix. The problem is elsewhere ;-)
-
- (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
- parameters of the parms method are themselves compatible or not !
-
- (StandardConversionExists): Fix very dangerous bug where we were forgetting
- to check that a class implements an interface before saying that an implicit
- conversion was allowed. Use ImplementsInterface to do the checking.
-
-2002-02-13 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs (Method.Define): Track whether we are an explicit
- implementation or not. And only call DefineMethodOverride if we
- are an explicit implementation.
-
- (Property.DefineMethod): Ditto.
-
-2002-02-11 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (BetterFunction): Catch hideous bug which was
- preventing us from detecting ambiguous calls due to implicit casts i.e
- cs0121.
-
-2002-01-29 Miguel de Icaza <miguel@ximian.com>
-
- * support.cs (Pair): Remove un-needed method. I figured why I was
- getting the error in cs-parser.jay, the variable in a foreach loop
- is readonly, and the compiler does not really treat this as a variable.
-
- * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
- instead of EQUALS in grammar.
-
- * typemanager.cs (VerifyUnmanaged): Report correct error (208)
-
- * expression.cs (Unary.DoResolve): Check whether the argument is
- managed or not.
-
-2002-01-28 Miguel de Icaza <miguel@ximian.com>
-
- * support.cs: Api for Pair to set a value. Despite the fact that
- the variables are public the MS C# compiler refuses to compile
- code that accesses the field if the variable is part of a foreach
- statement.
-
- * statement.cs (Fixed): Begin implementation of the fixed
- statement.
-
- (Block.AddVariable): Return the VariableInfo on success and null
- on failure instead of true/false.
-
- * cs-parser.jay (foreach): Catch errors on variables already
- defined (we were ignoring this value before) and properly unwind
- the block hierarchy
-
- (fixed_statement): grammar for the fixed statement.
-
-2002-01-25 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
- pointer types to be incretemented.
-
- (SizeOf): Implement.
-
- * cs-parser.jay (pointer_member_access): Implement
- expr->IDENTIFIER production.
-
- * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
- MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
- on safe contexts.
-
- (Unary): Implement indirection.
-
- * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
- use in non-unsafe context).
-
- (SimpleName.DoResolve): Check for pointers in field access on safe
- contexts.
-
- (Expression.LoadFromPtr): Factor the load-indirect code in this
- function. This was duplicated in UnboxCast and ParameterReference
-
-2002-01-24 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (ComposedCast): report an error if a pointer cast
- is used in a safe region.
-
- * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
- pointer type casts in unsafe context.
-
- * codegen.cs (EmitContext): Set up IsUnsafe.
-
- * cs-parser.jay (non_expression_type): Add productions for pointer
- casts.
-
- * expression.cs (Invocation.EmitCall): Remove chunk of buggy
- code. We should not use force into static mode if the method is
- not virtual. Fixes bug in MIS
-
- * statement.cs (Do.Emit, While.Emit, For.Emit,
- Statement.EmitBoolExpression): Add support to Do and While to
- propagate infinite loop as `I do return' semantics.
-
- Improve the For case to also test for boolean constants.
-
- * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
- to the list of attributes we can add.
-
- Remove `EmitContext' argument.
-
- * class.cs (Method.Define): Apply parameter attributes.
- (Constructor.Define): Apply parameter attributes.
- (MethodCore.LabelParameters): Move here the core of labeling
- parameters.
-
- * support.cs (ReflectionParameters.ParameterModifier,
- InternalParameters.ParameterModifier): Use IsByRef on the type and
- only return the OUT bit for these parameters instead of in/out/ref
- flags.
-
- This is because I miss-understood things. The ParameterInfo.IsIn
- and IsOut represent whether the parameter has the [In] and [Out]
- attributes set.
-
-2002-01-22 Miguel de Icaza <miguel@ximian.com>
-
- * ecore.cs (FieldExpr.Emit): Release temporaries.
-
- * assign.cs (LocalTemporary.Release): new function.
-
- * codegen.cs (EmitContext.GetTemporaryStorage,
- EmitContext.FreeTemporaryStorage): Rework the way we deal with
- temporary storage. Now we can "put back" localbuilders when we
- are done with them
-
-2002-01-21 Miguel de Icaza <miguel@ximian.com>
-
- * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
- need to make a copy of the variable to generate verifiable code.
-
-2002-01-19 Miguel de Icaza <miguel@ximian.com>
-
- * driver.cs: Compute dynamically the system directory.
-
- * ecore.cs (CopyNewMethods): reworked, exposed, made public.
- Slower, but more generally useful. Used by the abstract
- registering implementation.
-
- * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
- the rules for the special rule on Type/instances. First check if
- we have the same name, and if so, try that special static path
- rather than the instance path.
-
-2002-01-18 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay: Emit 642 (warning: possible empty statement) for
- for, while and if.
-
- * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
- Enum, ValueType, Delegate or Array for non-corlib compiles.
-
- * cs-tokenizer.cs: Catch long identifiers (645)
-
- * typemanager.cs (IndexerPropetyName): Ravi never tested this
- piece of code.
-
- * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
- fix, we were returning too early, so we were not registering
- pending methods from abstract classes.
-
- Do not register pending methods if the class is abstract.
-
- * expression.cs (Conditional.DoResolve): Report circular implicit
- conversions when we neecd to compute it for conditional
- expressions.
-
- (Is.DoResolve): If the expression is always of the provided type,
- flag warning 183. If the expression can not ever be of the
- provided type flag warning 184.
-
- * class.cs: Catch 169 as well.
-
- * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
- read.
-
-2002-01-18 Nick Drochak <ndrochak@gol.com>
-
- * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * interface.cs: (PopulateMethod): Check for pointers being defined
- only if the unsafe context is active.
- (PopulateProperty): ditto.
- (PopulateIndexer): ditto.
-
- * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
- specified. If pointers are present, make sure that they are
- present in an unsafe context.
- (Constructor, Constructor.Define): ditto.
- (Field, Field.Define): ditto.
- (Property, Property.Define): ditto.
- (Event, Event.Define): ditto.
-
- * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
- hashtable if there are classes or structs defined.
-
- * expression.cs (LocalVariableReference.DoResolve): Simplify this
- code, as the constant resolution moved.
-
- * statement.cs (Block.EmitMeta): Resolve all constants as we emit
- the metadata, so we can flag error 133.
-
- * decl.cs (MemberCore.UnsafeOK): New function to test that a
- pointer is being declared in an unsafe context.
-
-2002-01-16 Miguel de Icaza <miguel@ximian.com>
-
- * modifiers.cs (Modifiers.Check): Require a Location argument.
- Report error 227 for Unsafe use.
-
- * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
-
- * statement.cs (For.Emit): If the test is null, then report that
- we do `return', as we wont reach anything afterwards.
-
- (Switch.SwitchGoverningType): Track the expression that matched
- the conversion.
-
- * driver.cs: Allow negative numbers as an error code to flag.
-
- * cs-parser.jay: Handle 1551.
-
- * namespace.cs: Add 1537 checking (repeated using alias namespaces).
-
-2002-01-15 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay: Report 1518 (type declaration can only contain
- class, struct, interface, enum or delegate)
-
- (switch_label): Report 1523 (keywords `case' or `default' must
- preced code)
-
- (opt_switch_sections): Report 1522 (empty switch)
-
- * driver.cs: Report 1515 (response file specified multiple times)
- Report 1516 (Source file specified multiple times).
-
- * expression.cs (Argument.Resolve): Signal 1510
-
- (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
- access not allowed in static code)
-
-2002-01-11 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (IsPointerType): Utility method which we are going
- to need a lot.
-
- * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
- the object type, so we take care of that.
-
- * expression.cs (FullMethodDesc): Also include the return type in descriptions.
-
- * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
- added to non-params parameters :-)
-
- * typemanager.cs (CSharpName): Include 'void' type too.
-
- (void_ptr_type): Include in the set of core types.
-
- * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
- duplicating code.
-
- (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
- an unsafe context.
-
- * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
- completely forgotten about it.
-
-2002-01-10 Ravi Pratap <ravi@ximian.com>
-
- * cs-parser.jay (pointer_type): Add. This begins our implementation
- of parsing rules for unsafe code.
-
- (unsafe_statement): Implement.
-
- (embedded_statement): Modify to include the above.
-
- * statement.cs (Unsafe): Implement new class for unsafe blocks.
-
- * codegen.cs (EmitContext.InUnsafe): Add. This determines
- if the current context is an unsafe one.
-
- * cs-parser.jay (local_variable_pointer_type): Since local variable types
- are handled differently, we need separate rules for them.
-
- (local_variable_declaration): Update to use local_variable_pointer_type
- to allow variable declarations of unmanaged pointer types.
-
- * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
- in unsafe contexts.
-
- * ../errors/cs0214.cs : Add.
-
-2002-01-16 Nick Drochak <ndrochak@gol.com>
-
- * makefile: remove 'response' file when cleaning.
-
-2002-01-15 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay: Report 1524.
-
-2002-01-14 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs (RegisterMethod): drop checking if we have
- registered this from here
-
-2002-01-12 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs (Method.EmitDestructor): Implement calling our base
- destructor.
-
- * statement.cs (Try.Emit): Fix to reset the InFinally to the old
- value of InFinally.
-
- * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
- this routine and will wrap the call in a try/catch block. Deal
- with the case.
-
-2002-01-11 Miguel de Icaza <miguel@ximian.com>
-
- * ecore.cs (Expression.MemberLookup): instead of taking a
- parameter `same_type' that was used to tell whether we could
- access private members we compute our containing type from the
- EmitContext.
-
- (FieldExpr): Added partial support for volatile fields. This does
- not work for volatile fields exposed from assemblies, as I can not
- figure out how to extract the modreq from it.
-
- Updated all the source files to use this.
-
- * codegen.cs (EmitContext): Compute ContainerType ahead of time,
- because it is referenced by MemberLookup very often.
-
-2002-01-09 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
- TypeBuilder.GetCustomAttributes to retrieve what we need.
-
- Get rid of redundant default_member_attr_type as this is the same as
- default_member_type which already exists.
-
- * interface.cs, attribute.cs : Update accordingly.
-
-2002-01-08 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs: Enable IndexerPropertyName again. It does not
- work for TYpeBuilders though. Ravi, can you please fix this?
-
- * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
-
- * expression.cs (Argument.Emit): Handle the case of ref objects
- being passed to ref functions;
-
- (ParameterReference.EmitLoad): Loads the content of the pointer
- without dereferencing.
-
-2002-01-07 Miguel de Icaza <miguel@ximian.com>
-
- * cs-tokenizer.cs: Implemented the pre-processing expressions.
-
-2002-01-08 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (Indexer.DefineMethod): Incorporate the interface
- type in the name of the method if we are doing explicit interface
- implementation.
-
- * expression.cs (ConversionExists): Remove as it is completely obsolete.
-
- (BetterConversion): Fix extremely trivial bug where we were referring to
- ConversionExists instead of StandardConversionExists ! Hooray, things are fine
- again !
-
- * ../errors/bug16.cs : Add although we have fixed it.
-
-2002-01-07 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (BaseIndexer): Begin implementation.
-
- * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
-
- * cs-parser.jay (indexer_declarator): Use qualified_identifier
- production directly to remove a shift/reduce, and implement
- explicit interface implementation.
-
- * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
- after a floating point suffix.
-
- * expression.cs (DoNumericPromotions): Improved the conversion for
- uint/uint. If we have a constant, we avoid doing a typecast to a
- larger type.
-
- * class.cs (Indexer): Implement explicit interface implementation
- for indexers.
-
-Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * class.cs: make the default instance constructor public and hidebysig.
-
-2001-01-03 Ravi Pratap <ravi@ximian.com>
-
- * interface.cs (EmitDefaultMemberAttr): Make this helper method static
- so we can call it from elsewhere.
-
- * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
- we emit it internally if the class has a defined indexer; otherwise the user
- emits it by decorating the class definition with the DefaultMemberAttribute.
-
- * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
- attribute is not used on a type which defines an indexer.
-
- * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
- character when we skip whitespace.
-
- * ../errors/cs0646.cs : Add.
-
-2002-01-03 Miguel de Icaza <miguel@ximian.com>
-
- * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
- again.
-
- * makefile: Add practical target `mcs3.exe' which builds the third
- generation compiler.
-
- * expression.cs (New): Fix structures constructor calling.
-
- * class.cs (Property, Method, Indexer): Emit Final flag on the
- method if we are an interface implementation and we are not
- abstract.
-
- * ecore.cs (PropertyExpr): New public field `IsBase', tells
- whether this property is referencing a `base' method.
-
- * expression.cs (Invocation.EmitCall): take an extra argument:
- is_base, this is used to determine whether the `call' or
- `callvirt' opcode should be used.
-
-
- * delegate.cs: update EmitCall.
-
- * class.cs (Method.Define): Set NewSlot for the cases where we are
- not implementing an interface method.
-
- (Property.Define): ditto.
-
-2002-01-02 Miguel de Icaza <miguel@ximian.com>
-
- * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
- 'r'. Allows mcs to parse itself fully.
-
-2002-01-02 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
- of the number of initializers that require the InitializeArray method.
-
- (CheckIndices): Store the Expression in all cases - not the plain value. Also
- update the above field where necessary.
-
- (MakeByteBlob): Update accordingly.
-
- (DoEmit): Call EmitStaticInitializers only if the number of initializers is
- greater than 2.
-
- (EmitDynamicInitializers): Update in accordance with the new optimization.
-
- (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
- same OpCode applies.
-
- * cs-parser.jay : Fix some glaring errors I introduced.
-
-2002-01-01 Ravi Pratap <ravi@ximian.com>
-
- * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
- so that we can check for name clashes there too.
-
- * typemanager.cs (default_member_attr_type): The attribute that we need to emit
- for interface indexers.
-
- * interfaces.cs (Define): Emit the default member attribute.
-
- * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
- variable was being referred to while setting the value ;-)
-
-2002-01-01 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (MakeByteBlob): Optimize: we do not need to fill
- byte-by-byte information when we know the data is zero.
-
- Make the block always a multiple of 4, because
- DefineInitializedData has a bug.
-
- * assign.cs: Fix, we should assign from the temporary, not from
- the source.
-
- * expression.cs (MakeByteBlob): Fix my incorrect code.
-
-2001-12-31 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs (EnumToUnderlying): This function is used to get
- the underlying type from an enumeration, because it does not
- always work.
-
- * constant.cs: Use the I4_S form for values between -128 and 127.
-
- * statement.cs (Block.LookupLabel): Looks up a label.
- (Block): Drop support for labeled blocks.
-
- (LabeledStatement): New kind of statement that represents a label
- only.
-
- (Goto): Finally implement this bad boy.
-
- * cs-parser.jay: Update to reflect new mechanism to implement
- labels.
-
-2001-12-30 Miguel de Icaza <miguel@ximian.com>
-
- * codegen.cs (EmitContext.This): a codegen property that keeps the
- a single instance of this instead of creating many different this
- instances.
-
- * delegate.cs (Delegate.DoResolve): Update to use the property;
-
- * ecore.cs (SimpleName.SimpleNameResolve): Ditto
-
- * expression.cs (BaseAccess.DoResolve): Ditto.
-
-2001-12-29 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (methodimpl_attr_type): Add to hold the type
- corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
-
- (InitCoreTypes): Update accordingly.
-
- * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
- so we can quickly store the state.
-
- (ApplyAttributes): Set the correct implementation flags
- for InternalCall methods.
-
-2001-12-29 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (EmitCall): if a method is not virtual, then do
- not use callvirt on it.
-
- (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
- user defined stuff) requires the use of stobj, which takes an
- address on the stack instead of an array and an index. So emit
- the Ldelema operation for it.
-
- (EmitStoreOpcode): Use stobj for valuetypes.
-
- (UnaryMutator.EmitCode): Use the right 1 value depending on
- whether we are dealing with int64/uint64, float or doubles.
-
- * class.cs (TypeContainer.AddConstructor): Fix the logic to define
- constructors that I implemented last night.
-
- (Constructor.IsDefault): Fix to work properly for static
- constructors.
-
- * cs-parser.jay (CheckDef): report method signature errors.
- Update error number 103 to be 132.
-
- * decl.cs: New AdditionResult enumeration value: MethodExists.
- Although we do this check for methods later on in the semantic
- analysis, catching repeated default constructors is so easy that
- we catch these here.
-
- * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
- promotions code.
-
- (ParameterReference.EmitAssign, Emit): handle
- bools as bytes.
-
- (ArrayAccess.EmitLoadOpcode): Handle bool type here.
- (ArrayAccess.EmitStoreOpcode): ditto.
-
- * cs-tokenizer.cs (is_punct): Eliminated empty computation.
-
- * expression.cs (MakeByteBlob): Complete all the missing types
- (uint, short, ushort, byte, sbyte)
-
- * class.cs: Only init instance field initializers on instance
- constructors.
-
- Rename `constructors' to instance_constructors.
-
- (TypeContainer.AddConstructor): Only add constructors to the list
- if it is not static.
-
- Make sure that we handle default_static_constructor independently
- everywhere where we handle instance_constructors
-
-2001-12-28 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs: Do not lookup or create a base initializer for a
- static constructor.
-
- (ConstructorInitializer.Resolve): use the proper type to lookup
- for constructors.
-
- * cs-parser.jay: Report error 1585 (modifiers between type and name).
-
- * enum.cs, interface.cs: Remove CloseType, this is taken care by
- in DeclSpace.
-
- * decl.cs: CloseType is now an virtual method, the default
- implementation just closes this type.
-
-2001-12-28 Ravi Pratap <ravi@ximian.com>
-
- * attribute.cs (DefinePInvokeMethod): Set the implementation flags
- to PreserveSig by default. Also emit HideBySig on such methods.
-
- Basically, set the defaults to standard values.
-
- * expression.cs (Invocation.BetterFunction): We need to make sure that for each
- argument, if candidate is better, it can't be worse than the best !
-
- (Invocation): Re-write bits to differentiate between methods being
- applicable in their expanded form and their normal form - for params
- methods of course.
-
- Get rid of use_standard everywhere as only standard conversions are allowed
- in overload resolution.
-
- More spec conformance.
-
-2001-12-27 Miguel de Icaza <miguel@ximian.com>
-
- * driver.cs: Add --timestamp, to see where the compiler spends
- most of its time.
-
- * ecore.cs (SimpleName.DoResolve): Do not create an implicit
- `this' in static code.
-
- (SimpleName.DoResolve): Implement in terms of a helper function
- that allows static-references to be passed upstream to
- MemberAccess.
-
- (Expression.ResolveWithSimpleName): Resolve specially simple
- names when called by MemberAccess to implement the special
- semantics.
-
- (Expression.ImplicitReferenceConversion): Handle conversions from
- Null to reference types before others, as Null's type is
- System.Object.
-
- * expression.cs (Invocation.EmitCall): Handle the special case of
- calling methods declared on a reference type from a ValueType
- (Base classes System.Object and System.Enum)
-
- (MemberAccess.Resolve): Only perform lookups on Enumerations if
- the left hand side is a TypeExpr, not on every enumeration.
-
- (Binary.Resolve): If types are reference types, then do a cast to
- object on operators != and == of both arguments.
-
- * typemanager.cs (FindMembers): Extract instance and static
- members if requested.
-
- * interface.cs (PopulateProperty): Use void_type instead of null
- as the return type for the setter method.
-
- (PopulateIndexer): ditto.
-
-2001-12-27 Ravi Pratap <ravi@ximian.com>
-
- * support.cs (ReflectionParameters): Fix minor bug where we
- were examining the wrong parameter for the ParamArray attribute.
-
- Cope with requests for the type of the parameter at position
- greater than the params parameter's. We now return the element
- type of the params array as that makes more sense.
-
- * expression.cs (Invocation.IsParamsMethodApplicable): Update
- accordingly as we no longer have to extract the element type
- ourselves.
-
- (Invocation.OverloadResolve): Update.
-
-2001-12-27 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
- against IEnumerator, test whether the return value is a descendant
- of the IEnumerator interface.
-
- * class.cs (Indexer.Define): Use an auxiliary method to implement
- the other bits of the method definition. Begin support for
- explicit interface implementation.
-
- (Property.DefineMethod): Use TypeManager.void_type instead of null
- for an empty return value.
-
-2001-12-26 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (MemberAccess.ResolveMemberAccess): if we are
- dealing with a FieldExpr which is composed of a FieldBuilder, in
- the code path we did extract the constant, but we should have
- obtained the underlying value to be able to cast it (otherwise we
- end up in an infinite loop, this is what Ravi was running into).
-
- (ArrayCreation.UpdateIndices): Arrays might be empty.
-
- (MemberAccess.ResolveMemberAccess): Add support for section
- 14.5.4.1 that deals with the special case of E.I when E is a type
- and something else, that I can be a reference to a static member.
-
- (ArrayCreation.MakeByteBlob): It is not an error to not be able to
- handle a particular array type to create byte blobs, it is just
- something we dont generate byteblobs for.
-
- * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
- arguments.
-
- * location.cs (Push): remove the key from the hashtable that we
- are about to add. This happens for empty files.
-
- * driver.cs: Dispose files after we have parsed them.
-
- (tokenize): new function that only runs the tokenizer on its
- input, for speed testing.
-
-2001-12-26 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (Event.Define): Define the private field only if there
- are no accessors defined.
-
- * expression.cs (ResolveMemberAccess): If there is no associated
- field with the event, that means we have an event defined with its
- own accessors and we should flag error cs0070 since transforming
- ourselves into a field is not valid in that case.
-
- * ecore.cs (SimpleName.DoResolve): Same as above.
-
- * attribute.cs (DefinePInvokeMethod): Set the default calling convention
- and charset to sane values.
-
-2001-12-25 Ravi Pratap <ravi@ximian.com>
-
- * assign.cs (DoResolve): Perform check on events only if they
- are being accessed outside the declaring type.
-
- * cs-parser.jay (event_declarations): Update rules to correctly
- set the type of the implicit parameter etc.
-
- (add_accessor, remove_accessor): Set current local parameters.
-
- * expression.cs (Binary): For delegate addition and subtraction,
- cast the return value from the method into the appropriate delegate
- type.
-
-2001-12-24 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
- of these as the workaround is unnecessary.
-
- * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
- delegate data - none of that is needed at all.
-
- Re-write bits to extract the instance expression and the delegate method
- correctly.
-
- * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
- on delegates too.
-
- * attribute.cs (ApplyAttributes): New method to take care of common tasks
- of attaching attributes instead of duplicating code everywhere.
-
- * everywhere : Update code to do attribute emission using the above method.
-
-2001-12-23 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (IsParamsMethodApplicable): if there are not
- parameters, return immediately.
-
- * ecore.cs: The 0 literal can be implicity converted to an enum
- type.
-
- (SimpleName.DoResolve): First lookup the type, then lookup the
- members.
-
- (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
- want to get its address. If the InstanceExpression is not
- addressable, store the result in a temporary variable, then get
- the address of it.
-
- * codegen.cs: Only display 219 errors on warning level or above.
-
- * expression.cs (ArrayAccess): Make it implement the
- IMemoryLocation interface.
-
- (Binary.DoResolve): handle the operator == (object a, object b)
- and operator != (object a, object b) without incurring into a
- BoxedCast (because 5 != o should never be performed).
-
- Handle binary enumerator operators.
-
- (EmitLoadOpcode): Use Ldelema if the object we are loading is a
- value type, otherwise use Ldelem_ref.
-
- Use precomputed names;
-
- (AddressOf): Implement address of
-
- * cs-parser.jay (labeled_statement): Fix recursive block
- addition by reworking the production.
-
- * expression.cs (New.DoEmit): New has a special case:
-
- If we are dealing with a ValueType, we have a few
- situations to deal with:
-
- * The target of New is a ValueType variable, that is
- easy, we just pass this as the variable reference
-
- * The target of New is being passed as an argument,
- to a boxing operation or a function that takes a
- ValueType.
-
- In this case, we need to create a temporary variable
- that is the argument of New.
-
-
-2001-12-23 Ravi Pratap <ravi@ximian.com>
-
- * rootcontext.cs (LookupType): Check that current_type is not null before
- going about looking at nested types.
-
- * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
- not implement the IAssignMethod interface any more.
-
- * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
- where we tranform them into FieldExprs if they are being resolved from within
- the declaring type.
-
- * ecore.cs (SimpleName.DoResolve): Do the same here.
-
- * assign.cs (DoResolve, Emit): Clean up code considerably.
-
- * ../errors/bug10.cs : Add.
-
- * ../errors/cs0070.cs : Add.
-
- * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
-
- * assign.cs : Get rid of EventIsLocal everywhere.
-
-2001-12-23 Miguel de Icaza <miguel@ximian.com>
-
- * ecore.cs (ConvertIntLiteral): finished the implementation.
-
- * statement.cs (SwitchLabel): Convert the value we are using as a
- key before looking up the table.
-
-2001-12-22 Miguel de Icaza <miguel@ximian.com>
-
- * codegen.cs (EmitTopBlock): Require a Location argument now.
-
- * cs-parser.jay (constructor_declarator): We need to setup
- current_local_parameters before we parse the
- opt_constructor_initializer, to allow the variables to be bound
- to the constructor arguments.
-
- * rootcontext.cs (LookupType): First lookup nested classes in our
- class and our parents before we go looking outside our class.
-
- * expression.cs (ConstantFold): Extract/debox the values at the
- beginnning.
-
- * rootcontext.cs (EmitCode): Resolve the constants first before we
- resolve the types. This is not really needed, but it helps debugging.
-
- * statement.cs: report location.
-
- * cs-parser.jay: pass location to throw statement.
-
- * driver.cs: Small bug fix.
-
- * report.cs: Updated format to be 4-zero filled digits.
-
-2001-12-22 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (CheckIndices): Fix minor bug where the wrong
- variable was being referred to ;-)
-
- (DoEmit): Do not call EmitStaticInitializers when the
- underlying type is System.Object.
-
-2001-12-21 Ravi Pratap <ravi@ximian.com>
-
- * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
- and do the usual workaround for SRE.
-
- * class.cs (MyEventBuilder.EventType): New member to get at the type
- of the event, quickly.
-
- * expression.cs (Binary.ResolveOperator): Handle delegate addition.
-
- * assign.cs (Assign.DoResolve): Handle the case when the target
- is an EventExpr and perform the necessary checks.
-
- * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
- interface.
-
- (SimpleName.MemberStaticCheck): Include check for EventExpr.
-
- (EventExpr): Set the type in the constructor itself since we
- are meant to be born fully resolved.
-
- (EventExpr.Define): Revert code I wrote earlier.
-
- * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
- instance expression is null. The instance expression is a This in that case
- or a null, depending on whether it is a static method or not.
-
- Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
- refers to more than one method.
-
- * assign.cs (DoResolve): Check whether the event belongs to the same Type container
- and accordingly flag errors.
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
-
-2001-12-22 Miguel de Icaza <miguel@ximian.com>
-
- * location.cs (ToString): Provide useful rutine.
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
- objects, return the actual integral boxed.
-
- * statement.cs (SwitchLabel): define an ILLabel for each
- SwitchLabel.
-
- (Switch.CheckSwitch): If the value is a Literal, extract
- the underlying literal.
-
- Also in the unused hashtable we had, add the SwitchLabel so we can
- quickly look this value up.
-
- * constant.cs: Implement a bunch of new constants. Rewrite
- Literal based on this. Made changes everywhere to adapt to this.
-
- * expression.cs (Expression.MakeByteBlob): Optimize routine by
- dereferencing array only once, and also copes with enumrations.
-
- bytes are two bytes wide, not one.
-
- (Cast): Perform constant conversions.
-
- * ecore.cs (TryImplicitIntConversion): Return literals instead of
- wrappers to the literals here.
-
- * expression.cs (DoNumericPromotions): long literals can converted
- to ulong implicity (this is taken care of elsewhere, but I was
- missing this spot).
-
- * ecore.cs (Expression.Literalize): Make the return type Literal,
- to improve type checking.
-
- * rootcontext.cs: Lookup for nested classes in our class hierarchy.
-
-2001-12-20 Miguel de Icaza <miguel@ximian.com>
-
- * literal.cs: Revert code from ravi that checked the bounds. The
- bounds are sane by the definition of the type itself.
-
- * typemanager.cs: Fix implementation of ImplementsInterface. We
- need to actually look up in our parent hierarchy for interfaces
- implemented.
-
- * const.cs: Use the underlying type for enumerations
-
- * delegate.cs: Compute the basename for the delegate creation,
- that should fix the delegate test case, and restore the correct
- Type Lookup semantics in rootcontext
-
- * rootcontext.cs: Revert Ravi's last patch. The correct way of
- referencing a nested type with the Reflection API is using the "+"
- sign.
-
- * cs-parser.jay: Do not require EOF token at the end.
-
-2001-12-20 Ravi Pratap <ravi@ximian.com>
-
- * rootcontext.cs (LookupType): Concatenate type names with
- a '.' instead of a '+' The test suite passes again.
-
- * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
- field of the enumeration.
-
- * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
- the case when the member is an EventExpr.
-
- * ecore.cs (EventExpr.InstanceExpression): Every event which is not
- static has an associated instance expression.
-
- * typemanager.cs (RegisterEvent): The usual workaround, now for events.
-
- (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
-
- * class.cs (Event.Define): Register event and perform appropriate checks
- for error #111.
-
- We define the Add and Remove methods even if the use provides none because
- in that case, we provide default implementations ourselves.
-
- Define a private field of the type of the event. This is done by the CSC compiler
- and we should be doing it too ;-)
-
- * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
- More methods we use in code we generate.
-
- (multicast_delegate_type, delegate_type): Two separate types since the distinction
- is important.
-
- (InitCoreTypes): Update accordingly for the above.
-
- * class.cs (Event.Emit): Generate code for default accessors that we provide
-
- (EmitDefaultMethod): Do the job in the above.
-
- * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
- appropriate place.
-
-2001-12-20 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
- builders even if we were missing one.
-
- * interface.cs, class.cs, enum.cs: When calling DefineNestedType
- pass the Basename as our class name instead of the Name. The
- basename will be correctly composed for us.
-
- * parameter.cs (Paramters): Now takes a Location argument.
-
- * decl.cs (DeclSpace.LookupType): Removed convenience function and
- make all the code call directly LookupType in RootContext and take
- this chance to pass the Location information everywhere.
-
- * Everywhere: pass Location information.
-
-2001-12-19 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs (Constructor.Define): Updated way of detecting the
- length of the parameters.
-
- (TypeContainer.DefineType): Use basename as the type name for
- nested types.
-
- (TypeContainer.Define): Do not recursively define types here, as
- definition is taken care in order by the RootContext.
-
- * tree.cs: Keep track of namespaces in a per-file basis.
-
- * parameter.cs (Parameter.ComputeSignature): Update to use
- DeclSpace.
-
- (Parameters.GetSignature): ditto.
-
- * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
- instead of a TypeContainer.
-
- (Interface.SemanticAnalysis): Use `this' instead of our parent to
- resolve names. Because we need to be resolve in our context, not
- our parents.
-
- * driver.cs: Implement response files.
-
- * class.cs (TypeContainer.DefineType): If we are defined, do not
- redefine ourselves.
-
- (Event.Emit): Emit the code for add/remove handlers.
- (Event.Define): Save the MethodBuilders for add/remove.
-
- * typemanager.cs: Use pair here too.
-
- * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
- DictionaryEntry requires the first argument to be non-null.
-
- (enum_declaration): Compute full name for registering the
- enumeration.
-
- (delegate_declaration): Instead of using
- formal_parameter_list, use opt_formal_parameter_list as the list
- can be empty.
-
- * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
- (EventParsing): New property that controls whether `add' and
- `remove' are returned as tokens or identifiers (for events);
-
-2001-12-19 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
- use MyEventBuilder only and let it wrap the real builder for us.
-
- (MyEventBuilder): Revamp constructor etc.
-
- Implement all operations that we perform on EventBuilder in precisely the same
- way here too.
-
- (FindMembers): Update to use the EventBuilder member.
-
- (Event.Emit): Update accordingly.
-
-2001-12-18 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
- by calling the appropriate methods.
-
- (GetCustomAttributes): Make stubs as they cannot possibly do anything
- useful.
-
- (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
-
-2001-12-17 Ravi Pratap <ravi@ximian.com>
-
- * delegate.cs (Delegate.Populate): Check that the return type
- and various parameters types are indeed accessible.
-
- * class.cs (Constructor.Define): Same here.
-
- (Field.Define): Ditto.
-
- (Event.Define): Ditto.
-
- (Operator.Define): Check that the underlying Method defined itself
- correctly - so it's MethodBuilder should not be null.
-
- * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
- expression happens to be null.
-
- * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
- members but as of now we don't seem to be able to do anything really useful with it.
-
- (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
- not the EventBuilder.
-
-2001-12-18 Miguel de Icaza <miguel@ximian.com>
-
- * cs-tokenizer.cs: Add support for defines.
- Add support for #if, #elif, #else, #endif
-
- (eval_var): evaluates a variable.
- (eval): stubbed for evaluating functions.
-
- * cs-parser.jay: Pass the defines information
-
- * driver.cs: Add --define command line option.
-
- * decl.cs: Move MemberCore here.
-
- Make it the base class for DeclSpace. This allows us to catch and
- report 108 and 109 for everything now.
-
- * class.cs (TypeContainer.Define): Extract all the members
- before populating and emit the warning 108 (new keyword required
- to override) instead of having each member implement this.
-
- (MemberCore.Define): New abstract method, we will be using this in
- the warning reporting engine in Populate.
-
- (Operator.Define): Adjust to new MemberCore protocol.
-
- * const.cs (Const): This does not derive from Expression, it is a
- temporary object we use to create fields, it is a MemberCore.
-
- * class.cs (Method.Define): Allow the entry point to be in a
- specific class.
-
- * driver.cs: Rewrite the argument handler to clean it up a bit.
-
- * rootcontext.cs: Made it just an auxiliary namespace feature by
- making everything static.
-
- * driver.cs: Adapt code to use RootContext type name instead of
- instance variable.
-
- * delegate.cs: Remove RootContext argument.
-
- * class.cs: (Struct, TypeContainer, Class): Remove RootContext
- argument.
-
- * class.cs (Event.Define): The lookup can fail.
-
- * cs-tokenizer.cs: Begin implementation of pre-procesor.
-
- * expression.cs: Resolve the this instance before invoking the code.
-
-2001-12-17 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay: Add a production in element_access that allows
- the thing to become a "type" reference. This way we can parse
- things like "(string [])" as a type.
-
- Note that this still does not handle the more complex rules of
- casts.
-
-
- * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
-
- * ecore.cs: (CopyNewMethods): new utility function used to
- assemble the list of methods from running FindMembers.
-
- (MemberLookup): Rework FindMembers so that
-
-2001-12-16 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs (TypeContainer): Remove Delegates who fail to be
- defined.
-
- * delegate.cs (Populate): Verify that we dont get null return
- values. TODO: Check for AsAccessible.
-
- * cs-parser.jay: Use basename to emit error 574 (destructor should
- have the same name as container class), not the full name.
-
- * cs-tokenizer.cs (adjust_int): Fit the integer in the best
- possible representation.
-
- Also implements integer type suffixes U and L.
-
-2001-12-15 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (ArrayCreation.DoResolve): We need to do the
- argument resolution *always*.
-
- * decl.cs: Make this hold the namespace. Hold the root context as
- well.
- (LookupType): Move here.
-
- * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
-
- * location.cs (Row, Name): Fixed the code, it was always returning
- references to the first file.
-
- * interface.cs: Register properties defined through interfaces.
-
- * driver.cs: Add support for globbing on the command line
-
- * class.cs (Field): Make it derive from MemberCore as well.
- (Event): ditto.
-
-2001-12-15 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (Event::Define): Check that the type of the event is a delegate
- type else flag error #66.
-
- Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
- same.
-
- * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
- values of EntryPoint, CharSet etc etc.
-
- Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
-
- * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
- be null and we should ignore this. I am not sure if this is really clean. Apparently,
- there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
- which needs this to do its work.
-
- * ../errors/cs0066.cs : Add.
-
-2001-12-14 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
- helper functions.
-
- * class.cs: (MethodSignature.MethodSignature): Removed hack that
- clears out the parameters field.
- (MemberSignatureCompare): Cleanup
-
- (MemberCore): New base class used to share code between MethodCore
- and Property.
-
- (RegisterRequiredImplementations) BindingFlags.Public requires
- either BindingFlags.Instace or Static. Use instance here.
-
- (Property): Refactored code to cope better with the full spec.
-
- * parameter.cs (GetParameterInfo): Return an empty array instead
- of null on error.
-
- * class.cs (Property): Abstract or extern properties have no bodies.
-
- * parameter.cs (GetParameterInfo): return a zero-sized array.
-
- * class.cs (TypeContainer.MethodModifiersValid): Move all the
- method modifier validation to the typecontainer so we can reuse
- this on properties.
-
- (MethodCore.ParameterTypes): return an empty sized array of types.
-
- (Property.Define): Test property modifier validity.
-
- Add tests for sealed/override too.
-
- (Method.Emit): abstract or extern methods have no bodies.
-
-2001-12-14 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
- thing.
-
- (Method::Define, ::Emit): Modify accordingly.
-
- * expression.cs (Invocation::OverloadResolve): Handle error # 121.
-
- (ArrayCreation::MakeByteBlob): Handle floats and doubles.
-
- * makefile: Pass in /unsafe.
-
-2001-12-13 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs (MakeKey): Kill routine.
-
- * class.cs (TypeContainer.Define): Correctly define explicit
- method implementations (they require the full interface name plus
- the method name).
-
- * typemanager.cs: Deply the PtrHashtable here and stop using the
- lame keys. Things work so much better.
-
- This of course broke everyone who depended on `RegisterMethod' to
- do the `test for existance' test. This has to be done elsewhere.
-
- * support.cs (PtrHashtable): A hashtable that avoid comparing with
- the object stupid Equals method (because, that like fails all over
- the place). We still do not use it.
-
- * class.cs (TypeContainer.SetRequiredInterface,
- TypeContainer.RequireMethods): Killed these two routines and moved
- all the functionality to RegisterRequiredImplementations.
-
- (TypeContainer.RegisterRequiredImplementations): This routine now
- registers all the implementations required in an array for the
- interfaces and abstract methods. We use an array of structures
- which can be computed ahead of time to reduce memory usage and we
- also assume that lookups are cheap as most classes will not
- implement too many interfaces.
-
- We also avoid creating too many MethodSignatures.
-
- (TypeContainer.IsInterfaceMethod): Update and optionally does not
- clear the "pending" bit if we find that there are problems with
- the declaration.
-
- (TypeContainer.VerifyPendingMethods): Update to report errors of
- methods that look like implementations but are not.
-
- (TypeContainer.Define): Add support for explicit interface method
- implementation.
-
-2001-12-12 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs: Keep track of the parameters here instead of
- being a feature of the TypeContainer.
-
- * class.cs: Drop the registration of parameters here, as
- InterfaceMethods are also interface declarations.
-
- * delegate.cs: Register methods with the TypeManager not only with
- the TypeContainer. This code was buggy.
-
- * interface.cs: Full registation here.
-
-2001-12-11 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs: Remove reducer for binary expressions, it can not
- be done this way.
-
- * const.cs: Put here the code that used to go into constant.cs
-
- * constant.cs: Put here the code for constants, this is a new base
- class for Literals.
-
- * literal.cs: Make Literal derive from Constant.
-
-2001-12-09 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (Return.Emit): Report error 157 if the user
- attempts to return from a finally block.
-
- (Return.Emit): Instead of emitting a return, jump to the end of
- the function.
-
- * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
- LocalBuilder to store the result of the function. ReturnLabel is
- the target where we jump.
-
-
-2001-12-09 Radek Doulik <rodo@ximian.com>
-
- * cs-parser.jay: remember alias in current namespace
-
- * ecore.cs (SimpleName::DoResolve): use aliases for types or
- namespaces
-
- * class.cs (LookupAlias): lookup alias in my_namespace
-
- * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
- aliases hashtable
- (LookupAlias): lookup alias in this and if needed in parent
- namespaces
-
-2001-12-08 Miguel de Icaza <miguel@ximian.com>
-
- * support.cs:
-
- * rootcontext.cs: (ModuleBuilder) Made static, first step into
- making things static. I need this to avoid passing the
- TypeContainer when calling ParameterType.
-
- * support.cs (InternalParameters.ParameterType): Remove ugly hack
- that did string manipulation to compute the type and then call
- GetType. Use Parameter.ParameterType instead.
-
- * cs-tokenizer.cs: Consume the suffix for floating values.
-
- * expression.cs (ParameterReference): figure out whether this is a
- reference parameter or not. Kill an extra variable by computing
- the arg_idx during emission.
-
- * parameter.cs (Parameters.GetParameterInfo): New overloaded
- function that returns whether a parameter is an out/ref value or not.
-
- (Parameter.ParameterType): The type of the parameter (base,
- without ref/out applied).
-
- (Parameter.Resolve): Perform resolution here.
- (Parameter.ExternalType): The full type (with ref/out applied).
-
- * statement.cs (Using.Emit, Using.EmitExpression): Implement
- support for expressions on the using statement.
-
-2001-12-07 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (Using.EmitLocalVariableDecls): Split the
- localvariable handling of the using statement.
-
- (Block.EmitMeta): Keep track of variable count across blocks. We
- were reusing slots on separate branches of blocks.
-
- (Try.Emit): Emit the general code block, we were not emitting it.
-
- Check the type of the declaration to be an IDisposable or
- something that can be implicity converted to it.
-
- Emit conversions if required.
-
- * ecore.cs (EmptyExpression): New utility class.
- (Expression.ImplicitConversionExists): New utility function.
-
-2001-12-06 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (Using): Implement.
-
- * expression.cs (LocalVariableReference): Support read only variables.
-
- * statement.cs: Remove the explicit emit for the Leave opcode.
- (VariableInfo): Add a readonly field.
-
-2001-12-05 Miguel de Icaza <miguel@ximian.com>
-
- * ecore.cs (ConvCast): new class used to encapsulate the various
- explicit integer conversions that works in both checked and
- unchecked contexts.
-
- (Expression.ConvertNumericExplicit): Use new ConvCast class to
- properly generate the overflow opcodes.
-
-2001-12-04 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs: The correct type for the EmptyExpression is the
- element_type, not the variable type. Ravi pointed this out.
-
-2001-12-04 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (Method::Define): Handle PInvoke methods specially
- by using DefinePInvokeMethod instead of the usual one.
-
- * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
- above to do the task of extracting information and defining the method.
-
-2001-12-04 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
- of the condition for string type.
-
- (Emit): Move that here.
-
- (ArrayCreation::CheckIndices): Keep string literals in their expression
- form.
-
- (EmitDynamicInitializers): Handle strings appropriately.
-
-2001-12-04 Miguel de Icaza <miguel@ximian.com>
-
- * codegen.cs (EmitContext): Replace multiple variables with a
- single pointer to the current Switch statement.
-
- * statement.cs (GotoDefault, Switch): Adjust to cleaned up
- EmitContext.
-
-2001-12-03 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs
-
- * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
- default'.
-
- (Foreach.Emit): Foreach on arrays was not setting
- up the loop variables (for break/continue).
-
- (GotoCase): Semi-implented.
-
-2001-12-03 Ravi Pratap <ravi@ximian.com>
-
- * attribute.cs (CheckAttribute): Handle system attributes by using
- Attribute.GetAttributes to examine information we need.
-
- (GetValidPlaces): Same here.
-
- * class.cs (Method::Define): Catch invalid use of extern and abstract together.
-
- * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
-
- * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
-
- (Method::Define): Set appropriate flags if we have a DllImport attribute.
-
- (Method::Emit): Handle the case when we are a PInvoke method.
-
-2001-12-03 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs: Use ResolveWithSimpleName on compound names.
-
-2001-12-02 Ravi Pratap <ravi@ximian.com>
-
- * constant.cs (EmitConstant): Make sure we resolve the associated expression
- before trying to reduce it.
-
- * typemanager.cs (RegisterConstant, LookupConstant): Implement.
-
- * constant.cs (LookupConstantValue): Implement.
-
- (EmitConstant): Use the above in emitting the constant.
-
- * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
- that are user-defined by doing a LookupConstantValue on them.
-
- (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
- too, like above.
-
-2001-11-29 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (BaseAccess, BaseIndexer): Also split this out.
-
- (BaseAccess.DoResolve): Implement.
-
- (MemberAccess.DoResolve): Split this routine into a
- ResolveMemberAccess routine that can be used independently
-
-2001-11-28 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (Probe, Is, As): Split Probe in two classes Is and
- As that share bits of the implementation. Is returns a boolean,
- while As returns the Type that is being probed.
-
-2001-12-01 Ravi Pratap <ravi@ximian.com>
-
- * enum.cs (LookupEnumValue): Re-write various bits, return an object value
- instead of a Literal - much easier.
-
- (EnumInTransit): Remove - utterly useless :-)
-
- (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
-
- * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
-
- * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
- chain when we have no associated expression.
-
-2001-11-30 Ravi Pratap <ravi@ximian.com>
-
- * constant.cs (Define): Use Location while reporting the errror.
-
- Also emit a warning when 'new' is used and there is no inherited
- member to hide.
-
- * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
- populated.
-
- (LookupEnumValue): Implement to lookup an enum member's value and define it
- if necessary.
-
- (Populate): Re-write accordingly to use the above routine.
-
-2001-11-27 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (This): Fix prototype for DoResolveLValue to
- override the base class DoResolveLValue.
-
- * cs-parser.cs: Report errors cs574 and cs575 (destructor
- declarations)
-
- * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
- (we need to load the address of the field here). This fixes
- test-22.
-
- (FieldExpr.DoResolveLValue): Call the DoResolve
- function to initialize the Instance expression.
-
- * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
- correctly the GetEnumerator operation on a value type.
-
- * cs-parser.jay: Add more simple parsing error catches.
-
- * statement.cs (Switch): Add support for string switches.
- Handle null specially.
-
- * literal.cs (NullLiteral): Make NullLiteral objects singletons.
-
-2001-11-28 Ravi Pratap <ravi@ximian.com>
-
- * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
-
- (declare_local_constant): New helper function.
-
- * statement.cs (AddConstant): Keep a separate record of constants
-
- (IsConstant): Implement to determine if a variable is a constant.
-
- (GetConstantExpression): Implement.
-
- * expression.cs (LocalVariableReference): Handle the case when it is a constant.
-
- * statement.cs (IsVariableDefined): Re-write.
-
-2001-11-27 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (TypeContainer::FindMembers): Look for constants
- in the case when we are looking for MemberTypes.Field
-
- * expression.cs (MemberAccess::DoResolve): Check that in the
- case we are a FieldExpr and a Literal, we are not being accessed
- by an instance reference.
-
- * cs-parser.jay (local_constant_declaration): Implement.
-
- (declaration_statement): Implement for constant declarations.
-
-2001-11-26 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (Switch): Catch double defaults.
-
- (Switch): More work on the switch() statement
- implementation. It works for integral values now, need to finish
- string support.
-
-
-2001-11-24 Miguel de Icaza <miguel@ximian.com>
-
- * ecore.cs (Expression.ConvertIntLiteral): New function to convert
- integer literals into other integer literals. To be used by
- switch.
-
-2001-11-24 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
- some memory.
-
- (EmitDynamicInitializers): Cope with the above since we extract data
- directly from ArrayData now.
-
- (ExpectInitializers): Keep track of whether initializers are mandatory
- or not.
-
- (Bounds): Make it a hashtable to prevent the same dimension being
- recorded for every element in that dimension.
-
- (EmitDynamicInitializers): Fix bug which prevented the Set array method
- from being found.
-
- Also fix bug which was causing the indices to be emitted in the reverse
- order.
-
-2001-11-24 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (ArrayCreation): Implement the bits that Ravi left
- unfinished. They do not work, because the underlying code is
- sloppy.
-
-2001-11-22 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay: Remove bogus fixme.
-
- * statement.cs (Switch, SwitchSection, SwithLabel): Started work
- on Switch statement.
-
-2001-11-23 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
- the same.
-
- * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
- parameter. Apparently, any expression is allowed.
-
- (ValidateInitializers): Update accordingly.
-
- (CheckIndices): Fix some tricky bugs thanks to recursion.
-
- * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
- I was being completely brain-dead.
-
- (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
- and re-write acordingly.
-
- (DelegateInvocation): Re-write accordingly.
-
- * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
-
- (MakeByteBlob): Handle types more correctly.
-
- * expression.cs (ArrayCreation:Emit): Write preliminary code to do
- initialization from expressions but it is incomplete because I am a complete
- Dodo :-|
-
-2001-11-22 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (If.Emit): Fix a bug that generated incorrect code
- on If. Basically, we have to return `true' (ie, we do return to
- our caller) only if both branches of the if return.
-
- * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
- short-circuit operators, handle them as short circuit operators.
-
- (Cast.DoResolve): Resolve type.
- (Cast.Cast): Take an expression as the target type.
-
- * cs-parser.jay (cast_expression): Remove old hack that only
- allowed a limited set of types to be handled. Now we take a
- unary_expression and we resolve to a type during semantic
- analysis.
-
- Use the grammar productions from Rhys to handle casts (this is
- not complete like Rhys syntax yet, we fail to handle that corner
- case that C# has regarding (-x), but we will get there.
-
-2001-11-22 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (EmitFieldInitializer): Take care of the case when we have a
- field which is an array type.
-
- * cs-parser.jay (declare_local_variables): Support array initialization too.
-
- * typemanager.cs (MakeKey): Implement.
-
- (everywhere): Use the above appropriately.
-
- * cs-parser.jay (for_statement): Update for array initialization while
- declaring variables.
-
- * ecore.cs : The error message was correct, it's the variable's names that
- were misleading ;-) Make the code more readable.
-
- (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
- the correct type etc.
-
- (ConvertExplicit): Handle Enum types by examining the underlying type.
-
-2001-11-21 Ravi Pratap <ravi@ximian.com>
-
- * parameter.cs (GetCallingConvention): Always return
- CallingConventions.Standard for now.
-
-2001-11-22 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (Binary.ResolveOperator): Update the values of `l'
- and `r' after calling DoNumericPromotions.
-
- * ecore.cs: Fix error message (the types were in the wrong order).
-
- * statement.cs (Foreach.ProbeCollectionType): Need to pass
- BindingFlags.Instance as well
-
- * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
- implicit int literal conversion in an empty cast so that we
- propagate the right type upstream.
-
- (UnboxCast): new class used to unbox value types.
- (Expression.ConvertExplicit): Add explicit type conversions done
- by unboxing.
-
- (Expression.ImplicitNumericConversion): Oops, forgot to test for
- the target type before applying the implicit LongLiterals to ULong
- literal cast.
-
-2001-11-21 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay (for_statement): Reworked the way For works: now
- we declare manually any variables that are introduced in
- for_initializer to solve the problem of having out-of-band code
- emition (that is what got for broken).
-
- (declaration_statement): Perform the actual variable declaration
- that used to be done in local_variable_declaration here.
-
- (local_variable_declaration): Do not declare anything, just pass
- the information on a DictionaryEntry
-
-2001-11-20 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
- re-write of the logic to now make it recursive.
-
- (UpdateIndices): Re-write accordingly.
-
- Store element data in a separate ArrayData list in the above methods.
-
- (MakeByteBlob): Implement to dump the array data into a byte array.
-
-2001-11-19 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
- into CheckIndices.
-
- * constant.cs (Define): Implement.
-
- (EmitConstant): Re-write fully.
-
- Pass in location info.
-
- * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
- respectively.
-
- * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
- DictionaryEntry since we need location info too.
-
- (constant_declaration): Update accordingly.
-
- * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
- code into another method : UpdateIndices.
-
-2001-11-18 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
- some type checking etc.
-
-2001-11-17 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ArrayCreation::ValidateInitializers): Implement
- bits to provide dimension info if the user skips doing that.
-
- Update second constructor to store the rank correctly.
-
-2001-11-16 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ArrayCreation::ValidateInitializers): Poke around
- and try to implement.
-
- * ../errors/cs0150.cs : Add.
-
- * ../errors/cs0178.cs : Add.
-
-2001-11-16 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs: Implement foreach on multi-dimensional arrays.
-
- * parameter.cs (Parameters.GetParameterByName): Also lookup the
- name of the params argument.
-
- * expression.cs: Use EmitStoreOpcode to get the right opcode while
- initializing the array.
-
- (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
- we can use this elsewhere.
-
- * statement.cs: Finish implementation of foreach for single
- dimension arrays.
-
- * cs-parser.jay: Use an out-of-band stack to pass information
- around, I wonder why I need this.
-
- foreach_block: Make the new foreach_block the current_block.
-
- * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
- function used to return a static Parameters structure. Used for
- empty parameters, as those are created very frequently.
-
- * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
-
-2001-11-15 Ravi Pratap <ravi@ximian.com>
-
- * interface.cs : Default modifier is private, not public. The
- make verify test passes again.
-
-2001-11-15 Ravi Pratap <ravi@ximian.com>
-
- * support.cs (ReflectionParameters): Fix logic to determine
- whether the last parameter is a params one. Test 9 passes again.
-
- * delegate.cs (Populate): Register the builders we define with
- RegisterParameterForBuilder. Test 19 passes again.
-
- * cs-parser.jay (property_declaration): Reference $6 instead
- of $$ to get at the location.
-
- (indexer_declaration): Similar stuff.
-
- (attribute): Ditto.
-
- * class.cs (Property): Register parameters for the Get and Set methods
- if they exist. Test 23 passes again.
-
- * expression.cs (ArrayCreation::Emit): Pass null for the method in the
- call to EmitArguments as we are sure there aren't any params arguments.
- Test 32 passes again.
-
- * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
- IndexOutOfRangeException.
-
- * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
- Test 33 now passes again.
-
-2001-11-15 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
- broke a bunch of things. Will have to come up with a better way
- of tracking locations.
-
- * statement.cs: Implemented foreach for single dimension arrays.
-
-2001-11-09 Miguel de Icaza <miguel@ximian.com>
-
- * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
- an error. This removes the lookup from the critical path.
-
- * cs-parser.jay: Removed use of temporary_loc, which is completely
- broken.
-
-2001-11-14 Miguel de Icaza <miguel@ximian.com>
-
- * support.cs (ReflectionParameters.ParameterModifier): Report
- whether the argument is a PARAMS argument or not.
-
- * class.cs: Set the attribute `ParamArrayAttribute' on the
- parameter argument.
-
- * typemanager.cs: Define param_array_type (ParamArrayAttribute)
- and cons_param_array_attribute (ConstructorInfo for
- ParamArrayAttribute).,
-
- * codegen.cs: Emit the return using the `Return' statement, that
- way we can report the error correctly for missing return values.
-
- * class.cs (Method.Emit): Clean up.
-
- * expression.cs (Argument.Resolve): Take another argument: the
- location where this argument is used. Notice that this is not
- part of the "Argument" class as to reduce the size of the
- structure (we know the approximate location anyways).
-
- Test if the argument is a variable-reference, if not, then
- complain with a 206.
-
- (Argument.Emit): Emit addresses of variables.
-
- (Argument.FullDesc): Simplify.
-
- (Invocation.DoResolve): Update for Argument.Resolve.
-
- (ElementAccess.DoResolve): ditto.
-
- * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
- method should be virtual, as this method is always virtual.
-
- (NewDelegate.DoResolve): Update for Argument.Resolve.
-
- * class.cs (ConstructorInitializer.DoResolve): ditto.
-
- * attribute.cs (Attribute.Resolve): ditto.
-
-2001-11-13 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
-
- * expression.cs (ParameterReference): Drop IStackStorage and implement
- IAssignMethod instead.
-
- (LocalVariableReference): ditto.
-
- * ecore.cs (FieldExpr): Drop IStackStorage and implement
- IAssignMethod instead.
-
-2001-11-13 Miguel de Icaza <miguel@ximian.com>
-
- * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
- enumerations that are used in heavily used structures derive from
- byte in a laughable and pathetic attempt to reduce memory usage.
- This is the kind of pre-optimzations that you should not do at
- home without adult supervision.
-
- * expression.cs (UnaryMutator): New class, used to handle ++ and
- -- separatedly from the other unary operators. Cleans up the
- code, and kills the ExpressionStatement dependency in Unary.
-
- (Unary): Removed `method' and `Arguments' from this class, making
- it smaller, and moving it all to SimpleCall, so I can reuse this
- code in other locations and avoid creating a lot of transient data
- strucutres when not required.
-
- * cs-parser.jay: Adjust for new changes.
-
-2001-11-11 Miguel de Icaza <miguel@ximian.com>
-
- * enum.cs (Enum.Populate): If there is a failure during
- definition, return
-
- * cs-parser.jay (opt_enum_base): we used to catch type errors
- here, but this is really incorrect. The type error should be
- catched during semantic analysis.
-
-2001-12-11 Ravi Pratap <ravi@ximian.com>
-
- * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
- current_local_parameters as expected since I, in my stupidity, had forgotten
- to do this :-)
-
- * attribute.cs (GetValidPlaces): Fix stupid bug.
-
- * class.cs (Method::Emit): Perform check on applicability of attributes.
-
- (Constructor::Emit): Ditto.
-
- (Field::Emit): Ditto.
-
- (Field.Location): Store location information.
-
- (Property, Event, Indexer, Operator): Ditto.
-
- * cs-parser.jay (field_declaration): Pass in location for each field.
-
- * ../errors/cs0592.cs : Add.
-
-2001-11-12 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
-
- (InitCoreTypes): Update accordingly.
-
- (RegisterAttrType, LookupAttr): Implement.
-
- * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
- info about the same.
-
- (Resolve): Update to populate the above as necessary.
-
- (Error592): Helper.
-
- (GetValidPlaces): Helper to the above.
-
- (CheckAttribute): Implement to perform validity of attributes on declarative elements.
-
- * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
-
-2001-11-12 Ravi Pratap <ravi@ximian.com>
-
- * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
-
- * ../errors/cs0617.cs : Add.
-
-2001-11-11 Ravi Pratap <ravi@ximian.com>
-
- * enum.cs (Emit): Rename to Populate to be more consistent with what
- we expect it to do and when exactly it is called.
-
- * class.cs, rootcontext.cs : Update accordingly.
-
- * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
- FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
-
- * enum.cs (Populate): Register fields with TypeManager.RegisterField.
-
- * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
- of a fieldinfo using the above, when dealing with a FieldBuilder.
-
-2001-11-10 Ravi Pratap <ravi@ximian.com>
-
- * ../errors/cs0031.cs : Add.
-
- * ../errors/cs1008.cs : Add.
-
- * ../errrors/cs0543.cs : Add.
-
- * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
- enum type.
-
- (FindMembers): Implement.
-
- * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
- enums and delegates too.
-
- (enum_types): Rename to builder_to_enum.
-
- (delegate_types): Rename to builder_to_delegate.
-
- * delegate.cs (FindMembers): Implement.
-
-2001-11-09 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (IsEnumType): Implement.
-
- * enum.cs (Emit): Re-write parts to account for the underlying type
- better and perform checking etc.
-
- (GetNextDefaultValue): Helper to ensure we don't overshoot max value
- of the underlying type.
-
- * literal.cs (GetValue methods everywhere): Perform bounds checking and return
- value
-
- * enum.cs (error31): Helper to report error #31.
-
- * cs-parser.jay (enum_declaration): Store location of each member too.
-
- * enum.cs (member_to_location): New hashtable.
-
- (AddEnumMember): Update location hashtable.
-
- (Emit): Use the location of each member while reporting errors.
-
-2001-11-09 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay: A for_initializer if is a
- local_variable_declaration really ammount to have an implicit
- block with the variable declaration and no initializer for for.
-
- * statement.cs (For.Emit): Cope with null initializers.
-
- This fixes the infinite loop on for initializers.
-
-2001-11-08 Miguel de Icaza <miguel@ximian.com>
-
- * enum.cs: More cleanup.
-
- * ecore.cs: Remove dead code.
-
- * class.cs (Property.Emit): More simplification.
- (Event.Emit): ditto.
-
- Reworked to have less levels of indentation.
-
-2001-11-08 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (Property): Emit attributes.
-
- (Field): Ditto.
-
- (Event): Ditto.
-
- (Indexer): Ditto.
-
- (Operator): Ditto.
-
- * enum.cs (Emit): Ditto.
-
- * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
- Enums too.
-
- * class.cs (Field, Event, etc.): Move attribute generation into the
- Emit method everywhere.
-
- * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
- we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
- as we had no way of defining nested enums !
-
- * rootcontext.cs : Adjust code accordingly.
-
- * typemanager.cs (AddEnumType): To keep track of enum types separately.
-
-2001-11-07 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (EvalConstantExpression): Move into ecore.cs
-
- * enum.cs (Enum): Rename some members and make them public and readonly
- according to our convention.
-
- * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
- nothing else.
-
- * enum.cs (Enum::Define): Use the above instead of TypeAttr.
-
- (Enum::Emit): Write a simple version for now which doesn't try to compute
- expressions. I shall modify this to be more robust in just a while.
-
- * class.cs (TypeContainer::Emit): Make sure we include Enums too.
-
- (TypeContainer::CloseType): Create the Enum types too.
-
- * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
-
- * expression.cs (EvalConstantExpression): Get rid of completely.
-
- * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
- user-defined values and other cases.
-
- (IsValidEnumLiteral): Helper function.
-
- * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
- out there in the case we had a literal FieldExpr.
-
- (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
-
- (Literalize): Revamp a bit to take two arguments.
-
- (EnumLiteral): New class which derives from Literal to wrap enum literals.
-
-2001-11-06 Ravi Pratap <ravi@ximian.com>
-
- * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
-
- * expression.cs (ArrayCreation::ValidateInitializers): Implement.
-
- (Resolve): Use the above to ensure we have proper initializers.
-
-2001-11-05 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Expression::EvalConstantExpression): New method to
- evaluate constant expressions.
-
- * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
-
-2001-11-07 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (ArrayCreation.Emit): Some bits to initialize data
- in an array.
-
- (Binary.ResolveOperator): Handle operator != (object a, object b)
- and operator == (object a, object b);
-
- (Binary.DoNumericPromotions): Indicate whether the numeric
- promotion was possible.
-
- (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
- Implement.
-
- Made the ArrayAccess implement interface IAssignMethod instead of
- IStackStore as the order in which arguments are passed reflects
- this.
-
- * assign.cs: Instead of using expr.ExprClass to select the way of
- assinging, probe for the IStackStore/IAssignMethod interfaces.
-
- * typemanager.cs: Load InitializeArray definition.
-
- * rootcontext.cs (RootContext.MakeStaticData): Used to define
- static data that can be used to initialize arrays.
-
-2001-11-05 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs: Handle operator== and operator!= for booleans.
-
- (Conditioal.Reduce): Implement reducer for the ?: operator.
-
- (Conditional.Resolve): Implement dead code elimination.
-
- (Binary.Resolve): Catch string literals and return a new
- concatenated string.
-
- (Unary.Reduce): Implement reduction of unary expressions.
-
- * ecore.cs: Split out the expression core handling here.
-
- (Expression.Reduce): New method used to perform constant folding
- and CSE. This is needed to support constant-expressions.
-
- * statement.cs (Statement.EmitBoolExpression): Pass true and false
- targets, and optimize for !x.
-
-2001-11-04 Ravi Pratap <ravi@ximian.com>
-
- * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
- of an attribute gives us a CustomAttributeBuilder which we use accordingly to
- set custom atttributes.
-
- * literal.cs (Literal::GetValue): New abstract method to return the actual
- value of the literal, cast as an object.
-
- (*Literal): Implement GetValue method.
-
- * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
- expressions to the arraylist but objects of type Argument.
-
- * class.cs (TypeContainer::Emit): Emit our attributes too.
-
- (Method::Emit, Constructor::Emit): Ditto.
-
- * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
- to be ignoring earlier.
-
-2001-11-03 Ravi Pratap <ravi@ximian.com>
-
- * attribute.cs (AttributeSection::Define): Implement to do the business
- of constructing a CustomAttributeBuilder.
-
- (Attribute): New trivial class. Increases readability of code.
-
- * cs-parser.jay : Update accordingly.
-
- (positional_argument_list, named_argument_list, named_argument): New rules
-
- (attribute_arguments): Use the above so that we are more correct.
-
-2001-11-02 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Invocation::IsParamsMethodApplicable): Implement
- to perform all checks for a method with a params parameter.
-
- (Invocation::OverloadResolve): Update to use the above method and therefore
- cope correctly with params method invocations.
-
- * support.cs (InternalParameters::ParameterDesc): Provide a desc for
- params too.
-
- * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
- constructors in our parent too because we can't afford to miss out on
- protected ones ;-)
-
- * attribute.cs (AttributeSection): New name for the class Attribute
-
- Other trivial changes to improve readability.
-
- * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
- use the new class names.
-
-2001-11-01 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (Method::Define): Complete definition for params types too
-
- (Indexer::Define): Ditto.
-
- * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
- Cope everywhere with a request for info about the array parameter.
-
-2001-11-01 Ravi Pratap <ravi@ximian.com>
-
- * tree.cs (RecordNamespace): Fix up to check for the correct key.
-
- * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
- local_variable_type to extract the string corresponding to the type.
-
- (local_variable_type): Fixup the action to use the new helper method.
-
- * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
- go.
-
- * expression.cs : Clean out code which uses the above.
-
-2001-10-31 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (RegisterMethod): Check if we already have an existing key
- and bale out if necessary by returning a false.
-
- (RegisterProperty): Ditto.
-
- * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
- and print out appropriate error messages.
-
- * interface.cs (everywhere): Ditto.
-
- * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
- location to constructor.
-
- * class.cs (Property, Event, Indexer): Update accordingly.
-
- * ../errors/cs111.cs : Added.
-
- * expression.cs (Invocation::IsApplicable): New static method to determine applicability
- of a method, as laid down by the spec.
-
- (Invocation::OverloadResolve): Use the above method.
-
-2001-10-31 Ravi Pratap <ravi@ximian.com>
-
- * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
- now take a TypeContainer and a Parameters object.
-
- (ParameterData): Modify return type of ParameterModifier method to be
- Parameter.Modifier and not a string.
-
- (ReflectionParameters, InternalParameters): Update accordingly.
-
- * expression.cs (Argument::GetParameterModifier): Same here.
-
- * support.cs (InternalParameters::ParameterType): Find a better way of determining
- if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
- symbol in it at all so maybe this is only for now.
-
-2001-10-30 Ravi Pratap <ravi@ximian.com>
-
- * support.cs (InternalParameters): Constructor now takes an extra argument
- which is the actual Parameters class.
-
- (ParameterDesc): Update to provide info on ref/out modifiers.
-
- * class.cs (everywhere): Update call to InternalParameters to pass in
- the second argument too.
-
- * support.cs (ParameterData): Add ParameterModifier, which is a method
- to return the modifier info [ref/out etc]
-
- (InternalParameters, ReflectionParameters): Implement the above.
-
- * expression.cs (Argument::ParameterModifier): Similar function to return
- info about the argument's modifiers.
-
- (Invocation::OverloadResolve): Update to take into account matching modifiers
- too.
-
- * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
- a new SetFormalParameters object which we pass to InternalParameters.
-
-2001-10-30 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (NewArray): Merge into the ArrayCreation class.
-
-2001-10-29 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (NewArray): Merge classes NewBuiltinArray and
- NewUserdefinedArray into one as there wasn't much of a use in having
- two separate ones.
-
- * expression.cs (Argument): Change field's name to ArgType from Type.
-
- (Type): New readonly property which returns the proper type, taking into
- account ref/out modifiers.
-
- (everywhere): Adjust code accordingly for the above.
-
- * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
- whether we are emitting for a ref or out parameter.
-
- * expression.cs (Argument::Emit): Use the above field to set the state.
-
- (LocalVariableReference::Emit): Update to honour the flag and emit the
- right stuff.
-
- * parameter.cs (Attributes): Set the correct flags for ref parameters.
-
- * expression.cs (Argument::FullDesc): New function to provide a full desc.
-
- * support.cs (ParameterData): Add method ParameterDesc to the interface.
-
- (ReflectionParameters, InternalParameters): Implement the above method.
-
- * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
- reporting errors.
-
- (Invocation::FullMethodDesc): Ditto.
-
-2001-10-29 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay: Add extra production for the second form of array
- creation.
-
- * expression.cs (ArrayCreation): Update to reflect the above
- change.
-
- * Small changes to prepare for Array initialization.
-
-2001-10-28 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs (ImplementsInterface): interface might be null;
- Deal with this problem;
-
- Also, we do store negative hits on the cache (null values), so use
- this instead of calling t.GetInterfaces on the type everytime.
-
-2001-10-28 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (IsBuiltinType): New method to help determine the same.
-
- * expression.cs (New::DoResolve): Get rid of array creation code and instead
- split functionality out into different classes.
-
- (New::FormArrayType): Move into NewBuiltinArray.
-
- (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
- quite useless.
-
- (NewBuiltinArray): New class to handle creation of built-in arrays.
-
- (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
- account creation of one-dimensional arrays.
-
- (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
-
- (NewUserdefinedArray::DoResolve): Implement.
-
- * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
-
- * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
- we maintain inside the TypeManager. This is necessary to perform lookups on the
- module builder.
-
- (LookupType): Update to perform GetType on the module builders too.
-
- * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
-
- * exprssion.cs (NewUserdefinedArray::Emit): Implement.
-
-2001-10-23 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (New::DoResolve): Implement guts of array creation.
-
- (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
-
-2001-10-27 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs: Fix bug I introduced lsat night that broke
- Delegates.
-
- (Expression.Resolve): Report a 246 error (can not resolve name)
- if we find a SimpleName in the stream.
-
- (Expression.ResolveLValue): Ditto.
-
- (Expression.ResolveWithSimpleName): This function is a variant of
- ResolveName, this one allows SimpleNames to be returned without a
- warning. The only consumer of SimpleNames is MemberAccess
-
-2001-10-26 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (Invocation::DoResolve): Catch SimpleNames that
- might arrive here. I have my doubts that this is correct.
-
- * statement.cs (Lock): Implement lock statement.
-
- * cs-parser.jay: Small fixes to support `lock' and `using'
-
- * cs-tokenizer.cs: Remove extra space
-
- * driver.cs: New flag --checked, allows to turn on integer math
- checking.
-
- * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
- Threading.Monitor.Exit
-
-2001-10-23 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (IndexerAccess::DoResolveLValue): Set the
- Expression Class to be IndexerAccess.
-
- Notice that Indexer::DoResolve sets the eclass to Value.
-
-2001-10-22 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs (TypeContainer::Emit): Emit code for indexers.
-
- * assign.cs (IAssignMethod): New interface implemented by Indexers
- and Properties for handling assignment.
-
- (Assign::Emit): Simplify and reuse code.
-
- * expression.cs (IndexerAccess, PropertyExpr): Implement
- IAssignMethod, clean up old code.
-
-2001-10-22 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (ImplementsInterface): New method to determine if a type
- implements a given interface. Provides a nice cache too.
-
- * expression.cs (ImplicitReferenceConversion): Update checks to use the above
- method.
-
- (ConvertReferenceExplicit): Ditto.
-
- * delegate.cs (Delegate::Populate): Update to define the parameters on the
- various methods, with correct names etc.
-
- * class.cs (Operator::OpType): New members Operator.UnaryPlus and
- Operator.UnaryNegation.
-
- * cs-parser.jay (operator_declarator): Be a little clever in the case where
- we have a unary plus or minus operator.
-
- * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
- UnaryMinus.
-
- * everywhere : update accordingly.
-
- * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
- respectively.
-
- * class.cs (Method::Define): For the case where we are implementing a method
- inherited from an interface, we need to set the MethodAttributes.Final flag too.
- Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
-
-2001-10-21 Ravi Pratap <ravi@ximian.com>
-
- * interface.cs (FindMembers): Implement to work around S.R.E
- lameness.
-
- * typemanager.cs (IsInterfaceType): Implement.
-
- (FindMembers): Update to handle interface types too.
-
- * expression.cs (ImplicitReferenceConversion): Re-write bits which
- use IsAssignableFrom as that is not correct - it doesn't work.
-
- * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
- and accordingly override EmitStatement.
-
- * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
- using the correct logic :-)
-
-2001-10-19 Ravi Pratap <ravi@ximian.com>
-
- * ../errors/cs-11.cs : Add to demonstrate error -11
-
-2001-10-17 Miguel de Icaza <miguel@ximian.com>
-
- * assign.cs (Assign::Resolve): Resolve right hand side first, and
- then pass this as a hint to ResolveLValue.
-
- * expression.cs (FieldExpr): Add Location information
-
- (FieldExpr::LValueResolve): Report assignment to readonly
- variable.
-
- (Expression::ExprClassFromMemberInfo): Pass location information.
-
- (Expression::ResolveLValue): Add new method that resolves an
- LValue.
-
- (Expression::DoResolveLValue): Default invocation calls
- DoResolve.
-
- (Indexers): New class used to keep track of indexers in a given
- Type.
-
- (IStackStore): Renamed from LValue, as it did not really describe
- what this did. Also ResolveLValue is gone from this interface and
- now is part of Expression.
-
- (ElementAccess): Depending on the element access type
-
- * typemanager.cs: Add `indexer_name_type' as a Core type
- (System.Runtime.CompilerServices.IndexerNameAttribute)
-
- * statement.cs (Goto): Take a location.
-
-2001-10-18 Ravi Pratap <ravi@ximian.com>
-
- * delegate.cs (Delegate::VerifyDelegate): New method to verify
- if two delegates are compatible.
-
- (NewDelegate::DoResolve): Update to take care of the case when
- we instantiate a delegate from another delegate.
-
- * typemanager.cs (FindMembers): Don't even try to look up members
- of Delegate types for now.
-
-2001-10-18 Ravi Pratap <ravi@ximian.com>
-
- * delegate.cs (NewDelegate): New class to take care of delegate
- instantiation.
-
- * expression.cs (New): Split the delegate related code out into
- the NewDelegate class.
-
- * delegate.cs (DelegateInvocation): New class to handle delegate
- invocation.
-
- * expression.cs (Invocation): Split out delegate related code into
- the DelegateInvocation class.
-
-2001-10-17 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (New::DoResolve): Implement delegate creation fully
- and according to the spec.
-
- (New::DoEmit): Update to handle delegates differently.
-
- (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
- because of which we were printing out arguments in reverse order !
-
- * delegate.cs (VerifyMethod): Implement to check if the given method
- matches the delegate.
-
- (FullDelegateDesc): Implement.
-
- (VerifyApplicability): Implement.
-
- * expression.cs (Invocation::DoResolve): Update to accordingly handle
- delegate invocations too.
-
- (Invocation::Emit): Ditto.
-
- * ../errors/cs1593.cs : Added.
-
- * ../errors/cs1594.cs : Added.
-
- * delegate.cs (InstanceExpression, TargetMethod): New properties.
-
-2001-10-16 Ravi Pratap <ravi@ximian.com>
-
- * typemanager.cs (intptr_type): Core type for System.IntPtr
-
- (InitCoreTypes): Update for the same.
-
- (iasyncresult_type, asynccallback_type): Ditto.
-
- * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
- correct.
-
- * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
- too.
-
- * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
- the builders for the 4 members of a delegate type :-)
-
- (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
- type.
-
- * expression.cs (New::DoResolve): Implement guts for delegate creation.
-
- * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
-
-2001-10-15 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs (Break::Emit): Implement.
- (Continue::Emit): Implement.
-
- (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
- (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
- (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
- (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
- end loop
-
- * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
- properties that track the label for the current loop (begin of the
- loop and end of the loop).
-
-2001-10-15 Ravi Pratap <ravi@ximian.com>
-
- * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
- use of emitting anything at all.
-
- * class.cs, rootcontext.cs : Get rid of calls to the same.
-
- * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
-
- (Populate): Define the constructor correctly and set the implementation
- attributes.
-
- * typemanager.cs (delegate_types): New hashtable to hold delegates that
- have been defined.
-
- (AddDelegateType): Implement.
-
- (IsDelegateType): Implement helper method.
-
- * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
-
- * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
- and accordingly handle it.
-
- * delegate.cs (Populate): Take TypeContainer argument.
- Implement bits to define the Invoke method. However, I still haven't figured out
- how to take care of the native int bit :-(
-
- * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
- Qualify the name of the delegate, not its return type !
-
- * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
- conversion.
-
- (StandardConversionExists): Checking for array types turns out to be recursive.
-
- (ConvertReferenceExplicit): Implement array conversion.
-
- (ExplicitReferenceConversionExists): New method to determine precisely that :-)
-
-2001-10-12 Ravi Pratap <ravi@ximian.com>
-
- * cs-parser.jay (delegate_declaration): Store the fully qualified
- name as it is a type declaration.
-
- * delegate.cs (ReturnType, Name): Rename members to these. Make them
- readonly.
-
- (DefineDelegate): Renamed from Define. Does the same thing essentially,
- as TypeContainer::DefineType.
-
- (Populate): Method in which all the definition of the various methods (Invoke)
- etc is done.
-
- (Emit): Emit any code, if necessary. I am not sure about this really, but let's
- see.
-
- (CloseDelegate): Finally creates the delegate.
-
- * class.cs (TypeContainer::DefineType): Update to define delegates.
- (Populate, Emit and CloseType): Do the same thing here too.
-
- * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
- delegates in all these operations.
-
-2001-10-14 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs: LocalTemporary: a new expression used to
- reference a temporary that has been created.
-
- * assign.cs: Handle PropertyAccess back here, so that we can
- provide the proper semantic access to properties.
-
- * expression.cs (Expression::ConvertReferenceExplicit): Implement
- a few more explicit conversions.
-
- * modifiers.cs: `NEW' modifier maps to HideBySig.
-
- * expression.cs (PropertyExpr): Make this into an
- ExpressionStatement, and support the EmitStatement code path.
-
- Perform get/set error checking, clean up the interface.
-
- * assign.cs: recognize PropertyExprs as targets, and if so, turn
- them into toplevel access objects.
-
-2001-10-12 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs: PropertyExpr::PropertyExpr: use work around the
- SRE.
-
- * typemanager.cs: Keep track here of our PropertyBuilders again to
- work around lameness in SRE.
-
-2001-10-11 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (LValue::LValueResolve): New method in the
- interface, used to perform a second resolution pass for LValues.
-
- (This::DoResolve): Catch the use of this in static methods.
-
- (This::LValueResolve): Implement.
-
- (This::Store): Remove warning, assigning to `this' in structures
- is
-
- (Invocation::Emit): Deal with invocation of
- methods on value types. We need to pass the address to structure
- methods rather than the object itself. (The equivalent code to
- emit "this" for structures leaves the entire structure on the
- stack instead of a pointer to it).
-
- (ParameterReference::DoResolve): Compute the real index for the
- argument based on whether the method takes or not a `this' pointer
- (ie, the method is static).
-
- * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
- value types returned from functions when we need to invoke a
- method on the sturcture.
-
-
-2001-10-11 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (TypeContainer::DefineType): Method to actually do the business of
- defining the type in the Modulebuilder or Typebuilder. This is to take
- care of nested types which need to be defined on the TypeBuilder using
- DefineNestedMethod.
-
- (TypeContainer::GetClassBases): Implement. Essentially the code from the
- methods in RootContext, only ported to be part of TypeContainer.
-
- (TypeContainer::GetInterfaceOrClass): Ditto.
-
- (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
-
- * interface.cs (Interface::DefineInterface): New method. Does exactly
- what RootContext.CreateInterface did earlier, only it takes care of nested types
- too.
-
- (Interface::GetInterfaces): Move from RootContext here and port.
-
- (Interface::GetInterfaceByName): Same here.
-
- * rootcontext.cs (ResolveTree): Re-write.
-
- (PopulateTypes): Re-write.
-
- * class.cs (TypeContainer::Populate): Populate nested types too.
- (TypeContainer::Emit): Emit nested members too.
-
- * typemanager.cs (AddUserType): Do not make use of the FullName property,
- instead just use the name argument passed in as it is already fully
- qualified.
-
- (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
- to TypeContainer mapping to see if a type is user-defined.
-
- * class.cs (TypeContainer::CloseType): Implement.
-
- (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
- the default constructor.
-
- (TypeContainer::Populate): Fix minor bug which led to creating default constructors
- twice.
-
- (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
-
- * interface.cs (CloseType): Create the type here.
-
- * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
- the hierarchy.
-
- Remove all the methods which are now in TypeContainer.
-
-2001-10-10 Ravi Pratap <ravi@ximian.com>
-
- * delegate.cs (Define): Re-write bits to define the delegate
- correctly.
-
-2001-10-10 Miguel de Icaza <miguel@ximian.com>
-
- * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
-
- * expression.cs (ImplicitReferenceConversion): handle null as well
- as a source to convert to any reference type.
-
- * statement.cs (Return): Perform any implicit conversions to
- expected return type.
-
- Validate use of return statement.
-
- * codegen.cs (EmitContext): Pass the expected return type here.
-
- * class.cs (Method, Constructor, Property): Pass expected return
- type to EmitContext.
-
-2001-10-09 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs: Make DoResolve take an EmitContext instead of a
- TypeContainer.
-
- Replaced `l' and `location' for `loc', for consistency.
-
- (Error, Warning): Remove unneeded Tc argument.
-
- * assign.cs, literal.cs, constant.cs: Update to new calling
- convention.
-
- * codegen.cs: EmitContext now contains a flag indicating whether
- code is being generated in a static method or not.
-
- * cs-parser.jay: DecomposeQI, new function that replaces the old
- QualifiedIdentifier. Now we always decompose the assembled
- strings from qualified_identifier productions into a group of
- memberaccesses.
-
-2001-10-08 Miguel de Icaza <miguel@ximian.com>
-
- * rootcontext.cs: Deal with field-less struct types correctly now
- by passing the size option to Define Type.
-
- * class.cs: Removed hack that created one static field.
-
-2001-10-07 Miguel de Icaza <miguel@ximian.com>
-
- * statement.cs: Moved most of the code generation here.
-
-2001-10-09 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
- seem very right.
-
- (ElementAccess): Remove useless bits for now - keep checks as the spec
- says.
-
-2001-10-08 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ElementAccess::DoResolve): Remove my crap code
- and start performing checks according to the spec.
-
-2001-10-07 Ravi Pratap <ravi@ximian.com>
-
- * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
- rank_specifiers instead.
-
- (rank_specifiers): Change the order in which the rank specifiers are stored
-
- (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
-
- * expression.cs (ElementAccess): Implement the LValue interface too.
-
-2001-10-06 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
- except that user defined conversions are not included.
-
- (UserDefinedConversion): Update to use the ConvertExplicitStandard to
- perform the conversion of the return type, if necessary.
-
- (New::DoResolve): Check whether we are creating an array or an object
- and accordingly do the needful.
-
- (New::Emit): Same here.
-
- (New::DoResolve): Implement guts of array creation.
-
- (New::FormLookupType): Helper function.
-
-2001-10-07 Miguel de Icaza <miguel@ximian.com>
-
- * codegen.cs: Removed most of the code generation here, and move the
- corresponding code generation bits to the statement classes.
-
- Added support for try/catch/finalize and throw.
-
- * cs-parser.jay: Added support for try/catch/finalize.
-
- * class.cs: Catch static methods having the flags override,
- virtual or abstract.
-
- * expression.cs (UserCast): This user cast was not really doing
- what it was supposed to do. Which is to be born in fully resolved
- state. Parts of the resolution were being performed at Emit time!
-
- Fixed this code.
-
-2001-10-05 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs: Implicity convert the result from UserCast.
-
-2001-10-05 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Expression::FindMostEncompassingType): Fix bug which
- prevented it from working correctly.
-
- (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
- merely ConvertImplicit.
-
-2001-10-05 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs: Make the LookupTypeContainer function static,
- and not per-instance.
-
- * class.cs: Make static FindMembers (the one that takes a Type
- argument).
-
- * codegen.cs: Add EmitForeach here.
-
- * cs-parser.jay: Make foreach a toplevel object instead of the
- inline expansion, as we need to perform semantic analysis on it.
-
-2001-10-05 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Expression::ImplicitUserConversion): Rename to
- UserDefinedConversion.
-
- (Expression::UserDefinedConversion): Take an extra argument specifying
- whether we look for explicit user conversions too.
-
- (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
-
- (UserDefinedConversion): Incorporate support for user defined explicit conversions.
-
- (ExplicitUserConversion): Make it a call to UserDefinedConversion
- with the appropriate arguments.
-
- * cs-parser.jay (cast_expression): Record location too.
-
- * expression.cs (Cast): Record location info.
-
- (Expression::ConvertExplicit): Take location argument.
-
- (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
- to determine if we are doing explicit conversions.
-
- (UserCast::Emit): Update accordingly.
-
- (Expression::ConvertExplicit): Report an error if everything fails.
-
- * ../errors/cs0030.cs : Add.
-
-2001-10-04 Miguel de Icaza <miguel@ximian.com>
-
- * modifiers.cs: If the ABSTRACT keyword is present, also set the
- virtual and newslot bits.
-
- * class.cs (TypeContainer::RegisterRequiredImplementations):
- Record methods we need.
-
- (TypeContainer::MakeKey): Helper function to make keys for
- MethodBases, since the Methodbase key is useless.
-
- (TypeContainer::Populate): Call RegisterRequiredImplementations
- before defining the methods.
-
- Create a mapping for method_builders_to_methods ahead of time
- instead of inside a tight loop.
-
- (::RequireMethods): Accept an object as the data to set into the
- hashtable so we can report interface vs abstract method mismatch.
-
-2001-10-03 Miguel de Icaza <miguel@ximian.com>
-
- * report.cs: Make all of it static.
-
- * rootcontext.cs: Drop object_type and value_type computations, as
- we have those in the TypeManager anyways.
-
- Drop report instance variable too, now it is a global.
-
- * driver.cs: Use try/catch on command line handling.
-
- Add --probe option to debug the error reporting system with a test
- suite.
-
- * report.cs: Add support for exiting program when a probe
- condition is reached.
-
-2001-10-03 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Binary::DoNumericPromotions): Fix the case when
- we do a forcible conversion regardless of type, to check if
- ForceConversion returns a null.
-
- (Binary::error19): Use location to report error.
-
- (Unary::error23): Use location here too.
-
- * ../errors/cs0019.cs : Check in.
-
- * ../errors/cs0023.cs : Check in.
-
- * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
- case of a non-null MethodInfo object with a length of 0 !
-
- (Binary::ResolveOperator): Flag error if overload resolution fails to find
- an applicable member - according to the spec :-)
- Also fix logic to find members in base types.
-
- (Unary::ResolveOperator): Same here.
-
- (Unary::report23): Change name to error23 and make first argument a TypeContainer
- as I was getting thoroughly confused between this and error19 :-)
-
- * expression.cs (Expression::ImplicitUserConversion): Re-write fully
- (::FindMostEncompassedType): Implement.
- (::FindMostEncompassingType): Implement.
- (::StandardConversionExists): Implement.
-
- (UserImplicitCast): Re-vamp. We now need info about most specific
- source and target types so that we can do the necessary conversions.
-
- (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
- mathematical union with no duplicates.
-
-2001-10-03 Miguel de Icaza <miguel@ximian.com>
-
- * rootcontext.cs (RootContext::PopulateTypes): Populate containers
- in order from base classes to child classes, so that we can in
- child classes look up in our parent for method names and
- attributes (required for handling abstract, virtual, new, override
- constructs: we need to instrospect our base class, and if we dont
- populate the classes in order, the introspection might be
- incorrect. For example, a method could query its parent before
- the parent has any methods and would determine that the parent has
- no abstract methods (while it could have had them)).
-
- (RootContext::CreateType): Record the order in which we define the
- classes.
-
-2001-10-02 Miguel de Icaza <miguel@ximian.com>
-
- * class.cs (TypeContainer::Populate): Also method definitions can
- fail now, keep track of this.
-
- (TypeContainer::FindMembers): Implement support for
- DeclaredOnly/noDeclaredOnly flag.
-
- (Constructor::Emit) Return the ConstructorBuilder.
-
- (Method::Emit) Return the MethodBuilder.
- Check for abstract or virtual methods to be public.
-
- * rootcontext.cs (RootContext::CreateType): Register all the
- abstract methods required for the class to be complete and the
- interface methods that must be implemented.
-
- * cs-parser.jay: Report error 501 (method requires body if it is
- not marked abstract or extern).
-
- * expression.cs (TypeOf::Emit): Implement.
-
- * typemanager.cs: runtime_handle_type, new global type.
-
- * class.cs (Property::Emit): Generate code for properties.
-
-2001-10-02 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Unary::ResolveOperator): Find operators on base type
- too - we now conform exactly to the spec.
-
- (Binary::ResolveOperator): Same here.
-
- * class.cs (Operator::Define): Fix minor quirk in the tests.
-
- * ../errors/cs0215.cs : Added.
-
- * ../errors/cs0556.cs : Added.
-
- * ../errors/cs0555.cs : Added.
-
-2001-10-01 Miguel de Icaza <miguel@ximian.com>
-
- * cs-tokenizer.cs: Reimplemented Location to be a struct with a
- single integer which is really efficient
-
-2001-10-01 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Expression::ImplicitUserConversion): Use location
- even in the case when we are examining True operators.
-
- * class.cs (Operator::Define): Perform extensive checks to conform
- with the rules for operator overloading in the spec.
-
- * expression.cs (Expression::ImplicitReferenceConversion): Implement
- some of the other conversions mentioned in the spec.
-
- * typemanager.cs (array_type): New static member for the System.Array built-in
- type.
-
- (cloneable_interface): For System.ICloneable interface.
-
- * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
- we start resolving the tree and populating types.
-
- * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
-
-2001-10-01 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (Expression::ExprClassFromMemberInfo,
- Expression::Literalize): Create literal expressions from
- FieldInfos which are literals.
-
- (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
- type casts, because they were wrong. The test suite in tests
- caught these ones.
-
- (ImplicitNumericConversion): ushort to ulong requires a widening
- cast.
-
- Int32 constant to long requires widening cast as well.
-
- * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
- for integers because the type on the stack is not i4.
-
-2001-09-30 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (report118): require location argument.
-
- * parameter.cs: Do not dereference potential null value.
-
- * class.cs: Catch methods that lack the `new' keyword when
- overriding a name. Report warnings when `new' is used without
- anything being there to override.
-
- * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
-
- * class.cs: Only add constructor to hashtable if it is non-null
- (as now constructors can fail on define).
-
- (TypeManager, Class, Struct): Take location arguments.
-
- Catch field instance initialization in structs as errors.
-
- accepting_filter: a new filter for FindMembers that is static so
- that we dont create an instance per invocation.
-
- (Constructor::Define): Catch errors where a struct constructor is
- parameterless
-
- * cs-parser.jay: Pass location information for various new
- constructs.
-
- * delegate.cs (Delegate): take a location argument.
-
- * driver.cs: Do not call EmitCode if there were problesm in the
- Definition of the types, as many Builders wont be there.
-
- * decl.cs (Decl::Decl): Require a location argument.
-
- * cs-tokenizer.cs: Handle properly hex constants that can not fit
- into integers, and find the most appropiate integer for it.
-
- * literal.cs: Implement ULongLiteral.
-
- * rootcontext.cs: Provide better information about the location of
- failure when CreateType fails.
-
-2001-09-29 Miguel de Icaza <miguel@ximian.com>
-
- * rootcontext.cs (RootContext::PopulateTypes): Populates structs
- as well.
-
- * expression.cs (Binary::CheckShiftArguments): Add missing type
- computation.
- (Binary::ResolveOperator): Add type to the logical and and logical
- or, Bitwise And/Or and Exclusive Or code paths, it was missing
- before.
-
- (Binary::DoNumericPromotions): In the case where either argument
- is ulong (and most signed types combined with ulong cause an
- error) perform implicit integer constant conversions as well.
-
-2001-09-28 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (UserImplicitCast): Method should always be
- non-null.
- (Invocation::BetterConversion): Simplified test for IntLiteral.
-
- (Expression::ImplicitNumericConversion): Split this routine out.
- Put the code that performs implicit constant integer conversions
- here.
-
- (Expression::Resolve): Become a wrapper around DoResolve so we can
- check eclass and type being set after resolve.
-
- (Invocation::Badness): Remove this dead function
-
- (Binary::ResolveOperator): Do not compute the expensive argumnets
- unless we have a union for it.
-
- (Probe::Emit): Is needs to do an isinst and then
- compare against null.
-
- (::CanConvert): Added Location argument. If the Location argument
- is null (Location.Null), then we do not report errors. This is
- used by the `probe' mechanism of the Explicit conversion. We do
- not want to generate an error for something that the user
- explicitly requested to be casted. But the pipeline for an
- explicit cast first tests for potential implicit casts.
-
- So for now, if the Location is null, it means `Probe only' to
- avoid adding another argument. Might have to revise this
- strategy later.
-
- (ClassCast): New class used to type cast objects into arbitrary
- classes (used in Explicit Reference Conversions).
-
- Implement `as' as well.
-
- Reverted all the patches from Ravi below: they were broken:
-
- * The use of `level' as a mechanism to stop recursive
- invocations is wrong. That was there just to catch the
- bug with a strack trace but not as a way of addressing
- the problem.
-
- To fix the problem we have to *understand* what is going
- on and the interactions and come up with a plan, not
- just get things going.
-
- * The use of the type conversion cache that I proposed
- last night had an open topic: How does this work across
- protection domains. A user defined conversion might not
- be public in the location where we are applying the
- conversion, a different conversion might be selected
- (ie, private A->B (better) but public B->A (worse),
- inside A, A->B applies, but outside it, B->A will
- apply).
-
- * On top of that (ie, even if the above is solved),
- conversions in a cache need to be abstract. Ie, `To
- convert from an Int to a Short use an OpcodeCast', not
- `To convert from an Int to a Short use the OpcodeCast on
- the variable 5' (which is what this patch was doing).
-
-2001-09-28 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Invocation::ConversionExists): Re-write to use
- the conversion cache
-
- (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
- cache all conversions done, not just user-defined ones.
-
- (Invocation::BetterConversion): The real culprit. Use ConversionExists
- to determine if a conversion exists instead of acutually trying to
- perform the conversion. It's faster too.
-
- (Expression::ConvertExplicit): Modify to use ConversionExists to check
- and only then attempt the implicit conversion.
-
-2001-09-28 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (ConvertImplicit): Use a cache for conversions
- already found. Check level of recursion and bail out if necessary.
-
-2001-09-28 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs (string_concat_string_string, string_concat_object_object):
- Export standard methods that we expect for string operations.
-
- * statement.cs (Block::UsageWarning): Track usage of variables and
- report the errors for not used variables.
-
- * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
- operator.
-
-2001-09-27 Miguel de Icaza <miguel@ximian.com>
-
- * codegen.cs: remove unnneded code
-
- * expression.cs: Removed BuiltinTypeAccess class
-
- Fix the order in which implicit conversions are
- done.
-
- The previous fixed dropped support for boxed conversions (adding a
- test to the test suite now)
-
- (UserImplicitCast::CanConvert): Remove test for source being null,
- that code is broken. We should not feed a null to begin with, if
- we do, then we should track the bug where the problem originates
- and not try to cover it up here.
-
- Return a resolved expression of type UserImplicitCast on success
- rather than true/false. Ravi: this is what I was talking about,
- the pattern is to use a static method as a "constructor" for
- objects.
-
- Also, do not create arguments until the very last minute,
- otherwise we always create the arguments even for lookups that
- will never be performed.
-
- (UserImplicitCast::Resolve): Eliminate, objects of type
- UserImplicitCast are born in a fully resolved state.
-
- * typemanager.cs (InitCoreTypes): Init also value_type
- (System.ValueType).
-
- * expression.cs (Cast::Resolve): First resolve the child expression.
-
- (LValue): Add new method AddressOf to be used by
- the `&' operator.
-
- Change the argument of Store to take an EmitContext instead of an
- ILGenerator, because things like FieldExpr need to be able to call
- their children expression to generate the instance code.
-
- (Expression::Error, Expression::Warning): Sugar functions for
- reporting errors.
-
- (Expression::MemberLookup): Accept a TypeContainer instead of a
- Report as the first argument.
-
- (Expression::ResolvePrimary): Killed. I still want to improve
- this as currently the code is just not right.
-
- (Expression::ResolveMemberAccess): Simplify, but it is still
- wrong.
-
- (Unary::Resolve): Catch errors in AddressOf operators.
-
- (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
- index to a byte for the short-version, or the compiler will choose
- the wrong Emit call, which generates the wrong data.
-
- (ParameterReference::Emit, ::Store): same.
-
- (FieldExpr::AddressOf): Implement.
-
- * typemanager.cs: TypeManager: made public variable instead of
- property.
-
- * driver.cs: document --fatal.
-
- * report.cs (ErrorMessage, WarningMessage): new names for the old
- Error and Warning classes.
-
- * cs-parser.jay (member_access): Turn built-in access to types
- into a normal simplename
-
-2001-09-27 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Invocation::BetterConversion): Fix to cope
- with q being null, since this was introducing a bug.
-
- * expression.cs (ConvertImplicit): Do built-in conversions first.
-
-2001-09-27 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (UserImplicitCast::Resolve): Fix bug.
-
-2001-09-27 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
- I had introduced long ago (what's new ?).
-
- * expression.cs (UserImplicitCast::CanConvert): Static method to do
- the work of all the checking.
- (ConvertImplicit): Call CanConvert and only then create object if necessary.
- (UserImplicitCast::CanConvert, ::Resolve): Re-write.
-
- (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
- that is the right way.
-
- (Invocation::MakeUnionSet): Convenience function to make unions of sets for
- overloading resolution. Use everywhere instead of cutting and pasting code.
-
- (Binary::ResolveOperator): Use MakeUnionSet.
-
- (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
- we have to convert to bool types. Not complete yet.
-
-2001-09-27 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs (TypeManager::CSharpName): support ushort.
-
- * expression.cs (Expression::TryImplicitIntConversion): Attempts
- to provide an expression that performsn an implicit constant int
- conversion (section 6.1.6).
- (Expression::ConvertImplicitRequired): Reworked to include
- implicit constant expression conversions.
-
- (Expression::ConvertNumericExplicit): Finished.
-
- (Invocation::Emit): If InstanceExpression is null, then it means
- that we perform a call on this.
-
-2001-09-26 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (Unary::Emit): Remove some dead code.
- (Probe): Implement Resolve and Emit for `is'.
- (Expression::ConvertImplicitRequired): Attempt to do constant
- expression conversions here. Maybe should be moved to
- ConvertImplicit, but I am not sure.
- (Expression::ImplicitLongConstantConversionPossible,
- Expression::ImplicitIntConstantConversionPossible): New functions
- that tell whether is it possible to apply an implicit constant
- expression conversion.
-
- (ConvertNumericExplicit): Started work on explicit numeric
- conversions.
-
- * cs-parser.jay: Update operator constants.
-
- * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
- (Parameters::GetSignature): Hook up VerifyArgs here.
- (Parameters::VerifyArgs): Verifies that no two arguments have the
- same name.
-
- * class.cs (Operator): Update the operator names to reflect the
- ones that the spec expects (as we are just stringizing the
- operator names).
-
- * expression.cs (Unary::ResolveOperator): Fix bug: Use
- MethodInfo's ReturnType instead of LookupMethodByBuilder as the
- previous usage did only work for our methods.
- (Expression::ConvertImplicit): Handle decimal implicit numeric
- conversions as well.
- (Expression::InternalTypeConstructor): Used to invoke constructors
- on internal types for default promotions.
-
- (Unary::Emit): Implement special handling for the pre/post
- increment/decrement for overloaded operators, as they need to have
- the same semantics as the other operators.
-
- (Binary::ResolveOperator): ditto.
- (Invocation::ConversionExists): ditto.
- (UserImplicitCast::Resolve): ditto.
-
-2001-09-26 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
- operator, return after emitting body. Regression tests pass again !
-
- * expression.cs (ConvertImplicit): Take TypeContainer as first argument
- (Unary::ForceConversion, Binary::ForceConversion): Ditto.
- (Invocation::OverloadResolve): Ditto.
- (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
-
- * everywhere : update calls to the above methods accordingly.
-
-2001-09-26 Miguel de Icaza <miguel@ximian.com>
-
- * assign.cs (Assign): Make it inherit from ExpressionStatement.
-
- * expression.cs (ExpressionStatement): New base class used for
- expressions that can appear in statements, so that we can provide
- an alternate path to generate expression that do not leave a value
- on the stack.
-
- (Expression::Emit, and all the derivatives): We no longer return
- whether a value is left on the stack or not. Every expression
- after being emitted leaves a single value on the stack.
-
- * codegen.cs (EmitContext::EmitStatementExpression): Use the
- facilties of ExpressionStatement if possible.
-
- * cs-parser.jay: Update statement_expression.
-
-2001-09-25 Miguel de Icaza <miguel@ximian.com>
-
- * driver.cs: Change the wording of message
-
-2001-09-25 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Binary::ResolveOperator): Had forgottten to set
- the type of the expression to the return type of the method if
- we have an overloaded operator match ! The regression tests pass again !
- (Unary::ResolveOperator): Ditto.
-
- * expression.cs (Invocation::ConversionExists): Correct the member lookup
- to find "op_Implicit", not "implicit" ;-)
- (UserImplicitCast): New class to take care of user-defined implicit conversions.
- (ConvertImplicit, ForceConversion): Take TypeContainer argument
-
- * everywhere : Correct calls to the above accordingly.
-
- * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
- (ConvertImplicit): Do user-defined conversion if it exists.
-
-2001-09-24 Miguel de Icaza <miguel@ximian.com>
-
- * assign.cs: track location.
- (Resolve): Use implicit conversions on assignment.
-
- * literal.cs: Oops. Not good, Emit of short access values should
- pass (Bytes) or the wrong argument will be selected.
-
- * expression.cs (Unary::Emit): Emit code for -expr.
-
- (Unary::ResolveOperator): Handle `Substract' for non-constants
- (substract from zero from the non-constants).
- Deal with Doubles as well.
-
- (Expression::ConvertImplicitRequired): New routine that reports an
- error if no implicit conversion exists.
-
- (Invocation::OverloadResolve): Store the converted implicit
- expressions if we make them
-
-2001-09-24 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (ConstructorInitializer): Take a Location argument.
- (ConstructorBaseInitializer): Same here.
- (ConstructorThisInitializer): Same here.
-
- * cs-parser.jay : Update all calls accordingly.
-
- * expression.cs (Unary, Binary, New): Take location argument.
- Update accordingly everywhere.
-
- * cs-parser.jay : Update all calls to the above to take a location
- argument.
-
- * class.cs : Ditto.
-
-2001-09-24 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
- (Invocation::BetterConversion): Same here
- (Invocation::ConversionExists): Ditto.
-
- (Invocation::ConversionExists): Implement.
-
-2001-09-22 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
- Also take an additional TypeContainer argument.
-
- * All over : Pass in TypeContainer as argument to OverloadResolve.
-
- * typemanager.cs (CSharpName): Update to check for the string type and return
- that too.
-
- * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
- a given method.
-
-2001-09-21 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
- (Invocation::BetterFunction): Implement.
- (Invocation::BetterConversion): Implement.
- (Invocation::ConversionExists): Skeleton, no implementation yet.
-
- Okay, things work fine !
-
-2001-09-21 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs: declare and load enum_type, delegate_type and
- void_type.
-
- * expression.cs (Expression::Emit): Now emit returns a value that
- tells whether a value is left on the stack or not. This strategy
- might be reveted tomorrow with a mechanism that would address
- multiple assignments.
- (Expression::report118): Utility routine to report mismatches on
- the ExprClass.
-
- (Unary::Report23): Report impossible type/operator combination
- utility function.
-
- (Unary::IsIncrementableNumber): Whether the type can be
- incremented or decremented with add.
- (Unary::ResolveOperator): Also allow enumerations to be bitwise
- complemented.
- (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
-
- (Invocation::Emit): Deal with new Emit convetion.
-
- * All Expression derivatives: Updated their Emit method to return
- whether they leave values on the stack or not.
-
- * codegen.cs (CodeGen::EmitStatement): Pop values left on the
- stack for expressions that are statements.
-
-2001-09-20 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (LValue): New interface. Must be implemented by
- LValue objects.
- (LocalVariableReference, ParameterReference, FieldExpr): Implement
- LValue interface.
-
- * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
- interface for generating code, simplifies the code.
-
-2001-09-20 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (everywhere): Comment out return statements in ::Resolve
- methods to avoid the warnings.
-
-2001-09-20 Miguel de Icaza <miguel@ximian.com>
-
- * driver.cs (parse): Report error 2001 if we can not open the
- source file.
-
- * expression.cs (SimpleName::ResolveSimpleName): Error if we can
- not resolve it.
-
- * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
- object.
-
- * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
- otherwise nested blocks end up with the same index.
-
- * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
-
- * expression.cs: Instead of having FIXMEs in the Resolve
- functions, throw exceptions so it is obvious that we are facing a
- bug.
-
- * cs-parser.jay (invocation_expression): Pass Location information.
-
- * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
- Use a basename for those routines because .NET does not like paths
- on them.
-
- * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
- already defined.
-
-2001-09-19 Miguel de Icaza <miguel@ximian.com>
-
- * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
- are loading the correct data types (throws an exception if not).
- (TypeManager::InitCoreTypes): Use CoreLookupType
-
- * expression.cs (Unary::ResolveOperator): return the child
- expression for expressions which are just +expr.
- (Unary::ResolveOperator): Return negative literals for -LITERAL
- expressions (otherwise they are Unary {Literal}).
- (Invocation::Badness): Take into account `Implicit constant
- expression conversions'.
-
- * literal.cs (LongLiteral): Implement long literal class.
- (IntLiteral): export the `Value' of the intliteral.
-
-2001-09-19 Ravi Pratap <ravi@ximian.com>
-
- * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
-
- * class.cs (Operator::Define): Change the methodname prefix to 'op_'
- instead of 'Operator'
-
- * expression.cs (Binary::ResolveOperator): Update accordingly.
- (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
- and 'Minus'
-
- * cs-parser.jay (unary_expression): Update to use the new names.
-
- * gen-treedump.cs (GetUnary): Same here.
-
- * expression.cs (Unary::Resolve): Implement.
- (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
- operators are found instead of making noise ;-)
- (Unary::ResolveOperator): New method to do precisely the same thing which
- Binary::ResolveOperator does for Binary expressions.
- (Unary.method, .Arguments): Add.
- (Unary::OperName): Implement.
- (Unary::ForceConversion): Copy and Paste !
-
- * class.cs (Operator::Define): Fix a small bug for the case when we have
- a unary operator.
-
- * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
- for the inbuilt operators. Only overloading works for now ;-)
-
-2001-09-18 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
- UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
-
- * expression.cs (This::Emit): Implement.
- (This::Resolve): Implement.
- (TypeOf:Resolve): Implement.
- (Expression::ResolveSimpleName): Add an implicit this to instance
- field references.
- (MemberAccess::Resolve): Deal with Parameters and Fields.
- Bind instance variable to Field expressions.
- (FieldExpr::Instance): New field used to track the expression that
- represents the object instance.
- (FieldExpr::Resolve): Track potential errors from MemberLookup not
- binding
- (FieldExpr::Emit): Implement.
-
- * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
- the last instruction contains a return opcode to avoid generating
- the last `ret' instruction (this generates correct code, and it is
- nice to pass the peverify output).
-
- * class.cs (TypeContainer::EmitFieldInitializers): Implement field
- initializer for static and instance variables.
- (Constructor::Emit): Allow initializer to be null in the case of
- static constructors. Only emit initializer for instance
- constructors.
-
- (TypeContainer::FindMembers): Return a null array if there are no
- matches.
-
- Also fix the code for the MemberTypes.Method branch, as it was not
- scanning that for operators (or tried to access null variables before).
-
- * assign.cs (Assign::Emit): Handle instance and static fields.
-
- * TODO: Updated.
-
- * driver.cs: Stop compilation if there are parse errors.
-
- * cs-parser.jay (constructor_declaration): Provide default base
- initializer for non-static constructors.
- (constructor_declarator): Do not provide a default base
- initializers if none was specified.
- Catch the fact that constructors should not have parameters.
-
- * class.cs: Do not emit parent class initializers for static
- constructors, that should be flagged as an error.
-
-2001-09-18 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
- Move back code into TypeContainer::Populate.
-
-2001-09-18 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (TypeContainer::AddConstructor): Fix the check to
- compare against Name, not Basename.
- (Operator::OpType): Change Plus and Minus to Add and Subtract.
-
- * cs-parser.jay : Update accordingly.
-
- * class.cs (TypeContainer::FindMembers): For the case where we are searching
- for methods, don't forget to look into the operators too.
- (RegisterMethodBuilder): Helper method to take care of this for
- methods, constructors and operators.
- (Operator::Define): Completely revamp.
- (Operator.OperatorMethod, MethodName): New fields.
- (TypeContainer::Populate): Move the registering of builders into
- RegisterMethodBuilder.
- (Operator::Emit): Re-write.
-
- * expression.cs (Binary::Emit): Comment out code path to emit method
- invocation stuff for the case when we have a user defined operator. I am
- just not able to get it right !
-
-2001-09-17 Miguel de Icaza <miguel@ximian.com>
-
- * expression.cs (Expression::OverloadResolve): Drop TypeContainer
- argument.
-
- (Expression::MemberLookup): Provide a version that allows to
- specify the MemberTypes and BindingFlags.
-
- * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
- so it was not fetching variable information from outer blocks.
-
- * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
- Beforefieldinit as it was buggy.
-
- * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
- that Ravi put here.
-
- * class.cs (Constructor::Emit): Only emit if block is not null.
- (TypeContainer::EmitDefaultConstructor): Removed routine, now we
- deal with this by semantically definining it as if the user had
- done it.
-
- (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
- constructors as we now "emit" them at a higher level.
-
- (TypeContainer::DefineDefaultConstructor): Used to define the
- default constructors if none was provided.
-
- (ConstructorInitializer): Add methods Resolve and Emit.
-
- * expression.cs: Cast to ConstructorInfo instead of MethodInfo
-
-2001-09-17 Ravi Pratap <ravi@ximian.com>
-
- * class.cs (TypeContainer::EmitDefaultConstructor): Register
- the default constructor builder with our hashtable for methodbuilders
- to methodcores.
-
- * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
- and argument_count is 0 in which case we have a match.
- (Binary::ResolveOperator): More null checking and miscellaneous coding
- style cleanup.
-
-2001-09-17 Ravi Pratap <ravi@ximian.com>
-
- * rootcontext.cs (IsNameSpace): Compare against null.
-
- * everywhere : Correct spelling to 'Greater' and to 'Subtract'
-
- * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
- and Unary::Operator.
-
- * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
- accordingly.
-
- * expression.cs (Binary::method): New member to hold the MethodBase for the case when
- we have overloaded operators.
- (Binary::ResolveOperator): Implement the part which does the operator overload
- resolution.
-
- * class.cs (Operator::Emit): Implement.
- (TypeContainer::Emit): Emit the operators we have too.
-
- * expression.cs (Binary::Emit): Update to emit the appropriate code for
- the case when we have a user-defined operator.
-
-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>
-
- * 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 <simon@simon-cozens.org>
-
- * 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 <miguel@ximian.com>
-
- * 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 <macisaac@ximian.com>
-
- * makefile: Fixed up for easy making.
-
-2001-07-13 Simon Cozens <simon@simon-cozens.org>
-
- * 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 <miguel@ximian.com>
-
- * Adjustments for Beta2.
-
-2001-06-13 Miguel de Icaza <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * Experiment successful: Use System.Type rather that our own
- version of Type.
-
-2001-05-25 Miguel de Icaza <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * parameter.cs: Do not use `param' arguments as part of the
- signature, per the spec.
-
-2001-05-08 Miguel de Icaza <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * 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 <miguel@ximian.com>
-
- * 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.
-
diff --git a/mcs/mcs/TODO b/mcs/mcs/TODO
deleted file mode 100644
index f8019fffc6f..00000000000
--- a/mcs/mcs/TODO
+++ /dev/null
@@ -1,318 +0,0 @@
-Major tasks:
-------------
-
- Pinned and volatile require type modifiers that can not be encoded
- with Reflection.Emit.
-
- Properties and 17.6.3: Finish it.
-
- Implement base indexer access.
-
-MethodGroupExpr
-
- These guys should only appear as part of an Invocation, so we
- probably can afford to have a special callback:
-
- Expression.ResolveAllowMemberGroups
-
- This is only called by Invocation (or anyone that consumes
- MethodGroupExprs)
-
- And the regular DoResolve and DoResolveLValue do emit the error
- 654 `Method referenced without argument list'.
-
- Otherwise, a resolution will return a MethodGroupExpr which is
- not guaranteed to have set its `Expression.Type' to a non-null
- value.
-
-AddressOf
- Needs an extra argument: `set' or `read', this will help
- to track usage errors in variables (since AddressOf does not
- really know what is it being used for, it could be either)
-
-Unsafe code:
- Pointer arithmetic operators (++ and -- are done)
- Test for ++ and -- for non-builtin-types
- fixed
-
-readonly variables and ref/out
-
-BUGS
-----
-
-* Check for Final when overriding, if the parent is Final, then we cant
- allow an override.
-
-* Add test case for destructors
-
-* Do not declare a .property on things that are just implementations, that
- comes from the parent, just do the method.
-
-* Currently the code path for 108/109 reporting is not being ran for methods
- as we need to compare method signatures. But since we retrieve the expensive
- method arguments in the method, we probably should do 108/109 processing there.
-
-* Emit warning on hiding members without NEW not only in members.
-
-* Implement visibility.
-
-* Adding variables.
-
- We do add variables in a number of places, and this is erroneous:
-
- void a (int b)
- {
- int b;
- }
-
- Also:
-
- void a (int b)
- {
- foreach (int b ...)
- ;
- }
-
-* Visibility
-
- I am not reporting errors on visibility yet.
-
-* Interface indexers
-
- I have not figured out why the Microsoft version puts an
- `instance' attribute, and I am not generating this `instance' attribute.
-
- Explanation: The reason for the `instance' attribute on
- indexers is that indexers only apply to instances
-
-* Arrays
-
- We need to make sure at *compile time* that the arguments in
- the expression list of an array creation are always positive.
-
-* Implement dead code elimination in statement.cs
-
- It is pretty simple to implement dead code elimination in
- if/do/while
-
-* Indexer bugs:
-
- the following wont work:
-
- x [0] = x [1] = N
-
- if x has indexers, the value of x [N] set is set to void. This needs to be
- fixed.
-
-* Array declarations
-
- Multi-dim arrays are declared as [,] instead of [0..,0..]
-
-* Break/Continue statements
-
- A finally block should reset the InLoop/LoopBegin/LoopEnd, as
- they are logically outside the scope of the loop.
-
-* Break/continue part 2.
-
- They should transfer control to the finally block if inside a try/catch
- block.
-
-* Method Registration and error CS111
-
- The way we use the method registration to signal 111 is wrong.
-
- Method registration should only be used to register methodbuilders,
- we need an alternate method of checking for duplicates.
-
-* We need to catch:
-
- extern string Property {
- get { }
- }
-
- The get there should only have a semicolon
-
-*
-> // CSC sets beforefieldinit
-> class X {
-> // .cctor will be generated by compiler
-> public static readonly object O = new System.Object ();
-> public static void Main () {}
-> }
->
-
-PENDING TASKS
--------------
-
-* Implement (fixed case 3: string)
-
-* Revisit
-
- Primary-expression, as it has now been split into
- non-array-creation-expression and array-creation-expression.
-
-* Static flow analysis
-
- Required to warn about reachability of code and definite
- assignemt as well as missing returns on functions.
-
-* Code cleanup
-
- The information when registering a method in InternalParameters
- is duplicated, you can always get the types from the InternalParameters
-
-* Emit modreq for volatiles
-
- Handle modreq from public apis.
-
-* Emit `pinned' for pinned local variables.
-
- Both `modreq' and pinned will require special hacks in the compiler.
-
-* Make sure that we are pinning the right variable
-
-OPTIMIZATIONS
--------------
-
-* Use of local temporary in UnaryMutator
-
- We should get rid of the Localtemporary there for some cases
-
-* Emitcontext
-
- Do we really need to instanciate this variable all the time?
-
- It could be static for all we care, and just use it for making
- sure that there are no recursive invocations on it.
-
-* Static-ization
-
- Since AppDomain exists, maybe we can get rid of all the stuff
- that is part of the `compiler instance' and just use globals
- everywhere.
-
-
-* Constructors
-
- Currently it calls the parent constructor before initializing fields.
- It should do it the other way around.
-
-* Use of EmitBranchable
-
- Currently I use brfalse/brtrue in the code for statements, instead of
- using the EmitBranchable function that lives in Binary
-
-* ConvertImplicit
-
- Currently ConvertImplicit will not catch things like:
-
- - IntLiteral in a float context to generate a -FloatLiteral.
- Instead it will perform an integer load followed by a conversion.
-
-* Tests
-
- Write tests for the various reference conversions. We have
- test for all the numeric conversions.
-
-* Remove the tree dumper, cleanup `public readonly'
-
- And make all the stuff which is `public readonly' be private unless
- required.
-
-* Optimizations
-
- In Indexers and Properties, probably support an EmitWithDup
- That emits the code to call Get and then leaves a this pointer
- in the stack, so that later a Store can be emitted using that
- this pointer (consider Property++ or Indexer++)
-
-
-* Optimizations: variable allocation.
-
- When local variables of a type are required, we should request
- the variable and later release it when we are done, so that
- the same local variable slot can be reused later on.
-
-* Add a cache for the various GetArrayMethod operations.
-
-* Optimization:
-
- Do not use StatementCollections, use ArrayLists of Statements,
- and then "copy" it out to arrays. Then reuse the existing
- Statement structures.
-
-* TypeManager.FindMembers:
-
- Instead of having hundreds of builder_to_blah hash table, have
- a single one that maps a TypeBuilder `t' to a set of classes
- that implement an interface that supports FindMembers.
-
-* MakeUnionSet Callers
-
- If the types are the same, there is no need to compute the unionset,
- we can just use the list from one of the types.
-
-RECOMMENDATIONS
----------------
-
-* Use of lexer.Location in the parser
-
- Currently we do:
-
- TOKEN nt TERMINAL nt TERMINAL nt3 {
- $$ = new Blah ($2, $4, $6, lexer.Location);
- }
-
- This is bad, because the lexer.Location is for the last item in `nt3'
-
- We need to change that to use this pattern:
-
- TOKEN { oob_stack.Push (lexer.Location) } nt TERMINAL nt TERMINAL nt3 {
- $$ = new Blah ($3, $5, $7, (Location) oob_stack.Pop ());
- }
-
- Notice how numbering of the arguments changes as the
- { oob_stack.Push (lexer.Location) } takes a "slot" in the productions.
-
-* local_variable_declaration
-
- Not sure that this grammar is correct, we might have to
- resolve this during semantic analysis.
-
-
-* Try/Catch
-
- Investigate what is the right value to return from `Emit' in
- there (ie, for the `all code paths return')
-
-
-* Optimizations
-
- Only create one `This' instance per class, and reuse it.
-
- Maybe keep a pool of constants/literals (zero, 1)?
-
-************
-Potential bug:
-
- We would need to decode the shortname before we lookup members?
-
- Maybe not.
-
-interface I {
- void A ();
-}
-
-class X : I {
- void I.A ();
-}
-
-class Y : X, I {
- void I.A () {}
-}
-
-
-
-*************
-
diff --git a/mcs/mcs/assign.cs b/mcs/mcs/assign.cs
deleted file mode 100755
index 82ec496a9c0..00000000000
--- a/mcs/mcs/assign.cs
+++ /dev/null
@@ -1,272 +0,0 @@
-//
-// assign.cs: Assignments.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// This interface is implemented by expressions that can be assigned to.
- /// </summary>
- /// <remarks>
- /// This interface is implemented by Expressions whose values can not
- /// store the result on the top of the stack.
- ///
- /// Expressions implementing this (Properties, Indexers and Arrays) would
- /// perform an assignment of the Expression "source" into its final
- /// location.
- ///
- /// No values on the top of the stack are expected to be left by
- /// invoking this method.
- /// </remarks>
- public interface IAssignMethod {
- void EmitAssign (EmitContext ec, Expression source);
- }
-
- /// <summary>
- /// An Expression to hold a temporary value.
- /// </summary>
- /// <remarks>
- /// The LocalTemporary class is used to hold temporary values of a given
- /// type to "simulate" the expression semantics on property and indexer
- /// access whose return values are void.
- ///
- /// The local temporary is used to alter the normal flow of code generation
- /// basically it creates a local variable, and its emit instruction generates
- /// code to access this value, return its address or save its value.
- /// </remarks>
- public class LocalTemporary : Expression, IMemoryLocation {
- LocalBuilder builder;
-
- public LocalTemporary (EmitContext ec, Type t)
- {
- type = t;
- eclass = ExprClass.Value;
- builder = ec.GetTemporaryStorage (t);
- }
-
- public void Release (EmitContext ec)
- {
- ec.FreeTemporaryStorage (builder);
- builder = null;
- }
-
- public LocalTemporary (LocalBuilder b, Type t)
- {
- type = t;
- eclass = ExprClass.Value;
- builder = b;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldloc, builder);
- }
-
- public void Store (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Stloc, builder);
- }
-
- public void AddressOf (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldloca, builder);
- }
- }
-
- /// <summary>
- /// The Assign node takes care of assigning the value of source into
- /// the expression represented by target.
- /// </summary>
- public class Assign : ExpressionStatement {
- Expression target, source;
- Location l;
-
- public Assign (Expression target, Expression source, Location l)
- {
- this.target = target;
- this.source = source;
- this.l = l;
- }
-
- public Expression Target {
- get {
- return target;
- }
-
- set {
- target = value;
- }
- }
-
- public Expression Source {
- get {
- return source;
- }
-
- set {
- source = value;
- }
- }
-
- public static void error70 (EventInfo ei, Location l)
- {
- Report.Error (70, l, "The event '" + ei.Name +
- "' can only appear on the left-side of a += or -= (except when" +
- " used from within the type '" + ei.DeclaringType + "')");
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- source = source.Resolve (ec);
- if (source == null)
- return null;
-
- target = target.ResolveLValue (ec, source);
-
- if (target == null)
- return null;
-
- Type target_type = target.Type;
- Type source_type = source.Type;
-
- type = target_type;
- eclass = ExprClass.Value;
-
- //
- // If we are doing a property assignment, then
- // set the `value' field on the property, and Resolve
- // it.
- //
- if (target is PropertyExpr){
- PropertyExpr property_assign = (PropertyExpr) target;
-
- //
- // FIXME: Maybe handle this in the LValueResolve
- //
- if (!property_assign.VerifyAssignable ())
- return null;
-
- return this;
- }
-
- if (target is IndexerAccess){
- IndexerAccess ia = (IndexerAccess) target;
-
- return this;
- }
-
- if (target is EventExpr) {
-
- Binary tmp;
- EventInfo ei = ((EventExpr) target).EventInfo;
-
-
- Expression ml = MemberLookup (
- ec, ec.TypeContainer.TypeBuilder, ei.Name,
- MemberTypes.Event, AllBindingFlags, l);
-
- if (ml == null) {
- //
- // If this is the case, then the Event does not belong
- // to this TypeContainer and so, according to the spec
- // is allowed to only appear on the left hand of
- // the += and -= operators
- //
- // Note that if target will not appear as an EventExpr
- // in the case it is being referenced within the same type container;
- // it will appear as a FieldExpr in that case.
- //
-
- if (!(source is Binary)) {
- error70 (ei, l);
- return null;
- } else {
- tmp = ((Binary) source);
- if (tmp.Oper != Binary.Operator.Addition &&
- tmp.Oper != Binary.Operator.Subtraction) {
- error70 (ei, l);
- return null;
- }
- }
- }
- }
-
- if (source is New && target_type.IsSubclassOf (TypeManager.value_type)){
- New n = (New) source;
-
- n.ValueTypeVariable = target;
- return n;
- }
-
- if (target_type != source_type){
- source = ConvertImplicitRequired (ec, source, target_type, l);
- if (source == null)
- return null;
- }
-
- if (target.eclass != ExprClass.Variable && target.eclass != ExprClass.EventAccess){
- Report.Error (131, l,
- "Left hand of an assignment must be a variable, " +
- "a property or an indexer");
- return null;
- }
-
- return this;
- }
-
- void Emit (EmitContext ec, bool is_statement)
- {
- if (target is EventExpr) {
- ((EventExpr) target).EmitAddOrRemove (ec, source);
- return;
- }
-
- //
- // FIXME! We need a way to "probe" if the process can
- // just use `dup' to propagate the result
- //
- IAssignMethod am = (IAssignMethod) target;
-
- if (is_statement)
- am.EmitAssign (ec, source);
- else {
- LocalTemporary tempo;
-
- tempo = new LocalTemporary (ec, source.Type);
-
- source.Emit (ec);
- tempo.Store (ec);
- am.EmitAssign (ec, tempo);
- tempo.Emit (ec);
- tempo.Release (ec);
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- Emit (ec, false);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- Emit (ec, true);
- }
- }
-}
-
-
-
-
diff --git a/mcs/mcs/attribute.cs b/mcs/mcs/attribute.cs
deleted file mode 100644
index fdaf4d07898..00000000000
--- a/mcs/mcs/attribute.cs
+++ /dev/null
@@ -1,642 +0,0 @@
-//
-// attribute.cs: Attribute Handler
-//
-// Author: Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
-using System.Text;
-
-namespace Mono.CSharp {
-
- public class Attribute {
- public readonly string Name;
- public readonly ArrayList Arguments;
-
- Location Location;
-
- public Type Type;
-
- //
- // The following are only meaningful when the attribute
- // being emitted is one of the builtin ones
- //
- public AttributeTargets Targets;
- public bool AllowMultiple;
- public bool Inherited;
-
- public bool UsageAttr = false;
-
- public MethodImplOptions ImplOptions;
-
- public Attribute (string name, ArrayList args, Location loc)
- {
- Name = name;
- Arguments = args;
- Location = loc;
- }
-
- void error617 (string name)
- {
- Report.Error (617, Location, "'" + name + "' is not a valid named attribute " +
- "argument. Named attribute arguments must be fields which are not " +
- "readonly, static or const, or properties with a set accessor which "+
- "are not static.");
- }
-
- void error182 ()
- {
- Report.Error (182, Location,
- "An attribute argument must be a constant expression, typeof " +
- "expression or array creation expression");
- }
-
- public CustomAttributeBuilder Resolve (EmitContext ec)
- {
- string name = Name;
- bool MethodImplAttr = false;
-
- UsageAttr = false;
-
- if (Name.IndexOf ("Attribute") == -1)
- name = Name + "Attribute";
- else if (Name.LastIndexOf ("Attribute") == 0)
- name = Name + "Attribute";
-
- Type = RootContext.LookupType (ec.TypeContainer, name, false, Location);
-
- if (Type == null) {
- Report.Error (
- 246, Location, "Could not find attribute '" + Name + "' (are you" +
- " missing a using directive or an assembly reference ?)");
- return null;
- }
-
- if (Type == TypeManager.attribute_usage_type)
- UsageAttr = true;
- if (Type == TypeManager.methodimpl_attr_type)
- MethodImplAttr = true;
-
- // Now we extract the positional and named arguments
-
- ArrayList pos_args = new ArrayList ();
- ArrayList named_args = new ArrayList ();
-
- if (Arguments != null) {
- pos_args = (ArrayList) Arguments [0];
- if (Arguments.Count > 1)
- named_args = (ArrayList) Arguments [1];
- }
-
- object [] pos_values = new object [pos_args.Count];
-
- //
- // First process positional arguments
- //
-
- int i;
- for (i = 0; i < pos_args.Count; i++) {
- Argument a = (Argument) pos_args [i];
- Expression e;
-
- if (!a.Resolve (ec, Location))
- return null;
-
- e = a.Expr;
- if (e is Constant) {
- pos_values [i] = ((Constant) e).GetValue ();
-
- if (UsageAttr)
- this.Targets = (AttributeTargets) pos_values [0];
-
- if (MethodImplAttr)
- this.ImplOptions = (MethodImplOptions) pos_values [0];
-
- } else {
- error182 ();
- return null;
- }
- }
-
- //
- // Now process named arguments
- //
-
- ArrayList field_infos = new ArrayList ();
- ArrayList prop_infos = new ArrayList ();
- ArrayList field_values = new ArrayList ();
- ArrayList prop_values = new ArrayList ();
-
- for (i = 0; i < named_args.Count; i++) {
- DictionaryEntry de = (DictionaryEntry) named_args [i];
- string member_name = (string) de.Key;
- Argument a = (Argument) de.Value;
- Expression e;
-
- if (!a.Resolve (ec, Location))
- return null;
-
- Expression member = Expression.MemberLookup (
- ec, Type, member_name,
- MemberTypes.Field | MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance,
- Location);
-
- if (member == null || !(member is PropertyExpr || member is FieldExpr)) {
- error617 (member_name);
- return null;
- }
-
- e = a.Expr;
- if (member is PropertyExpr) {
- PropertyExpr pe = (PropertyExpr) member;
- PropertyInfo pi = pe.PropertyInfo;
-
- if (!pi.CanWrite) {
- error617 (member_name);
- return null;
- }
-
- if (e is Constant) {
- object o = ((Constant) e).GetValue ();
- prop_values.Add (o);
-
- if (UsageAttr) {
- if (member_name == "AllowMultiple")
- this.AllowMultiple = (bool) o;
- if (member_name == "Inherited")
- this.Inherited = (bool) o;
- }
-
- } else {
- error182 ();
- return null;
- }
-
- prop_infos.Add (pi);
-
- } else if (member is FieldExpr) {
- FieldExpr fe = (FieldExpr) member;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi.IsInitOnly) {
- error617 (member_name);
- return null;
- }
-
- if (e is Constant)
- field_values.Add (((Constant) e).GetValue ());
- else {
- error182 ();
- return null;
- }
-
- field_infos.Add (fi);
- }
- }
-
- Expression mg = Expression.MemberLookup (
- ec, Type, ".ctor", MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance, Location);
-
- if (mg == null) {
- Report.Error (
- -6, Location,
- "Could not find a constructor for this argument list.");
- return null;
- }
-
- MethodBase constructor = Invocation.OverloadResolve (
- ec, (MethodGroupExpr) mg, pos_args, Location);
-
- if (constructor == null) {
- Report.Error (
- -6, Location,
- "Could not find a constructor for this argument list.");
- return null;
- }
-
- PropertyInfo [] prop_info_arr = new PropertyInfo [prop_infos.Count];
- FieldInfo [] field_info_arr = new FieldInfo [field_infos.Count];
- object [] field_values_arr = new object [field_values.Count];
- object [] prop_values_arr = new object [prop_values.Count];
-
- field_infos.CopyTo (field_info_arr, 0);
- field_values.CopyTo (field_values_arr, 0);
-
- prop_values.CopyTo (prop_values_arr, 0);
- prop_infos.CopyTo (prop_info_arr, 0);
-
- CustomAttributeBuilder cb = new CustomAttributeBuilder (
- (ConstructorInfo) constructor, pos_values,
- prop_info_arr, prop_values_arr,
- field_info_arr, field_values_arr);
-
- return cb;
- }
-
- static string GetValidPlaces (Attribute attr)
- {
- StringBuilder sb = new StringBuilder ();
- AttributeTargets targets = 0;
-
- TypeContainer a = TypeManager.LookupAttr (attr.Type);
-
- if (a == null) {
- System.Attribute [] attrs = System.Attribute.GetCustomAttributes (attr.Type);
-
- foreach (System.Attribute tmp in attrs)
- if (tmp is AttributeUsageAttribute)
- targets = ((AttributeUsageAttribute) tmp).ValidOn;
- } else
- targets = a.Targets;
-
-
- if ((targets & AttributeTargets.Assembly) != 0)
- sb.Append ("'assembly' ");
-
- if ((targets & AttributeTargets.Class) != 0)
- sb.Append ("'class' ");
-
- if ((targets & AttributeTargets.Constructor) != 0)
- sb.Append ("'constructor' ");
-
- if ((targets & AttributeTargets.Delegate) != 0)
- sb.Append ("'delegate' ");
-
- if ((targets & AttributeTargets.Enum) != 0)
- sb.Append ("'enum' ");
-
- if ((targets & AttributeTargets.Event) != 0)
- sb.Append ("'event' ");
-
- if ((targets & AttributeTargets.Field) != 0)
- sb.Append ("'field' ");
-
- if ((targets & AttributeTargets.Interface) != 0)
- sb.Append ("'interface' ");
-
- if ((targets & AttributeTargets.Method) != 0)
- sb.Append ("'method' ");
-
- if ((targets & AttributeTargets.Module) != 0)
- sb.Append ("'module' ");
-
- if ((targets & AttributeTargets.Parameter) != 0)
- sb.Append ("'parameter' ");
-
- if ((targets & AttributeTargets.Property) != 0)
- sb.Append ("'property' ");
-
- if ((targets & AttributeTargets.ReturnValue) != 0)
- sb.Append ("'return value' ");
-
- if ((targets & AttributeTargets.Struct) != 0)
- sb.Append ("'struct' ");
-
- return sb.ToString ();
-
- }
-
- public static void error592 (Attribute a, Location loc)
- {
- Report.Error (
- 592, loc, "Attribute '" + a.Name +
- "' is not valid on this declaration type. " +
- "It is valid on " + GetValidPlaces (a) + "declarations only.");
- }
-
- public static bool CheckAttribute (Attribute a, object element)
- {
- TypeContainer attr = TypeManager.LookupAttr (a.Type);
- AttributeTargets targets = 0;
-
- if (attr == null) {
- System.Attribute [] attrs = System.Attribute.GetCustomAttributes (a.Type);
-
- foreach (System.Attribute tmp in attrs)
- if (tmp is AttributeUsageAttribute)
- targets = ((AttributeUsageAttribute) tmp).ValidOn;
- } else
- targets = attr.Targets;
-
- if (element is Class) {
- if ((targets & AttributeTargets.Class) != 0)
- return true;
- else
- return false;
-
- } else if (element is Struct) {
- if ((targets & AttributeTargets.Struct) != 0)
- return true;
- else
- return false;
- } else if (element is Constructor) {
- if ((targets & AttributeTargets.Constructor) != 0)
- return true;
- else
- return false;
- } else if (element is Delegate) {
- if ((targets & AttributeTargets.Delegate) != 0)
- return true;
- else
- return false;
- } else if (element is Enum) {
- if ((targets & AttributeTargets.Enum) != 0)
- return true;
- else
- return false;
- } else if (element is Event) {
- if ((targets & AttributeTargets.Event) != 0)
- return true;
- else
- return false;
- } else if (element is Field) {
- if ((targets & AttributeTargets.Field) != 0)
- return true;
- else
- return false;
- } else if (element is Interface) {
- if ((targets & AttributeTargets.Interface) != 0)
- return true;
- else
- return false;
- } else if (element is Method) {
- if ((targets & AttributeTargets.Method) != 0)
- return true;
- else
- return false;
- } else if (element is ParameterBuilder) {
- if ((targets & AttributeTargets.Parameter) != 0)
- return true;
- else
- return false;
- } else if (element is Property) {
- if ((targets & AttributeTargets.Property) != 0)
- return true;
- else
- return false;
- } else if (element is AssemblyBuilder){
- if ((targets & AttributeTargets.Assembly) != 0)
- return true;
- else
- return false;
- }
-
- return false;
- }
-
- public static void ApplyAttributes (EmitContext ec, object builder, object kind,
- Attributes opt_attrs, Location loc)
- {
- if (opt_attrs == null)
- return;
-
- if (opt_attrs.AttributeSections == null)
- return;
-
- foreach (AttributeSection asec in opt_attrs.AttributeSections) {
-
- if (asec.Attributes == null)
- continue;
-
- foreach (Attribute a in asec.Attributes) {
- CustomAttributeBuilder cb = a.Resolve (ec);
- if (cb == null)
- continue;
-
- if (!(kind is TypeContainer))
- if (!CheckAttribute (a, kind)) {
- error592 (a, loc);
- return;
- }
-
-
- if (kind is Method) {
- if (a.Type == TypeManager.methodimpl_attr_type) {
- if (a.ImplOptions == MethodImplOptions.InternalCall)
- ((MethodBuilder) builder).SetImplementationFlags (
- MethodImplAttributes.InternalCall |
- MethodImplAttributes.Runtime);
- } else if (a.Type != TypeManager.dllimport_type)
- ((MethodBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Constructor) {
- ((ConstructorBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Field) {
- ((FieldBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Property || kind is Indexer) {
- ((PropertyBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Event) {
- ((EventBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is ParameterBuilder){
- ((ParameterBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Operator) {
- ((MethodBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Enum) {
- ((TypeBuilder) builder).SetCustomAttribute (cb);
-
- } else if (kind is TypeContainer) {
-
- TypeContainer tc = (TypeContainer) kind;
-
- if (a.UsageAttr) {
- tc.Targets = a.Targets;
- tc.AllowMultiple = a.AllowMultiple;
- tc.Inherited = a.Inherited;
-
- RootContext.TypeManager.RegisterAttrType (
- (TypeBuilder) builder, tc);
-
- } else if (a.Type == TypeManager.default_member_type) {
- if (tc.Indexers != null) {
- Report.Error (646, loc,
- "Cannot specify the DefaultMember attribute on " +
- " a type containing an indexer");
- return;
- }
-
- } else {
- if (!CheckAttribute (a, kind)) {
- error592 (a, loc);
- return;
- }
- }
-
- ((TypeBuilder) builder).SetCustomAttribute (cb);
-
- } else if (kind is AssemblyBuilder){
- ((AssemblyBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is ModuleBuilder) {
- ((ModuleBuilder) builder).SetCustomAttribute (cb);
- } else
- throw new Exception ("Unknown kind: " + kind);
- }
- }
- }
-
- public MethodBuilder DefinePInvokeMethod (EmitContext ec, TypeBuilder builder, string name,
- MethodAttributes flags, Type ret_type, Type [] param_types)
- {
- //
- // We extract from the attribute the information we need
- //
-
- if (Arguments == null) {
- Console.WriteLine ("Internal error : this is not supposed to happen !");
- return null;
- }
-
- string attr_name = Name;
-
- if (Name.IndexOf ("Attribute") == -1)
- attr_name = Name + "Attribute";
- else if (Name.LastIndexOf ("Attribute") == 0)
- attr_name = Name + "Attribute";
-
- Type = RootContext.LookupType (ec.TypeContainer, attr_name, false, Location);
-
- if (Type == null) {
- Report.Error (246, Location, "Could not find attribute '" + Name + "' (are you" +
- " missing a using directive or an assembly reference ?)");
- return null;
- }
-
- ArrayList named_args = new ArrayList ();
-
- ArrayList pos_args = (ArrayList) Arguments [0];
- if (Arguments.Count > 1)
- named_args = (ArrayList) Arguments [1];
-
-
- string dll_name = null;
-
- Argument tmp = (Argument) pos_args [0];
-
- if (!tmp.Resolve (ec, Location))
- return null;
-
- if (tmp.Expr is Constant)
- dll_name = (string) ((Constant) tmp.Expr).GetValue ();
- else {
- error182 ();
- return null;
- }
-
- // Now we process the named arguments
- CallingConvention cc = CallingConvention.Winapi;
- CharSet charset = CharSet.Ansi;
- bool preserve_sig = true;
- bool exact_spelling = false;
- bool set_last_err = false;
- string entry_point = null;
-
- for (int i = 0; i < named_args.Count; i++) {
-
- DictionaryEntry de = (DictionaryEntry) named_args [i];
-
- string member_name = (string) de.Key;
- Argument a = (Argument) de.Value;
-
- if (!a.Resolve (ec, Location))
- return null;
-
- Expression member = Expression.MemberLookup (
- ec, Type, member_name,
- MemberTypes.Field | MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance,
- Location);
-
- if (member == null || !(member is FieldExpr)) {
- error617 (member_name);
- return null;
- }
-
- if (member is FieldExpr) {
- FieldExpr fe = (FieldExpr) member;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi.IsInitOnly) {
- error617 (member_name);
- return null;
- }
-
- if (a.Expr is Constant) {
- Constant c = (Constant) a.Expr;
-
- if (member_name == "CallingConvention")
- cc = (CallingConvention) c.GetValue ();
- else if (member_name == "CharSet")
- charset = (CharSet) c.GetValue ();
- else if (member_name == "EntryPoint")
- entry_point = (string) c.GetValue ();
- else if (member_name == "SetLastError")
- set_last_err = (bool) c.GetValue ();
- else if (member_name == "ExactSpelling")
- exact_spelling = (bool) c.GetValue ();
- else if (member_name == "PreserveSig")
- preserve_sig = (bool) c.GetValue ();
- } else {
- error182 ();
- return null;
- }
-
- }
- }
-
- MethodBuilder mb = builder.DefinePInvokeMethod (
- name, dll_name, flags | MethodAttributes.HideBySig,
- CallingConventions.Standard,
- ret_type,
- param_types,
- cc,
- charset);
-
- if (preserve_sig)
- mb.SetImplementationFlags (MethodImplAttributes.PreserveSig);
-
- return mb;
- }
-
- }
-
- public class AttributeSection {
-
- public readonly string Target;
- public readonly ArrayList Attributes;
-
- public AttributeSection (string target, ArrayList attrs)
- {
- Target = target;
- Attributes = attrs;
- }
-
- }
-
- public class Attributes {
- public ArrayList AttributeSections;
- public Location Location;
-
- public Attributes (AttributeSection a, Location loc)
- {
- AttributeSections = new ArrayList ();
- AttributeSections.Add (a);
-
- }
-
- public void AddAttribute (AttributeSection a)
- {
- if (a != null)
- AttributeSections.Add (a);
- }
- }
-}
diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs
deleted file mode 100755
index ec39d747e8f..00000000000
--- a/mcs/mcs/class.cs
+++ /dev/null
@@ -1,3942 +0,0 @@
-//
-// class.cs: Class and Struct handlers
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System;
-using System.Runtime.CompilerServices;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// This is the base class for structs and classes.
- /// </summary>
- public class TypeContainer : DeclSpace {
- // Holds a list of classes and structures
- ArrayList types;
-
- // Holds the list of properties
- ArrayList properties;
-
- // Holds the list of enumerations
- ArrayList enums;
-
- // Holds the list of delegates
- ArrayList delegates;
-
- // Holds the list of constructors
- ArrayList instance_constructors;
-
- // Holds the list of fields
- ArrayList fields;
-
- // Holds a list of fields that have initializers
- ArrayList initialized_fields;
-
- // Holds a list of static fields that have initializers
- ArrayList initialized_static_fields;
-
- // Holds the list of constants
- ArrayList constants;
-
- // Holds the list of
- ArrayList interfaces;
-
- // Holds the methods.
- ArrayList methods;
-
- // Holds the events
- ArrayList events;
-
- // Holds the indexers
- ArrayList indexers;
-
- // Holds the operators
- ArrayList operators;
-
- //
- // Pointers to the default constructor and the default static constructor
- //
- Constructor default_constructor;
- Constructor default_static_constructor;
-
- //
- // Whether we have seen a static constructor for this class or not
- //
- bool have_static_constructor = false;
-
- //
- // This one is computed after we can distinguish interfaces
- // from classes from the arraylist `type_bases'
- //
- string base_class_name;
-
- ArrayList type_bases;
-
- // Attributes for this type
- protected Attributes attributes;
-
- // Information in the case we are an attribute type
-
- public AttributeTargets Targets;
- public bool AllowMultiple;
- public bool Inherited;
-
-
- public TypeContainer (TypeContainer parent, string name, Location l)
- : base (parent, name, l)
- {
- string n;
- types = new ArrayList ();
-
- if (parent == null)
- n = "";
- else
- n = parent.Name;
-
- base_class_name = null;
-
- //Console.WriteLine ("New class " + name + " inside " + n);
- }
-
- public AdditionResult AddConstant (Const constant)
- {
- AdditionResult res;
- string name = constant.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (constants == null)
- constants = new ArrayList ();
-
- constants.Add (constant);
- DefineName (name, constant);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddEnum (Mono.CSharp.Enum e)
- {
- AdditionResult res;
- string name = e.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (enums == null)
- enums = new ArrayList ();
-
- enums.Add (e);
- DefineName (name, e);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddClass (Class c)
- {
- AdditionResult res;
- string name = c.Name;
-
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- DefineName (name, c);
- types.Add (c);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddStruct (Struct s)
- {
- AdditionResult res;
- string name = s.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- DefineName (name, s);
- types.Add (s);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddDelegate (Delegate d)
- {
- AdditionResult res;
- string name = d.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (delegates == null)
- delegates = new ArrayList ();
-
- DefineName (name, d);
- delegates.Add (d);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddMethod (Method method)
- {
- string name = method.Name;
- Object value = defined_names [name];
-
- if (value != null && (!(value is Method)))
- return AdditionResult.NameExists;
-
- if (methods == null)
- methods = new ArrayList ();
-
- methods.Add (method);
- if (value != null)
- DefineName (name, method);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddConstructor (Constructor c)
- {
- if (c.Name != Basename)
- return AdditionResult.NotAConstructor;
-
- bool is_static = (c.ModFlags & Modifiers.STATIC) != 0;
-
- if (is_static){
- have_static_constructor = true;
- if (default_static_constructor != null){
- Console.WriteLine ("I have a static constructor already");
- Console.WriteLine (" " + default_static_constructor);
- return AdditionResult.MethodExists;
- }
-
- default_static_constructor = c;
- } else {
- if (c.IsDefault ()){
- if (default_constructor != null)
- return AdditionResult.MethodExists;
- default_constructor = c;
- }
-
- if (instance_constructors == null)
- instance_constructors = new ArrayList ();
-
- instance_constructors.Add (c);
- }
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddInterface (Interface iface)
- {
- AdditionResult res;
- string name = iface.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (interfaces == null)
- interfaces = new ArrayList ();
- interfaces.Add (iface);
- DefineName (name, iface);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddField (Field field)
- {
- AdditionResult res;
- string name = field.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (fields == null)
- fields = new ArrayList ();
-
- fields.Add (field);
-
- if (field.Initializer != null){
- if ((field.ModFlags & Modifiers.STATIC) != 0){
- if (initialized_static_fields == null)
- initialized_static_fields = new ArrayList ();
-
- initialized_static_fields.Add (field);
-
- //
- // We have not seen a static constructor,
- // but we will provide static initialization of fields
- //
- have_static_constructor = true;
- } else {
- if (initialized_fields == null)
- initialized_fields = new ArrayList ();
-
- initialized_fields.Add (field);
- }
- }
-
- DefineName (name, field);
- return AdditionResult.Success;
- }
-
- public AdditionResult AddProperty (Property prop)
- {
- AdditionResult res;
- string name = prop.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (properties == null)
- properties = new ArrayList ();
-
- properties.Add (prop);
- DefineName (name, prop);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddEvent (Event e)
- {
- AdditionResult res;
- string name = e.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (events == null)
- events = new ArrayList ();
-
- events.Add (e);
- DefineName (name, e);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddIndexer (Indexer i)
- {
- if (indexers == null)
- indexers = new ArrayList ();
-
- indexers.Add (i);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddOperator (Operator op)
- {
- if (operators == null)
- operators = new ArrayList ();
-
- operators.Add (op);
-
- return AdditionResult.Success;
- }
-
- public ArrayList Types {
- get {
- return types;
- }
- }
-
- public ArrayList Methods {
- get {
- return methods;
- }
- }
-
- public ArrayList Constants {
- get {
- return constants;
- }
- }
-
- public ArrayList Interfaces {
- get {
- return interfaces;
- }
- }
-
- public string Base {
- get {
- return base_class_name;
- }
- }
-
- public ArrayList Bases {
- get {
- return type_bases;
- }
-
- set {
- type_bases = value;
- }
- }
-
- public ArrayList Fields {
- get {
- return fields;
- }
- }
-
- public ArrayList InstanceConstructors {
- get {
- return instance_constructors;
- }
- }
-
- public ArrayList Properties {
- get {
- return properties;
- }
- }
-
- public ArrayList Events {
- get {
- return events;
- }
- }
-
- public ArrayList Enums {
- get {
- return enums;
- }
- }
-
- public ArrayList Indexers {
- get {
- return indexers;
- }
- }
-
- public ArrayList Operators {
- get {
- return operators;
- }
- }
-
- public ArrayList Delegates {
- get {
- return delegates;
- }
- }
-
- public Attributes OptAttributes {
- get {
- return attributes;
- }
- }
-
- //
- // root_types contains all the types. All TopLevel types
- // hence have a parent that points to `root_types', that is
- // why there is a non-obvious test down here.
- //
- public bool IsTopLevel {
- get {
- if (Parent != null){
- if (Parent.Parent == null)
- return true;
- }
- return false;
- }
- }
-
- public bool HaveStaticConstructor {
- get {
- return have_static_constructor;
- }
- }
-
- public virtual TypeAttributes TypeAttr {
- get {
- return Modifiers.TypeAttr (ModFlags, this);
- }
- }
-
- //
- // Emits the instance field initializers
- //
- public bool EmitFieldInitializers (EmitContext ec, bool is_static)
- {
- ArrayList fields;
- ILGenerator ig = ec.ig;
-
- if (is_static)
- fields = initialized_static_fields;
- else
- fields = initialized_fields;
-
- if (fields == null)
- return true;
-
- foreach (Field f in fields){
- Object init = f.Initializer;
-
- Expression e;
- if (init is Expression)
- e = (Expression) init;
- else {
- string base_type = f.Type.Substring (0, f.Type.IndexOf ("["));
- string rank = f.Type.Substring (f.Type.IndexOf ("["));
- e = new ArrayCreation (base_type, rank, (ArrayList) init, f.Location);
- }
-
- e = e.Resolve (ec);
- if (e == null)
- return false;
-
- if (!is_static)
- ig.Emit (OpCodes.Ldarg_0);
-
- e.Emit (ec);
-
- if (is_static)
- ig.Emit (OpCodes.Stsfld, f.FieldBuilder);
- else
- ig.Emit (OpCodes.Stfld, f.FieldBuilder);
-
- }
-
- return true;
- }
-
- //
- // Defines the default constructors
- //
- void DefineDefaultConstructor (bool is_static)
- {
- Constructor c;
- int mods = 0;
-
- c = new Constructor (Basename, Parameters.GetEmptyReadOnlyParameters (),
- new ConstructorBaseInitializer (null, new Location (-1)),
- new Location (-1));
-
- if (is_static)
- mods = Modifiers.STATIC;
-
- c.ModFlags = mods;
-
- AddConstructor (c);
-
- c.Block = new Block (null);
-
- }
-
- public void ReportStructInitializedInstanceError ()
- {
- string n = TypeBuilder.FullName;
-
- foreach (Field f in initialized_fields){
- Report.Error (
- 573, Location,
- "`" + n + "." + f.Name + "': can not have " +
- "instance field initializers in structs");
- }
- }
-
- struct TypeAndMethods {
- public Type type;
- public MethodInfo [] methods;
-
- // Far from ideal, but we want to avoid creating a copy
- // of methods above.
- public Type [][] args;
-
- //
- // This flag on the method says `We found a match, but
- // because it was private, we could not use the match
- //
- public bool [] found;
- }
-
- //
- // This array keeps track of the pending implementations
- //
- TypeAndMethods [] pending_implementations;
-
- //
- // Returns a list of the abstract methods that are exposed by all of our
- // parents that we must implement. Notice that this `flattens' the
- // method search space, and takes into account overrides.
- //
- ArrayList GetAbstractMethods (Type t)
- {
- ArrayList list = null;
- bool searching = true;
- Type current_type = t;
-
- do {
- MemberInfo [] mi;
-
- mi = FindMembers (
- current_type, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.Instance |
- BindingFlags.DeclaredOnly,
- virtual_method_filter, null);
-
- if (current_type == TypeManager.object_type)
- searching = false;
- else {
- current_type = current_type.BaseType;
- if (!current_type.IsAbstract)
- searching = false;
- }
-
- if (mi == null)
- continue;
-
- int count = mi.Length;
- if (count == 0)
- continue;
-
- if (count == 1 && !(mi [0] is MethodBase))
- searching = false;
- else
- list = Expression.CopyNewMethods (list, mi);
- } while (searching);
-
- if (list == null)
- return null;
-
- for (int i = 0; i < list.Count; i++){
- while (list.Count > i && !((MethodInfo) list [i]).IsAbstract)
- list.RemoveAt (i);
- }
-
- if (list.Count == 0)
- return null;
-
- return list;
- }
-
- //
- // Registers the required method implementations for this class
- //
- // Register method implementations are either abstract methods
- // flagged as such on the base class or interface methods
- //
- public void RegisterRequiredImplementations ()
- {
- Type [] ifaces = TypeBuilder.GetInterfaces ();
- Type b = TypeBuilder.BaseType;
- int icount = 0;
-
- icount = ifaces.Length;
-
- //
- // If we are implementing an abstract class, and we are not
- // ourselves abstract, and there are abstract methods (C# allows
- // abstract classes that have no abstract methods), then allocate
- // one slot.
- //
- // We also pre-compute the methods.
- //
- bool implementing_abstract = (b.IsAbstract && !TypeBuilder.IsAbstract);
- ArrayList abstract_methods = null;
-
- if (implementing_abstract){
- abstract_methods = GetAbstractMethods (b);
-
- if (abstract_methods == null)
- implementing_abstract = false;
- }
-
- int total = icount + (implementing_abstract ? 1 : 0);
- if (total == 0)
- return;
-
- pending_implementations = new TypeAndMethods [total];
-
- int i = 0;
- if (ifaces != null){
- foreach (Type t in ifaces){
- MethodInfo [] mi;
-
- if (t is TypeBuilder){
- Interface iface;
-
- iface = RootContext.TypeManager.LookupInterface (t);
-
- mi = iface.GetMethods ();
- } else
- mi = t.GetMethods ();
-
- int count = mi.Length;
- pending_implementations [i].type = t;
- pending_implementations [i].methods = mi;
- pending_implementations [i].args = new Type [count][];
- pending_implementations [i].found = new bool [count];
-
- int j = 0;
- foreach (MethodInfo m in mi){
- Type [] types = TypeManager.GetArgumentTypes (m);
-
- pending_implementations [i].args [j] = types;
- j++;
- }
- i++;
- }
- }
-
- if (abstract_methods != null){
- int count = abstract_methods.Count;
- pending_implementations [i].methods = new MethodInfo [count];
-
- abstract_methods.CopyTo (pending_implementations [i].methods, 0);
- pending_implementations [i].found = new bool [count];
- pending_implementations [i].args = new Type [count][];
- pending_implementations [i].type = TypeBuilder;
-
- int j = 0;
- foreach (MemberInfo m in abstract_methods){
- MethodInfo mi = (MethodInfo) m;
-
- Type [] types = TypeManager.GetArgumentTypes (mi);
-
- pending_implementations [i].args [j] = types;
- j++;
- }
- }
- }
-
- public static string MakeFQN (string nsn, string name)
- {
- string prefix = (nsn == "" ? "" : nsn + ".");
-
- return prefix + name;
- }
-
- Type LookupInterfaceOrClass (object builder, string ns, string name, bool is_class, out bool error)
- {
- TypeContainer parent;
- Type t;
-
- error = false;
- name = MakeFQN (ns, name);
-
- t = RootContext.TypeManager.LookupType (name);
- if (t != null)
- return t;
-
- if (is_class)
- parent = (Class) RootContext.Tree.Classes [name];
- else
- parent = (Struct) RootContext.Tree.Structs [name];
-
-
- if (parent != null){
- t = parent.DefineType (builder);
- if (t == null){
- Report.Error (146, "Class definition is circular: `"+name+"'");
- error = true;
- return null;
- }
-
- return t;
- }
-
- return null;
- }
-
- //
- // returns the type for an interface or a class, this will recursively
- // try to define the types that it depends on.
- //
- Type GetInterfaceOrClass (object builder, string name, bool is_class)
- {
- Type t;
- bool error;
-
- //
- // Attempt to lookup the class on our namespace
- //
- t = LookupInterfaceOrClass (builder, Namespace.Name, name, is_class, out error);
- if (error)
- return null;
-
- if (t != null)
- return t;
-
- //
- // Attempt to do a direct unqualified lookup
- //
- t = LookupInterfaceOrClass (builder, "", name, is_class, out error);
- if (error)
- return null;
-
- if (t != null)
- return t;
-
- //
- // Attempt to lookup the class on any of the `using'
- // namespaces
- //
-
- for (Namespace ns = Namespace; ns != null; ns = ns.Parent){
- ArrayList using_list = ns.UsingTable;
-
- if (using_list == null)
- continue;
-
- foreach (string n in using_list){
- t = LookupInterfaceOrClass (builder, n, name, is_class, out error);
- if (error)
- return null;
-
- if (t != null)
- return t;
- }
-
- }
- Report.Error (246, "Can not find type `"+name+"'");
- return null;
- }
-
- /// <summary>
- /// This function computes the Base class and also the
- /// list of interfaces that the class or struct @c implements.
- ///
- /// The return value is an array (might be null) of
- /// interfaces implemented (as Types).
- ///
- /// The @parent argument is set to the parent object or null
- /// if this is `System.Object'.
- /// </summary>
- Type [] GetClassBases (object builder, bool is_class, out Type parent, out bool error)
- {
- ArrayList bases = Bases;
- int count;
- int start, j, i;
-
- error = false;
-
- if (is_class)
- parent = null;
- else
- parent = TypeManager.value_type;
-
- if (bases == null){
- if (is_class){
- if (RootContext.StdLib)
- parent = TypeManager.object_type;
- else if (Name != "System.Object")
- parent = TypeManager.object_type;
- } else {
- //
- // If we are compiling our runtime,
- // and we are defining ValueType, then our
- // parent is `System.Object'.
- //
- if (!RootContext.StdLib && Name == "System.ValueType")
- parent = TypeManager.object_type;
- }
-
- return null;
- }
-
- //
- // Bases should be null if there are no bases at all
- //
- count = bases.Count;
-
- if (is_class){
- string name = (string) bases [0];
- Type first = GetInterfaceOrClass (builder, name, is_class);
-
- if (first == null){
- error = true;
- return null;
- }
-
- if (first.IsClass){
- parent = first;
- start = 1;
- } else {
- parent = TypeManager.object_type;
- start = 0;
- }
- } else {
- start = 0;
- }
-
- Type [] ifaces = new Type [count-start];
-
- for (i = start, j = 0; i < count; i++, j++){
- string name = (string) bases [i];
- Type t = GetInterfaceOrClass (builder, name, is_class);
-
- if (t == null){
- error = true;
- return null;
- }
-
- if (is_class == false && !t.IsInterface){
- Report.Error (527, "In Struct `" + Name + "', type `"+
- name +"' is not an interface");
- error = true;
- return null;
- }
-
- if (t.IsSealed) {
- string detail = "";
-
- if (t.IsValueType)
- detail = " (a class can not inherit from a struct)";
-
- Report.Error (509, "class `"+ Name +
- "': Cannot inherit from sealed class `"+
- bases [i]+"'"+detail);
- error = true;
- return null;
- }
-
- if (t.IsClass) {
- if (parent != null){
- Report.Error (527, "In Class `" + Name + "', type `"+
- name+"' is not an interface");
- error = true;
- return null;
- }
- }
-
- ifaces [j] = t;
- }
-
- return ifaces;
- }
-
- //
- // Defines the type in the appropriate ModuleBuilder or TypeBuilder.
- //
- public TypeBuilder DefineType (object parent_builder)
- {
- Type parent;
- Type [] ifaces;
- bool error;
- bool is_class;
-
- if (TypeBuilder != null)
- return TypeBuilder;
-
- if (InTransit)
- return null;
-
- InTransit = true;
-
- if (this is Class)
- is_class = true;
- else
- is_class = false;
-
- ifaces = GetClassBases (parent_builder, is_class, out parent, out error);
-
- if (error)
- return null;
-
- if (this is Class){
- if (parent == TypeManager.enum_type ||
- (parent == TypeManager.value_type && RootContext.StdLib) ||
- parent == TypeManager.delegate_type ||
- parent == TypeManager.array_type){
- Report.Error (
- 644, Location, "`" + Name + "' cannot inherit from " +
- "special class `" + TypeManager.CSharpName (parent) + "'");
- return null;
- }
- }
-
- if (parent_builder is ModuleBuilder) {
- ModuleBuilder builder = (ModuleBuilder) parent_builder;
- //
- // Structs with no fields need to have a ".size 1"
- // appended
- //
-
- if (!is_class && Fields == null)
- TypeBuilder = builder.DefineType (Name,
- TypeAttr,
- parent,
- PackingSize.Unspecified, 1);
- else
- //
- // classes or structs with fields
- //
- TypeBuilder = builder.DefineType (Name,
- TypeAttr,
- parent,
- ifaces);
- } else {
- TypeBuilder builder = (System.Reflection.Emit.TypeBuilder) parent_builder;
-
- //
- // Structs with no fields need to have a ".size 1"
- // appended
- //
- if (!is_class && Fields == null)
- TypeBuilder = builder.DefineNestedType (Basename,
- TypeAttr,
- parent,
- PackingSize.Unspecified);
- else
- //
- // classes or structs with fields
- //
- TypeBuilder = builder.DefineNestedType (Basename,
- TypeAttr,
- parent,
- ifaces);
- }
-
- RootContext.TypeManager.AddUserType (Name, TypeBuilder, this);
- RootContext.RegisterOrder (this);
-
- if (Types != null) {
- foreach (TypeContainer tc in Types)
- tc.DefineType (TypeBuilder);
- }
-
- if (Delegates != null) {
- foreach (Delegate d in Delegates)
- d.DefineDelegate (TypeBuilder);
- }
-
- if (Enums != null) {
- foreach (Enum en in Enums)
- en.DefineEnum (TypeBuilder);
- }
-
- InTransit = false;
- return TypeBuilder;
- }
-
-
- /// <summary>
- /// Defines the MemberCore objects that are in the `list' Arraylist
- ///
- /// The `defined_names' array contains a list of members defined in
- /// a base class
- /// </summary>
- static ArrayList remove_list = new ArrayList ();
- void DefineMembers (ArrayList list, MemberInfo [] defined_names)
- {
- int idx;
-
- remove_list.Clear ();
-
- foreach (MemberCore mc in list){
- if (!mc.Define (this)){
- remove_list.Add (mc);
- continue;
- }
-
- if (defined_names == null)
- continue;
-
- idx = Array.BinarySearch (defined_names, mc.Name, mif_compare);
-
- if (idx < 0){
- if (RootContext.WarningLevel >= 4){
- if ((mc.ModFlags & Modifiers.NEW) != 0)
- Report109 (mc.Location, mc);
- }
- continue;
- }
-
- if (defined_names [idx] is PropertyInfo &&
- ((mc.ModFlags & Modifiers.OVERRIDE) != 0)){
- continue;
- }
-
-#if WANT_TO_VERIFY_SIGNATURES_HERE
- if (defined_names [idx] is MethodBase && mc is MethodCore){
- MethodBase mb = (MethodBase) defined_names [idx];
- MethodCore met = (MethodCore) mc;
-
- if ((mb.IsVirtual || mb.IsAbstract) &&
- (mc.ModFlags & Modifiers.OVERRIDE) != 0)
- continue;
-
- //
- // FIXME: Compare the signatures here. If they differ,
- // then: `continue;'
- }
-#endif
- Report108 (mc.Location, defined_names [idx]);
- }
-
- foreach (object o in remove_list)
- list.Remove (o);
-
- remove_list.Clear ();
- }
-
- /// <summary>
- /// Populates our TypeBuilder with fields and methods
- /// </summary>
- public override bool Define (TypeContainer parent)
- {
- MemberInfo [] defined_names = null;
-
- if (RootContext.WarningLevel > 1){
- Type ptype;
-
- //
- // This code throws an exception in the comparer
- // I guess the string is not an object?
- //
- ptype = TypeBuilder.BaseType;
- if (ptype != null){
- defined_names = FindMembers (
- ptype, MemberTypes.All & ~MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance |
- BindingFlags.Static, null, null);
-
- Array.Sort (defined_names, mif_compare);
- }
- }
-
- if (constants != null)
- DefineMembers (constants, defined_names);
-
- if (fields != null)
- DefineMembers (fields, defined_names);
-
- if (this is Class){
- if (instance_constructors == null){
- if (default_constructor == null)
- DefineDefaultConstructor (false);
- }
-
- if (initialized_static_fields != null &&
- default_static_constructor == null)
- DefineDefaultConstructor (true);
- }
-
- if (this is Struct){
- //
- // Structs can not have initialized instance
- // fields
- //
- if (initialized_static_fields != null &&
- default_static_constructor == null)
- DefineDefaultConstructor (true);
-
- if (initialized_fields != null)
- ReportStructInitializedInstanceError ();
- }
-
- RegisterRequiredImplementations ();
-
- //
- // Constructors are not in the defined_names array
- //
- if (instance_constructors != null)
- DefineMembers (instance_constructors, null);
-
- if (default_static_constructor != null)
- default_static_constructor.Define (this);
-
- if (methods != null)
- DefineMembers (methods, null);
-
- if (properties != null)
- DefineMembers (properties, defined_names);
-
- if (events != null)
- DefineMembers (events, defined_names);
-
- if (indexers != null) {
- foreach (Indexer i in Indexers)
- i.Define (this);
- }
-
- if (operators != null)
- DefineMembers (operators, null);
-
- if (enums != null)
- DefineMembers (enums, defined_names);
-
- if (delegates != null)
- DefineMembers (delegates, defined_names);
-
- return true;
- }
-
- /// <summary>
- /// Looks up the alias for the name
- /// </summary>
- public string LookupAlias (string name)
- {
- if (Namespace != null)
- return Namespace.LookupAlias (name);
- else
- return null;
- }
-
- /// <summary>
- /// This function is based by a delegate to the FindMembers routine
- /// </summary>
- static bool AlwaysAccept (MemberInfo m, object filterCriteria)
- {
- return true;
- }
-
- /// <summary>
- /// This filter is used by FindMembers, and we just keep
- /// a global for the filter to `AlwaysAccept'
- /// </summary>
- static MemberFilter accepting_filter;
-
- static bool IsVirtualFilter (MemberInfo m, object filterCriteria)
- {
- if (!(m is MethodInfo))
- return false;
-
- return ((MethodInfo) m).IsVirtual;
- }
-
- /// <summary>
- /// This filter is used by FindMembers, and it is used to
- /// extract only virtual/abstract fields
- /// </summary>
- static MemberFilter virtual_method_filter;
-
- /// <summary>
- /// A member comparission method based on name only
- /// </summary>
- static IComparer mif_compare;
-
- static TypeContainer ()
- {
- accepting_filter = new MemberFilter (AlwaysAccept);
- virtual_method_filter = new MemberFilter (IsVirtualFilter);
- mif_compare = new MemberInfoCompare ();
- }
-
- /// <summary>
- /// This method returns the members of this type just like Type.FindMembers would
- /// Only, we need to use this for types which are _being_ defined because MS'
- /// implementation can't take care of that.
- /// </summary>
- //
- // FIXME: return an empty static array instead of null, that cleans up
- // some code and is consistent with some coding conventions I just found
- // out existed ;-)
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
- {
- ArrayList members = new ArrayList ();
-
- if (filter == null)
- filter = accepting_filter;
-
- if ((mt & MemberTypes.Field) != 0) {
- if (fields != null) {
- foreach (Field f in fields) {
- FieldBuilder fb = f.FieldBuilder;
- if (filter (fb, criteria) == true)
- members.Add (fb);
- }
- }
-
- if (constants != null) {
- foreach (Const con in constants) {
- FieldBuilder fb = con.FieldBuilder;
- if (filter (fb, criteria) == true)
- members.Add (fb);
- }
- }
- }
-
- if ((mt & MemberTypes.Method) != 0) {
- if (methods != null) {
- foreach (Method m in methods) {
- MethodBuilder mb = m.MethodBuilder;
-
- // If we are in transit, ignore
- // This case arises when we are still defining a PInvoke method
- // and we hit FindMembers because of the need to resolve named
- // arguments inside of Attribute.DefinePInvokeMethod
- if (mb == null)
- continue;
-
- if (filter (mb, criteria) == true)
- members.Add (mb);
- }
- }
-
- if (operators != null){
- foreach (Operator o in operators) {
- MethodBuilder ob = o.OperatorMethodBuilder;
-
- if (filter (ob, criteria) == true)
- members.Add (ob);
- }
- }
- }
-
- if ((mt & MemberTypes.Event) != 0) {
- if (events != null)
- foreach (Event e in events) {
- if (filter (e.EventBuilder, criteria) == true)
- members.Add (e.EventBuilder);
- }
- }
-
- if ((mt & MemberTypes.Property) != 0){
- if (properties != null)
- foreach (Property p in properties) {
- if (filter (p.PropertyBuilder, criteria) == true) {
- members.Add (p.PropertyBuilder);
- }
- }
-
- if (indexers != null)
- foreach (Indexer ix in indexers) {
- if (filter (ix.PropertyBuilder, criteria) == true) {
- members.Add (ix.PropertyBuilder);
- }
- }
- }
-
- if ((mt & MemberTypes.NestedType) != 0) {
-
- if (Types != null)
- foreach (TypeContainer t in Types)
- if (filter (t.TypeBuilder, criteria) == true)
- members.Add (t.TypeBuilder);
-
- if (Enums != null)
- foreach (Enum en in Enums)
- if (filter (en.TypeBuilder, criteria) == true)
- members.Add (en.TypeBuilder);
-
- }
-
- if ((mt & MemberTypes.Constructor) != 0){
- if (instance_constructors != null){
- foreach (Constructor c in instance_constructors){
- ConstructorBuilder cb = c.ConstructorBuilder;
-
- if (filter (cb, criteria) == true)
- members.Add (cb);
- }
- }
-
- if (default_static_constructor != null){
- ConstructorBuilder cb =
- default_static_constructor.ConstructorBuilder;
-
- if (filter (cb, criteria) == true)
- members.Add (cb);
- }
- }
-
- //
- // Lookup members in parent if requested.
- //
- if ((bf & BindingFlags.DeclaredOnly) == 0){
- MemberInfo [] mi;
-
- mi = FindMembers (TypeBuilder.BaseType, mt, bf, filter, criteria);
- if (mi != null)
- members.AddRange (mi);
- }
-
- int count = members.Count;
- if (count > 0){
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi);
- return mi;
- }
-
- return null;
- }
-
- public MemberInfo GetFieldFromEvent (EventExpr event_expr)
- {
- EventInfo ei = event_expr.EventInfo;
-
- foreach (Event e in events) {
-
- if (e.FieldBuilder == null)
- continue;
-
- if (Type.FilterName (e.FieldBuilder, ei.Name))
- return e.FieldBuilder;
- }
-
- return null;
- }
-
- public static MemberInfo [] FindMembers (Type t, MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
- {
- TypeContainer tc = TypeManager.LookupTypeContainer (t);
-
- if (tc != null)
- return tc.FindMembers (mt, bf, filter, criteria);
- else
- return t.FindMembers (mt, bf, filter, criteria);
- }
-
- /// <summary>
- /// Whether the specified method is an interface method implementation
- /// </summary>
- ///
- /// <remarks>
- /// If a method in Type `t' (or null to look in all interfaces
- /// and the base abstract class) with name `Name', return type `ret_type' and
- /// arguments `args' implements an interface, this method will
- /// return the MethodInfo that this method implements.
- ///
- /// This will remove the method from the list of "pending" methods
- /// that are required to be implemented for this class as a side effect.
- ///
- /// </remarks>
- public MethodInfo IsInterfaceMethod (Type t, string Name, Type ret_type, Type [] args,
- bool clear)
- {
- if (pending_implementations == null)
- return null;
-
- foreach (TypeAndMethods tm in pending_implementations){
- if (!(t == null || tm.type == t))
- continue;
-
- int i = 0;
- foreach (MethodInfo m in tm.methods){
- if (m == null){
- i++;
- continue;
- }
-
- if (Name != m.Name){
- i++;
- continue;
- }
-
- if (ret_type != m.ReturnType){
- i++;
- continue;
- }
-
- if (args == null){
- if (tm.args [i] == null || tm.args [i].Length == 0){
- if (clear)
- tm.methods [i] = null;
- tm.found [i] = true;
- return m;
- }
- i++;
- continue;
- }
-
- if (tm.args == null){
- Console.WriteLine ("Type: " + tm.type);
- Console.WriteLine ("method: " + tm.methods [i]);
- }
-
- if (tm.args [i] == null){
- i++;
- continue;
- }
-
- //
- // Check if we have the same parameters
- //
- if (tm.args [i].Length != args.Length){
- i++;
- continue;
- }
-
- int j, top = args.Length;
- bool fail = false;
-
- for (j = 0; j < top; j++){
- if (tm.args [i][j] != args[j]){
- fail = true;
- break;
- }
- }
- if (fail){
- i++;
- continue;
- }
-
- if (clear)
- tm.methods [i] = null;
- tm.found [i] = true;
- return m;
- }
-
- // If a specific type was requested, we can stop now.
- if (tm.type == t)
- return null;
- }
- return null;
- }
-
- /// <summary>
- /// Verifies that any pending abstract methods or interface methods
- /// were implemented.
- /// </summary>
- bool VerifyPendingMethods ()
- {
- int top = pending_implementations.Length;
- bool errors = false;
- int i;
-
- for (i = 0; i < top; i++){
- Type type = pending_implementations [i].type;
- int j = 0;
-
- foreach (MethodInfo mi in pending_implementations [i].methods){
- if (mi == null)
- continue;
-
- if (type.IsInterface){
- string extra = "";
-
- if (pending_implementations [i].found [j])
- extra = ". (method might be private or static)";
- Report.Error (
- 536, Location,
- "`" + Name + "' does not implement " +
- "interface member `" +
- type.FullName + "." + mi.Name + "'" + extra);
- } else {
- Report.Error (
- 534, Location,
- "`" + Name + "' does not implement " +
- "inherited abstract member `" +
- type.FullName + "." + mi.Name + "'");
- }
- errors = true;
- j++;
- }
- }
- return errors;
- }
-
- /// <summary>
- /// Emits the values for the constants
- /// </summary>
- public void EmitConstants ()
- {
- if (constants != null)
- foreach (Const con in constants)
- con.EmitConstant (this);
- return;
- }
-
- /// <summary>
- /// Emits the code, this step is performed after all
- /// the types, enumerations, constructors
- /// </summary>
- public void Emit ()
- {
- if (instance_constructors != null)
- foreach (Constructor c in instance_constructors)
- c.Emit (this);
-
- if (default_static_constructor != null)
- default_static_constructor.Emit (this);
-
- if (methods != null)
- foreach (Method m in methods)
- m.Emit (this);
-
- if (operators != null)
- foreach (Operator o in operators)
- o.Emit (this);
-
- if (properties != null)
- foreach (Property p in properties)
- p.Emit (this);
-
- if (indexers != null) {
- foreach (Indexer ix in indexers)
- ix.Emit (this);
-
- CustomAttributeBuilder cb = Interface.EmitDefaultMemberAttr (this, ModFlags, Location);
-
- TypeBuilder.SetCustomAttribute (cb);
- }
-
- if (fields != null)
- foreach (Field f in fields)
- f.Emit (this);
-
- if (events != null){
- foreach (Event e in Events)
- e.Emit (this);
- }
-
- if (pending_implementations != null)
- if (!VerifyPendingMethods ())
- return;
-
- EmitContext ec = new EmitContext (
- this, Mono.CSharp.Location.Null, null, null,
- ModFlags, false);
-
- Attribute.ApplyAttributes (ec, TypeBuilder, this, OptAttributes, Location);
-
- //
- // Check for internal or private fields that were never assigned
- //
- if (RootContext.WarningLevel >= 3){
- foreach (Field f in fields){
- if ((f.ModFlags & Modifiers.PUBLIC) != 0)
- continue;
-
- if (f.status == 0){
- Report.Warning (
- 169, f.Location, "Private field " +
- MakeName (f.Name) + " is never used");
- continue;
- }
-
- //
- // Only report 649 on level 4
- //
- if (RootContext.WarningLevel < 4)
- continue;
-
- if ((f.status & Field.Status.ASSIGNED) != 0)
- continue;
-
- Report.Warning (
- 649, f.Location,
- "Field " + MakeName (f.Name) + " is never assigned " +
- " to and will always have its default value");
- }
- }
-
-// if (types != null)
-// foreach (TypeContainer tc in types)
-// tc.Emit ();
- }
-
- public override void CloseType ()
- {
- try {
- if (!Created){
- Created = true;
- TypeBuilder.CreateType ();
- }
- } catch (TypeLoadException){
- //
- // This is fine, the code still created the type
- //
-// Report.Warning (-20, "Exception while creating class: " + TypeBuilder.Name);
-// Console.WriteLine (e.Message);
- }
-
- if (Enums != null)
- foreach (Enum en in Enums)
- en.CloseType ();
-
- if (Types != null){
- foreach (TypeContainer tc in Types)
- if (tc is Struct)
- tc.CloseType ();
-
- foreach (TypeContainer tc in Types)
- if (!(tc is Struct))
- tc.CloseType ();
- }
-
- if (Delegates != null)
- foreach (Delegate d in Delegates)
- d.CloseDelegate ();
- }
-
- public string MakeName (string n)
- {
- return "`" + Name + "." + n + "'";
- }
-
- public void Report108 (Location l, MemberInfo mi)
- {
- Report.Warning (
- 108, l, "The keyword new is required on " +
- MakeName (mi.Name) + " because it hides `" +
- mi.ReflectedType.Name + "." + mi.Name + "'");
- }
-
- public void Report109 (Location l, MemberCore mc)
- {
- Report.Warning (
- 109, l, "The member " + MakeName (mc.Name) + " does not hide an " +
- "inherited member, the keyword new is not required");
- }
-
- public static int CheckMember (string name, MemberInfo mi, int ModFlags)
- {
- return 0;
- }
-
- //
- // Performs the validation on a Method's modifiers (properties have
- // the same properties).
- //
- public bool MethodModifiersValid (int flags, string n, Location loc)
- {
- const int vao = (Modifiers.VIRTUAL | Modifiers.ABSTRACT | Modifiers.OVERRIDE);
- const int nv = (Modifiers.NEW | Modifiers.VIRTUAL);
- bool ok = true;
- string name = MakeName (n);
-
- //
- // At most one of static, virtual or override
- //
- if ((flags & Modifiers.STATIC) != 0){
- if ((flags & vao) != 0){
- Report.Error (
- 112, loc, "static method " + name + "can not be marked " +
- "as virtual, abstract or override");
- ok = false;
- }
- }
-
- if ((flags & Modifiers.OVERRIDE) != 0 && (flags & nv) != 0){
- Report.Error (
- 113, loc, name +
- " marked as override cannot be marked as new or virtual");
- ok = false;
- }
-
- //
- // If the declaration includes the abstract modifier, then the
- // declaration does not include static, virtual or extern
- //
- if ((flags & Modifiers.ABSTRACT) != 0){
- if ((flags & Modifiers.EXTERN) != 0){
- Report.Error (
- 180, loc, name + " can not be both abstract and extern");
- ok = false;
- }
-
- if ((flags & Modifiers.VIRTUAL) != 0){
- Report.Error (
- 503, loc, name + " can not be both abstract and virtual");
- ok = false;
- }
-
- if ((ModFlags & Modifiers.ABSTRACT) == 0){
- Report.Error (
- 513, loc, name +
- " is abstract but its container class is not");
- ok = false;
-
- }
- }
-
- if ((flags & Modifiers.PRIVATE) != 0){
- if ((flags & vao) != 0){
- Report.Error (
- 621, loc, name +
- " virtual or abstract members can not be private");
- ok = false;
- }
- }
-
- if ((flags & Modifiers.SEALED) != 0){
- if ((flags & Modifiers.OVERRIDE) == 0){
- Report.Error (
- 238, loc, name +
- " cannot be sealed because it is not an override");
- ok = false;
- }
- }
-
- return ok;
- }
-
- //
- // Returns true if `type' is as accessible as the flags `flags'
- // given for this member
- //
- static public bool AsAccessible (Type type, int flags)
- {
- return true;
- }
-
- Hashtable builder_and_args;
-
- public bool RegisterMethod (MethodBuilder mb, InternalParameters ip, Type [] args)
- {
- if (builder_and_args == null)
- builder_and_args = new Hashtable ();
- return true;
- }
- }
-
- public class Class : TypeContainer {
- // <summary>
- // Modifiers allowed in a class declaration
- // </summary>
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.ABSTRACT |
- Modifiers.SEALED |
- Modifiers.UNSAFE;
-
- public Class (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, l)
- {
- int accmods;
-
- if (parent.Parent == null)
- accmods = Modifiers.INTERNAL;
- else
- accmods = Modifiers.PRIVATE;
-
- this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, l);
- this.attributes = attrs;
- }
-
- //
- // FIXME: How do we deal with the user specifying a different
- // layout?
- //
- public override TypeAttributes TypeAttr {
- get {
- return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class;
- }
- }
- }
-
- public class Struct : TypeContainer {
- // <summary>
- // Modifiers allowed in a struct declaration
- // </summary>
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.UNSAFE |
- Modifiers.PRIVATE;
-
- public Struct (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, l)
- {
- int accmods;
-
- if (parent.Parent == null)
- accmods = Modifiers.INTERNAL;
- else
- accmods = Modifiers.PRIVATE;
-
- this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, l);
-
- this.ModFlags |= Modifiers.SEALED;
- this.attributes = attrs;
-
- }
-
- //
- // FIXME: Allow the user to specify a different set of attributes
- // in some cases (Sealed for example is mandatory for a class,
- // but what SequentialLayout can be changed
- //
- public override TypeAttributes TypeAttr {
- get {
- return base.TypeAttr |
- TypeAttributes.SequentialLayout |
- TypeAttributes.Sealed |
- TypeAttributes.BeforeFieldInit;
- }
- }
- }
-
- public abstract class MethodCore : MemberCore {
- public readonly Parameters Parameters;
- Block block;
-
- //
- // Parameters, cached for semantic analysis.
- //
- InternalParameters parameter_info;
-
- public MethodCore (string name, Parameters parameters, Location l)
- : base (name, l)
- {
- Name = name;
- Parameters = parameters;
- }
-
- //
- // Returns the System.Type array for the parameters of this method
- //
- Type [] parameter_types;
- static Type [] no_types = new Type [0];
- public Type [] ParameterTypes (TypeContainer parent)
- {
- if (Parameters == null)
- return no_types;
-
- if (parameter_types == null)
- parameter_types = Parameters.GetParameterInfo (parent);
-
- return parameter_types;
- }
-
- public InternalParameters ParameterInfo
- {
- get {
- return parameter_info;
- }
-
- set {
- parameter_info = value;
- }
- }
-
- public Block Block {
- get {
- return block;
- }
-
- set {
- block = value;
- }
- }
-
- public CallingConventions GetCallingConvention (bool is_class)
- {
- CallingConventions cc = 0;
-
- cc = Parameters.GetCallingConvention ();
-
- if (is_class)
- if ((ModFlags & Modifiers.STATIC) == 0)
- cc |= CallingConventions.HasThis;
-
- // FIXME: How is `ExplicitThis' used in C#?
-
- return cc;
- }
-
- public void LabelParameters (EmitContext ec, Type [] parameters, MethodBase builder)
- {
- //
- // Define each type attribute (in/out/ref) and
- // the argument names.
- //
- Parameter [] p = Parameters.FixedParameters;
- if (p == null)
- return;
-
- MethodBuilder mb = null;
- ConstructorBuilder cb = null;
-
- if (builder is MethodBuilder)
- mb = (MethodBuilder) builder;
- else
- cb = (ConstructorBuilder) builder;
-
- int i;
-
- for (i = 0; i < p.Length; i++) {
- ParameterBuilder pb;
-
- if (mb == null)
- pb = cb.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
- else
- pb = mb.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
-
- Attributes attr = p [i].OptAttributes;
- if (attr != null)
- Attribute.ApplyAttributes (ec, pb, pb, attr, Location);
- }
-
- if (i != parameters.Length) {
- ParameterBuilder pb;
-
- Parameter array_param = Parameters.ArrayParameter;
- if (mb == null)
- pb = cb.DefineParameter (
- i + 1, array_param.Attributes,
- array_param.Name);
- else
- pb = mb.DefineParameter (
- i + 1, array_param.Attributes,
- array_param.Name);
-
- CustomAttributeBuilder a = new CustomAttributeBuilder (
- TypeManager.cons_param_array_attribute, new object [0]);
-
- pb.SetCustomAttribute (a);
- }
- }
- }
-
- public class Method : MethodCore {
- public readonly string ReturnType;
- public MethodBuilder MethodBuilder;
- public readonly Attributes OptAttributes;
-
- MethodAttributes flags;
-
- /// <summary>
- /// Modifiers allowed in a class declaration
- /// </summary>
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.VIRTUAL |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.ABSTRACT |
- Modifiers.UNSAFE |
- Modifiers.EXTERN;
-
- //
- // return_type can be "null" for VOID values.
- //
- public Method (string return_type, int mod, string name, Parameters parameters,
- Attributes attrs, Location l)
- : base (name, parameters, l)
- {
- ReturnType = return_type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
- OptAttributes = attrs;
- }
-
- static bool MemberSignatureCompare (MemberInfo m, object filter_criteria)
- {
- MethodInfo mi;
-
- if (! (m is MethodInfo))
- return false;
-
- MethodSignature sig = (MethodSignature) filter_criteria;
-
- if (m.Name != sig.Name)
- return false;
-
- mi = (MethodInfo) m;
-
- if (mi.ReturnType != sig.RetType)
- return false;
-
- Type [] args = TypeManager.GetArgumentTypes (mi);
- Type [] sigp = sig.Parameters;
-
- if (args.Length != sigp.Length)
- return false;
-
- for (int i = args.Length; i > 0; ){
- i--;
- if (args [i] != sigp [i])
- return false;
- }
- return true;
- }
-
- /// <summary>
- /// This delegate is used to extract methods which have the
- /// same signature as the argument
- /// </summary>
- static MemberFilter method_signature_filter;
-
- static Method ()
- {
- method_signature_filter = new MemberFilter (MemberSignatureCompare);
- return;
- }
-
- //
- // Returns the `System.Type' for the ReturnType of this
- // function. Provides a nice cache. (used between semantic analysis
- // and actual code generation
- //
- Type type_return_type;
-
- public Type GetReturnType (TypeContainer parent)
- {
- if (type_return_type == null)
- type_return_type = RootContext.LookupType (
- parent, ReturnType, false, Location);
-
- return type_return_type;
- }
-
- void DuplicatEntryPoint (MethodInfo b)
- {
- Report.Error (
- 17, Location,
- "Program `" + RootContext.CodeGen.FileName +
- "' has more than one entry point defined: `" +
- b.DeclaringType.Name + "." + b.Name + "'");
- }
-
- //
- // Creates the type
- //
- public override bool Define (TypeContainer parent)
- {
- Type ret_type = GetReturnType (parent);
- Type [] parameters = ParameterTypes (parent);
- bool error = false;
- MethodInfo implementing;
- Type iface_type = null;
- string iface = "", short_name;
- bool explicit_impl = false;
-
- // Check if the return type and arguments were correct
- if (ret_type == null || parameters == null)
- return false;
-
- if (!parent.MethodModifiersValid (ModFlags, Name, Location))
- return false;
-
- flags = Modifiers.MethodAttr (ModFlags);
- //
- // verify accessibility
- //
- if (!TypeContainer.AsAccessible (ret_type, ModFlags))
- return false;
-
- if (ret_type.IsPointer && !UnsafeOK (parent))
- return false;
-
- foreach (Type partype in parameters){
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- error = true;
- if (partype.IsPointer && !UnsafeOK (parent))
- error = true;
- }
-
- if (error)
- return false;
-
- //
- // Verify if the parent has a type with the same name, and then
- // check whether we have to create a new slot for it or not.
- //
- Type ptype = parent.TypeBuilder.BaseType;
-
- // ptype is only null for System.Object while compiling corlib.
- if (ptype != null){
- MethodSignature ms = new MethodSignature (Name, ret_type, parameters);
- MemberInfo [] mi, mi_static, mi_instance;
-
- mi_static = TypeContainer.FindMembers (
- ptype, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.Static, method_signature_filter,
- ms);
-
- mi_instance = TypeContainer.FindMembers (
- ptype, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.Instance, method_signature_filter,
- ms);
-
- if (mi_instance != null && mi_instance.Length > 0){
- mi = mi_instance;
- } else if (mi_static != null && mi_static.Length > 0)
- mi = mi_static;
- else
- mi = null;
-
- if (mi != null && mi.Length > 0){
- if (!CheckMethodAgainstBase (parent, (MethodInfo) mi [0])){
- return false;
- }
- } else {
- if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0)
- Report.Error (115, Location,
- parent.MakeName (Name) +
- " no suitable methods found to override");
- }
- } else if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- //
- // If we implement an interface, extract the interface name.
- //
-
- if (Name.IndexOf (".") != -1){
- int pos = Name.LastIndexOf (".");
- iface = Name.Substring (0, pos);
-
- iface_type = RootContext.LookupType (parent, iface, false, Location);
- short_name = Name.Substring (pos + 1);
-
- if (iface_type == null)
- return false;
-
- // Compute the full name that we need to export
- Name = iface_type.FullName + "." + short_name;
- explicit_impl = true;
- } else
- short_name = Name;
-
- //
- // Check if we are an implementation of an interface method or
- // a method
- //
- implementing = parent.IsInterfaceMethod (
- iface_type, short_name, ret_type, parameters, false);
-
- //
- // For implicit implementations, make sure we are public, for
- // explicit implementations, make sure we are private.
- //
- if (implementing != null){
- //
- // Setting null inside this block will trigger a more
- // verbose error reporting for missing interface implementations
- //
- // The "candidate" function has been flagged already
- // but it wont get cleared
- //
- if (iface_type == null){
- if ((ModFlags & Modifiers.PUBLIC) == 0)
- implementing = null;
-
- if ((ModFlags & Modifiers.STATIC) != 0)
- implementing = null;
- } else {
- if ((ModFlags & (Modifiers.PUBLIC | Modifiers.ABSTRACT)) != 0){
- Report.Error (
- 106, Location, "`public' or `abstract' modifiers "+
- "are not allowed in explicit interface declarations"
- );
- implementing = null;
- }
- }
- }
-
- //
- // If implementing is still valid, set flags
- //
- if (implementing != null){
- flags |=
- MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
-
- // If not abstract, then we can set Final.
- if (((flags & MethodAttributes.Abstract) == 0) &&
- implementing.DeclaringType.IsInterface)
- flags |= MethodAttributes.Final;
-
- //
- // clear the flag
- //
- parent.IsInterfaceMethod (
- iface_type, short_name, ret_type, parameters, true);
- }
-
- Attribute dllimport_attr = null;
- if (OptAttributes != null && OptAttributes.AttributeSections != null) {
- foreach (AttributeSection asec in OptAttributes.AttributeSections) {
- if (asec.Attributes == null)
- continue;
-
- foreach (Attribute a in asec.Attributes)
- if (a.Name.IndexOf ("DllImport") != -1) {
- flags |= MethodAttributes.PinvokeImpl;
- dllimport_attr = a;
- }
- }
- }
-
- //
- // Finally, define the method
- //
-
- if ((flags & MethodAttributes.PinvokeImpl) != 0) {
- EmitContext ec = new EmitContext (
- parent, Location, null, GetReturnType (parent), ModFlags);
-
- MethodBuilder = dllimport_attr.DefinePInvokeMethod (
- ec, parent.TypeBuilder,
- Name, flags, ret_type, parameters);
- } else {
-
- MethodBuilder = parent.TypeBuilder.DefineMethod (
- Name, flags,
- GetCallingConvention (parent is Class),
- ret_type, parameters);
-
- if (implementing != null && explicit_impl)
- parent.TypeBuilder.DefineMethodOverride (
- MethodBuilder, implementing);
- }
-
- if (MethodBuilder == null)
- return false;
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- ParameterInfo = new InternalParameters (parent, Parameters);
-
- if (!TypeManager.RegisterMethod (MethodBuilder, ParameterInfo,
- parameters)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name + "' already contains a definition with " +
- " the same return value and parameter types for method `" +
- Name + "'");
- return false;
- }
-
- //
- // This is used to track the Entry Point,
- //
- // FIXME: Allow pluggable entry point, check arguments, etc.
- //
- if (Name == "Main" &&
- ((ModFlags & Modifiers.STATIC) != 0) &&
- (RootContext.MainClass == null ||
- RootContext.MainClass == parent.TypeBuilder.FullName)){
- if (RootContext.EntryPoint != null){
- DuplicatEntryPoint (MethodBuilder);
- DuplicatEntryPoint (RootContext.EntryPoint);
- } else
- RootContext.EntryPoint = MethodBuilder;
-
- //
- // FIXME: Verify that the method signature
- // is valid for an entry point, and report
- // error 28 if not.
- //
- }
-
- return true;
- }
-
- //
- // Emits the code
- //
- public void Emit (TypeContainer parent)
- {
- if ((flags & MethodAttributes.PinvokeImpl) != 0)
- return;
-
- ILGenerator ig = MethodBuilder.GetILGenerator ();
- EmitContext ec = new EmitContext (parent, Location, ig,
- GetReturnType (parent), ModFlags);
-
- if (OptAttributes != null)
- Attribute.ApplyAttributes (ec, MethodBuilder, this, OptAttributes, Location);
-
-
- LabelParameters (ec, ParameterTypes (parent), MethodBuilder);
-
- //
- // abstract or extern methods have no bodies
- //
- if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0)
- return;
-
- //
- // Handle destructors specially
- //
- // FIXME: This code generates buggy code
- //
- if (Name == "Finalize" && type_return_type == TypeManager.void_type)
- EmitDestructor (ec);
- else
- ec.EmitTopBlock (Block, Location);
- }
-
- void EmitDestructor (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- Label finish = ig.DefineLabel ();
- bool old_in_try = ec.InTry;
- Expression member_lookup;
-
- ig.BeginExceptionBlock ();
- ec.InTry = true;
- ec.ReturnLabel = finish;
- ec.EmitTopBlock (Block, Location);
- ec.InTry = old_in_try;
-
- ig.MarkLabel (finish);
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- ig.BeginFinallyBlock ();
-
- member_lookup = Expression.MemberLookup (
- ec, ec.TypeContainer.TypeBuilder.BaseType, "Finalize",
- MemberTypes.Method, Expression.AllBindingFlags, Location);
-
- if (member_lookup != null){
- MethodGroupExpr parent_destructor = ((MethodGroupExpr) member_lookup);
-
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Call, (MethodInfo) parent_destructor.Methods [0]);
- }
- ec.InFinally = old_in_finally;
-
- ig.EndExceptionBlock ();
- //ig.MarkLabel (ec.ReturnLabel);
- ig.Emit (OpCodes.Ret);
- }
- }
-
- public abstract class ConstructorInitializer {
- ArrayList argument_list;
- ConstructorInfo parent_constructor;
- Location location;
-
- public ConstructorInitializer (ArrayList argument_list, Location location)
- {
- this.argument_list = argument_list;
- this.location = location;
- }
-
- public ArrayList Arguments {
- get {
- return argument_list;
- }
- }
-
- public bool Resolve (EmitContext ec)
- {
- Expression parent_constructor_group;
- Type t;
-
- if (argument_list != null){
- for (int i = argument_list.Count; i > 0; ){
- --i;
-
- Argument a = (Argument) argument_list [i];
- if (!a.Resolve (ec, location))
- return false;
- }
- }
-
- if (this is ConstructorBaseInitializer)
- t = ec.TypeContainer.TypeBuilder.BaseType;
- else
- t = ec.TypeContainer.TypeBuilder;
-
- parent_constructor_group = Expression.MemberLookup (
- ec, t, ".ctor",
- MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance, location);
-
- if (parent_constructor_group == null){
- Console.WriteLine ("Could not find a constructor in our parent");
- return false;
- }
-
- parent_constructor = (ConstructorInfo) Invocation.OverloadResolve (ec,
- (MethodGroupExpr) parent_constructor_group, argument_list, location);
-
- if (parent_constructor == null){
- Console.WriteLine ("Could not locate a proper overload function");
- return false;
- }
-
- return true;
- }
-
- public void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldarg_0);
- if (argument_list != null)
- Invocation.EmitArguments (ec, null, argument_list);
- ec.ig.Emit (OpCodes.Call, parent_constructor);
- }
- }
-
- public class ConstructorBaseInitializer : ConstructorInitializer {
- public ConstructorBaseInitializer (ArrayList argument_list, Location l) : base (argument_list, l)
- {
- }
- }
-
- public class ConstructorThisInitializer : ConstructorInitializer {
- public ConstructorThisInitializer (ArrayList argument_list, Location l) : base (argument_list, l)
- {
- }
- }
-
- public class Constructor : MethodCore {
- public ConstructorBuilder ConstructorBuilder;
- public ConstructorInitializer Initializer;
- public Attributes OptAttributes;
-
- // <summary>
- // Modifiers allowed for a constructor.
- // </summary>
- const int AllowedModifiers =
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.STATIC |
- Modifiers.UNSAFE |
- Modifiers.PRIVATE;
-
- //
- // The spec claims that static is not permitted, but
- // my very own code has static constructors.
- //
- public Constructor (string name, Parameters args, ConstructorInitializer init, Location l)
- : base (name, args, l)
- {
- Initializer = init;
- }
-
- //
- // Returns true if this is a default constructor
- //
- public bool IsDefault ()
- {
- if ((ModFlags & Modifiers.STATIC) != 0)
- return (Parameters.FixedParameters == null ? true : Parameters.Empty) &&
- (Parameters.ArrayParameter == null ? true : Parameters.Empty);
-
- else
- return (Parameters.FixedParameters == null ? true : Parameters.Empty) &&
- (Parameters.ArrayParameter == null ? true : Parameters.Empty) &&
- (Initializer is ConstructorBaseInitializer) &&
- (Initializer.Arguments == null);
- }
-
- //
- // Creates the ConstructorBuilder
- //
- public override bool Define (TypeContainer parent)
- {
- MethodAttributes ca = (MethodAttributes.RTSpecialName |
- MethodAttributes.SpecialName);
-
- Type [] parameters = ParameterTypes (parent);
-
- if ((ModFlags & Modifiers.STATIC) != 0)
- ca |= MethodAttributes.Static;
- else {
- if (parent is Struct && parameters.Length == 0){
- Report.Error (
- 568, Location,
- "Structs can not contain explicit parameterless " +
- "constructors");
- return false;
- }
- ca |= MethodAttributes.Public | MethodAttributes.HideBySig;
- }
-
- foreach (Type partype in parameters)
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- return false;
-
- ConstructorBuilder = parent.TypeBuilder.DefineConstructor (
- ca, GetCallingConvention (parent is Class), parameters);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- ParameterInfo = new InternalParameters (parent, Parameters);
-
- if (!TypeManager.RegisterMethod (ConstructorBuilder, ParameterInfo, parameters)) {
- Report.Error (
- 111, Location,
- "Class `" +parent.Name+ "' already contains a definition with the " +
- "same return value and parameter types for constructor `" + Name
- + "'");
- return false;
- }
-
- return true;
- }
-
- //
- // Emits the code
- //
- public void Emit (TypeContainer parent)
- {
- ILGenerator ig = ConstructorBuilder.GetILGenerator ();
- EmitContext ec = new EmitContext (parent, Location, ig, null, ModFlags, true);
-
- if (parent is Class && ((ModFlags & Modifiers.STATIC) == 0)){
- if (Initializer == null)
- Initializer = new ConstructorBaseInitializer (null, parent.Location);
-
- if (!Initializer.Resolve (ec)){
- Console.WriteLine ("Could not resolve initializer: " + parent.Name);
- }
- }
-
- LabelParameters (ec, ParameterTypes (parent), ConstructorBuilder);
-
- //
- // Classes can have base initializers and instance field initializers.
- //
- if (parent is Class){
- if ((ModFlags & Modifiers.STATIC) == 0){
- Initializer.Emit (ec);
- parent.EmitFieldInitializers (ec, false);
- }
- }
-
- if ((ModFlags & Modifiers.STATIC) != 0)
- parent.EmitFieldInitializers (ec, true);
-
- Attribute.ApplyAttributes (ec, ConstructorBuilder, this, OptAttributes, Location);
-
- ec.EmitTopBlock (Block, Location);
- }
- }
-
- public class Field : MemberCore {
- public readonly string Type;
- public readonly Object Initializer;
- public readonly Attributes OptAttributes;
- public FieldBuilder FieldBuilder;
- public Status status;
-
- [Flags]
- public enum Status : byte { ASSIGNED = 1, USED = 2 }
-
-
- // <summary>
- // Modifiers allowed in a class declaration
- // </summary>
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.VOLATILE |
- Modifiers.UNSAFE |
- Modifiers.READONLY;
-
- public Field (string type, int mod, string name, Object expr_or_array_init,
- Attributes attrs, Location loc)
- : base (name, loc)
- {
- Type = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, loc);
- Initializer = expr_or_array_init;
- OptAttributes = attrs;
- }
-
- public override bool Define (TypeContainer parent)
- {
- Type t = RootContext.LookupType (parent, Type, false, Location);
-
- if (t == null)
- return false;
-
- if (!TypeContainer.AsAccessible (t, ModFlags))
- return false;
-
- if (t.IsPointer && !UnsafeOK (parent))
- return false;
-
- if (RootContext.WarningLevel > 1){
- Type ptype = parent.TypeBuilder.BaseType;
-
- // ptype is only null for System.Object while compiling corlib.
- if (ptype != null){
- MemberInfo [] mi;
-
- mi = TypeContainer.FindMembers (
- ptype, MemberTypes.Method,
- BindingFlags.Public |
- BindingFlags.Static | BindingFlags.Instance,
- System.Type.FilterName, Name);
- }
- }
-
- if ((ModFlags & Modifiers.VOLATILE) != 0){
- if (!t.IsClass){
- if (TypeManager.IsEnumType (t))
- t = TypeManager.EnumToUnderlying (t);
-
- if (!((t == TypeManager.bool_type) ||
- (t == TypeManager.sbyte_type) ||
- (t == TypeManager.byte_type) ||
- (t == TypeManager.short_type) ||
- (t == TypeManager.ushort_type) ||
- (t == TypeManager.int32_type) ||
- (t == TypeManager.uint32_type) ||
- (t == TypeManager.char_type) ||
- (t == TypeManager.float_type))){
- Report.Error (
- 677, Location, parent.MakeName (Name) +
- " A volatile field can not be of type `" +
- TypeManager.CSharpName (t) + "'");
- return false;
- }
- }
- }
-
- FieldBuilder = parent.TypeBuilder.DefineField (
- Name, t, Modifiers.FieldAttr (ModFlags));
-
- TypeManager.RegisterField (FieldBuilder, this);
- return true;
- }
-
- public void Emit (TypeContainer tc)
- {
- EmitContext ec = new EmitContext (tc, Location, null, FieldBuilder.FieldType, ModFlags);
-
- Attribute.ApplyAttributes (ec, FieldBuilder, this, OptAttributes, Location);
- }
- }
-
- public class Property : MemberCore {
- public readonly string Type;
- public Block Get, Set;
- public PropertyBuilder PropertyBuilder;
- public Attributes OptAttributes;
- MethodBuilder GetBuilder, SetBuilder;
-
- //
- // The type, once we compute it.
-
- Type PropertyType;
-
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.ABSTRACT |
- Modifiers.UNSAFE |
- Modifiers.VIRTUAL;
-
- public Property (string type, string name, int mod_flags, Block get_block, Block set_block,
- Attributes attrs, Location loc)
- : base (name, loc)
- {
- Type = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PRIVATE, loc);
- Get = get_block;
- Set = set_block;
- OptAttributes = attrs;
- }
-
- //
- // Checks our base implementation if any
- //
- bool CheckBase (TypeContainer parent)
- {
- //
- // Find properties with the same name on the base class
- //
- MemberInfo [] props;
- MemberInfo [] props_static = TypeContainer.FindMembers (
- parent.TypeBuilder.BaseType,
- MemberTypes.All, BindingFlags.Public | BindingFlags.Static,
- System.Type.FilterName, Name);
-
- MemberInfo [] props_instance = TypeContainer.FindMembers (
- parent.TypeBuilder.BaseType,
- MemberTypes.All, BindingFlags.Public | BindingFlags.Instance,
- System.Type.FilterName, Name);
-
- //
- // Find if we have anything
- //
- if (props_static != null && props_static.Length > 0)
- props = props_static;
- else if (props_instance != null && props_instance.Length > 0)
- props = props_instance;
- else
- props = null;
-
- //
- // If we have something on the base.
- if (props != null && props.Length > 0){
- //
- // FIXME:
- // Currently we expect only to get 1 match at most from our
- // base class, maybe we can get more than one, investigate
- // whether this is possible
- //
- if (props.Length > 1)
- throw new Exception ("How do we handle this?");
-
- PropertyInfo pi = (PropertyInfo) props [0];
-
- MethodInfo inherited_get = TypeManager.GetPropertyGetter (pi);
- MethodInfo inherited_set = TypeManager.GetPropertySetter (pi);
-
- MethodInfo reference = inherited_get == null ?
- inherited_set : inherited_get;
-
- if (!CheckMethodAgainstBase (parent, reference))
- return false;
- } else {
- if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- Report.Error (115, Location,
- parent.MakeName (Name) +
- " no suitable methods found to override");
- return false;
- }
- }
- return true;
- }
-
- bool DefineMethod (TypeContainer parent, Type iface_type, string short_name, bool is_get)
- {
- MethodAttributes flags = Modifiers.MethodAttr (ModFlags);
- Type [] parameters = null;
- MethodInfo implementing;
- Type fn_type;
- string name;
-
- flags |= MethodAttributes.HideBySig |
- MethodAttributes.SpecialName;
-
- if (is_get){
- fn_type = PropertyType;
- name = "get_" + short_name;
- } else {
- name = "set_" + short_name;
- parameters = new Type [1];
- parameters [0] = PropertyType;
- fn_type = TypeManager.void_type;
- }
-
- implementing = parent.IsInterfaceMethod (
- iface_type, name, fn_type, parameters, false);
-
- //
- // For implicit implementations, make sure we are public, for
- // explicit implementations, make sure we are private.
- //
- if (implementing != null){
- //
- // Setting null inside this block will trigger a more
- // verbose error reporting for missing interface implementations
- //
- // The "candidate" function has been flagged already
- // but it wont get cleared
- //
- if (iface_type == null){
- if ((ModFlags & Modifiers.PUBLIC) == 0)
- implementing = null;
- if ((ModFlags & Modifiers.STATIC) != 0)
- implementing = null;
- } else {
- if ((ModFlags & (Modifiers.PUBLIC | Modifiers.ABSTRACT)) != 0){
- Report.Error (
- 106, Location, "`public' or `abstract' modifiers "+
- "are not allowed in explicit interface declarations"
- );
- implementing = null;
- }
- }
- }
-
- //
- // If implementing is still valid, set flags
- //
- if (implementing != null){
- flags |=
- MethodAttributes.Virtual |
- // removed newslot
- MethodAttributes.HideBySig;
-
- // If an interface implementation, then we can set Final.
- if (((flags & MethodAttributes.Abstract) == 0) &&
- implementing.DeclaringType.IsInterface)
- flags |= MethodAttributes.Final;
-
- //
- // clear the pending flag
- //
- parent.IsInterfaceMethod (
- iface_type, name, fn_type, parameters, true);
- }
-
- //
- // If this is not an explicit interface implementation,
- // clear implementing, as it is only used for explicit
- // interface implementation
- //
- if (Name.IndexOf (".") == -1)
- implementing = null;
-
- if (is_get){
- GetBuilder = parent.TypeBuilder.DefineMethod (
- name, flags, PropertyType, null);
- PropertyBuilder.SetGetMethod (GetBuilder);
-
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- GetBuilder, implementing);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- InternalParameters ip = new InternalParameters (
- parent, Parameters.GetEmptyReadOnlyParameters ());
-
- if (!TypeManager.RegisterMethod (GetBuilder, ip, null)) {
- Report.Error (111, Location,
- "Class `" + parent.Name +
- "' already contains a definition with the " +
- "same return value and parameter types as the " +
- "'get' method of property `" + Name + "'");
- return false;
- }
- } else {
- SetBuilder = parent.TypeBuilder.DefineMethod (
- name, flags, null, parameters);
-
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- SetBuilder, implementing);
-
- SetBuilder.DefineParameter (1, ParameterAttributes.None, "value");
- PropertyBuilder.SetSetMethod (SetBuilder);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- Parameter [] parms = new Parameter [1];
- parms [0] = new Parameter (Type, "value", Parameter.Modifier.NONE, null);
- InternalParameters ip = new InternalParameters (
- parent, new Parameters (parms, null, Location));
-
- if (!TypeManager.RegisterMethod (SetBuilder, ip, parameters)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name +
- "' already contains a definition with the " +
- "same return value and parameter types as the " +
- "'set' method of property `" + Name + "'");
- return false;
- }
- }
-
- return true;
- }
-
- public override bool Define (TypeContainer parent)
- {
- Type iface_type = null;
- string short_name;
-
- if (!parent.MethodModifiersValid (ModFlags, Name, Location))
- return false;
-
- // Lookup Type, verify validity
- PropertyType = RootContext.LookupType (parent, Type, false, Location);
- if (PropertyType == null)
- return false;
-
- // verify accessibility
- if (!TypeContainer.AsAccessible (PropertyType, ModFlags))
- return false;
-
- if (PropertyType.IsPointer && !UnsafeOK (parent))
- return false;
-
- if (!CheckBase (parent))
- return false;
-
- //
- // Check for explicit interface implementation
- //
- if (Name.IndexOf (".") != -1){
- int pos = Name.LastIndexOf (".");
- string iface = Name.Substring (0, pos);
-
- iface_type = RootContext.LookupType (parent, iface, false, Location);
- if (iface_type == null)
- return false;
-
- short_name = Name.Substring (pos + 1);
-
- // Compute the full name that we need to export.
- Name = iface_type.FullName + "." + short_name;
- } else
- short_name = Name;
-
- // FIXME - PropertyAttributes.HasDefault ?
-
- PropertyAttributes prop_attr = PropertyAttributes.RTSpecialName |
- PropertyAttributes.SpecialName;
-
- PropertyBuilder = parent.TypeBuilder.DefineProperty (
- Name, prop_attr, PropertyType, null);
-
- if (Get != null)
- if (!DefineMethod (parent, iface_type, short_name, true))
- return false;
-
- if (Set != null)
- if (!DefineMethod (parent, iface_type, short_name, false))
- return false;
-
- //
- // HACK for the reasons exposed above
- //
- if (!TypeManager.RegisterProperty (PropertyBuilder, GetBuilder, SetBuilder)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name +
- "' already contains a definition for the property `" +
- Name + "'");
- return false;
- }
-
- return true;
- }
-
- public void Emit (TypeContainer tc)
- {
- ILGenerator ig;
- EmitContext ec;
-
- ec = new EmitContext (tc, Location, null, PropertyType, ModFlags);
- Attribute.ApplyAttributes (ec, PropertyBuilder, this, OptAttributes, Location);
-
-
- //
- // abstract or extern properties have no bodies
- //
- if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0)
- return;
-
- if (Get != null){
- ig = GetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, PropertyType, ModFlags);
-
- ec.EmitTopBlock (Get, Location);
- }
-
- if (Set != null){
- ig = SetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, null, ModFlags);
-
- ec.EmitTopBlock (Set, Location);
- }
- }
- }
-
-
- /// </summary>
- /// Gigantic workaround for lameness in SRE follows :
- /// This class derived from EventInfo and attempts to basically
- /// wrap around the EventBuilder so that FindMembers can quickly
- /// return this in it search for members
- /// </summary>
- public class MyEventBuilder : EventInfo {
-
- //
- // We use this to "point" to our Builder which is
- // not really a MemberInfo
- //
- EventBuilder MyBuilder;
-
- //
- // We "catch" and wrap these methods
- //
- MethodInfo raise, remove, add;
-
- EventAttributes attributes;
- Type declaring_type, reflected_type, event_type;
- string name;
-
- public MyEventBuilder (TypeBuilder type_builder, string name, EventAttributes event_attr, Type event_type)
- {
- MyBuilder = type_builder.DefineEvent (name, event_attr, event_type);
-
- // And now store the values in our own fields.
-
- declaring_type = type_builder;
-
- // FIXME : This is supposed to be MyBuilder but since that doesn't
- // derive from Type, I have no clue what to do with this.
- reflected_type = null;
-
- attributes = event_attr;
- this.name = name;
- this.event_type = event_type;
- }
-
- //
- // Methods that you have to override. Note that you only need
- // to "implement" the variants that take the argument (those are
- // the "abstract" methods, the others (GetAddMethod()) are
- // regular.
- //
- public override MethodInfo GetAddMethod (bool nonPublic)
- {
- return add;
- }
-
- public override MethodInfo GetRemoveMethod (bool nonPublic)
- {
- return remove;
- }
-
- public override MethodInfo GetRaiseMethod (bool nonPublic)
- {
- return raise;
- }
-
- //
- // These methods make "MyEventInfo" look like a Builder
- //
- public void SetRaiseMethod (MethodBuilder raiseMethod)
- {
- raise = raiseMethod;
- MyBuilder.SetRaiseMethod (raiseMethod);
- }
-
- public void SetRemoveOnMethod (MethodBuilder removeMethod)
- {
- remove = removeMethod;
- MyBuilder.SetRemoveOnMethod (removeMethod);
- }
-
- public void SetAddOnMethod (MethodBuilder addMethod)
- {
- add = addMethod;
- MyBuilder.SetAddOnMethod (addMethod);
- }
-
- public void SetCustomAttribute (CustomAttributeBuilder cb)
- {
- MyBuilder.SetCustomAttribute (cb);
- }
-
- public override object [] GetCustomAttributes (bool inherit)
- {
- // FIXME : There's nothing which can be seemingly done here because
- // we have no way of getting at the custom attribute objects of the
- // EventBuilder !
- return null;
- }
-
- public override object [] GetCustomAttributes (Type t, bool inherit)
- {
- // FIXME : Same here !
- return null;
- }
-
- public override bool IsDefined (Type t, bool b)
- {
- return true;
- }
-
- public override EventAttributes Attributes {
- get {
- return attributes;
- }
- }
-
- public override string Name {
- get {
- return name;
- }
- }
-
- public override Type DeclaringType {
- get {
- return declaring_type;
- }
- }
-
- public override Type ReflectedType {
- get {
- return reflected_type;
- }
- }
-
- public Type EventType {
- get {
- return event_type;
- }
- }
- }
-
- public class Event : MemberCore {
-
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.VIRTUAL |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.UNSAFE |
- Modifiers.ABSTRACT;
-
- public readonly string Type;
- public readonly Object Initializer;
- public readonly Block Add;
- public readonly Block Remove;
- public MyEventBuilder EventBuilder;
- public FieldBuilder FieldBuilder;
- public Attributes OptAttributes;
-
- Type EventType;
- MethodBuilder AddBuilder, RemoveBuilder;
-
-
- public Event (string type, string name, Object init, int flags, Block add_block,
- Block rem_block, Attributes attrs, Location loc)
- : base (name, loc)
- {
- Type = type;
- Initializer = init;
- ModFlags = Modifiers.Check (AllowedModifiers, flags, Modifiers.PRIVATE, loc);
- Add = add_block;
- Remove = rem_block;
- OptAttributes = attrs;
- }
-
- public override bool Define (TypeContainer parent)
- {
- if (!parent.MethodModifiersValid (ModFlags, Name, Location))
- return false;
-
- MethodAttributes m_attr = Modifiers.MethodAttr (ModFlags);
- EventAttributes e_attr = EventAttributes.RTSpecialName | EventAttributes.SpecialName;
-
- EventType = RootContext.LookupType (parent, Type, false, Location);
- if (EventType == null)
- return false;
-
- if (!TypeContainer.AsAccessible (EventType, ModFlags))
- return false;
-
- if (EventType.IsPointer && !UnsafeOK (parent))
- return false;
-
- if (!EventType.IsSubclassOf (TypeManager.delegate_type)) {
- Report.Error (66, Location, "'" + parent.Name + "." + Name +
- "' : event must be of a delegate type");
- return false;
- }
-
- Type [] parameters = new Type [1];
- parameters [0] = EventType;
-
- EventBuilder = new MyEventBuilder (parent.TypeBuilder, Name, e_attr, EventType);
-
- if (Add == null && Remove == null)
- FieldBuilder = parent.TypeBuilder.DefineField (Name, EventType, FieldAttributes.Private);
-
- //
- // Now define the accessors
- //
-
- AddBuilder = parent.TypeBuilder.DefineMethod (
- "add_" + Name, m_attr, null, parameters);
- AddBuilder.DefineParameter (1, ParameterAttributes.None, "value");
- EventBuilder.SetAddOnMethod (AddBuilder);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- Parameter [] parms = new Parameter [1];
- parms [0] = new Parameter (Type, "value", Parameter.Modifier.NONE, null);
- InternalParameters ip = new InternalParameters (
- parent, new Parameters (parms, null, Location));
-
- if (!TypeManager.RegisterMethod (AddBuilder, ip, parameters)) {
- Report.Error (111, Location,
- "Class `" + parent.Name + "' already contains a definition with the " +
- "same return value and parameter types for the " +
- "'add' method of event `" + Name + "'");
- return false;
- }
-
- RemoveBuilder = parent.TypeBuilder.DefineMethod (
- "remove_" + Name, m_attr, null, parameters);
- RemoveBuilder.DefineParameter (1, ParameterAttributes.None, "value");
- EventBuilder.SetRemoveOnMethod (RemoveBuilder);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
-
- if (!TypeManager.RegisterMethod (RemoveBuilder, ip, parameters)) {
- Report.Error (111, Location,
- "Class `" + parent.Name + "' already contains a definition with the " +
- "same return value and parameter types for the " +
- "'remove' method of event `" + Name + "'");
- return false;
- }
-
- if (!TypeManager.RegisterEvent (EventBuilder, AddBuilder, RemoveBuilder)) {
- Report.Error (111, Location,
- "Class `" + parent.Name +
- "' already contains a definition for the event `" +
- Name + "'");
- return false;
- }
-
- return true;
- }
-
- void EmitDefaultMethod (EmitContext ec, bool is_add)
- {
- ILGenerator ig = ec.ig;
- MethodInfo method = null;
-
- if (is_add)
- method = TypeManager.delegate_combine_delegate_delegate;
- else
- method = TypeManager.delegate_remove_delegate_delegate;
-
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Ldfld, (FieldInfo) FieldBuilder);
- ig.Emit (OpCodes.Ldarg_1);
- ig.Emit (OpCodes.Call, method);
- ig.Emit (OpCodes.Castclass, EventType);
- ig.Emit (OpCodes.Stfld, (FieldInfo) FieldBuilder);
- ig.Emit (OpCodes.Ret);
- }
-
- public void Emit (TypeContainer tc)
- {
- EmitContext ec;
- ILGenerator ig;
-
- ig = AddBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, TypeManager.void_type, ModFlags);
-
- if (Add != null)
- ec.EmitTopBlock (Add, Location);
- else
- EmitDefaultMethod (ec, true);
-
- ig = RemoveBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, TypeManager.void_type, ModFlags);
-
- if (Remove != null)
- ec.EmitTopBlock (Remove, Location);
- else
- EmitDefaultMethod (ec, false);
-
- ec = new EmitContext (tc, Location, null, EventType, ModFlags);
- Attribute.ApplyAttributes (ec, EventBuilder, this, OptAttributes, Location);
-
- }
-
- }
-
- //
- // FIXME: This does not handle:
- //
- // int INTERFACENAME [ args ]
- //
- // Only:
- //
- // int this [ args ]
-
- public class Indexer : MemberCore {
-
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.VIRTUAL |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.UNSAFE |
- Modifiers.ABSTRACT;
-
- public readonly string Type;
- public readonly string InterfaceType;
- public readonly Parameters FormalParameters;
- public readonly Block Get;
- public readonly Block Set;
- public Attributes OptAttributes;
- public MethodBuilder GetBuilder;
- public MethodBuilder SetBuilder;
- public PropertyBuilder PropertyBuilder;
- public Type IndexerType;
-
- public Indexer (string type, string int_type, int flags, Parameters parms,
- Block get_block, Block set_block, Attributes attrs, Location loc)
- : base ("", loc)
- {
-
- Type = type;
- InterfaceType = int_type;
- ModFlags = Modifiers.Check (AllowedModifiers, flags, Modifiers.PRIVATE, loc);
- FormalParameters = parms;
- Get = get_block;
- Set = set_block;
- OptAttributes = attrs;
- }
-
- void DefineMethod (TypeContainer parent, Type iface_type,
- Type ret_type, string name,
- Type [] parameters, bool is_get)
- {
- MethodAttributes attr = Modifiers.MethodAttr (ModFlags);
- MethodInfo implementing;
-
- implementing = parent.IsInterfaceMethod (
- iface_type, name, ret_type, parameters, false);
-
- //
- // Setting null inside this block will trigger a more
- // verbose error reporting for missing interface implementations
- //
- // The "candidate" function has been flagged already
- // but it wont get cleared
- //
- if (implementing != null){
- if (iface_type == null){
- if ((ModFlags & Modifiers.PUBLIC) == 0)
- implementing = null;
- if ((ModFlags & Modifiers.STATIC) != 0)
- implementing = null;
- } else {
- if((ModFlags&(Modifiers.PUBLIC | Modifiers.ABSTRACT)) != 0){
- Report.Error (
- 106, Location,
- "`public' or `abstract' modifiers are not "+
- "allowed in explicit interface declarations"
- );
- implementing = null;
- }
- }
- }
- if (implementing != null){
- attr |=
- MethodAttributes.Virtual |
- // removed newslot
- MethodAttributes.HideBySig;
-
- // If an interface implementing, then we can set final.
- if (((attr & MethodAttributes.Abstract) == 0) &&
- implementing.DeclaringType.IsInterface)
- attr |= MethodAttributes.Final;
-
- //
- // clear the pending flag
- //
- parent.IsInterfaceMethod (
- iface_type, name, ret_type, parameters, true);
- }
-
- //
- // If this is not an explicit interface implementation,
- // clear implementing, as it is only used for explicit
- // interface implementation
- //
- if (Name.IndexOf (".") == -1)
- implementing = null;
-
- if (is_get){
-
- string meth_name = "get_Item";
- if (iface_type != null)
- meth_name = iface_type + ".get_Item";
-
- GetBuilder = parent.TypeBuilder.DefineMethod (
- meth_name, attr, IndexerType, parameters);
-
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- GetBuilder, implementing);
-
-
- PropertyBuilder.SetGetMethod (GetBuilder);
- } else {
-
- string meth_name = "set_Item";
-
- if (iface_type != null)
- meth_name = iface_type + ".set_Item";
-
- SetBuilder = parent.TypeBuilder.DefineMethod (
- meth_name, attr, null, parameters);
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- SetBuilder, implementing);
-
- PropertyBuilder.SetSetMethod (SetBuilder);
- }
- }
-
- public override bool Define (TypeContainer parent)
- {
- PropertyAttributes prop_attr =
- PropertyAttributes.RTSpecialName |
- PropertyAttributes.SpecialName;
- bool error = false;
-
- IndexerType = RootContext.LookupType (parent, Type, false, Location);
- Type [] parameters = FormalParameters.GetParameterInfo (parent);
-
- // Check if the return type and arguments were correct
- if (IndexerType == null || parameters == null)
- return false;
-
- if (!parent.MethodModifiersValid (ModFlags, InterfaceType == null ?
- "this" : InterfaceType, Location))
- return false;
-
- //
- // verify accessibility and unsafe pointers
- //
- if (!TypeContainer.AsAccessible (IndexerType, ModFlags))
- return false;
-
- if (IndexerType.IsPointer && !UnsafeOK (parent))
- return false;
-
- foreach (Type partype in parameters){
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- error = true;
- if (partype.IsPointer && !UnsafeOK (parent))
- error = true;
- }
-
- if (error)
- return false;
-
- Type iface_type = null;
-
- if (InterfaceType != null){
- iface_type = RootContext.LookupType (parent, InterfaceType, false, Location);
- if (iface_type == null)
- return false;
- }
-
-
- PropertyBuilder = parent.TypeBuilder.DefineProperty (
- TypeManager.IndexerPropertyName (parent.TypeBuilder),
- prop_attr, IndexerType, parameters);
-
- if (Get != null){
- DefineMethod (parent, iface_type, IndexerType, "get_Item", parameters, true);
- InternalParameters pi = new InternalParameters (parent, FormalParameters);
- if (!TypeManager.RegisterMethod (GetBuilder, pi, parameters)) {
- Report.Error (111, Location,
- "Class `" + parent.Name +
- "' already contains a definition with the " +
- "same return value and parameter types for the " +
- "'get' indexer");
- return false;
- }
- }
-
- if (Set != null){
- int top = parameters.Length;
- Type [] set_pars = new Type [top + 1];
- parameters.CopyTo (set_pars, 0);
- set_pars [top] = IndexerType;
-
- Parameter [] fixed_parms = FormalParameters.FixedParameters;
-
- Parameter [] tmp = new Parameter [fixed_parms.Length + 1];
-
- fixed_parms.CopyTo (tmp, 0);
- tmp [fixed_parms.Length] = new Parameter (
- Type, "value", Parameter.Modifier.NONE, null);
-
- Parameters set_formal_params = new Parameters (tmp, null, Location);
-
- DefineMethod (
- parent, iface_type, TypeManager.void_type,
- "set_Item", set_pars, false);
-
- InternalParameters ip = new InternalParameters (parent, set_formal_params);
-
- if (!TypeManager.RegisterMethod (SetBuilder, ip, set_pars)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name + "' already contains a " +
- "definition with the " +
- "same return value and parameter types for the " +
- "'set' indexer");
- return false;
- }
- }
-
- //
- // Now name the parameters
- //
- Parameter [] p = FormalParameters.FixedParameters;
- if (p != null) {
- int i;
-
- for (i = 0; i < p.Length; ++i) {
- if (Get != null)
- GetBuilder.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
-
- if (Set != null)
- SetBuilder.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
- }
-
- if (Set != null)
- SetBuilder.DefineParameter (
- i + 1, ParameterAttributes.None, "value");
-
- if (i != parameters.Length) {
- Parameter array_param = FormalParameters.ArrayParameter;
- SetBuilder.DefineParameter (i + 1, array_param.Attributes,
- array_param.Name);
- }
- }
-
- TypeManager.RegisterProperty (PropertyBuilder, GetBuilder, SetBuilder);
-
- return true;
- }
-
- public void Emit (TypeContainer tc)
- {
- ILGenerator ig;
- EmitContext ec;
-
- ec = new EmitContext (tc, Location, null, IndexerType, ModFlags);
- Attribute.ApplyAttributes (ec, PropertyBuilder, this, OptAttributes, Location);
-
- if (Get != null){
- ig = GetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, IndexerType, ModFlags);
-
- ec.EmitTopBlock (Get, Location);
- }
-
- if (Set != null){
- ig = SetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, null, ModFlags);
-
- ec.EmitTopBlock (Set, Location);
- }
- }
- }
-
- public class Operator : MemberCore {
-
- const int AllowedModifiers =
- Modifiers.PUBLIC |
- Modifiers.UNSAFE |
- Modifiers.STATIC;
-
- const int RequiredModifiers =
- Modifiers.PUBLIC |
- Modifiers.STATIC;
-
- public enum OpType : byte {
-
- // Unary operators
- LogicalNot,
- OnesComplement,
- Increment,
- Decrement,
- True,
- False,
-
- // Unary and Binary operators
- Addition,
- Subtraction,
-
- UnaryPlus,
- UnaryNegation,
-
- // Binary operators
- Multiply,
- Division,
- Modulus,
- BitwiseAnd,
- BitwiseOr,
- ExclusiveOr,
- LeftShift,
- RightShift,
- Equality,
- Inequality,
- GreaterThan,
- LessThan,
- GreaterThanOrEqual,
- LessThanOrEqual,
-
- // Implicit and Explicit
- Implicit,
- Explicit
- };
-
- public readonly OpType OperatorType;
- public readonly string ReturnType;
- public readonly string FirstArgType;
- public readonly string FirstArgName;
- public readonly string SecondArgType;
- public readonly string SecondArgName;
- public readonly Block Block;
- public Attributes OptAttributes;
- public MethodBuilder OperatorMethodBuilder;
-
- public string MethodName;
- public Method OperatorMethod;
-
- public Operator (OpType type, string ret_type, int flags, string arg1type, string arg1name,
- string arg2type, string arg2name, Block block, Attributes attrs, Location loc)
- : base ("", loc)
- {
- OperatorType = type;
- ReturnType = ret_type;
- ModFlags = Modifiers.Check (AllowedModifiers, flags, Modifiers.PUBLIC, loc);
- FirstArgType = arg1type;
- FirstArgName = arg1name;
- SecondArgType = arg2type;
- SecondArgName = arg2name;
- Block = block;
- OptAttributes = attrs;
- }
-
- string Prototype (TypeContainer parent)
- {
- return parent.Name + ".operator " + OperatorType + " (" + FirstArgType + "," +
- SecondArgType + ")";
- }
-
- public override bool Define (TypeContainer parent)
- {
- int length = 1;
- MethodName = "op_" + OperatorType;
-
- if (SecondArgType != null)
- length = 2;
-
- Parameter [] param_list = new Parameter [length];
-
- if ((ModFlags & RequiredModifiers) != RequiredModifiers){
- Report.Error (
- 558, Location,
- "User defined operators `" +
- Prototype (parent) +
- "' must be declared static and public");
- return false;
- }
-
- param_list[0] = new Parameter (FirstArgType, FirstArgName,
- Parameter.Modifier.NONE, null);
- if (SecondArgType != null)
- param_list[1] = new Parameter (SecondArgType, SecondArgName,
- Parameter.Modifier.NONE, null);
-
- OperatorMethod = new Method (ReturnType, ModFlags, MethodName,
- new Parameters (param_list, null, Location),
- OptAttributes, Mono.CSharp.Location.Null);
-
- OperatorMethod.Define (parent);
-
- if (OperatorMethod.MethodBuilder == null)
- return false;
-
- OperatorMethodBuilder = OperatorMethod.MethodBuilder;
-
- Type [] param_types = OperatorMethod.ParameterTypes (parent);
- Type declaring_type = OperatorMethodBuilder.DeclaringType;
- Type return_type = OperatorMethod.GetReturnType (parent);
- Type first_arg_type = param_types [0];
-
- // Rules for conversion operators
-
- if (OperatorType == OpType.Implicit || OperatorType == OpType.Explicit) {
- if (first_arg_type == return_type && first_arg_type == declaring_type){
- Report.Error (
- 555, Location,
- "User-defined conversion cannot take an object of the " +
- "enclosing type and convert to an object of the enclosing" +
- " type");
- return false;
- }
-
- if (first_arg_type != declaring_type && return_type != declaring_type){
- Report.Error (
- 556, Location,
- "User-defined conversion must convert to or from the " +
- "enclosing type");
- return false;
- }
-
- if (first_arg_type == TypeManager.object_type ||
- return_type == TypeManager.object_type){
- Report.Error (
- -8, Location,
- "User-defined conversion cannot convert to or from " +
- "object type");
- return false;
- }
-
- if (first_arg_type.IsInterface || return_type.IsInterface){
- Report.Error (
- 552, Location,
- "User-defined conversion cannot convert to or from an " +
- "interface type");
- return false;
- }
-
- if (first_arg_type.IsSubclassOf (return_type) ||
- return_type.IsSubclassOf (first_arg_type)){
- Report.Error (
- -10, Location,
- "User-defined conversion cannot convert between types " +
- "that derive from each other");
- return false;
- }
- } else if (SecondArgType == null) {
- // Checks for Unary operators
-
- if (first_arg_type != declaring_type){
- Report.Error (
- 562, Location,
- "The parameter of a unary operator must be the " +
- "containing type");
- return false;
- }
-
- if (OperatorType == OpType.Increment || OperatorType == OpType.Decrement) {
- if (return_type != declaring_type){
- Report.Error (
- 559, Location,
- "The parameter and return type for ++ and -- " +
- "must be the containing type");
- return false;
- }
-
- }
-
- if (OperatorType == OpType.True || OperatorType == OpType.False) {
- if (return_type != TypeManager.bool_type){
- Report.Error (
- 215, Location,
- "The return type of operator True or False " +
- "must be bool");
- return false;
- }
- }
-
- } else {
- // Checks for Binary operators
-
- if (first_arg_type != declaring_type &&
- param_types [1] != declaring_type){
- Report.Error (
- 563, Location,
- "One of the parameters of a binary operator must " +
- "be the containing type");
- return false;
- }
- }
-
- return true;
- }
-
- public void Emit (TypeContainer parent)
- {
- EmitContext ec = new EmitContext (parent, Location, null, null, ModFlags);
- Attribute.ApplyAttributes (ec, OperatorMethodBuilder, this, OptAttributes, Location);
-
- OperatorMethod.Block = Block;
- OperatorMethod.Emit (parent);
- }
- }
-
- //
- // This is used to compare method signatures
- //
- struct MethodSignature {
- public string Name;
- public Type RetType;
- public Type [] Parameters;
-
- public MethodSignature (string name, Type ret_type, Type [] parameters)
- {
- Name = name;
- RetType = ret_type;
- Parameters = parameters;
- }
-
- public override int GetHashCode ()
- {
- return Name.GetHashCode ();
- }
-
- public override bool Equals (Object o)
- {
- MethodSignature other = (MethodSignature) o;
-
- if (other.Name != Name)
- return false;
-
- if (other.RetType != RetType)
- return false;
-
- if (Parameters == null){
- if (other.Parameters == null)
- return true;
- return false;
- }
-
- if (other.Parameters == null)
- return false;
-
- int c = Parameters.Length;
- if (other.Parameters.Length != c)
- return false;
-
- for (int i = 0; i < c; i++)
- if (other.Parameters [i] != Parameters [i])
- return false;
-
- return true;
- }
- }
-}
diff --git a/mcs/mcs/codegen.cs b/mcs/mcs/codegen.cs
deleted file mode 100755
index d64f9241514..00000000000
--- a/mcs/mcs/codegen.cs
+++ /dev/null
@@ -1,309 +0,0 @@
-//
-// codegen.cs: The code generator
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Code generator class.
- /// </summary>
- public class CodeGen {
- AppDomain current_domain;
- AssemblyBuilder assembly_builder;
- ModuleBuilder module_builder;
-
- public static string Basename (string name)
- {
- int pos = name.LastIndexOf ("/");
-
- if (pos != -1)
- return name.Substring (pos + 1);
-
- pos = name.LastIndexOf ("\\");
- if (pos != -1)
- return name.Substring (pos + 1);
-
- return name;
- }
-
- string TrimExt (string name)
- {
- int pos = name.LastIndexOf (".");
-
- return name.Substring (0, pos);
- }
-
- public string FileName;
-
- public CodeGen (string name, string output)
- {
- AssemblyName an;
-
- FileName = output;
- an = new AssemblyName ();
- an.Name = TrimExt (Basename (name));
- current_domain = AppDomain.CurrentDomain;
- assembly_builder = current_domain.DefineDynamicAssembly (
- an, AssemblyBuilderAccess.RunAndSave);
-
- //
- // Pass a path-less name to DefineDynamicModule. Wonder how
- // this copes with output in different directories then.
- // FIXME: figure out how this copes with --output /tmp/blah
- //
- module_builder = assembly_builder.DefineDynamicModule (
- Basename (name), Basename (output));
-
- }
-
- public AssemblyBuilder AssemblyBuilder {
- get {
- return assembly_builder;
- }
- }
-
- public ModuleBuilder ModuleBuilder {
- get {
- return module_builder;
- }
- }
-
- public void Save (string name)
- {
- try {
- assembly_builder.Save (Basename (name));
- } catch (System.IO.IOException io){
- Report.Error (16, "Coult not write to file `"+name+"', cause: " + io.Message);
- }
- }
- }
-
- /// <summary>
- /// An Emit Context is created for each body of code (from methods,
- /// properties bodies, indexer bodies or constructor bodies)
- /// </summary>
- public class EmitContext {
- public TypeContainer TypeContainer;
- public ILGenerator ig;
- public bool CheckState;
-
- /// <summary>
- /// Whether we are emitting code inside a static or instance method
- /// </summary>
- public bool IsStatic;
-
- /// <summary>
- /// The value that is allowed to be returned or NULL if there is no
- /// return type.
- /// </summary>
- public Type ReturnType;
-
- /// <summary>
- /// Points to the Type (extracted from the TypeContainer) that
- /// declares this body of code
- /// </summary>
- public Type ContainerType;
-
- /// <summary>
- /// Whether this is generating code for a constructor
- /// </summary>
- public bool IsConstructor;
-
- /// <summary>
- /// Keeps track of the Type to LocalBuilder temporary storage created
- /// to store structures (used to compute the address of the structure
- /// value on structure method invocations)
- /// </summary>
- public Hashtable temporary_storage;
-
- public Block CurrentBlock;
-
- /// <summary>
- /// The location where we store the return value.
- /// </summary>
- LocalBuilder return_value;
-
- /// <summary>
- /// The location where return has to jump to return the
- /// value
- /// </summary>
- public Label ReturnLabel;
-
- /// <summary>
- /// Whether we are in a Finally block
- /// </summary>
- public bool InFinally;
-
- /// <summary>
- /// Whether we are in a Try block
- /// </summary>
- public bool InTry;
-
- /// <summary>
- /// Whether we are in a Catch block
- /// </summary>
- public bool InCatch;
-
- /// <summary>
- /// Whether we are inside an unsafe block
- /// </summary>
- public bool InUnsafe;
-
- /// <summary>
- /// Location for this EmitContext
- /// </summary>
- public Location loc;
-
- public EmitContext (TypeContainer parent, Location l, ILGenerator ig,
- Type return_type, int code_flags, bool is_constructor)
- {
- this.ig = ig;
-
- TypeContainer = parent;
- CheckState = RootContext.Checked;
- IsStatic = (code_flags & Modifiers.STATIC) != 0;
- ReturnType = return_type;
- IsConstructor = is_constructor;
- CurrentBlock = null;
- ContainerType = parent.TypeBuilder;
- InUnsafe = ((parent.ModFlags | code_flags) & Modifiers.UNSAFE) != 0;
- loc = l;
-
- if (ReturnType == TypeManager.void_type)
- ReturnType = null;
- }
-
- public EmitContext (TypeContainer parent, Location l, ILGenerator ig,
- Type return_type, int code_flags)
- : this (parent, l, ig, return_type, code_flags, false)
- {
- }
-
- public void EmitTopBlock (Block block, Location loc)
- {
- bool has_ret = false;
-
-// Console.WriteLine ("Emitting: " + loc);
- if (block != null){
- int errors = Report.Errors;
-
- block.EmitMeta (this, block, 0);
-
- if (Report.Errors == errors){
- has_ret = block.Emit (this);
-
- if (Report.Errors == errors){
- if (RootContext.WarningLevel >= 3)
- block.UsageWarning ();
- }
- }
- }
-
- if (ReturnType != null && !has_ret){
- //
- // FIXME: we need full flow analysis to implement this
- // correctly and emit an error instead of a warning.
- //
- //
- Report.Error (161, loc, "Not all code paths return a value");
- return;
- }
-
- if (return_value != null){
- ig.MarkLabel (ReturnLabel);
- ig.Emit (OpCodes.Ldloc, return_value);
- ig.Emit (OpCodes.Ret);
- } else {
- if (!has_ret){
- if (!InTry)
- ig.Emit (OpCodes.Ret);
- }
- }
- }
-
- /// <summary>
- /// Returns a temporary storage for a variable of type t as
- /// a local variable in the current body.
- /// </summary>
- public LocalBuilder GetTemporaryStorage (Type t)
- {
- LocalBuilder location;
-
- if (temporary_storage != null){
- location = (LocalBuilder) temporary_storage [t];
- if (location != null)
- return location;
- }
-
- location = ig.DeclareLocal (t);
-
- return location;
- }
-
- public void FreeTemporaryStorage (LocalBuilder b)
- {
- // Empty for now.
- }
-
- /// <summary>
- /// Current loop begin and end labels.
- /// </summary>
- public Label LoopBegin, LoopEnd;
-
- /// <summary>
- /// Whether we are inside a loop and break/continue are possible.
- /// </summary>
- public bool InLoop;
-
- /// <summary>
- /// Default target in a switch statement. Only valid if
- /// InSwitch is true
- /// </summary>
- public Label DefaultTarget;
-
- /// <summary>
- /// If this is non-null, points to the current switch statement
- /// </summary>
- public Switch Switch;
-
- /// <summary>
- /// ReturnValue creates on demand the LocalBuilder for the
- /// return value from the function. By default this is not
- /// used. This is only required when returns are found inside
- /// Try or Catch statements.
- /// </summary>
- public LocalBuilder TemporaryReturn ()
- {
- if (return_value == null){
- return_value = ig.DeclareLocal (ReturnType);
- ReturnLabel = ig.DefineLabel ();
- }
-
- return return_value;
- }
-
- /// <summary>
- /// A dynamic This that is shared by all variables in a emitcontext.
- /// Created on demand.
- /// </summary>
- public Expression my_this;
- public Expression This {
- get {
- if (my_this == null)
- my_this = new This (loc).Resolve (this);
-
- return my_this;
- }
- }
- }
-}
diff --git a/mcs/mcs/compiler.csproj b/mcs/mcs/compiler.csproj
deleted file mode 100755
index 6626d6e9ecf..00000000000
--- a/mcs/mcs/compiler.csproj
+++ /dev/null
@@ -1,233 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "compiler"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Exe"
- RootNamespace = "CIR"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "true"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- />
- <Reference
- Name = "System.Web.Services"
- AssemblyName = "System.Web.Services"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "assign.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "attribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "class.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "codegen.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "const.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "constant.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "cs-parser.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "cs-tokenizer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "decl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "delegate.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "driver.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ecore.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "enum.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "expression.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "genericparser.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "interface.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "literal.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "location.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "modifiers.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "namespace.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "parameter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "parameterCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "report.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "rootcontext.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "statement.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "statementCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "support.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "tree.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "typemanager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <Folder
- RelPath = "Web References\"
- WebReferences = "TRUE"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/mcs/compiler.csproj.user b/mcs/mcs/compiler.csproj.user
deleted file mode 100755
index 3ad35158f42..00000000000
--- a/mcs/mcs/compiler.csproj.user
+++ /dev/null
@@ -1,48 +0,0 @@
-<VisualStudioProject>
- <CSHARP>
- <Build>
- <Settings ReferencePath = "" >
- <Config
- Name = "Debug"
- EnableASPDebugging = "false"
- EnableASPXDebugging = "false"
- EnableUnmanagedDebugging = "false"
- EnableSQLServerDebugging = "false"
- RemoteDebugEnabled = "false"
- RemoteDebugMachine = ""
- StartAction = "Project"
- StartArguments = "@response"
- StartPage = ""
- StartProgram = ""
- StartURL = ""
- StartWorkingDirectory = "\mono\mcs\mcs"
- StartWithIE = "false"
- />
- <Config
- Name = "Release"
- EnableASPDebugging = "false"
- EnableASPXDebugging = "false"
- EnableUnmanagedDebugging = "false"
- EnableSQLServerDebugging = "false"
- RemoteDebugEnabled = "false"
- RemoteDebugMachine = ""
- StartAction = "Project"
- StartArguments = ""
- StartPage = ""
- StartProgram = ""
- StartURL = ""
- StartWorkingDirectory = ""
- StartWithIE = "false"
- />
- </Settings>
- </Build>
- <OtherProjectSettings
- CopyProjectDestinationFolder = ""
- CopyProjectUncPath = ""
- CopyProjectOption = "0"
- ProjectView = "ProjectFiles"
- ProjectTrust = "0"
- />
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/mcs/compiler.doc b/mcs/mcs/compiler.doc
deleted file mode 100644
index fafb61ed531..00000000000
--- a/mcs/mcs/compiler.doc
+++ /dev/null
@@ -1,114 +0,0 @@
-Compiler operation
-
-The compiler has a number of phases:
-
-* Parsing.
-
- Initially the compiler parses all the source files and keeps a
- parsed representation in memory. Very syntax error checking
- is performed at this point.
-
- The compiler stores the information in classes whose names
- represent the language construct, for example, the "if"
- construct is stored in an `If' class. A class is stored in a
- `Class'.
-
-* The TypeManager
-
- The TypeManager loads all the assemblies that were referenced
- by the programmer. The CLR type system is used as our
- repository for types defined as well.
-
- So the same interface that is used to query the types,
- properties and flags about system types is the same interface
- that we use for our types.
-
- As we work our way through the code generation and semantic
- analysis, new types are entered into the Type system through
- the use of System.Reflection.Emit. The TypeManager will
- lookup types on both the user defined types and on the system
- defined ones.
-
- So special care has to be used. The order in which we
- proceeed from here is important.
-
-* Base class resolution and type definition.
-
- Once the parsing has happened, the compiler resolves the
- inheritance tree for interfaces. This is done recursively
- and we catch recursive interface definitions here.
-
- After this is done, we continue on with classes. Classes have
- can have an optional "parent" inherit from or the implicit
- System.Object class (for normal builds, builds with /nostdlib
- will allow you to compile class System.Object with no parent).
-
- At this point we do some error checking and verify that the
- inherits/implements section of a class is correct (since we
- have previously built the interface inheritance).
-
- By the time we are done, all classes, structs and interfaces
- have been created using System.Reflection.Emit and registered
- with the Type Manager.
-
- This allows us to define fields and resolve argument names for
- methods, properties, indexers and events.
-
-* Field generation
-
- Fields are generated next, we go through all the type
- containers (classes and structs) and enter the fields into
- their types.
-
-* Method, Properties, Indexers and events definitions
-
- Now all the methods, constructors, properties, indexers and
- events are entered. They are only `defined' using
- System.Reflection.Emit. No code generation will happen until
- everything has been entered into System.Reflection.Emit.
-
- This is important because to actually generate code we need to
- know everything about the environment in which the code is
- being generated.
-
-* Code Generation
-
- At this point all the definitions have been entered into the
- type manager through System.Reflection.Emit. We can now use
- System.Reflection to query all the information about the
- types.
-
- Your normal semantic analysis and code generation phase lives
- here.
-
-* Statements
-
- Most of the statements are handled in the codegen.cs file.
-
-* Expressions
-
-* Error reporting
-
- We should try to use the `Report.Error' and `Report.Warning'
- classes which are part of the RootContext (there is even a
- property to access it).
-
- Error reporting should try to use the same codes that the
- Microsoft compiler uses (if only so we can track which errors
- we handle and which ones we dont).
-
- If there is an error which is specific to MSC, use negative
- numbers, and register the number in mcs/errors/errors.txt
-
- Try to write a test case for any error that you run into the
- code of the compiler if there is none already.
-
- Put your test case in a file called csNNNN.cs in the
- mcs/errors directory, and have the first two lines be:
-
- // csNNNN.cs: This is the description.
- // Line: XXX
-
- Where `XXX' is the line where the error ocurrs. We will later
- use this as a regression test suite for catching errors in the
- compiler.
diff --git a/mcs/mcs/compiler.sln b/mcs/mcs/compiler.sln
deleted file mode 100755
index 3b94d64a492..00000000000
--- a/mcs/mcs/compiler.sln
+++ /dev/null
@@ -1,21 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "compiler", "compiler.csproj", "{896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Debug.ActiveCfg = Debug|.NET
- {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Debug.Build.0 = Debug|.NET
- {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Release.ActiveCfg = Release|.NET
- {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Release.Build.0 = Release|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/mcs/mcs/const.cs b/mcs/mcs/const.cs
deleted file mode 100755
index e526fff11c6..00000000000
--- a/mcs/mcs/const.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// const.cs: Constant declarations.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-
-//
-// This is needed because the following situation arises:
-//
-// The FieldBuilder is declared with the real type for an enumeration
-//
-// When we attempt to set the value for the constant, the FieldBuilder.SetConstant
-// function aborts because it requires its argument to be of the same type
-//
-
-namespace Mono.CSharp {
-
- using System;
- using System.Reflection;
- using System.Reflection.Emit;
- using System.Collections;
-
- public class Const : MemberCore {
- public readonly string ConstantType;
- public Expression Expr;
- public Attributes OptAttributes;
- public FieldBuilder FieldBuilder;
-
- object ConstantValue = null;
- Type type;
-
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE;
-
- public Const (string constant_type, string name, Expression expr, int mod_flags,
- Attributes attrs, Location loc)
- : base (name, loc)
- {
- ConstantType = constant_type;
- Name = name;
- Expr = expr;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PRIVATE, loc);
- OptAttributes = attrs;
- }
-
- public FieldAttributes FieldAttr {
- get {
- return FieldAttributes.Literal | FieldAttributes.Static |
- Modifiers.FieldAttr (ModFlags) ;
- }
- }
-
-#if DEBUG
- void dump_tree (Type t)
- {
- Console.WriteLine ("Dumping hierarchy");
- while (t != null){
- Console.WriteLine (" " + t.FullName + " " +
- (t.GetType ().IsEnum ? "yes" : "no"));
- t = t.BaseType;
- }
- }
-#endif
-
- /// <summary>
- /// Defines the constant in the @parent
- /// </summary>
- public override bool Define (TypeContainer parent)
- {
- type = RootContext.LookupType (parent, ConstantType, true, Location);
-
- if (type == null)
- return false;
-
- if (!TypeManager.IsBuiltinType (type) &&
- (!type.IsSubclassOf (TypeManager.enum_type))) {
- Report.Error (
- -3, Location,
- "Constant type is not valid (only system types are allowed)");
- return false;
- }
-
- Type ptype = parent.TypeBuilder.BaseType;
-
- if (ptype != null) {
- MemberInfo [] mi = TypeContainer.FindMembers (
- ptype, MemberTypes.Field, BindingFlags.Public,
- Type.FilterName, Name);
-
- if (mi == null || mi.Length == 0)
- if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- } else if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- FieldBuilder = parent.TypeBuilder.DefineField (Name, type, FieldAttr);
-
- TypeManager.RegisterConstant (FieldBuilder, this);
-
- return true;
- }
-
- /// <summary>
- /// Looks up the value of a constant field. Defines it if it hasn't
- /// already been. Similar to LookupEnumValue in spirit.
- /// </summary>
- public object LookupConstantValue (EmitContext ec)
- {
- if (ConstantValue != null)
- return ConstantValue;
-
- Expr = Expr.Resolve (ec);
-
- if (Expr == null) {
- Report.Error (150, Location, "A constant value is expected");
- return null;
- }
-
- if (!(Expr is Constant)) {
- Report.Error (150, Location, "A constant value is expected");
- return null;
- }
-
- ConstantValue = ((Constant) Expr).GetValue ();
-
- if (type.IsEnum){
- //
- // This sadly does not work for our user-defined enumerations types ;-(
- //
- try {
- ConstantValue = System.Enum.ToObject (
- type, ConstantValue);
- } catch (ArgumentException){
- Report.Error (
- -16, Location,
- ".NET SDK 1.0 does not permit to create the constant "+
- " field from a user-defined enumeration");
- }
- }
-
- FieldBuilder.SetConstant (ConstantValue);
-
- if (!TypeManager.RegisterFieldValue (FieldBuilder, ConstantValue))
- return null;
-
- return ConstantValue;
- }
-
-
- /// <summary>
- /// Emits the field value by evaluating the expression
- /// </summary>
- public void EmitConstant (TypeContainer parent)
- {
- EmitContext ec = new EmitContext (parent, Location, null, type, ModFlags);
- LookupConstantValue (ec);
-
- return;
- }
- }
-}
-
-
diff --git a/mcs/mcs/constant.cs b/mcs/mcs/constant.cs
deleted file mode 100755
index 6fa4c625233..00000000000
--- a/mcs/mcs/constant.cs
+++ /dev/null
@@ -1,504 +0,0 @@
-//
-// constant.cs: Constants.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-
-namespace Mono.CSharp {
-
- using System;
- using System.Reflection.Emit;
-
- /// <summary>
- /// Base class for constants and literals.
- /// </summary>
- public abstract class Constant : Expression {
-
- protected Constant ()
- {
- eclass = ExprClass.Value;
- }
-
- /// <remarks>
- /// This is different from ToString in that ToString
- /// is supposed to be there for debugging purposes,
- /// and is not guaranteed to be useful for anything else,
- /// AsString() will provide something that can be used
- /// for round-tripping C# code. Maybe it can be used
- /// for IL assembly as well.
- /// </remarks>
- public abstract string AsString ();
-
- override public string ToString ()
- {
- return AsString ();
- }
-
- /// <summary>
- /// This is used to obtain the actual value of the literal
- /// cast into an object.
- /// </summary>
- public abstract object GetValue ();
-
- /// <summary>
- /// Constants are always born in a fully resolved state
- /// </summary>
- public override Expression DoResolve (EmitContext ec)
- {
- return this;
- }
- }
-
- public class BoolConstant : Constant {
- public readonly bool Value;
-
- public BoolConstant (bool val)
- {
- type = TypeManager.bool_type;
-
- Value = val;
- }
-
- override public string AsString ()
- {
- return Value ? "true" : "false";
- }
-
- public override object GetValue ()
- {
- return (object) Value;
- }
-
-
- public override void Emit (EmitContext ec)
- {
- if (Value)
- ec.ig.Emit (OpCodes.Ldc_I4_1);
- else
- ec.ig.Emit (OpCodes.Ldc_I4_0);
- }
- }
-
- public class ByteConstant : Constant {
- public readonly byte Value;
-
- public ByteConstant (byte v)
- {
- type = TypeManager.byte_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class CharConstant : Constant {
- public readonly char Value;
-
- public CharConstant (char v)
- {
- type = TypeManager.char_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- static public string descape (char c)
- {
- switch (c){
- case '\a':
- return "\\a";
- case '\b':
- return "\\b";
- case '\n':
- return "\\n";
- case '\t':
- return "\\t";
- case '\v':
- return "\\v";
- case '\r':
- return "\\r";
- case '\\':
- return "\\\\";
- case '\f':
- return "\\f";
- case '\0':
- return "\\0";
- case '"':
- return "\\\"";
- case '\'':
- return "\\\'";
- }
- return c.ToString ();
- }
-
- public override string AsString ()
- {
- return "\"" + descape (Value) + "\"";
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class SByteConstant : Constant {
- public readonly sbyte Value;
-
- public SByteConstant (sbyte v)
- {
- type = TypeManager.sbyte_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class ShortConstant : Constant {
- public readonly short Value;
-
- public ShortConstant (short v)
- {
- type = TypeManager.short_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class UShortConstant : Constant {
- public readonly ushort Value;
-
- public UShortConstant (ushort v)
- {
- type = TypeManager.ushort_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class IntConstant : Constant {
- public readonly int Value;
-
- public IntConstant (int v)
- {
- type = TypeManager.int32_type;
- Value = v;
- }
-
- static public void EmitInt (ILGenerator ig, int i)
- {
- switch (i){
- case -1:
- ig.Emit (OpCodes.Ldc_I4_M1);
- break;
-
- case 0:
- ig.Emit (OpCodes.Ldc_I4_0);
- break;
-
- case 1:
- ig.Emit (OpCodes.Ldc_I4_1);
- break;
-
- case 2:
- ig.Emit (OpCodes.Ldc_I4_2);
- break;
-
- case 3:
- ig.Emit (OpCodes.Ldc_I4_3);
- break;
-
- case 4:
- ig.Emit (OpCodes.Ldc_I4_4);
- break;
-
- case 5:
- ig.Emit (OpCodes.Ldc_I4_5);
- break;
-
- case 6:
- ig.Emit (OpCodes.Ldc_I4_6);
- break;
-
- case 7:
- ig.Emit (OpCodes.Ldc_I4_7);
- break;
-
- case 8:
- ig.Emit (OpCodes.Ldc_I4_8);
- break;
-
- default:
- if (i >= -128 && i <= 127){
- ig.Emit (OpCodes.Ldc_I4_S, (sbyte) i);
- } else
- ig.Emit (OpCodes.Ldc_I4, i);
- break;
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class UIntConstant : Constant {
- public readonly uint Value;
-
- public UIntConstant (uint v)
- {
- type = TypeManager.uint32_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, unchecked ((int) Value));
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class LongConstant : Constant {
- public readonly long Value;
-
- public LongConstant (long v)
- {
- type = TypeManager.int64_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- EmitLong (ig, Value);
- }
-
- static public void EmitLong (ILGenerator ig, long l)
- {
- ig.Emit (OpCodes.Ldc_I8, l);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class ULongConstant : Constant {
- public readonly ulong Value;
-
- public ULongConstant (ulong v)
- {
- type = TypeManager.uint64_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- LongLiteral.EmitLong (ig, unchecked ((long) Value));
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class FloatConstant : Constant {
- public readonly float Value;
-
- public FloatConstant (float v)
- {
- type = TypeManager.float_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldc_R4, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class DoubleConstant : Constant {
- public readonly double Value;
-
- public DoubleConstant (double v)
- {
- type = TypeManager.double_type;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldc_R8, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
- }
-
- public class DecimalConstant : Constant {
- public readonly decimal Value;
-
- public DecimalConstant (decimal d)
- {
- type = TypeManager.decimal_type;
- Value = d;
- }
-
- override public string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return (object) Value;
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Implement me");
- }
- }
-
- public class StringConstant : Constant {
- public readonly string Value;
-
- public StringConstant (string s)
- {
- type = TypeManager.string_type;
- Value = s;
- }
-
- // FIXME: Escape the string.
- override public string AsString ()
- {
- return "\"" + Value + "\"";
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldstr, Value);
- }
- }
-
-}
-
-
diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay
deleted file mode 100755
index 9279b84aa60..00000000000
--- a/mcs/mcs/cs-parser.jay
+++ /dev/null
@@ -1,3904 +0,0 @@
-%{
-//
-// cs-parser.jay: The Parser for the C# compiler
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-// TODO:
-// (1) Get rid of the *Collections.cs, that is an idea I took from System.CodeDOM
-// And come to think of it, it is not that great, it duplicates a lot of code
-// for something which is not really needed. We still have piles of typecasts
-// anwyays (due to the nature of the stack being a collection of Objects).
-//
-// (2) Figure out why error productions dont work. `type-declaration' is a
-// great spot to put an `error' because you can reproduce it with this input:
-// "public X { }"
-//
-// (3) Move Modifier checking from each object into the parser itself, that will
-// get rid of the global "error" symbol that we use now to report errors.
-// We still need to pass a pointer to the tree.ErrorHandler, but that is a
-// separate problem
-//
-using System.Text;
-using System;
-
-namespace Mono.CSharp
-{
- using System.Collections;
- using Mono.Languages;
-
- /// <summary>
- /// The C# Parser
- /// </summary>
- public class CSharpParser : GenericParser {
- Namespace current_namespace;
- TypeContainer current_container;
-
- // <summary>
- // Current block is used to add statements as we find
- // them.
- // </summary>
-
- Block current_block;
-
- // <summary>
- // Current interface is used by the various declaration
- // productions in the interface declaration to "add"
- // the interfaces as we find them.
- // </summary>
- Interface current_interface;
-
- // <summary>
- // This is used by the unary_expression code to resolve
- // a name against a parameter.
- // </summary>
- Parameters current_local_parameters;
-
- // <summary>
- // Using during property parsing to describe the implicit
- // value parameter that is passed to the "set" and "get"accesor
- // methods (properties and indexers).
- // </summary>
- string implicit_value_parameter_type;
- Parameters indexer_parameters;
-
- // <summary>
- // Used to determine if we are parsing the get/set pair
- // of an indexer or a property
- // </summmary>
- bool parsing_indexer;
-
- //
- // An out-of-band stack.
- //
- Stack oob_stack;
-%}
-
-%token EOF
-%token NONE /* This token is never returned by our lexer */
-%token ERROR // This is used not by the parser, but by the tokenizer.
- // do not remove.
-
-/*
- *These are the C# keywords
- */
-%token ABSTRACT
-%token AS
-%token ADD
-%token ASSEMBLY
-%token BASE
-%token BOOL
-%token BREAK
-%token BYTE
-%token CASE
-%token CATCH
-%token CHAR
-%token CHECKED
-%token CLASS
-%token CONST
-%token CONTINUE
-%token DECIMAL
-%token DEFAULT
-%token DELEGATE
-%token DO
-%token DOUBLE
-%token ELSE
-%token ENUM
-%token EVENT
-%token EXPLICIT
-%token EXTERN
-%token FALSE
-%token FINALLY
-%token FIXED
-%token FLOAT
-%token FOR
-%token FOREACH
-%token GOTO
-%token IF
-%token IMPLICIT
-%token IN
-%token INT
-%token INTERFACE
-%token INTERNAL
-%token IS
-%token LOCK
-%token LONG
-%token NAMESPACE
-%token NEW
-%token NULL
-%token OBJECT
-%token OPERATOR
-%token OUT
-%token OVERRIDE
-%token PARAMS
-%token PRIVATE
-%token PROTECTED
-%token PUBLIC
-%token READONLY
-%token REF
-%token RETURN
-%token REMOVE
-%token SBYTE
-%token SEALED
-%token SHORT
-%token SIZEOF
-%token STACKALLOC
-%token STATIC
-%token STRING
-%token STRUCT
-%token SWITCH
-%token THIS
-%token THROW
-%token TRUE
-%token TRY
-%token TYPEOF
-%token UINT
-%token ULONG
-%token UNCHECKED
-%token UNSAFE
-%token USHORT
-%token USING
-%token VIRTUAL
-%token VOID
-%token VOLATILE
-%token WHILE
-
-/* C# keywords which are not really keywords */
-%token GET "get"
-%token SET "set"
-
-/* C# single character operators/punctuation. */
-%token OPEN_BRACE "{"
-%token CLOSE_BRACE "}"
-%token OPEN_BRACKET "["
-%token CLOSE_BRACKET "]"
-%token OPEN_PARENS "("
-%token CLOSE_PARENS ")"
-%token DOT "."
-%token COMMA ","
-%token COLON ":"
-%token SEMICOLON ";"
-%token TILDE "~"
-
-%token PLUS "+"
-%token MINUS "-"
-%token BANG "!"
-%token ASSIGN "="
-%token OP_LT "<"
-%token OP_GT ">"
-%token BITWISE_AND "&"
-%token BITWISE_OR "|"
-%token STAR "*"
-%token PERCENT "%"
-%token DIV "/"
-%token CARRET "^"
-%token INTERR "?"
-
-/* C# multi-character operators. */
-%token OP_INC "++"
-%token OP_DEC "--"
-%token OP_SHIFT_LEFT "<<"
-%token OP_SHIFT_RIGHT ">>"
-%token OP_LE "<="
-%token OP_GE ">="
-%token OP_EQ "=="
-%token OP_NE "!="
-%token OP_AND "&&"
-%token OP_OR "||"
-%token OP_MULT_ASSIGN "*="
-%token OP_DIV_ASSIGN "/="
-%token OP_MOD_ASSIGN "%="
-%token OP_ADD_ASSIGN "+="
-%token OP_SUB_ASSIGN "-="
-%token OP_SHIFT_LEFT_ASSIGN "<<="
-%token OP_SHIFT_RIGHT_ASSIGN ">>="
-%token OP_AND_ASSIGN "&="
-%token OP_XOR_ASSIGN "^="
-%token OP_OR_ASSIGN "|="
-%token OP_PTR "->"
-
-/* Numbers */
-%token LITERAL_INTEGER "int literal"
-%token LITERAL_FLOAT "float literal"
-%token LITERAL_DOUBLE "double literal"
-%token LITERAL_DECIMAL "decimal literal"
-%token LITERAL_CHARACTER "character literal"
-%token LITERAL_STRING "string literal"
-
-%token IDENTIFIER
-
-/* Add precedence rules to solve dangling else s/r conflict */
-%nonassoc LOWPREC
-%nonassoc IF
-%nonassoc ELSE
-%right ASSIGN
-%left OP_OR
-%left OP_AND
-%left BITWISE_OR
-%left BITWISE_AND
-%left OP_SHIFT_LEFT OP_SHIFT_RIGHT
-%left PLUS MINUS
-%left STAR DIV PERCENT
-%right BANG CARRET UMINUS
-%nonassoc OP_INC OP_DEC
-%left OPEN_PARENS
-%left OPEN_BRACKET OPEN_BRACE
-%left DOT
-%nonassoc HIGHPREC
-
-%start compilation_unit
-/*%start namespace_declaration */
-%%
-
-compilation_unit
- : opt_using_directives opt_namespace_member_declarations opt_attributes opt_EOF
- {
- // Check that using comes only before namespace elements
- }
- ;
-
-opt_EOF
- : /* empty */
- | EOF
- ;
-
-using_directives
- : using_directive
- | using_directives using_directive
- ;
-
-using_directive
- : using_alias_directive
- | using_namespace_directive
- ;
-
-using_alias_directive
- : USING IDENTIFIER ASSIGN
- namespace_or_type_name SEMICOLON
- {
- current_namespace.UsingAlias ((string) $2, (string) $4, lexer.Location);
- }
- ;
-
-using_namespace_directive
- : USING namespace_name SEMICOLON
- {
- current_namespace.Using ((string) $2);
- }
- ;
-
-// namespace_declarations
-// : namespace_declaration
-// | namespace_declarations namespace_declaration
-
-namespace_declaration
- : NAMESPACE qualified_identifier
- {
- current_namespace = RootContext.Tree.RecordNamespace (current_namespace, name, (string) $2);
- }
- namespace_body opt_semicolon
- {
- current_namespace = current_namespace.Parent;
- }
- ;
-
-opt_semicolon
- : /* empty */
- | SEMICOLON
- ;
-
-opt_comma
- : /* empty */
- | COMMA
- ;
-
-qualified_identifier
- : IDENTIFIER
- | qualified_identifier DOT IDENTIFIER {
- $$ = (($1).ToString ()) + "." + ($3.ToString ()); }
- ;
-
-
-namespace_name
- : namespace_or_type_name
- ;
-
-namespace_body
- : OPEN_BRACE
- opt_using_directives
- opt_namespace_member_declarations
- CLOSE_BRACE
- {
- }
- ;
-
-opt_using_directives
- : /* empty */
- | using_directives
- ;
-
-opt_namespace_member_declarations
- : /* empty */
- | namespace_member_declarations
- ;
-
-namespace_member_declarations
- : namespace_member_declaration
- | namespace_member_declarations namespace_member_declaration
- ;
-
-namespace_member_declaration
- : type_declaration
- {
- string name = "";
- int mod_flags;
-
- if ($1 is Class){
- Class c = (Class) $1;
- mod_flags = c.ModFlags;
- name = c.Name;
- } else if ($1 is Struct){
- Struct s = (Struct) $1;
- mod_flags = s.ModFlags;
- name = s.Name;
- } else
- break;
-
- if ((mod_flags & (Modifiers.PRIVATE|Modifiers.PROTECTED)) != 0){
- Report.Error (
- 1527, lexer.Location,
- "Namespace elements cant be explicitly " +
- "declared private or protected in `" + name + "'");
- }
- }
- | namespace_declaration
- ;
-
-type_declaration
- : class_declaration
- | struct_declaration
- | interface_declaration
- | enum_declaration
- | delegate_declaration
-//
-// Enable this when we have handled all errors, because this acts as a generic fallback
-//
-// | error {
-// Report.Error (1518, lexer.Location, "Expected class, struct, interface, enum or delegate");
-// }
- ;
-
-//
-// Attributes 17.2
-//
-opt_attributes
- : /* empty */ { $$ = null; }
- | attribute_section opt_attributes
- {
- Attributes attrs = null;
- AttributeSection sect = (AttributeSection) $1;
-
- if (sect.Target == "assembly"){
- RootContext.AddGlobalAttributes (sect, lexer.Location);
- sect = null;
- }
-
- if ($2 != null) {
- if (sect != null){
- attrs = (Attributes) $2;
- attrs.AddAttribute (sect);
- }
- } else {
- if (sect != null)
- attrs = new Attributes (sect, lexer.Location);
- }
-
- $$ = attrs;
- }
- ;
-
-attribute_section
- : OPEN_BRACKET attribute_target_specifier attribute_list CLOSE_BRACKET
- {
- string target = null;
-
- if ($2 != null)
- target = (string) $2;
-
- $$ = new AttributeSection (target, (ArrayList) $3);
- }
- | OPEN_BRACKET attribute_list CLOSE_BRACKET
- {
- $$ = new AttributeSection (null, (ArrayList) $2);
- }
- ;
-
-attribute_target_specifier
- : attribute_target COLON
- {
- $$ = $1;
- }
- ;
-
-attribute_target
- : IDENTIFIER
- {
- CheckAttributeTarget ((string) $1);
- $$ = $1;
- }
- | EVENT { $$ = "event"; }
- | RETURN { $$ = "return"; }
- ;
-
-attribute_list
- : attribute
- {
- ArrayList attrs = new ArrayList ();
- attrs.Add ($1);
-
- $$ = attrs;
-
- }
- | attribute_list COMMA attribute
- {
- ArrayList attrs = (ArrayList) $1;
- attrs.Add ($3);
-
- $$ = attrs;
- }
- ;
-
-attribute
- : attribute_name
- {
- $$ = lexer.Location;
- }
- opt_attribute_arguments
- {
- $$ = new Attribute ((string) $1, (ArrayList) $3, (Location) $2);
- }
- ;
-
-attribute_name
- : type_name { /* reserved attribute name or identifier: 17.4 */ }
- ;
-
-opt_attribute_arguments
- : /* empty */ { $$ = null; }
- | OPEN_PARENS attribute_arguments CLOSE_PARENS
- {
- $$ = $2;
- }
- ;
-
-
-attribute_arguments
- : positional_argument_list
- {
- ArrayList args = new ArrayList ();
- args.Add ($1);
-
- $$ = args;
- }
- | positional_argument_list COMMA named_argument_list
- {
- ArrayList args = new ArrayList ();
- args.Add ($1);
- args.Add ($3);
-
- $$ = args;
- }
- | named_argument_list
- {
- ArrayList args = new ArrayList ();
- args.Add (null);
- args.Add ($1);
-
- $$ = args;
- }
- ;
-
-
-positional_argument_list
- : expression
- {
- ArrayList args = new ArrayList ();
- args.Add (new Argument ((Expression) $1, Argument.AType.Expression));
-
- $$ = args;
- }
- | positional_argument_list COMMA expression
- {
- ArrayList args = (ArrayList) $1;
- args.Add (new Argument ((Expression) $3, Argument.AType.Expression));
-
- $$ = args;
- }
- ;
-
-named_argument_list
- : named_argument
- {
- ArrayList args = new ArrayList ();
- args.Add ($1);
-
- $$ = args;
- }
- | named_argument_list COMMA named_argument
- {
- ArrayList args = (ArrayList) $1;
- args.Add ($3);
-
- $$ = args;
- }
- ;
-
-named_argument
- : IDENTIFIER ASSIGN expression
- {
- $$ = new DictionaryEntry (
- (string) $1,
- new Argument ((Expression) $3, Argument.AType.Expression));
- }
- ;
-
-
-class_body
- : OPEN_BRACE opt_class_member_declarations CLOSE_BRACE
- ;
-
-opt_class_member_declarations
- : /* empty */
- | class_member_declarations
- ;
-
-class_member_declarations
- : class_member_declaration
- | class_member_declarations
- class_member_declaration
- ;
-
-class_member_declaration
- : constant_declaration // done
- | field_declaration // done
- | method_declaration // done
- | property_declaration // done
- | event_declaration // done
- | indexer_declaration // done
- | operator_declaration // done
- | constructor_declaration // done
- | destructor_declaration // done
- | type_declaration
- ;
-
-struct_declaration
- : opt_attributes
- opt_modifiers
- STRUCT IDENTIFIER
- {
- Struct new_struct;
- string full_struct_name = MakeName ((string) $4);
-
- new_struct = new Struct (current_container, full_struct_name, (int) $2,
- (Attributes) $1, lexer.Location);
- current_container = new_struct;
- current_container.Namespace = current_namespace;
- RootContext.Tree.RecordStruct (full_struct_name, new_struct);
- }
- opt_struct_interfaces
- struct_body
- opt_semicolon
- {
- Struct new_struct = (Struct) current_container;
-
- current_container = current_container.Parent;
- CheckDef (current_container.AddStruct (new_struct), new_struct.Name);
- $$ = new_struct;
- }
- ;
-
-opt_struct_interfaces
- : /* empty */
- | struct_interfaces
- ;
-
-struct_interfaces
- : struct_interface
- | struct_interfaces struct_interface
- ;
-
-struct_interface
- : COLON type_list
- ;
-
-struct_body
- : OPEN_BRACE opt_struct_member_declarations CLOSE_BRACE
- ;
-
-opt_struct_member_declarations
- : /* empty */
- | struct_member_declarations
- ;
-
-struct_member_declarations
- : struct_member_declaration
- | struct_member_declarations struct_member_declaration
- ;
-
-struct_member_declaration
- : constant_declaration
- | field_declaration
- | method_declaration
- | property_declaration
- | event_declaration
- | indexer_declaration
- | operator_declaration
- | constructor_declaration
- | type_declaration
-
- /*
- * This is only included so we can flag error 575:
- * destructors only allowed on class types
- */
- | destructor_declaration
- ;
-
-constant_declaration
- : opt_attributes
- opt_modifiers
- CONST
- type
- constant_declarators
- SEMICOLON
- {
- foreach (VariableDeclaration constant in (ArrayList) $5){
- Const c = new Const (
- (string) $4, (string) constant.identifier,
- (Expression) constant.expression_or_array_initializer, (int) $2, (Attributes) $1,
- constant.Location);
-
- CheckDef (current_container.AddConstant (c), c.Name);
- }
- }
- ;
-
-constant_declarators
- : constant_declarator
- {
- ArrayList constants = new ArrayList ();
- constants.Add ($1);
- $$ = constants;
- }
- | constant_declarators COMMA constant_declarator
- {
- ArrayList constants = (ArrayList) $1;
-
- constants.Add ($3);
- }
- ;
-
-constant_declarator
- : IDENTIFIER ASSIGN constant_expression
- {
- $$ = new VariableDeclaration ((string) $1, $3, lexer.Location);
- }
- ;
-
-field_declaration
- : opt_attributes
- opt_modifiers
- type
- variable_declarators
- SEMICOLON
- {
- string type = (string) $3;
- int mod = (int) $2;
-
- foreach (VariableDeclaration var in (ArrayList) $4){
- Field field = new Field (type, mod, var.identifier,
- var.expression_or_array_initializer, (Attributes) $1, var.Location);
-
- CheckDef (current_container.AddField (field), field.Name);
- }
- }
- ;
-
-variable_declarators
- : variable_declarator
- {
- ArrayList decl = new ArrayList ();
- decl.Add ($1);
- $$ = decl;
- }
- | variable_declarators COMMA variable_declarator
- {
- ArrayList decls = (ArrayList) $1;
- decls.Add ($3);
- $$ = $1;
- }
- ;
-
-variable_declarator
- : IDENTIFIER ASSIGN variable_initializer
- {
- $$ = new VariableDeclaration ((string) $1, $3, lexer.Location);
- }
- | IDENTIFIER
- {
- $$ = new VariableDeclaration ((string) $1, null, lexer.Location);
- }
- ;
-
-variable_initializer
- : expression
- {
- $$ = $1;
- }
- | array_initializer
- {
- $$ = $1;
- }
- | STACKALLOC type OPEN_BRACKET expression CLOSE_BRACKET
- {
- $$ = new StackAlloc ((string) $2, (Expression) $4, lexer.Location);
- }
- ;
-
-method_declaration
- : method_header
- method_body
- {
- Method method = (Method) $1;
- Block b = (Block) $2;
- const int extern_abstract = (Modifiers.EXTERN | Modifiers.ABSTRACT);
-
- if (b == null){
- if ((method.ModFlags & extern_abstract) == 0){
- Report.Error (
- 501, lexer.Location, current_container.MakeName (method.Name) +
- "must declare a body because it is not marked abstract or extern");
- }
- } else {
- if ((method.ModFlags & Modifiers.EXTERN) != 0){
- Report.Error (
- 179, lexer.Location, current_container.MakeName (method.Name) +
- " is declared extern, but has a body");
- }
- }
-
- method.Block = (Block) $2;
- CheckDef (current_container.AddMethod (method), method.Name);
-
- current_local_parameters = null;
- }
- ;
-
-opt_error_modifier
- : /* empty */
- | modifiers
- {
- int m = (int) $1;
- int i = 1;
-
- while (m != 0){
- if ((i & m) != 0){
- Report.Error (
- 1585, lexer.Location, "Member modifier `" +
- Modifiers.Name (i) + "' must precede member type and name");
- }
- m &= ~i;
- i = i << 1;
- }
- }
- ;
-
-method_header
- : opt_attributes
- opt_modifiers
- type
- member_name
- OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
- {
- Method method = new Method ((string) $3, (int) $2, (string) $4,
- (Parameters) $6, (Attributes) $1, lexer.Location);
-
- current_local_parameters = (Parameters) $6;
-
- $$ = method;
- }
- | opt_attributes
- opt_modifiers
- VOID
- member_name
- OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
- {
- Method method = new Method ("System.Void", (int) $2, (string) $4,
- (Parameters) $6, (Attributes) $1, lexer.Location);
-
- current_local_parameters = (Parameters) $6;
- $$ = method;
- }
- ;
-
-method_body
- : block
- | SEMICOLON { $$ = null; }
- ;
-
-opt_formal_parameter_list
- : /* empty */ { $$ = Parameters.GetEmptyReadOnlyParameters (); }
- | formal_parameter_list
- ;
-
-formal_parameter_list
- : fixed_parameters
- {
- ArrayList pars_list = (ArrayList) $1;
-
- Parameter [] pars = new Parameter [pars_list.Count];
- pars_list.CopyTo (pars);
-
- $$ = new Parameters (pars, null, lexer.Location);
- }
- | fixed_parameters COMMA parameter_array
- {
- ArrayList pars_list = (ArrayList) $1;
-
- Parameter [] pars = new Parameter [pars_list.Count];
- pars_list.CopyTo (pars);
-
- $$ = new Parameters (pars, (Parameter) $3, lexer.Location);
- }
- | parameter_array
- {
- $$ = new Parameters (null, (Parameter) $1, lexer.Location);
- }
- ;
-
-fixed_parameters
- : fixed_parameter
- {
- ArrayList pars = new ArrayList ();
-
- pars.Add ($1);
- $$ = pars;
- }
- | fixed_parameters COMMA fixed_parameter
- {
- ArrayList pars = (ArrayList) $1;
-
- pars.Add ($3);
- $$ = $1;
- }
- ;
-
-fixed_parameter
- : opt_attributes
- opt_parameter_modifier
- type
- IDENTIFIER
- {
- $$ = new Parameter ((string) $3, (string) $4, (Parameter.Modifier) $2, (Attributes) $1);
- }
- ;
-
-opt_parameter_modifier
- : /* empty */ { $$ = Parameter.Modifier.NONE; }
- | parameter_modifier
- ;
-
-parameter_modifier
- : REF { $$ = Parameter.Modifier.REF; }
- | OUT { $$ = Parameter.Modifier.OUT; }
- ;
-
-parameter_array
- : opt_attributes PARAMS type IDENTIFIER
- {
- $$ = new Parameter ((string) $3, (string) $4, Parameter.Modifier.PARAMS, (Attributes) $1);
- note ("type must be a single-dimension array type");
- }
- ;
-
-member_name
- : qualified_identifier
- ;
-
-property_declaration
- : opt_attributes
- opt_modifiers
- type member_name
- OPEN_BRACE
- {
- implicit_value_parameter_type = (string) $3;
-
- lexer.PropertyParsing = true;
-
- $$ = lexer.Location;
- }
- accessor_declarations
- {
- lexer.PropertyParsing = false;
- }
- CLOSE_BRACE
- {
- Property prop;
- Pair pair = (Pair) $7;
- Block get_block = null;
- Block set_block = null;
-
- if (pair.First != null)
- get_block = (Block) pair.First;
- if (pair.Second != null)
- set_block = (Block) pair.Second;
-
- prop = new Property ((string) $3, (string) $4, (int) $2, get_block, set_block,
- (Attributes) $1, (Location) $6);
-
- CheckDef (current_container.AddProperty (prop), prop.Name);
- implicit_value_parameter_type = null;
- }
- ;
-
-accessor_declarations
- : get_accessor_declaration opt_set_accessor_declaration
- {
- $$ = new Pair ($1, $2);
- }
- | set_accessor_declaration opt_get_accessor_declaration
- {
- $$ = new Pair ($2, $1);
- }
- ;
-
-opt_get_accessor_declaration
- : /* empty */ { $$ = null; }
- | get_accessor_declaration
- ;
-
-opt_set_accessor_declaration
- : /* empty */ { $$ = null; }
- | set_accessor_declaration
- ;
-
-get_accessor_declaration
- : opt_attributes GET
- {
- // If this is not the case, then current_local_parameters has already
- // been set in indexer_declaration
- if (parsing_indexer == false)
- current_local_parameters = null;
- else
- current_local_parameters = indexer_parameters;
- lexer.PropertyParsing = false;
- }
- accessor_body
- {
- $$ = $4;
- current_local_parameters = null;
- lexer.PropertyParsing = true;
- }
- ;
-
-set_accessor_declaration
- : opt_attributes SET
- {
- Parameter [] args;
- Parameter implicit_value_parameter = new Parameter (
- implicit_value_parameter_type, "value",
- Parameter.Modifier.NONE, null);
-
- if (parsing_indexer == false) {
- args = new Parameter [1];
- args [0] = implicit_value_parameter;
- } else {
- Parameter [] fp = indexer_parameters.FixedParameters;
- int count = fp.Length;
-
- args = new Parameter [count + 1];
-
- fp.CopyTo (args, 0);
- args [count] = implicit_value_parameter;
- }
-
- current_local_parameters = new Parameters (args, null, lexer.Location);
- lexer.PropertyParsing = false;
- }
- accessor_body
- {
- $$ = $4;
- current_local_parameters = null;
- lexer.PropertyParsing = true;
- }
- ;
-
-accessor_body
- : block
- | SEMICOLON { $$ = new Block (null); }
- ;
-
-interface_declaration
- : opt_attributes
- opt_modifiers
- INTERFACE IDENTIFIER
- {
- Interface new_interface;
- string full_interface_name = MakeName ((string) $4);
-
- new_interface = new Interface (current_container, full_interface_name, (int) $2,
- (Attributes) $1, lexer.Location);
- if (current_interface != null) {
- Location l = lexer.Location;
- Report.Error (-2, l, "Internal compiler error: interface inside interface");
- }
- current_interface = new_interface;
- new_interface.Namespace = current_namespace;
- RootContext.Tree.RecordInterface (full_interface_name, new_interface);
- }
- opt_interface_base
- interface_body
- {
- Interface new_interface = (Interface) current_interface;
-
- if ($6 != null)
- new_interface.Bases = (ArrayList) $6;
-
- current_interface = null;
- CheckDef (current_container.AddInterface (new_interface), new_interface.Name);
- }
- ;
-
-opt_interface_base
- : /* empty */ { $$ = null; }
- | interface_base
- ;
-
-interface_base
- : COLON interface_type_list { $$ = $2; }
- ;
-
-interface_type_list
- : interface_type
- {
- ArrayList interfaces = new ArrayList ();
-
- interfaces.Add ($1);
- $$ = interfaces;
- }
- | interface_type_list COMMA interface_type
- {
- ArrayList interfaces = (ArrayList) $1;
- interfaces.Add ($3);
- $$ = interfaces;
- }
- ;
-
-interface_body
- : OPEN_BRACE
- opt_interface_member_declarations
- CLOSE_BRACE
- ;
-
-opt_interface_member_declarations
- : /* empty */
- | interface_member_declarations
- ;
-
-interface_member_declarations
- : interface_member_declaration
- | interface_member_declarations interface_member_declaration
- ;
-
-interface_member_declaration
- : interface_method_declaration
- {
- InterfaceMethod m = (InterfaceMethod) $1;
-
- CheckDef (current_interface.AddMethod (m), m.Name);
- }
- | interface_property_declaration
- {
- InterfaceProperty p = (InterfaceProperty) $1;
-
- CheckDef (current_interface.AddProperty (p), p.Name);
- }
- | interface_event_declaration
- {
- InterfaceEvent e = (InterfaceEvent) $1;
-
- CheckDef (current_interface.AddEvent (e), e.Name);
- }
- | interface_indexer_declaration
- {
- InterfaceIndexer i = (InterfaceIndexer) $1;
-
- CheckDef (current_interface.AddIndexer (i), "indexer");
- }
- ;
-
-opt_new
- : /* empty */ { $$ = false; }
- | NEW { $$ = true; }
- ;
-
-interface_method_declaration
- : opt_attributes opt_new type IDENTIFIER
- OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
- SEMICOLON
- {
- $$ = new InterfaceMethod ((string) $3, (string) $4, (bool) $2,
- (Parameters) $6, (Attributes) $1, lexer.Location);
- }
- | opt_attributes opt_new VOID IDENTIFIER
- OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
- SEMICOLON
- {
- $$ = new InterfaceMethod ("System.Void", (string) $4, (bool) $2, (Parameters) $6,
- (Attributes) $1, lexer.Location);
- }
- ;
-
-interface_property_declaration
- : opt_attributes
- opt_new
- type IDENTIFIER
- OPEN_BRACE
- { lexer.PropertyParsing = true; }
- interface_accesors
- { lexer.PropertyParsing = false; }
- CLOSE_BRACE
- {
- int gs = (int) $7;
-
- $$ = new InterfaceProperty ((string) $3, (string) $4, (bool) $2,
- (gs & 1) == 1, (gs & 2) == 2, (Attributes) $1,
- lexer.Location);
- }
- ;
-
-interface_accesors
- : opt_attributes GET SEMICOLON { $$ = 1; }
- | opt_attributes SET SEMICOLON { $$ = 2; }
- | opt_attributes GET SEMICOLON opt_attributes SET SEMICOLON
- { $$ = 3; }
- | opt_attributes SET SEMICOLON opt_attributes GET SEMICOLON
- { $$ = 3; }
- ;
-
-interface_event_declaration
- : opt_attributes opt_new EVENT type IDENTIFIER SEMICOLON
- {
- $$ = new InterfaceEvent ((string) $4, (string) $5, (bool) $2, (Attributes) $1);
- }
- ;
-
-interface_indexer_declaration
- : opt_attributes opt_new type THIS
- OPEN_BRACKET formal_parameter_list CLOSE_BRACKET
- OPEN_BRACE
- { lexer.PropertyParsing = true; }
- interface_accesors
- { lexer.PropertyParsing = false; }
- CLOSE_BRACE
- {
- int a_flags = (int) $10;
-
- bool do_get = (a_flags & 1) == 1;
- bool do_set = (a_flags & 2) == 2;
-
- $$ = new InterfaceIndexer ((string) $3, (Parameters) $6, do_get, do_set,
- (bool) $2, (Attributes) $1, lexer.Location);
- }
- ;
-
-operator_declaration
- : opt_attributes opt_modifiers operator_declarator block
- {
- OperatorDeclaration decl = (OperatorDeclaration) $3;
-
- Operator op = new Operator (decl.optype, decl.ret_type, (int) $2, decl.arg1type, decl.arg1name,
- decl.arg2type, decl.arg2name, (Block) $4, (Attributes) $1, decl.location);
-
- // Note again, checking is done in semantic analysis
- current_container.AddOperator (op);
-
- current_local_parameters = null;
- }
- ;
-
-operator_declarator
- : type OPERATOR overloadable_operator
- OPEN_PARENS type IDENTIFIER CLOSE_PARENS
- {
- Operator.OpType op = (Operator.OpType) $3;
- CheckUnaryOperator (op);
-
- if (op == Operator.OpType.Addition)
- op = Operator.OpType.UnaryPlus;
-
- if (op == Operator.OpType.Subtraction)
- op = Operator.OpType.UnaryNegation;
-
- Parameter [] pars = new Parameter [1];
-
- pars [0] = new Parameter ((string) $5, (string) $6, Parameter.Modifier.NONE, null);
-
- current_local_parameters = new Parameters (pars, null, lexer.Location);
-
- $$ = new OperatorDeclaration (op, (string) $1, (string) $5, (string) $6,
- null, null, lexer.Location);
- }
- | type OPERATOR overloadable_operator
- OPEN_PARENS
- type IDENTIFIER COMMA
- type IDENTIFIER
- CLOSE_PARENS
- {
- CheckBinaryOperator ((Operator.OpType) $3);
-
- Parameter [] pars = new Parameter [2];
-
- pars [0] = new Parameter ((string) $5, (string) $6, Parameter.Modifier.NONE, null);
- pars [1] = new Parameter ((string) $8, (string) $9, Parameter.Modifier.NONE, null);
-
- current_local_parameters = new Parameters (pars, null, lexer.Location);
-
- $$ = new OperatorDeclaration ((Operator.OpType) $3, (string) $1, (string) $5, (string) $6,
- (string) $8, (string) $9, lexer.Location);
- }
- | conversion_operator_declarator
- ;
-
-overloadable_operator
-// Unary operators:
- : BANG { $$ = Operator.OpType.LogicalNot; }
- | TILDE { $$ = Operator.OpType.OnesComplement; }
- | OP_INC { $$ = Operator.OpType.Increment; }
- | OP_DEC { $$ = Operator.OpType.Decrement; }
- | TRUE { $$ = Operator.OpType.True; }
- | FALSE { $$ = Operator.OpType.False; }
-// Unary and binary:
- | PLUS { $$ = Operator.OpType.Addition; }
- | MINUS { $$ = Operator.OpType.Subtraction; }
-// Binary:
- | STAR { $$ = Operator.OpType.Multiply; }
- | DIV { $$ = Operator.OpType.Division; }
- | PERCENT { $$ = Operator.OpType.Modulus; }
- | BITWISE_AND { $$ = Operator.OpType.BitwiseAnd; }
- | BITWISE_OR { $$ = Operator.OpType.BitwiseOr; }
- | CARRET { $$ = Operator.OpType.ExclusiveOr; }
- | OP_SHIFT_LEFT { $$ = Operator.OpType.LeftShift; }
- | OP_SHIFT_RIGHT { $$ = Operator.OpType.RightShift; }
- | OP_EQ { $$ = Operator.OpType.Equality; }
- | OP_NE { $$ = Operator.OpType.Inequality; }
- | OP_GT { $$ = Operator.OpType.GreaterThan; }
- | OP_LT { $$ = Operator.OpType.LessThan; }
- | OP_GE { $$ = Operator.OpType.GreaterThanOrEqual; }
- | OP_LE { $$ = Operator.OpType.LessThanOrEqual; }
- ;
-
-conversion_operator_declarator
- : IMPLICIT OPERATOR type OPEN_PARENS type IDENTIFIER CLOSE_PARENS
- {
- Parameter [] pars = new Parameter [1];
-
- pars [0] = new Parameter ((string) $5, (string) $6, Parameter.Modifier.NONE, null);
-
- current_local_parameters = new Parameters (pars, null, lexer.Location);
-
- $$ = new OperatorDeclaration (Operator.OpType.Implicit, (string) $3, (string) $5, (string) $6,
- null, null, lexer.Location);
- }
- | EXPLICIT OPERATOR type OPEN_PARENS type IDENTIFIER CLOSE_PARENS
- {
- Parameter [] pars = new Parameter [1];
-
- pars [0] = new Parameter ((string) $5, (string) $6, Parameter.Modifier.NONE, null);
-
- current_local_parameters = new Parameters (pars, null, lexer.Location);
-
- $$ = new OperatorDeclaration (Operator.OpType.Explicit, (string) $3, (string) $5, (string) $6,
- null, null, lexer.Location);
- }
- | IMPLICIT error
- {
- syntax_error (lexer.Location, "'operator' expected");
- }
- | EXPLICIT error
- {
- syntax_error (lexer.Location, "'operator' expected");
- }
- ;
-
-constructor_declaration
- : opt_attributes
- opt_modifiers
- constructor_declarator
- block
- {
- Constructor c = (Constructor) $3;
- c.Block = (Block) $4;
- c.ModFlags = (int) $2;
- c.OptAttributes = (Attributes) $1;
-
- if ((c.ModFlags & Modifiers.STATIC) != 0){
- if ((c.ModFlags & Modifiers.Accessibility) != 0) {
- Location l = lexer.Location;
- Report.Error (515, l, "Access modifiers are not allowed on static constructors");
- }
-
- if (c.Initializer != null){
- Location l = lexer.Location;
- Report.Error (514, l, "Static constructors can not have an explicit this or base constructor invocations");
- }
-
- if (!c.Parameters.Empty){
- Location l = lexer.Location;
- Report.Error (132, l, "Static constructors should not have parameters");
- }
- }
-
- CheckDef (current_container.AddConstructor (c), c.Name);
-
- current_local_parameters = null;
- }
- ;
-
-constructor_declarator
- : IDENTIFIER
- OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
- {
- oob_stack.Push (lexer.Location);
-
- current_local_parameters = (Parameters) $3;
- }
- opt_constructor_initializer
- {
- Location l = (Location) oob_stack.Pop ();
- $$ = new Constructor ((string) $1, (Parameters) $3, (ConstructorInitializer) $6, l);
- }
- ;
-
-opt_constructor_initializer
- : /* empty */ { $$ = null; }
- | constructor_initializer
- ;
-
-constructor_initializer
- : COLON BASE OPEN_PARENS opt_argument_list CLOSE_PARENS
- {
- $$ = new ConstructorBaseInitializer ((ArrayList) $4, lexer.Location);
- }
- | COLON THIS OPEN_PARENS opt_argument_list CLOSE_PARENS
- {
- $$ = new ConstructorThisInitializer ((ArrayList) $4, lexer.Location);
- }
- ;
-
-destructor_declaration
- : opt_attributes TILDE IDENTIFIER OPEN_PARENS CLOSE_PARENS block
- {
- if ((string) $3 != current_container.Basename){
- Report.Error (574, lexer.Location, "Name of destructor must match name of class");
- } else if (!(current_container is Class)){
- Report.Error (575, lexer.Location, "Destructors are only allowed in class types");
- } else {
- Location l = lexer.Location;
-
- Method d = new Method (
- "System.Void", 0, "Finalize",
- new Parameters (null, null, l), (Attributes) $1, l);
-
- d.Block = (Block) $6;
- CheckDef (current_container.AddMethod (d), d.Name);
- }
- }
- ;
-
-event_declaration
- : opt_attributes
- opt_modifiers
- EVENT type variable_declarators SEMICOLON
- {
- foreach (VariableDeclaration var in (ArrayList) $5) {
-
- Event e = new Event ((string) $4, var.identifier, var.expression_or_array_initializer,
- (int) $2, null, null, (Attributes) $1, lexer.Location);
-
- CheckDef (current_container.AddEvent (e), e.Name);
-
- }
- }
- | opt_attributes
- opt_modifiers
- EVENT type member_name
- OPEN_BRACE
- {
- implicit_value_parameter_type = (string) $4;
- lexer.EventParsing = true;
- }
- event_accessor_declarations
- {
- lexer.EventParsing = false;
- }
- CLOSE_BRACE
- {
- Pair pair = (Pair) $8;
- Block add_block = null;
- Block rem_block = null;
-
- if (pair.First != null)
- add_block = (Block) pair.First;
- if (pair.Second != null)
- rem_block = (Block) pair.Second;
-
- Event e = new Event ((string) $4, (string) $5, null, (int) $2, add_block, rem_block,
- (Attributes) $1, lexer.Location);
-
- CheckDef (current_container.AddEvent (e), e.Name);
- implicit_value_parameter_type = null;
- }
- ;
-
-event_accessor_declarations
- : add_accessor_declaration remove_accessor_declaration
- {
- $$ = new Pair ($1, $2);
- }
- | remove_accessor_declaration add_accessor_declaration
- {
- $$ = new Pair ($2, $1);
- }
- ;
-
-add_accessor_declaration
- : opt_attributes ADD
- {
- Parameter [] args = new Parameter [1];
- Parameter implicit_value_parameter = new Parameter (
- implicit_value_parameter_type, "value",
- Parameter.Modifier.NONE, null);
-
- args [0] = implicit_value_parameter;
-
- current_local_parameters = new Parameters (args, null, lexer.Location);
- lexer.EventParsing = false;
- }
- block
- {
- $$ = $4;
- lexer.EventParsing = true;
- }
- ;
-
-remove_accessor_declaration
- : opt_attributes REMOVE
- {
- Parameter [] args = new Parameter [1];
- Parameter implicit_value_parameter = new Parameter (
- implicit_value_parameter_type, "value",
- Parameter.Modifier.NONE, null);
-
- args [0] = implicit_value_parameter;
-
- current_local_parameters = new Parameters (args, null, lexer.Location);
- lexer.EventParsing = false;
- }
- block
- {
- $$ = $4;
- lexer.EventParsing = true;
- }
- ;
-
-indexer_declaration
- : opt_attributes opt_modifiers indexer_declarator
- OPEN_BRACE
- {
- IndexerDeclaration decl = (IndexerDeclaration) $3;
-
- implicit_value_parameter_type = decl.type;
-
- lexer.PropertyParsing = true;
- parsing_indexer = true;
-
- indexer_parameters = decl.param_list;
- $$ = lexer.Location;
- }
- accessor_declarations
- {
- lexer.PropertyParsing = false;
- parsing_indexer = false;
- }
- CLOSE_BRACE
- {
- // The signature is computed from the signature of the indexer. Look
- // at section 3.6 on the spec
-
- Indexer indexer;
- IndexerDeclaration decl = (IndexerDeclaration) $3;
- Pair pair = (Pair) $6;
- Block get_block = null;
- Block set_block = null;
-
- if (pair.First != null)
- get_block = (Block) pair.First;
- if (pair.Second != null)
- set_block = (Block) pair.Second;
-
- indexer = new Indexer (decl.type, decl.interface_type, (int) $2, decl.param_list,
- get_block, set_block, (Attributes) $1, (Location) $5);
-
- // Note that there is no equivalent of CheckDef for this case
- // We shall handle this in semantic analysis
-
- current_container.AddIndexer (indexer);
-
- current_local_parameters = null;
- implicit_value_parameter_type = null;
- indexer_parameters = null;
- }
- ;
-
-indexer_declarator
- : type THIS OPEN_BRACKET opt_formal_parameter_list CLOSE_BRACKET
- {
- Parameters pars = (Parameters) $4;
-
- if (pars.FixedParameters == null){
- Report.Error (1551, lexer.Location, "Indexers must have at least one parameter");
- }
-
- $$ = new IndexerDeclaration ((string) $1, null, pars);
- }
- | type qualified_identifier DOT THIS OPEN_BRACKET opt_formal_parameter_list CLOSE_BRACKET
- {
- Parameters pars = (Parameters) $6;
-
- if (pars.FixedParameters == null){
- Report.Error (1551, lexer.Location, "Indexers must have at least one parameter");
- }
- $$ = new IndexerDeclaration ((string) $1, (string) $2, pars);
- }
- ;
-
-enum_declaration
- : opt_attributes
- opt_modifiers
- ENUM IDENTIFIER
- opt_enum_base
- enum_body
- opt_semicolon
- {
- string full_name = MakeName ((string) $4);
- Enum e = new Enum (current_container, (string) $5, (int) $2, full_name, (Attributes) $1, lexer.Location);
-
- foreach (VariableDeclaration ev in (ArrayList) $6){
- CheckDef (e.AddEnumMember (ev.identifier,
- (Expression) ev.expression_or_array_initializer,
- (Location) ev.Location),
- ev.identifier);
- }
-
- CheckDef (current_container.AddEnum (e), name);
- }
- ;
-
-opt_enum_base
- : /* empty */ { $$ = "System.Int32"; }
- | COLON type { $$ = $2; }
- ;
-
-enum_body
- : OPEN_BRACE opt_enum_member_declarations CLOSE_BRACE
- {
- $$ = $2;
- }
- ;
-
-opt_enum_member_declarations
- : /* empty */ { $$ = new ArrayList (); }
- | enum_member_declarations opt_comma { $$ = $1; }
- ;
-
-enum_member_declarations
- : enum_member_declaration
- {
- ArrayList l = new ArrayList ();
-
- l.Add ($1);
- $$ = l;
- }
- | enum_member_declarations COMMA enum_member_declaration
- {
- ArrayList l = (ArrayList) $1;
-
- l.Add ($3);
-
- $$ = l;
- }
- ;
-
-enum_member_declaration
- : opt_attributes IDENTIFIER
- {
- $$ = new VariableDeclaration ((string) $2, null, lexer.Location);
- }
- | opt_attributes IDENTIFIER
- {
- $$ = lexer.Location;
- }
- ASSIGN expression
- {
- $$ = new VariableDeclaration ((string) $2, $5, lexer.Location);
- }
- ;
-
-delegate_declaration
- : opt_attributes
- opt_modifiers
- DELEGATE type
- IDENTIFIER OPEN_PARENS
- opt_formal_parameter_list
- CLOSE_PARENS
- SEMICOLON
- {
- Delegate del = new Delegate ((string) $4, (int) $2,
- MakeName ((string) $5), (Parameters) $7,
- (Attributes) $1, lexer.Location);
-
- CheckDef (current_container.AddDelegate (del), del.Name);
- }
- | opt_attributes
- opt_modifiers
- DELEGATE VOID
- IDENTIFIER OPEN_PARENS
- opt_formal_parameter_list
- CLOSE_PARENS
- SEMICOLON
- {
- Delegate del = new Delegate ("System.Void", (int) $2, (string) $5, (Parameters) $7,
- (Attributes) $1, lexer.Location);
-
- CheckDef (current_container.AddDelegate (del), del.Name);
- }
- ;
-
-type_name
- : namespace_or_type_name
- ;
-
-namespace_or_type_name
- : qualified_identifier
- ;
-
-/*
- * Before you think of adding a return_type, notice that we have been
- * using two rules in the places where it matters (one rule using type
- * and another identical one that uses VOID as the return type). This
- * gets rid of a shift/reduce couple
- */
-type
- : type_name { /* class_type */
- /*
- This does interfaces, delegates, struct_types, class_types,
- parent classes, and more! 4.2
- */
- $$ = $1;
- }
- | builtin_types
- | array_type
- | pointer_type
- ;
-
-
-pointer_type
- : type STAR
- {
- //
- // Note that here only unmanaged types are allowed but we
- // can't perform checks during this phase - we do it during
- // semantic analysis.
- //
- $$ = (string) $1 + "*";
- }
- | VOID STAR
- {
- $$ = "System.Void*";
- }
- ;
-
-non_expression_type
- : builtin_types
- {
- $$ = new SimpleName ((string) $1, lexer.Location);
- }
- | non_expression_type rank_specifier
- {
- $$ = new ComposedCast ((Expression) $1, (string) $2, lexer.Location);
- }
- | non_expression_type STAR
- {
- $$ = new ComposedCast ((Expression) $1, "*", lexer.Location);
- }
- | expression rank_specifiers
- {
- $$ = new ComposedCast ((Expression) $1, (string) $2, lexer.Location);
- }
- | expression STAR
- {
- $$ = new ComposedCast ((Expression) $1, "*", lexer.Location);
- }
- ;
-
-type_list
- : type
- {
- ArrayList types = new ArrayList ();
-
- types.Add ($1);
- $$ = types;
- }
- | type_list COMMA type
- {
- ArrayList types = (ArrayList) $1;
-
- types.Add ($3);
- $$ = types;
- }
- ;
-
-/*
- * replaces all the productions for isolating the various
- * simple types, but we need this to reuse it easily in local_variable_type
- */
-builtin_types
- : OBJECT { $$ = "System.Object"; }
- | STRING { $$ = "System.String"; }
- | BOOL { $$ = "System.Boolean"; }
- | DECIMAL { $$ = "System.Decimal"; }
- | FLOAT { $$ = "System.Single"; }
- | DOUBLE { $$ = "System.Double"; }
- | integral_type
- ;
-
-integral_type
- : SBYTE { $$ = "System.SByte"; }
- | BYTE { $$ = "System.Byte"; }
- | SHORT { $$ = "System.Int16"; }
- | USHORT { $$ = "System.UInt16"; }
- | INT { $$ = "System.Int32"; }
- | UINT { $$ = "System.UInt32"; }
- | LONG { $$ = "System.Int64"; }
- | ULONG { $$ = "System.UInt64"; }
- | CHAR { $$ = "System.Char"; }
- ;
-
-interface_type
- : type_name
- ;
-
-array_type
- : type rank_specifiers
- {
- $$ = (string) $1 + (string) $2;
- }
- ;
-
-//
-// Expressions, section 7.5
-//
-primary_expression
- : literal
- {
- // 7.5.1: Literals
- }
-
- | qualified_identifier
- {
- string name = (string) $1;
-
- $$ = null;
- $$ = DecomposeQI (name, lexer.Location);
- }
- | parenthesized_expression
- | member_access
- | invocation_expression
- | element_access
- | this_access
- | base_access
- | post_increment_expression
- | post_decrement_expression
- | new_expression
- | typeof_expression
- | sizeof_expression
- | checked_expression
- | unchecked_expression
- | pointer_member_access
- // TODO: pointer_element_access
- // TODO: sizeof-expression
- ;
-
-literal
- : boolean_literal
- | integer_literal
- | real_literal
- | LITERAL_CHARACTER { $$ = new CharLiteral ((char) lexer.Value); }
- | LITERAL_STRING { $$ = new StringLiteral ((string) lexer.Value); }
- | NULL { $$ = NullLiteral.Null; }
- ;
-
-real_literal
- : LITERAL_FLOAT { $$ = new FloatLiteral ((float) lexer.Value); }
- | LITERAL_DOUBLE { $$ = new DoubleLiteral ((double) lexer.Value); }
- | LITERAL_DECIMAL { $$ = new DecimalLiteral ((decimal) lexer.Value); }
- ;
-
-integer_literal
- : LITERAL_INTEGER {
- object v = lexer.Value;
-
- //
- // FIXME: Possible optimization would be to
- // compute the *Literal objects directly in the scanner
- //
- if (v is int)
- $$ = new IntLiteral ((Int32) v);
- else if (v is uint)
- $$ = new UIntLiteral ((UInt32) v);
- else if (v is long)
- $$ = new LongLiteral ((Int64) v);
- else if (v is ulong)
- $$ = new ULongLiteral ((UInt64) v);
- else
- Console.WriteLine ("OOPS. Unexpected result from scanner");
- }
- ;
-
-boolean_literal
- : TRUE { $$ = new BoolLiteral (true); }
- | FALSE { $$ = new BoolLiteral (false); }
- ;
-
-parenthesized_expression
- : OPEN_PARENS expression CLOSE_PARENS
- { $$ = $2; }
- ;
-
-member_access
- : primary_expression DOT IDENTIFIER
- {
- $$ = new MemberAccess ((Expression) $1, (string) $3, lexer.Location);
- }
- | predefined_type DOT IDENTIFIER
- {
- $$ = new SimpleName ((string) $1 + "." + (string) $3, lexer.Location);
- }
- ;
-
-predefined_type
- : builtin_types
- ;
-
-invocation_expression
- : primary_expression OPEN_PARENS opt_argument_list CLOSE_PARENS
- {
- if ($1 == null) {
- Location l = lexer.Location;
- Report.Error (1, l, "THIS IS CRAZY");
- }
- $$ = new Invocation ((Expression) $1, (ArrayList) $3, lexer.Location);
- }
- ;
-
-opt_argument_list
- : /* empty */ { $$ = null; }
- | argument_list
- ;
-
-argument_list
- : argument
- {
- ArrayList list = new ArrayList ();
- list.Add ($1);
- $$ = list;
- }
- | argument_list COMMA argument
- {
- ArrayList list = (ArrayList) $1;
- list.Add ($3);
- $$ = list;
- }
- ;
-
-argument
- : expression
- {
- $$ = new Argument ((Expression) $1, Argument.AType.Expression);
- }
- | REF variable_reference
- {
- $$ = new Argument ((Expression) $2, Argument.AType.Ref);
- }
- | OUT variable_reference
- {
- $$ = new Argument ((Expression) $2, Argument.AType.Out);
- }
- ;
-
-variable_reference
- : expression { note ("section 5.4"); $$ = $1; }
- ;
-
-element_access
- : primary_expression OPEN_BRACKET expression_list CLOSE_BRACKET
- {
- $$ = new ElementAccess ((Expression) $1, (ArrayList) $3, lexer.Location);
- }
- | primary_expression rank_specifiers
- {
- // So the super-trick is that primary_expression
- // can only be either a SimpleName or a MemberAccess.
- // The MemberAccess case arises when you have a fully qualified type-name like :
- // Foo.Bar.Blah i;
- // SimpleName is when you have
- // Blah i;
-
- Expression expr = (Expression) $1;
- if (!(expr is SimpleName || expr is MemberAccess)) {
- Location l = lexer.Location;
- Report.Error (-1, l, "Invalid Type definition");
- $$ = "System.Object";
- }
-
- //
- // So we extract the string corresponding to the SimpleName
- // or MemberAccess
- //
- $$ = new SimpleName (GetQualifiedIdentifier (expr) + (string) $2, lexer.Location);
- }
- ;
-
-expression_list
- : expression
- {
- ArrayList list = new ArrayList ();
- list.Add ($1);
- $$ = list;
- }
- | expression_list COMMA expression
- {
- ArrayList list = (ArrayList) $1;
- list.Add ($3);
- $$ = list;
- }
- ;
-
-this_access
- : THIS
- {
- $$ = new This (lexer.Location);
- }
- ;
-
-base_access
- : BASE DOT IDENTIFIER
- {
- $$ = new BaseAccess ((string) $3, lexer.Location);
- }
- | BASE OPEN_BRACKET expression_list CLOSE_BRACKET
- {
- $$ = new BaseIndexerAccess ((ArrayList) $3, lexer.Location);
- }
- ;
-
-post_increment_expression
- : primary_expression OP_INC
- {
- $$ = new UnaryMutator (UnaryMutator.Mode.PostIncrement,
- (Expression) $1, lexer.Location);
- }
- ;
-
-post_decrement_expression
- : primary_expression OP_DEC
- {
- $$ = new UnaryMutator (UnaryMutator.Mode.PostDecrement,
- (Expression) $1, lexer.Location);
- }
- ;
-
-new_expression
- : object_or_delegate_creation_expression
- | array_creation_expression
- ;
-
-object_or_delegate_creation_expression
- : NEW type OPEN_PARENS opt_argument_list CLOSE_PARENS
- {
- $$ = new New ((string) $2, (ArrayList) $4, lexer.Location);
- }
- ;
-
-array_creation_expression
- : NEW type OPEN_BRACKET expression_list CLOSE_BRACKET
- opt_rank_specifier
- opt_array_initializer
- {
- $$ = new ArrayCreation ((string) $2, (ArrayList) $4, (string) $6, (ArrayList) $7,
- lexer.Location);
- }
- | NEW type rank_specifiers array_initializer
- {
- $$ = new ArrayCreation ((string) $2, (string) $3, (ArrayList) $4, lexer.Location);
- }
- | NEW type error
- {
- Report.Error (1526, lexer.Location, "new expression requires () or [] after type");
- }
- ;
-
-opt_rank_specifier
- : /* empty */
- {
- $$ = "";
- }
- | rank_specifiers
- {
- $$ = $1;
- }
- ;
-
-rank_specifiers
- : rank_specifier
- {
- $$ = $1;
- }
- | rank_specifiers rank_specifier
- {
- $$ = (string) $2 + (string) $1;
- }
- ;
-
-rank_specifier
- : OPEN_BRACKET opt_dim_separators CLOSE_BRACKET
- {
- $$ = "[" + (string) $2 + "]";
- }
- ;
-
-opt_dim_separators
- : /* empty */
- {
- $$ = "";
- }
- | dim_separators
- {
- $$ = $1;
- }
- ;
-
-dim_separators
- : COMMA
- {
- $$ = ",";
- }
- | dim_separators COMMA
- {
- $$ = (string) $1 + ",";
- }
- ;
-
-opt_array_initializer
- : /* empty */
- {
- $$ = null;
- }
- | array_initializer
- {
- $$ = $1;
- }
- ;
-
-array_initializer
- : OPEN_BRACE CLOSE_BRACE
- {
- ArrayList list = new ArrayList ();
- $$ = list;
- }
- | OPEN_BRACE variable_initializer_list opt_comma CLOSE_BRACE
- {
- $$ = (ArrayList) $2;
- }
- ;
-
-variable_initializer_list
- : variable_initializer
- {
- ArrayList list = new ArrayList ();
- list.Add ($1);
- $$ = list;
- }
- | variable_initializer_list COMMA variable_initializer
- {
- ArrayList list = (ArrayList) $1;
- list.Add ($3);
- $$ = list;
- }
- ;
-
-typeof_expression
- : TYPEOF OPEN_PARENS type CLOSE_PARENS
- {
- $$ = new TypeOf ((string) $3, lexer.Location);
- }
- ;
-
-sizeof_expression
- : SIZEOF OPEN_PARENS type CLOSE_PARENS {
- $$ = new SizeOf ((string) $3, lexer.Location);
-
- note ("Verify type is unmanaged");
- note ("if (5.8) builtin, yield constant expression");
- }
- ;
-
-checked_expression
- : CHECKED OPEN_PARENS expression CLOSE_PARENS
- {
- $$ = new CheckedExpr ((Expression) $3);
- }
- ;
-
-unchecked_expression
- : UNCHECKED OPEN_PARENS expression CLOSE_PARENS
- {
- $$ = new UnCheckedExpr ((Expression) $3);
- }
- ;
-
-pointer_member_access
- : primary_expression OP_PTR IDENTIFIER
- {
- Expression deref;
-
- deref = new Unary (Unary.Operator.Indirection, (Expression) $1, lexer.Location);
- $$ = new MemberAccess (deref, (string) $3, lexer.Location);
- }
-
-unary_expression
- : primary_expression
- | BANG prefixed_unary_expression
- {
- $$ = new Unary (Unary.Operator.LogicalNot, (Expression) $2, lexer.Location);
- }
- | TILDE prefixed_unary_expression
- {
- $$ = new Unary (Unary.Operator.OnesComplement, (Expression) $2, lexer.Location);
- }
- | OPEN_PARENS expression CLOSE_PARENS unary_expression
- {
- $$ = new Cast ((Expression) $2, (Expression) $4, lexer.Location);
- }
- | OPEN_PARENS non_expression_type CLOSE_PARENS prefixed_unary_expression
- {
- $$ = new Cast ((Expression) $2, (Expression) $4, lexer.Location);
- }
- ;
-
- //
- // The idea to split this out is from Rhys' grammar
- // to solve the problem with casts.
- //
-prefixed_unary_expression
- : unary_expression
- | PLUS prefixed_unary_expression
- {
- $$ = new Unary (Unary.Operator.UnaryPlus, (Expression) $2, lexer.Location);
- }
- | MINUS prefixed_unary_expression
- {
- $$ = new Unary (Unary.Operator.UnaryNegation, (Expression) $2, lexer.Location);
- }
- | OP_INC prefixed_unary_expression
- {
- $$ = new UnaryMutator (UnaryMutator.Mode.PreIncrement,
- (Expression) $2, lexer.Location);
- }
- | OP_DEC prefixed_unary_expression
- {
- $$ = new UnaryMutator (UnaryMutator.Mode.PreDecrement,
- (Expression) $2, lexer.Location);
- }
- | STAR prefixed_unary_expression
- {
- $$ = new Unary (Unary.Operator.Indirection, (Expression) $2, lexer.Location);
- }
- | BITWISE_AND prefixed_unary_expression
- {
- $$ = new Unary (Unary.Operator.AddressOf, (Expression) $2, lexer.Location);
- }
- ;
-
-pre_increment_expression
- : OP_INC prefixed_unary_expression
- {
- $$ = new UnaryMutator (UnaryMutator.Mode.PreIncrement,
- (Expression) $2, lexer.Location);
- }
- ;
-
-pre_decrement_expression
- : OP_DEC prefixed_unary_expression
- {
- $$ = new UnaryMutator (UnaryMutator.Mode.PreDecrement,
- (Expression) $2, lexer.Location);
- }
- ;
-
-multiplicative_expression
- : prefixed_unary_expression
- | multiplicative_expression STAR prefixed_unary_expression
- {
- $$ = new Binary (Binary.Operator.Multiply,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- | multiplicative_expression DIV prefixed_unary_expression
- {
- $$ = new Binary (Binary.Operator.Division,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- | multiplicative_expression PERCENT prefixed_unary_expression
- {
- $$ = new Binary (Binary.Operator.Modulus,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- ;
-
-additive_expression
- : multiplicative_expression
- | additive_expression PLUS multiplicative_expression
- {
- $$ = new Binary (Binary.Operator.Addition,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- | additive_expression MINUS multiplicative_expression
- {
- $$ = new Binary (Binary.Operator.Subtraction,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- ;
-
-shift_expression
- : additive_expression
- | shift_expression OP_SHIFT_LEFT additive_expression
- {
- $$ = new Binary (Binary.Operator.LeftShift,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- | shift_expression OP_SHIFT_RIGHT additive_expression
- {
- $$ = new Binary (Binary.Operator.RightShift,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- ;
-
-relational_expression
- : shift_expression
- | relational_expression OP_LT shift_expression
- {
- $$ = new Binary (Binary.Operator.LessThan,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- | relational_expression OP_GT shift_expression
- {
- $$ = new Binary (Binary.Operator.GreaterThan,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- | relational_expression OP_LE shift_expression
- {
- $$ = new Binary (Binary.Operator.LessThanOrEqual,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- | relational_expression OP_GE shift_expression
- {
- $$ = new Binary (Binary.Operator.GreaterThanOrEqual,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- | relational_expression IS type
- {
- $$ = new Is ((Expression) $1, (string) $3, lexer.Location);
- }
- | relational_expression AS type
- {
- $$ = new As ((Expression) $1, (string) $3, lexer.Location);
- }
- ;
-
-equality_expression
- : relational_expression
- | equality_expression OP_EQ relational_expression
- {
- $$ = new Binary (Binary.Operator.Equality,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- | equality_expression OP_NE relational_expression
- {
- $$ = new Binary (Binary.Operator.Inequality,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- ;
-
-and_expression
- : equality_expression
- | and_expression BITWISE_AND equality_expression
- {
- $$ = new Binary (Binary.Operator.BitwiseAnd,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- ;
-
-exclusive_or_expression
- : and_expression
- | exclusive_or_expression CARRET and_expression
- {
- $$ = new Binary (Binary.Operator.ExclusiveOr,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- ;
-
-inclusive_or_expression
- : exclusive_or_expression
- | inclusive_or_expression BITWISE_OR exclusive_or_expression
- {
- $$ = new Binary (Binary.Operator.BitwiseOr,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- ;
-
-conditional_and_expression
- : inclusive_or_expression
- | conditional_and_expression OP_AND inclusive_or_expression
- {
- $$ = new Binary (Binary.Operator.LogicalAnd,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- ;
-
-conditional_or_expression
- : conditional_and_expression
- | conditional_or_expression OP_OR conditional_and_expression
- {
- $$ = new Binary (Binary.Operator.LogicalOr,
- (Expression) $1, (Expression) $3, lexer.Location);
- }
- ;
-
-conditional_expression
- : conditional_or_expression
- | conditional_or_expression INTERR expression COLON expression
- {
- $$ = new Conditional ((Expression) $1, (Expression) $3, (Expression) $5, lexer.Location);
- }
- ;
-
-assignment_expression
- : prefixed_unary_expression ASSIGN expression
- {
- $$ = new Assign ((Expression) $1, (Expression) $3, lexer.Location);
- }
- | prefixed_unary_expression OP_MULT_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.Multiply,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- | prefixed_unary_expression OP_DIV_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.Division,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- | prefixed_unary_expression OP_MOD_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.Modulus,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- | prefixed_unary_expression OP_ADD_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.Addition,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- | prefixed_unary_expression OP_SUB_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.Subtraction,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- | prefixed_unary_expression OP_SHIFT_LEFT_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.LeftShift,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- | prefixed_unary_expression OP_SHIFT_RIGHT_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.RightShift,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- | prefixed_unary_expression OP_AND_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.BitwiseAnd,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- | prefixed_unary_expression OP_OR_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.BitwiseOr,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- | prefixed_unary_expression OP_XOR_ASSIGN expression
- {
- Location l = lexer.Location;
-
- $$ = new Assign ((Expression) $1,
- new Binary (Binary.Operator.ExclusiveOr,
- (Expression) $1,
- (Expression) $3, l), l);
- }
- ;
-
-expression
- : conditional_expression
- | assignment_expression
- ;
-
-constant_expression
- : expression
- ;
-
-boolean_expression
- : expression
- ;
-
-//
-// 10 classes
-//
-class_declaration
- : opt_attributes
- opt_modifiers
- CLASS IDENTIFIER
- {
- Class new_class;
- string name;
-
- name = MakeName ((string) $4);
-
- new_class = new Class (current_container, name, (int) $2,
- (Attributes) $1, lexer.Location);
- current_container = new_class;
- current_container.Namespace = current_namespace;
- RootContext.Tree.RecordClass (name, new_class);
- }
- opt_class_base
- class_body
- opt_semicolon
- {
- Class new_class = (Class) current_container;
-
- if ($6 != null)
- new_class.Bases = (ArrayList) $6;
-
- current_container = current_container.Parent;
- CheckDef (current_container.AddClass (new_class), new_class.Name);
-
- $$ = new_class;
- }
- ;
-
-opt_modifiers
- : /* empty */ { $$ = (int) 0; }
- | modifiers
- ;
-
-modifiers
- : modifier
- | modifiers modifier
- {
- int m1 = (int) $1;
- int m2 = (int) $2;
-
- if ((m1 & m2) != 0) {
- Location l = lexer.Location;
- Report.Error (1004, l, "Duplicate modifier: `" + Modifiers.Name (m2) + "'");
- }
- $$ = (int) (m1 | m2);
- }
- ;
-
-modifier
- : NEW { $$ = Modifiers.NEW; }
- | PUBLIC { $$ = Modifiers.PUBLIC; }
- | PROTECTED { $$ = Modifiers.PROTECTED; }
- | INTERNAL { $$ = Modifiers.INTERNAL; }
- | PRIVATE { $$ = Modifiers.PRIVATE; }
- | ABSTRACT { $$ = Modifiers.ABSTRACT; }
- | SEALED { $$ = Modifiers.SEALED; }
- | STATIC { $$ = Modifiers.STATIC; }
- | READONLY { $$ = Modifiers.READONLY; }
- | VIRTUAL { $$ = Modifiers.VIRTUAL; }
- | OVERRIDE { $$ = Modifiers.OVERRIDE; }
- | EXTERN { $$ = Modifiers.EXTERN; }
- | VOLATILE { $$ = Modifiers.VOLATILE; }
- | UNSAFE { $$ = Modifiers.UNSAFE; }
- ;
-
-opt_class_base
- : /* empty */ { $$ = null; }
- | class_base { $$ = $1; }
- ;
-
-class_base
- : COLON type_list { $$ = $2; }
- ;
-
-//
-// Statements (8.2)
-//
-
-//
-// A block is "contained" on the following places:
-// method_body
-// property_declaration as part of the accessor body (get/set)
-// operator_declaration
-// constructor_declaration
-// destructor_declaration
-// event_declaration as part of add_accessor_declaration or remove_accessor_declaration
-//
-block
- : OPEN_BRACE
- {
- current_block = new Block (current_block);
- }
- opt_statement_list CLOSE_BRACE
- {
- while (current_block.Implicit)
- current_block = current_block.Parent;
- $$ = current_block;
- current_block = current_block.Parent;
- }
- ;
-
-opt_statement_list
- : /* empty */
- | statement_list
- ;
-
-statement_list
- : statement
- | statement_list statement
- ;
-
-statement
- : declaration_statement
- {
- if ((Block) $1 != current_block){
- current_block.AddStatement ((Statement) $1);
- current_block = (Block) $1;
- }
- }
- | embedded_statement
- {
- Statement s = (Statement) $1;
-
-
- current_block.AddStatement ((Statement) $1);
- }
- | labeled_statement
- ;
-
-embedded_statement
- : block
- | empty_statement
- | expression_statement
- | selection_statement
- | iteration_statement
- | jump_statement
- | try_statement
- | checked_statement
- | unchecked_statement
- | lock_statement
- | using_statement
- | unsafe_statement
- | fixed_statement
- ;
-
-empty_statement
- : SEMICOLON
- {
- $$ = new EmptyStatement ();
- }
- ;
-
-labeled_statement
- : IDENTIFIER COLON
- {
- LabeledStatement labeled = new LabeledStatement ((string) $1);
-
- if (!current_block.AddLabel ((string) $1, labeled)){
- Location l = lexer.Location;
- Report.Error (140, l, "The label '" + ((string) $1) + "' is a duplicate");
- }
- current_block.AddStatement (labeled);
- }
- statement
- ;
-
-declaration_statement
- : local_variable_declaration SEMICOLON
- {
- DictionaryEntry de = (DictionaryEntry) $1;
-
- $$ = declare_local_variables ((string) de.Key, (ArrayList) de.Value, lexer.Location);
- }
-
- | local_constant_declaration SEMICOLON
- {
- DictionaryEntry de = (DictionaryEntry) $1;
-
- $$ = declare_local_constant ((string) de.Key, (VariableDeclaration) de.Value);
- }
- ;
-
-/*
- * The following is from Rhys' grammar:
- * > Types in local variable declarations must be recognized as
- * > expressions to prevent reduce/reduce errors in the grammar.
- * > The expressions are converted into types during semantic analysis.
- */
-local_variable_type
- : primary_expression opt_rank_specifier
- {
- // FIXME: Do something smart here regarding the composition of the type.
-
- // Ok, the above "primary_expression" is there to get rid of
- // both reduce/reduce and shift/reduces in the grammar, it should
- // really just be "type_name". If you use type_name, a reduce/reduce
- // creeps up. If you use qualified_identifier (which is all we need
- // really) two shift/reduces appear.
- //
-
- // So the super-trick is that primary_expression
- // can only be either a SimpleName or a MemberAccess.
- // The MemberAccess case arises when you have a fully qualified type-name like :
- // Foo.Bar.Blah i;
- // SimpleName is when you have
- // Blah i;
-
- Expression expr = (Expression) $1;
- if (!(expr is SimpleName || expr is MemberAccess)) {
- Location l = lexer.Location;
- Report.Error (-1, l, "Invalid Type definition");
- $$ = "System.Object";
- }
-
- //
- // So we extract the string corresponding to the SimpleName
- // or MemberAccess
- //
- $$ = GetQualifiedIdentifier (expr) + (string) $2;
- }
- | builtin_types opt_rank_specifier
- {
- $$ = (string) $1 + (string) $2;
- }
- ;
-
-local_variable_pointer_type
- : primary_expression STAR
- {
- Expression expr = (Expression) $1;
- if (!(expr is SimpleName || expr is MemberAccess)) {
- Location l = lexer.Location;
- Report.Error (-1, l, "Invalid Type definition");
- $$ = "System.Object";
- }
-
- $$ = GetQualifiedIdentifier (expr) + "*";
- }
- | builtin_types STAR
- {
- $$ = (string) $1 + "*";
- }
- | VOID STAR
- {
- $$ = "System.Void*";
- }
- | local_variable_pointer_type STAR
- {
- $$ = (string) $1 + "*";
- }
- ;
-
-local_variable_declaration
- : local_variable_type variable_declarators
- {
- $$ = new DictionaryEntry ($1, $2);
- }
- | local_variable_pointer_type opt_rank_specifier variable_declarators
- {
- $$ = new DictionaryEntry ((string) $1 + (string) $2, $3);
- }
- ;
-
-local_constant_declaration
- : CONST local_variable_type constant_declarator
- {
- $$ = new DictionaryEntry ($2, $3);
- }
- ;
-
-expression_statement
- : statement_expression SEMICOLON
- {
- $$ = $1;
- }
- ;
-
- //
- // We have to do the wrapping here and not in the case above,
- // because statement_expression is used for example in for_statement
- //
-statement_expression
- : invocation_expression { $$ = new StatementExpression ((ExpressionStatement) $1); }
- | object_creation_expression { $$ = new StatementExpression ((ExpressionStatement) $1); }
- | assignment_expression { $$ = new StatementExpression ((ExpressionStatement) $1); }
- | post_increment_expression { $$ = new StatementExpression ((ExpressionStatement) $1); }
- | post_decrement_expression { $$ = new StatementExpression ((ExpressionStatement) $1); }
- | pre_increment_expression { $$ = new StatementExpression ((ExpressionStatement) $1); }
- | pre_decrement_expression { $$ = new StatementExpression ((ExpressionStatement) $1); }
- | error {
- Report.Error (1002, lexer.Location, "Expecting `;'");
- }
- ;
-
-object_creation_expression
- : object_or_delegate_creation_expression
- { note ("complain if this is a delegate maybe?"); }
- ;
-
-selection_statement
- : if_statement
- | switch_statement
- ;
-
-if_statement
- : if_statement_open if_statement_rest
- {
- $$ = $2;
- }
- ;
-
-if_statement_open
- : IF OPEN_PARENS
- {
- oob_stack.Push (lexer.Location);
- }
- ;
-
-if_statement_rest
- : boolean_expression CLOSE_PARENS
- embedded_statement
- {
- Location l = (Location) oob_stack.Pop ();
-
- $$ = new If ((Expression) $1, (Statement) $3, l);
-
- if (RootContext.WarningLevel >= 3){
- if ($3 is EmptyStatement)
- Report.Warning (642, lexer.Location, "Possibly mistaken empty statement");
- }
-
- }
- | boolean_expression CLOSE_PARENS
- embedded_statement ELSE embedded_statement
- {
- Location l = (Location) oob_stack.Pop ();
-
- $$ = new If ((Expression) $1, (Statement) $3, (Statement) $5, l);
- }
- ;
-
-switch_statement
- : SWITCH OPEN_PARENS
- {
- oob_stack.Push (lexer.Location);
- }
- expression CLOSE_PARENS
- switch_block
- {
- $$ = new Switch ((Expression) $4, (ArrayList) $6, (Location) oob_stack.Pop ());
- }
- ;
-
-switch_block
- : OPEN_BRACE
- opt_switch_sections
- CLOSE_BRACE
- {
- $$ = $2;
- }
- ;
-
-opt_switch_sections
- : /* empty */
- {
- Report.Error (1522, lexer.Location, "Empty switch block");
- }
- | switch_sections
- ;
-
-switch_sections
- : switch_section
- {
- ArrayList sections = new ArrayList ();
-
- sections.Add ($1);
- $$ = sections;
- }
- | switch_sections switch_section
- {
- ArrayList sections = (ArrayList) $1;
-
- sections.Add ($2);
- $$ = sections;
- }
- ;
-
-switch_section
- : switch_labels
- {
- current_block = new Block (current_block);
- }
- statement_list
- {
- while (current_block.Implicit)
- current_block = current_block.Parent;
- $$ = new SwitchSection ((ArrayList) $1, current_block);
- current_block = current_block.Parent;
- }
- ;
-
-switch_labels
- : switch_label
- {
- ArrayList labels = new ArrayList ();
-
- labels.Add ($1);
- $$ = labels;
- }
- | switch_labels switch_label
- {
- ArrayList labels = (ArrayList) ($1);
- labels.Add ($2);
-
- $$ = labels;
- }
- ;
-
-switch_label
- : CASE constant_expression COLON { $$ = new SwitchLabel ((Expression) $2, lexer.Location); }
- | DEFAULT COLON { $$ = new SwitchLabel (null, lexer.Location); }
- | error {
- Report.Error (
- 1523, lexer.Location,
- "The keyword case or default must precede code in switch block");
- }
- ;
-
-iteration_statement
- : while_statement
- | do_statement
- | for_statement
- | foreach_statement
- ;
-
-while_statement
- : WHILE OPEN_PARENS
- {
- oob_stack.Push (lexer.Location);
- }
- boolean_expression CLOSE_PARENS embedded_statement
- {
- Location l = (Location) oob_stack.Pop ();
- $$ = new While ((Expression) $4, (Statement) $6, l);
-
- if (RootContext.WarningLevel >= 3){
- if ($6 is EmptyStatement)
- Report.Warning (642, lexer.Location, "Possibly mistaken empty statement");
- }
- }
- ;
-
-do_statement
- : DO embedded_statement
- WHILE OPEN_PARENS boolean_expression CLOSE_PARENS SEMICOLON
- {
- $$ = new Do ((Statement) $2, (Expression) $5, lexer.Location);
- }
- ;
-
-for_statement
- : FOR OPEN_PARENS
- opt_for_initializer SEMICOLON
- {
- Block assign_block = new Block (current_block);
- current_block = assign_block;
-
- if ($3 is DictionaryEntry){
- DictionaryEntry de = (DictionaryEntry) $3;
-
- string type = (string) de.Key;
- ArrayList var_declarators = (ArrayList) de.Value;
-
- foreach (VariableDeclaration decl in var_declarators){
-
- VariableInfo vi;
-
- vi = current_block.AddVariable (
- type, decl.identifier, current_local_parameters, decl.Location);
- if (vi == null){
- Report.Error (128, decl.Location,
- "A local variable `" + decl.identifier +
- "' is already defined in this scope");
- } else {
- Location l = lexer.Location;
- Expression expr;
- if (decl.expression_or_array_initializer is Expression){
- expr = (Expression) decl.expression_or_array_initializer;
-
- } else {
-
- ArrayList init = (ArrayList) decl.expression_or_array_initializer;
-
- string base_type = type.Substring (0, type.IndexOf ("["));
- string rank = type.Substring (type.IndexOf ("["));
-
- expr = new ArrayCreation (base_type, rank, init, decl.Location);
- }
-
- LocalVariableReference var;
- var = new LocalVariableReference (
- assign_block, decl.identifier, l);
-
- Assign a = new Assign (var, expr, decl.Location);
-
- assign_block.AddStatement (new StatementExpression (a));
- }
- }
-
- $3 = null;
- }
- oob_stack.Push (lexer.Location);
- }
- opt_for_condition SEMICOLON
- opt_for_iterator CLOSE_PARENS
- embedded_statement
- {
- Location l = (Location) oob_stack.Pop ();
-
- For f = new For ((Statement) $3, (Expression) $6, (Statement) $8, (Statement) $10, l);
-
- if (RootContext.WarningLevel >= 3){
- if ($10 is EmptyStatement)
- Report.Warning (642, lexer.Location, "Possibly mistaken empty statement");
- }
-
- current_block.AddStatement (f);
- while (current_block.Implicit)
- current_block = current_block.Parent;
- $$ = current_block;
- current_block = current_block.Parent;
- }
- ;
-
-opt_for_initializer
- : /* empty */ { $$ = new EmptyStatement (); }
- | for_initializer
- ;
-
-for_initializer
- : local_variable_declaration
- | statement_expression_list
- ;
-
-opt_for_condition
- : /* empty */ { $$ = null; }
- | boolean_expression
- ;
-
-opt_for_iterator
- : /* empty */ { $$ = new EmptyStatement (); }
- | for_iterator
- ;
-
-for_iterator
- : statement_expression_list
- ;
-
-statement_expression_list
- : statement_expression
- {
- Block b = new Block (null, true);
-
- b.AddStatement ((Statement) $1);
- $$ = b;
- }
- | statement_expression_list COMMA statement_expression
- {
- Block b = (Block) $1;
-
- b.AddStatement ((Statement) $3);
- $$ = $1;
- }
- ;
-
-foreach_statement
- : FOREACH OPEN_PARENS type IDENTIFIER IN
- {
- oob_stack.Push (lexer.Location);
- }
- expression CLOSE_PARENS
- {
- oob_stack.Push (current_block);
-
- Block foreach_block = new Block (current_block, true);
- LocalVariableReference v;
- Location l = lexer.Location;
- VariableInfo vi;
-
- vi = foreach_block.AddVariable ((string) $3, (string) $4, current_local_parameters, l);
- if (vi == null){
- Report.Error (
- 128, l, "A local variable `" + (string) $4 + "' is already "+
- "defined in this scope");
- }
-
- v = new LocalVariableReference (foreach_block, (string) $4, l);
-
- current_block.AddStatement (foreach_block);
- current_block = foreach_block;
-
- oob_stack.Push (v);
- }
- embedded_statement
- {
- LocalVariableReference v = (LocalVariableReference) oob_stack.Pop ();
- Block prev_block = (Block) oob_stack.Pop ();
- Location l = (Location) oob_stack.Pop ();
-
- while (current_block != prev_block)
- current_block = current_block.Parent;
-
- $$ = new Foreach ((string) $3, v, (Expression) $7, (Statement) $10, l);
- }
- ;
-
-jump_statement
- : break_statement
- | continue_statement
- | goto_statement
- | return_statement
- | throw_statement
- ;
-
-break_statement
- : BREAK SEMICOLON
- {
- $$ = new Break (lexer.Location);
- }
- ;
-
-continue_statement
- : CONTINUE SEMICOLON
- {
- $$ = new Continue (lexer.Location);
- }
- ;
-
-goto_statement
- : GOTO IDENTIFIER SEMICOLON
- {
- $$ = new Goto (current_block, (string) $2, lexer.Location);
- }
- | GOTO CASE constant_expression SEMICOLON
- {
- $$ = new GotoCase ((Expression) $3, lexer.Location);
- }
- | GOTO DEFAULT SEMICOLON
- {
- $$ = new GotoDefault (lexer.Location);
- }
- ;
-
-return_statement
- : RETURN opt_expression SEMICOLON
- {
- $$ = new Return ((Expression) $2, lexer.Location);
- }
- ;
-
-throw_statement
- : THROW opt_expression SEMICOLON
- {
- $$ = new Throw ((Expression) $2, lexer.Location);
- }
- ;
-
-opt_expression
- : /* empty */
- | expression
- ;
-
-try_statement
- : TRY block catch_clauses
- {
- Catch g = null;
- ArrayList s = new ArrayList ();
-
- foreach (Catch cc in (ArrayList) $3) {
- if (cc.Type == null)
- g = cc;
- else
- s.Add (cc);
- }
-
- // Now s contains the list of specific catch clauses
- // and g contains the general one.
-
- $$ = new Try ((Block) $2, s, g, null);
- }
- | TRY block opt_catch_clauses FINALLY block
- {
- Catch g = null;
- ArrayList s = new ArrayList ();
- ArrayList catch_list = (ArrayList) $3;
-
- if (catch_list != null){
- foreach (Catch cc in catch_list) {
- if (cc.Type == null)
- g = cc;
- else
- s.Add (cc);
- }
- }
-
- $$ = new Try ((Block) $2, s, g, (Block) $5);
- }
- | TRY block error
- {
- Report.Error (1524, lexer.Location, "Expected catch or finally");
- }
- ;
-
-opt_catch_clauses
- : /* empty */ { $$ = null; }
- | catch_clauses
- ;
-
-catch_clauses
- : catch_clause
- {
- ArrayList l = new ArrayList ();
-
- l.Add ($1);
- $$ = l;
- }
- | catch_clauses catch_clause
- {
- ArrayList l = (ArrayList) $1;
-
- l.Add ($2);
- $$ = l;
- }
- ;
-
-opt_identifier
- : /* empty */ { $$ = null; }
- | IDENTIFIER
- ;
-
-catch_clause
- : CATCH opt_catch_args
- {
- string type = null, id = null;
-
- if ($2 != null) {
- DictionaryEntry cc = (DictionaryEntry) $2;
- type = (string) cc.Key;
- id = (string) cc.Value;
-
- if (id != null){
- ArrayList one = new ArrayList ();
- Location loc = lexer.Location;
-
- one.Add (new VariableDeclaration (id, null, loc));
-
- $1 = current_block;
- current_block = new Block (current_block);
- Block b = declare_local_variables (type, one, loc);
- current_block = b;
-
-
- }
- }
- } block {
- string type = null, id = null;
-
- if ($2 != null){
- DictionaryEntry cc = (DictionaryEntry) $2;
- type = (string) cc.Key;
- id = (string) cc.Value;
-
- if ($1 != null){
- while (current_block != (Block) $1)
- current_block = current_block.Parent;
- }
- }
-
-
- $$ = new Catch (type, id , (Block) $4, lexer.Location);
- }
- ;
-
-opt_catch_args
- : /* empty */ { $$ = null; }
- | catch_args
- ;
-
-catch_args
- : OPEN_PARENS type opt_identifier CLOSE_PARENS
- {
- $$ = new DictionaryEntry ($2, $3);
- }
- ;
-
-checked_statement
- : CHECKED block
- {
- $$ = new Checked ((Block) $2);
- }
- ;
-
-unchecked_statement
- : UNCHECKED block
- {
- $$ = new Unchecked ((Block) $2);
- }
- ;
-
-unsafe_statement
- : UNSAFE
- {
- if (!RootContext.Unsafe){
- Report.Error (227, lexer.Location,
- "Unsafe code can only be used if --unsafe is used");
- }
- } block {
- $$ = new Unsafe ((Block) $3);
- }
- ;
-
-fixed_statement
- : FIXED OPEN_PARENS
- pointer_type fixed_pointer_declarators
- CLOSE_PARENS
- {
- Block assign_block = new Block (current_block, true);
- ArrayList list = (ArrayList) $4;
- string type = (string) $3;
- Location l = lexer.Location;
- int top = list.Count;
-
- for (int i = 0; i < top; i++){
- Pair p = (Pair) list [i];
- VariableInfo v;
-
- v = current_block.AddVariable (type, (string) p.First,current_local_parameters, l);
- if (v == null){
- Report.Error (
- 128, l, "A local variable `" + (string) p.First + "' is already "+
- "defined in this scope");
- }
- v.ReadOnly = true;
- p.First = v;
- list [i] = p;
- }
- current_block.AddStatement (assign_block);
- current_block = assign_block;
- oob_stack.Push (assign_block);
- oob_stack.Push (l);
- }
- embedded_statement
- {
- Location l = (Location) oob_stack.Pop ();
- Block assign_block = (Block) oob_stack.Pop ();
-
- ArrayList list = (ArrayList) $4;
- int top = list.Count;
-
- $$ = new Fixed ((string) $3, (ArrayList) $4, (Statement) $7, l);
- }
- ;
-
-fixed_pointer_declarators
- : fixed_pointer_declarator {
- ArrayList declarators = new ArrayList ();
- declarators.Add ($1);
- $$ = declarators;
- }
- | fixed_pointer_declarators COMMA fixed_pointer_declarator
- {
- ArrayList declarators = (ArrayList) $1;
- declarators.Add ($3);
- $$ = declarators;
- }
- ;
-
-fixed_pointer_declarator
- : IDENTIFIER ASSIGN expression
- {
- $$ = new Pair ($1, $3);
- }
- ;
-
-lock_statement
- : LOCK OPEN_PARENS expression CLOSE_PARENS
- {
- //
- }
- embedded_statement
- {
- $$ = new Lock ((Expression) $3, (Statement) $6, lexer.Location);
- }
- ;
-
-using_statement
- : USING OPEN_PARENS resource_acquisition CLOSE_PARENS
- {
- Block assign_block = new Block (current_block);
- current_block = assign_block;
-
- oob_stack.Push (lexer.Location);
-
- if ($3 is DictionaryEntry){
- DictionaryEntry de = (DictionaryEntry) $3;
- Location l = lexer.Location;
-
- string type = (string) de.Key;
- ArrayList var_declarators = (ArrayList) de.Value;
-
- foreach (VariableDeclaration decl in var_declarators){
- if (current_block.AddVariable (
- type, decl.identifier,
- current_local_parameters, decl.Location) == null){
- Report.Error (128, decl.Location,
- "A local variable `" + decl.identifier + "' is already" +
- "defined in this scope");
- }
- }
-
- ArrayList vars = new ArrayList ();
-
- foreach (VariableDeclaration decl in var_declarators){
-
- Expression expr;
- if (decl.expression_or_array_initializer is Expression){
- expr = (Expression) decl.expression_or_array_initializer;
-
- } else {
-
- ArrayList init = (ArrayList) decl.expression_or_array_initializer;
-
- string base_type = type.Substring (0, type.IndexOf ("["));
- string rank = type.Substring (type.IndexOf ("["));
-
- expr = new ArrayCreation (base_type, rank, init, decl.Location);
- }
-
- LocalVariableReference var;
- VariableInfo vi;
-
- var = new LocalVariableReference (assign_block, decl.identifier, l);
- vi = var.VariableInfo;
- vi.ReadOnly = true;
-
- // This is so that it is not a warning on using variables
- vi.Used = true;
-
- vars.Add (new DictionaryEntry (var, expr));
-
- // Assign a = new Assign (var, expr, decl.Location);
- // assign_block.AddStatement (new StatementExpression (a));
- }
- $3 = new DictionaryEntry (type, vars);
- }
- }
- embedded_statement
- {
- Using u = new Using ($3, (Statement) $6, (Location) oob_stack.Pop ());
- current_block.AddStatement (u);
- while (current_block.Implicit)
- current_block = current_block.Parent;
- $$ = current_block;
- current_block = current_block.Parent;
- }
- ;
-
-resource_acquisition
- : local_variable_declaration
- | expression
- ;
-
-%%
-
-// <summary>
-// A class used to pass around variable declarations and constants
-// </summary>
-public class VariableDeclaration {
- public string identifier;
- public object expression_or_array_initializer;
- public Location Location;
-
- public VariableDeclaration (string id, object eoai, Location l){
- this.identifier = id;
- this.expression_or_array_initializer = eoai;
- this.Location = l;
- }
-}
-
-// <summary>
-// A class used to hold info about an indexer declarator
-// </summary>
-
-public class IndexerDeclaration {
- public string type;
- public string interface_type;
- public Parameters param_list;
-
- public IndexerDeclaration (string type, string interface_type, Parameters param_list)
- {
- this.type = type;
- this.interface_type = interface_type;
- this.param_list = param_list;
- }
-}
-
-// <summary>
-// A class used to hold info about an operator declarator
-// </summary>
-
-public class OperatorDeclaration {
- public Operator.OpType optype;
- public string ret_type;
- public string arg1type;
- public string arg1name;
- public string arg2type;
- public string arg2name;
- public Location location;
-
- public OperatorDeclaration (Operator.OpType op, string ret_type, string arg1type, string arg1name,
- string arg2type, string arg2name, Location location)
- {
- optype = op;
- this.ret_type = ret_type;
- this.arg1type = arg1type;
- this.arg1name = arg1name;
- this.arg2type = arg2type;
- this.arg2name = arg2name;
- this.location = location;
- }
-
-}
-
-// <summary>
-// Given the @class_name name, it creates a fully qualified name
-// based on the containing declaration space
-// </summary>
-string
-MakeName (string class_name)
-{
- string ns = current_namespace.Name;
- string container_name = current_container.Name;
-
- if (container_name == ""){
- if (ns != "")
- return ns + "." + class_name;
- else
- return class_name;
- } else
- return container_name + "." + class_name;
-}
-
-// <summary>
-// Used to report back to the user the result of a declaration
-// in the current declaration space
-// </summary>
-void
-CheckDef (AdditionResult result, string name)
-{
- if (result == AdditionResult.Success)
- return;
-
- Location l = lexer.Location;
-
- switch (result){
- case AdditionResult.NameExists:
- Report.Error (102, l, "The namespace `" + current_container.Name +
- "' already contains a definition for `"+
- name + "'");
- break;
-
-
- //
- // This is handled only for static Constructors, because
- // in reality we handle these by the semantic analysis later
- //
- case AdditionResult.MethodExists:
- Report.Error (
- 111, l, "Class `"+current_container.Name+
- "' already defines a member called '" +
- name + "' with the same parameter types (more than one default constructor)");
- break;
-
- case AdditionResult.EnclosingClash:
- Report.Error (542, l, "Member names cannot be the same as their enclosing type");
- break;
-
- case AdditionResult.NotAConstructor:
- Report.Error (1520, l, "Class, struct, or interface method must have a return type");
- break;
- }
-}
-
-void
-CheckDef (bool result, string name)
-{
- if (result)
- return;
- CheckDef (AdditionResult.NameExists, name);
-}
-
-Expression
-SimpleLookup (string name, Location loc)
-{
- //
- // we need to check against current_block not being null
- // as `expression' is allowed in argument_lists, which
- // do not exist inside a block.
- //
- if (current_block != null){
- if (current_block.IsVariableDefined (name))
- return new LocalVariableReference (current_block, name, loc);
- }
-
- if (current_local_parameters != null){
- int idx;
- Parameter par = current_local_parameters.GetParameterByName (name, out idx);
- if (par != null)
- return new ParameterReference (current_local_parameters, idx, name);
- }
-
- return null;
-}
-
-Expression DecomposeQI (string name, Location loc)
-{
- Expression o;
-
- if (name.IndexOf ('.') == -1){
- o = SimpleLookup (name, loc);
- if (o == null)
- return new SimpleName (name, loc);
- return o;
- } else {
- int pos = name.LastIndexOf (".");
- string left = name.Substring (0, pos);
- string right = name.Substring (pos + 1);
-
- o = DecomposeQI (left, loc);
- return new MemberAccess (o, right, loc);
- }
-}
-
-// <summary>
-// This method is used to get at the complete string representation of
-// a fully-qualified type name, hiding inside a MemberAccess ;-)
-// This is necessary because local_variable_type admits primary_expression
-// as the type of the variable. So we do some extra checking
-// </summary>
-string GetQualifiedIdentifier (Expression expr)
-{
- if (expr is SimpleName)
- return ((SimpleName)expr).Name;
- else if (expr is MemberAccess)
- return GetQualifiedIdentifier (((MemberAccess)expr).Expr) + "." + ((MemberAccess) expr).Identifier;
- else
- throw new Exception ("Expr has to be either SimpleName or MemberAccess! (" + expr + ")");
-
-}
-
-Block declare_local_variables (string type, ArrayList variable_declarators, Location loc)
-{
- Block implicit_block;
- ArrayList inits = null;
-
- //
- // We use the `Used' property to check whether statements
- // have been added to the current block. If so, we need
- // to create another block to contain the new declaration
- // otherwise, as an optimization, we use the same block to
- // add the declaration.
- //
- // FIXME: A further optimization is to check if the statements
- // that were added were added as part of the initialization
- // below. In which case, no other statements have been executed
- // and we might be able to reduce the number of blocks for
- // situations like this:
- //
- // int j = 1; int k = j + 1;
- //
- if (current_block.Used)
- implicit_block = new Block (current_block, true);
- else
- implicit_block = current_block;
-
- foreach (VariableDeclaration decl in variable_declarators){
-
- if (implicit_block.AddVariable (type, decl.identifier, current_local_parameters, decl.Location) != null) {
- if (decl.expression_or_array_initializer != null){
- if (inits == null)
- inits = new ArrayList ();
- inits.Add (decl);
- }
- } else {
- Report.Error (128, decl.Location, "A local variable `" + decl.identifier +
- "' is already defined in this scope");
- }
- }
-
- if (inits == null)
- return implicit_block;
-
- foreach (VariableDeclaration decl in inits){
- Assign assign;
- Expression expr;
-
- if (decl.expression_or_array_initializer is Expression){
- expr = (Expression) decl.expression_or_array_initializer;
-
- } else {
- ArrayList init = (ArrayList) decl.expression_or_array_initializer;
-
- string base_type = type.Substring (0, type.IndexOf ("["));
- string rank = type.Substring (type.IndexOf ("["));
-
- expr = new ArrayCreation (base_type, rank, init, decl.Location);
-
- }
-
- LocalVariableReference var;
- var = new LocalVariableReference (implicit_block, decl.identifier, loc);
-
- assign = new Assign (var, expr, decl.Location);
-
- implicit_block.AddStatement (new StatementExpression (assign));
- }
-
- return implicit_block;
-}
-
-Block declare_local_constant (string type, VariableDeclaration decl)
-{
- Block implicit_block;
-
- if (current_block.Used)
- implicit_block = new Block (current_block, true);
- else
- implicit_block = current_block;
-
- if (!(implicit_block.AddConstant (type, decl.identifier, (Expression) decl.expression_or_array_initializer,
- current_local_parameters, decl.Location))){
- Report.Error (128, decl.Location, "A local variable `" + decl.identifier +
- "' is already defined in this scope");
- }
-
- return implicit_block;
-}
-
-void CheckAttributeTarget (string a)
-{
- switch (a) {
-
- case "assembly" : case "field" : case "method" : case "param" : case "property" : case "type" :
- return;
-
- default :
- Location l = lexer.Location;
- Report.Error (658, l, "`" + a + "' is an invalid attribute target");
- break;
- }
-
-}
-
-void CheckUnaryOperator (Operator.OpType op)
-{
- switch (op) {
-
- case Operator.OpType.LogicalNot:
- case Operator.OpType.OnesComplement:
- case Operator.OpType.Increment:
- case Operator.OpType.Decrement:
- case Operator.OpType.True:
- case Operator.OpType.False:
- case Operator.OpType.Addition:
- case Operator.OpType.Subtraction:
-
- break;
-
- default :
- Location l = lexer.Location;
- Report.Error (1019, l, "Overloadable unary operator expected");
- break;
-
- }
-}
-
-void CheckBinaryOperator (Operator.OpType op)
-{
- switch (op) {
-
- case Operator.OpType.Addition:
- case Operator.OpType.Subtraction:
- case Operator.OpType.Multiply:
- case Operator.OpType.Division:
- case Operator.OpType.Modulus:
- case Operator.OpType.BitwiseAnd:
- case Operator.OpType.BitwiseOr:
- case Operator.OpType.ExclusiveOr:
- case Operator.OpType.LeftShift:
- case Operator.OpType.RightShift:
- case Operator.OpType.Equality:
- case Operator.OpType.Inequality:
- case Operator.OpType.GreaterThan:
- case Operator.OpType.LessThan:
- case Operator.OpType.GreaterThanOrEqual:
- case Operator.OpType.LessThanOrEqual:
- break;
-
- default :
- Location l = lexer.Location;
- Report.Error (1020, l, "Overloadable binary operator expected");
- break;
- }
-
-}
-
-void syntax_error (Location l, string msg)
-{
- Report.Error (1003, l, "Syntax error, " + msg);
-}
-
-void output (string s)
-{
- Console.WriteLine (s);
-}
-
-void note (string s)
-{
- // Used to put annotations
-}
-
-Tokenizer lexer;
-
-public Tokenizer Lexer {
- get {
- return lexer;
- }
-}
-
-public CSharpParser (string name, System.IO.Stream input, ArrayList defines)
-{
- current_namespace = new Namespace (null, "");
- this.name = name;
- this.input = input;
- current_container = RootContext.Tree.Types;
- current_container.Namespace = current_namespace;
- oob_stack = new Stack ();
-
- lexer = new Tokenizer (input, name, defines);
-}
-
-public override int parse ()
-{
- StringBuilder value = new StringBuilder ();
-
- global_errors = 0;
- try {
- if (yacc_verbose_flag)
- yyparse (lexer, new yydebug.yyDebugSimple ());
- else
- yyparse (lexer);
- } catch (Exception e){
- // Console.WriteLine ("Fatal error: " + name);
- // Console.WriteLine (lexer.location);
-
- //
- // Please do not remove this, it is used during debugging
- // of the grammar
- //
- Console.WriteLine (lexer.location + " : Parsing error ");
- Console.WriteLine (e);
- global_errors++;
- }
-
- return global_errors;
-}
-
-/* end end end */
-}
diff --git a/mcs/mcs/cs-tokenizer.cs b/mcs/mcs/cs-tokenizer.cs
deleted file mode 100755
index 4695b7710db..00000000000
--- a/mcs/mcs/cs-tokenizer.cs
+++ /dev/null
@@ -1,1437 +0,0 @@
-//
-// cs-tokenizer.cs: The Tokenizer for the C# compiler
-// This also implements the preprocessor
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-/*
- * TODO:
- * Make sure we accept the proper Unicode ranges, per the spec.
- * Report error 1032
-*/
-
-using System;
-using System.Text;
-using System.Collections;
-using System.IO;
-using System.Globalization;
-
-namespace Mono.CSharp
-{
- /// <summary>
- /// Tokenizer for C# source code.
- /// </summary>
-
- public class Tokenizer : yyParser.yyInput
- {
- StreamReader reader;
- public string ref_name;
- public int ref_line = 1;
- public int line = 1;
- public int col = 1;
- public int current_token;
- bool handle_get_set = false;
- bool handle_remove_add = false;
- bool handle_assembly = false;
-
- //
- // Whether tokens have been seen on this line
- //
- bool tokens_seen = false;
-
- //
- // Returns a verbose representation of the current location
- //
- public string location {
- get {
- string det;
-
- if (current_token == Token.ERROR)
- det = "detail: " + error_details;
- else
- det = "";
-
- // return "Line: "+line+" Col: "+col + "\n" +
- // "VirtLine: "+ref_line +
- // " Token: "+current_token + " " + det;
-
- return ref_name + " " + "(" + line + "," + col + "), Token:" + current_token + " " + det;
- }
- }
-
- public bool PropertyParsing {
- get {
- return handle_get_set;
- }
-
- set {
- handle_get_set = value;
- }
- }
-
- public bool AssemblyTargetParsing {
- get {
- return handle_assembly;
- }
-
- set {
- handle_assembly = value;
- }
- }
-
- public bool EventParsing {
- get {
- return handle_remove_add;
- }
-
- set {
- handle_remove_add = value;
- }
- }
-
- //
- // Class variables
- //
- static Hashtable keywords;
- static NumberStyles styles;
- static NumberFormatInfo csharp_format_info;
-
- //
- // Values for the associated token returned
- //
- System.Text.StringBuilder number;
- int putback_char;
- Object val;
-
- //
- // Pre-processor
- //
- Hashtable defines;
-
- const int TAKING = 1;
- const int TAKEN_BEFORE = 2;
- const int ELSE_SEEN = 4;
- const int PARENT_TAKING = 8;
-
- //
- // pre-processor if stack state:
- //
- Stack ifstack;
-
- //
- // Details about the error encoutered by the tokenizer
- //
- string error_details;
-
- public string error {
- get {
- return error_details;
- }
- }
-
- public int Line {
- get {
- return line;
- }
- }
-
- public int Col {
- get {
- return col;
- }
- }
-
- static void InitTokens ()
- {
- keywords = new Hashtable ();
-
- keywords.Add ("abstract", Token.ABSTRACT);
- keywords.Add ("as", Token.AS);
- keywords.Add ("add", Token.ADD);
- keywords.Add ("assembly", Token.ASSEMBLY);
- keywords.Add ("base", Token.BASE);
- keywords.Add ("bool", Token.BOOL);
- keywords.Add ("break", Token.BREAK);
- keywords.Add ("byte", Token.BYTE);
- keywords.Add ("case", Token.CASE);
- keywords.Add ("catch", Token.CATCH);
- keywords.Add ("char", Token.CHAR);
- keywords.Add ("checked", Token.CHECKED);
- keywords.Add ("class", Token.CLASS);
- keywords.Add ("const", Token.CONST);
- keywords.Add ("continue", Token.CONTINUE);
- keywords.Add ("decimal", Token.DECIMAL);
- keywords.Add ("default", Token.DEFAULT);
- keywords.Add ("delegate", Token.DELEGATE);
- keywords.Add ("do", Token.DO);
- keywords.Add ("double", Token.DOUBLE);
- keywords.Add ("else", Token.ELSE);
- keywords.Add ("enum", Token.ENUM);
- keywords.Add ("event", Token.EVENT);
- keywords.Add ("explicit", Token.EXPLICIT);
- keywords.Add ("extern", Token.EXTERN);
- keywords.Add ("false", Token.FALSE);
- keywords.Add ("finally", Token.FINALLY);
- keywords.Add ("fixed", Token.FIXED);
- keywords.Add ("float", Token.FLOAT);
- keywords.Add ("for", Token.FOR);
- keywords.Add ("foreach", Token.FOREACH);
- keywords.Add ("goto", Token.GOTO);
- keywords.Add ("get", Token.GET);
- keywords.Add ("if", Token.IF);
- keywords.Add ("implicit", Token.IMPLICIT);
- keywords.Add ("in", Token.IN);
- keywords.Add ("int", Token.INT);
- keywords.Add ("interface", Token.INTERFACE);
- keywords.Add ("internal", Token.INTERNAL);
- keywords.Add ("is", Token.IS);
- keywords.Add ("lock", Token.LOCK);
- keywords.Add ("long", Token.LONG);
- keywords.Add ("namespace", Token.NAMESPACE);
- keywords.Add ("new", Token.NEW);
- keywords.Add ("null", Token.NULL);
- keywords.Add ("object", Token.OBJECT);
- keywords.Add ("operator", Token.OPERATOR);
- keywords.Add ("out", Token.OUT);
- keywords.Add ("override", Token.OVERRIDE);
- keywords.Add ("params", Token.PARAMS);
- keywords.Add ("private", Token.PRIVATE);
- keywords.Add ("protected", Token.PROTECTED);
- keywords.Add ("public", Token.PUBLIC);
- keywords.Add ("readonly", Token.READONLY);
- keywords.Add ("ref", Token.REF);
- keywords.Add ("remove", Token.REMOVE);
- keywords.Add ("return", Token.RETURN);
- keywords.Add ("sbyte", Token.SBYTE);
- keywords.Add ("sealed", Token.SEALED);
- keywords.Add ("set", Token.SET);
- keywords.Add ("short", Token.SHORT);
- keywords.Add ("sizeof", Token.SIZEOF);
- keywords.Add ("stackalloc", Token.STACKALLOC);
- keywords.Add ("static", Token.STATIC);
- keywords.Add ("string", Token.STRING);
- keywords.Add ("struct", Token.STRUCT);
- keywords.Add ("switch", Token.SWITCH);
- keywords.Add ("this", Token.THIS);
- keywords.Add ("throw", Token.THROW);
- keywords.Add ("true", Token.TRUE);
- keywords.Add ("try", Token.TRY);
- keywords.Add ("typeof", Token.TYPEOF);
- keywords.Add ("uint", Token.UINT);
- keywords.Add ("ulong", Token.ULONG);
- keywords.Add ("unchecked", Token.UNCHECKED);
- keywords.Add ("unsafe", Token.UNSAFE);
- keywords.Add ("ushort", Token.USHORT);
- keywords.Add ("using", Token.USING);
- keywords.Add ("virtual", Token.VIRTUAL);
- keywords.Add ("void", Token.VOID);
- keywords.Add ("volatile", Token.VOLATILE);
- keywords.Add ("while", Token.WHILE);
- }
-
- //
- // Class initializer
- //
- static Tokenizer ()
- {
- InitTokens ();
- csharp_format_info = new NumberFormatInfo ();
- csharp_format_info.CurrencyDecimalSeparator = ".";
- styles = NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint;
- }
-
- bool is_keyword (string name)
- {
- bool res;
-
- res = keywords.Contains (name);
- if (handle_get_set == false && (name == "get" || name == "set"))
- return false;
- if (handle_remove_add == false && (name == "remove" || name == "add"))
- return false;
- if (handle_assembly == false && (name == "assembly"))
- return false;
- return res;
- }
-
- int GetKeyword (string name)
- {
- return (int) (keywords [name]);
- }
-
- public Location Location {
- get {
- return new Location (ref_line);
- }
- }
-
- public Tokenizer (System.IO.Stream input, string fname, ArrayList defs)
- {
- this.ref_name = fname;
- reader = new System.IO.StreamReader (input);
- putback_char = -1;
-
- if (defs != null){
- defines = new Hashtable ();
- foreach (string def in defs)
- defines [def] = true;
- }
-
- //
- // FIXME: This could be `Location.Push' but we have to
- // find out why the MS compiler allows this
- //
- Mono.CSharp.Location.Push (fname);
- }
-
- bool is_identifier_start_character (char c)
- {
- return Char.IsLetter (c) || c == '_' ;
- }
-
- bool is_identifier_part_character (char c)
- {
- return (Char.IsLetter (c) || Char.IsDigit (c) || c == '_');
- }
-
- int is_punct (char c, ref bool doread)
- {
- int d;
- int t;
-
- doread = false;
-
- switch (c){
- case '{':
- return Token.OPEN_BRACE;
- case '}':
- return Token.CLOSE_BRACE;
- case '[':
- return Token.OPEN_BRACKET;
- case ']':
- return Token.CLOSE_BRACKET;
- case '(':
- return Token.OPEN_PARENS;
- case ')':
- return Token.CLOSE_PARENS;
- case ',':
- return Token.COMMA;
- case ':':
- return Token.COLON;
- case ';':
- return Token.SEMICOLON;
- case '~':
- return Token.TILDE;
- case '?':
- return Token.INTERR;
- }
-
- d = peekChar ();
- if (c == '+'){
-
- if (d == '+')
- t = Token.OP_INC;
- else if (d == '=')
- t = Token.OP_ADD_ASSIGN;
- else
- return Token.PLUS;
- doread = true;
- return t;
- }
- if (c == '-'){
- if (d == '-')
- t = Token.OP_DEC;
- else if (d == '=')
- t = Token.OP_SUB_ASSIGN;
- else if (d == '>')
- t = Token.OP_PTR;
- else
- return Token.MINUS;
- doread = true;
- return t;
- }
-
- if (c == '!'){
- if (d == '='){
- doread = true;
- return Token.OP_NE;
- }
- return Token.BANG;
- }
-
- if (c == '='){
- if (d == '='){
- doread = true;
- return Token.OP_EQ;
- }
- return Token.ASSIGN;
- }
-
- if (c == '&'){
- if (d == '&'){
- doread = true;
- return Token.OP_AND;
- } else if (d == '='){
- doread = true;
- return Token.OP_AND_ASSIGN;
- }
- return Token.BITWISE_AND;
- }
-
- if (c == '|'){
- if (d == '|'){
- doread = true;
- return Token.OP_OR;
- } else if (d == '='){
- doread = true;
- return Token.OP_OR_ASSIGN;
- }
- return Token.BITWISE_OR;
- }
-
- if (c == '*'){
- if (d == '='){
- doread = true;
- return Token.OP_MULT_ASSIGN;
- }
- return Token.STAR;
- }
-
- if (c == '/'){
- if (d == '='){
- doread = true;
- return Token.OP_DIV_ASSIGN;
- }
- return Token.DIV;
- }
-
- if (c == '%'){
- if (d == '='){
- doread = true;
- return Token.OP_MOD_ASSIGN;
- }
- return Token.PERCENT;
- }
-
- if (c == '^'){
- if (d == '='){
- doread = true;
- return Token.OP_XOR_ASSIGN;
- }
- return Token.CARRET;
- }
-
- if (c == '<'){
- if (d == '<'){
- getChar ();
- d = peekChar ();
-
- if (d == '='){
- doread = true;
- return Token.OP_SHIFT_LEFT_ASSIGN;
- }
- return Token.OP_SHIFT_LEFT;
- } else if (d == '='){
- doread = true;
- return Token.OP_LE;
- }
- return Token.OP_LT;
- }
-
- if (c == '>'){
- if (d == '>'){
- getChar ();
- d = peekChar ();
-
- if (d == '='){
- doread = true;
- return Token.OP_SHIFT_RIGHT_ASSIGN;
- }
- return Token.OP_SHIFT_RIGHT;
- } else if (d == '='){
- doread = true;
- return Token.OP_GE;
- }
- return Token.OP_GT;
- }
- return Token.ERROR;
- }
-
- bool decimal_digits (int c)
- {
- int d;
- bool seen_digits = false;
-
- if (c != -1)
- number.Append ((char) c);
-
- while ((d = peekChar ()) != -1){
- if (Char.IsDigit ((char)d)){
- number.Append ((char) d);
- getChar ();
- seen_digits = true;
- } else
- break;
- }
-
- return seen_digits;
- }
-
- void hex_digits (int c)
- {
- int d;
-
- if (c != -1)
- number.Append ((char) c);
- while ((d = peekChar ()) != -1){
- char e = Char.ToUpper ((char) d);
-
- if (Char.IsDigit (e) || (e >= 'A' && e <= 'F')){
- number.Append ((char) e);
- getChar ();
- } else
- break;
- }
- }
-
- int real_type_suffix (int c)
- {
- int t;
-
- switch (c){
- case 'F': case 'f':
- t = Token.LITERAL_FLOAT;
- break;
- case 'D': case 'd':
- t = Token.LITERAL_DOUBLE;
- break;
- case 'M': case 'm':
- t= Token.LITERAL_DECIMAL;
- break;
- default:
- return Token.NONE;
- }
- return t;
- }
-
- int integer_type_suffix (ulong ul, int c)
- {
- bool is_unsigned = false;
- bool is_long = false;
-
- if (c != -1){
- bool scanning = true;
- do {
- switch (c){
- case 'U': case 'u':
- if (is_unsigned)
- scanning = false;
- is_unsigned = true;
- getChar ();
- break;
-
- case 'l':
- if (!is_unsigned){
- //
- // if we have not seen anything in between
- // report this error
- //
- Report.Warning (
- 78, Location,
- "the 'l' suffix is easily confused with digit `1'," +
- " use 'L' for clarity");
- }
- goto case 'L';
-
- case 'L':
- if (is_long)
- scanning = false;
- is_long = true;
- getChar ();
- break;
-
- default:
- scanning = false;
- break;
- }
- c = peekChar ();
- } while (scanning);
- }
-
- if (is_long && is_unsigned){
- val = ul;
- return Token.LITERAL_INTEGER;
- } else if (is_unsigned){
- // uint if possible, or ulong else.
-
- if ((ul & 0xffffffff00000000) == 0)
- val = (uint) ul;
- else
- val = ul;
- } else if (is_long){
- // long if possible, ulong otherwise
- if ((ul & 0x8000000000000000) != 0)
- val = ul;
- else
- val = (long) ul;
- } else {
- // int, uint, long or ulong in that order
- if ((ul & 0xffffffff00000000) == 0){
- uint ui = (uint) ul;
-
- if ((ui & 0x80000000) != 0)
- val = ui;
- else
- val = (int) ui;
- } else {
- if ((ul & 0x8000000000000000) != 0)
- val = ul;
- else
- val = (long) ul;
- }
- }
- return Token.LITERAL_INTEGER;
- }
-
- //
- // given `c' as the next char in the input decide whether
- // we need to convert to a special type, and then choose
- // the best representation for the integer
- //
- int adjust_int (int c)
- {
- ulong ul = System.UInt64.Parse (number.ToString ());
- return integer_type_suffix (ul, c);
- }
-
- int adjust_real (int t)
- {
- string s = number.ToString ();
-
- switch (t){
- case Token.LITERAL_DECIMAL:
- val = new System.Decimal ();
- val = System.Decimal.Parse (
- s, styles, csharp_format_info);
- break;
- case Token.LITERAL_DOUBLE:
- val = new System.Double ();
- val = System.Double.Parse (
- s, styles, csharp_format_info);
- break;
- case Token.LITERAL_FLOAT:
- val = new System.Double ();
- val = (float) System.Double.Parse (
- s, styles, csharp_format_info);
- break;
-
- case Token.NONE:
- val = new System.Double ();
- val = System.Double.Parse (
- s, styles, csharp_format_info);
- t = Token.LITERAL_DOUBLE;
- break;
- }
- return t;
- }
-
- //
- // Invoked if we know we have .digits or digits
- //
- int is_number (int c)
- {
- bool is_real = false;
- number = new System.Text.StringBuilder ();
- int type;
-
- number.Length = 0;
-
- if (Char.IsDigit ((char)c)){
- if (c == '0' && peekChar () == 'x' || peekChar () == 'X'){
- ulong ul;
- getChar ();
- hex_digits (-1);
-
- string s = number.ToString ();
-
- ul = System.UInt64.Parse (s, NumberStyles.HexNumber);
- return integer_type_suffix (ul, peekChar ());
- }
- decimal_digits (c);
- c = getChar ();
- }
-
- //
- // We need to handle the case of
- // "1.1" vs "1.string" (LITERAL_FLOAT vs NUMBER DOT IDENTIFIER)
- //
- if (c == '.'){
- if (decimal_digits ('.')){
- is_real = true;
- c = getChar ();
- } else {
- putback ('.');
- number.Length -= 1;
- return adjust_int (-1);
- }
- }
-
- if (c == 'e' || c == 'E'){
- is_real = true;
- number.Append ("e");
- c = getChar ();
-
- if (c == '+'){
- number.Append ((char) c);
- c = getChar ();
- } else if (c == '-'){
- number.Append ((char) c);
- c = getChar ();
- }
- decimal_digits (-1);
- c = getChar ();
- }
-
- type = real_type_suffix (c);
- if (type == Token.NONE && !is_real){
- putback (c);
- return adjust_int (c);
- } else
- is_real = true;
-
- if (type == Token.NONE){
- putback (c);
- }
-
- if (is_real)
- return adjust_real (type);
-
- Console.WriteLine ("This should not be reached");
- throw new Exception ("Is Number should never reach this point");
- }
-
- int escape (int c)
- {
- int d;
- int v;
-
- d = peekChar ();
- if (c != '\\')
- return c;
-
- switch (d){
- case 'a':
- v = '\a'; break;
- case 'b':
- v = '\b'; break;
- case 'n':
- v = '\n'; break;
- case 't':
- v = '\t'; break;
- case 'v':
- v = '\v'; break;
- case 'r':
- v = '\r'; break;
- case '\\':
- v = '\\'; break;
- case 'f':
- v = '\f'; break;
- case '0':
- v = 0; break;
- case '"':
- v = '"'; break;
- case '\'':
- v = '\''; break;
- default:
- error_details = "cs1009: Unrecognized escape sequence " + (char)d;
- return -1;
- }
- getChar ();
- return v;
- }
-
- int getChar ()
- {
- if (putback_char != -1){
- int x = putback_char;
- putback_char = -1;
-
- return x;
- }
- return reader.Read ();
- }
-
- int peekChar ()
- {
- if (putback_char != -1)
- return putback_char;
- return reader.Peek ();
- }
-
- void putback (int c)
- {
- if (putback_char != -1)
- throw new Exception ("This should not happen putback on putback");
- putback_char = c;
- }
-
- public bool advance ()
- {
- return peekChar () != -1;
- }
-
- public Object Value {
- get {
- return val;
- }
- }
-
- public Object value ()
- {
- return val;
- }
-
- public int token ()
- {
- current_token = xtoken ();
- return current_token;
- }
-
- static StringBuilder static_cmd_arg = new System.Text.StringBuilder ();
-
- void get_cmd_arg (out string cmd, out string arg)
- {
- int c;
-
- tokens_seen = false;
- arg = "";
- static_cmd_arg.Length = 0;
-
- while ((c = getChar ()) != -1 && (c != '\n') && ((c != ' ') || c == '\t')){
- if (c == '\r')
- continue;
- static_cmd_arg.Append ((char) c);
- }
-
- cmd = static_cmd_arg.ToString ();
-
- if (c == '\n'){
- line++;
- ref_line++;
- return;
- }
-
- // skip over white space
- while ((c = getChar ()) != -1 && (c != '\n') && ((c == ' ') || (c == '\t')))
- ;
-
- if (c == '\n'){
- line++;
- ref_line++;
- return;
- }
-
- static_cmd_arg.Length = 0;
- static_cmd_arg.Append ((char) c);
-
- while ((c = getChar ()) != -1 && (c != '\n')){
- if (c == '\r')
- continue;
- static_cmd_arg.Append ((char) c);
- }
-
- if (c == '\n'){
- line++;
- ref_line++;
- }
- arg = static_cmd_arg.ToString ().Trim ();
- }
-
- //
- // Handles the #line directive
- //
- bool PreProcessLine (string arg)
- {
- if (arg == "")
- return false;
-
- if (arg == "default"){
- line = ref_line = line;
- return false;
- }
-
- try {
- int pos;
-
- if ((pos = arg.IndexOf (' ')) != -1 && pos != 0){
- ref_line = System.Int32.Parse (arg.Substring (0, pos));
- pos++;
-
- char [] quotes = { '\"' };
-
- ref_name = arg.Substring (pos);
- ref_name.TrimStart (quotes);
- ref_name.TrimEnd (quotes);
- } else {
- ref_line = System.Int32.Parse (arg);
- }
- } catch {
- return false;
- }
-
- return true;
- }
-
- //
- // Handles #define and #undef
- //
- void PreProcessDefinition (bool is_define, string arg)
- {
- if (arg == "" || arg == "true" || arg == "false"){
- Report.Error(1001, Location, "Missing identifer to pre-processor directive");
- return;
- }
-
- if (is_define){
- if (defines == null)
- defines = new Hashtable ();
- defines [arg] = 1;
- } else {
- if (defines == null)
- return;
- if (defines.Contains (arg))
- defines.Remove (arg);
- }
- }
-
- bool eval_val (string s)
- {
- if (s == "true")
- return true;
- if (s == "false")
- return false;
-
- if (defines == null)
- return false;
- if (defines.Contains (s))
- return true;
-
- return false;
- }
-
- bool pp_primary (ref string s)
- {
- s.Trim ();
- int len = s.Length;
-
- if (len > 0){
- char c = s [0];
-
- if (c == '('){
- s = s.Substring (1);
- bool val = pp_expr (ref s);
- if (s.Length > 0 && s [0] == ')')
- return val;
- report1517 ();
- return false;
- }
-
- if (Char.IsLetter (c) || c == '_'){
- int j = 1;
-
- while (j < len){
- c = s [j];
-
- if (Char.IsLetter (c) || Char.IsDigit (c) || c == '_'){
- j++;
- continue;
- }
- bool v = eval_val (s.Substring (0, j));
- s = s.Substring (j);
- return v;
- }
- bool vv = eval_val (s);
- s = "";
- return vv;
- }
- }
- report1517 ();
- return false;
- }
-
- bool pp_unary (ref string s)
- {
- s = s.Trim ();
- int len = s.Length;
-
- if (len > 0){
- if (s [0] == '!'){
- if (len > 1 && s [1] == '='){
- report1517 ();
- return false;
- }
- s = s.Substring (1);
- return ! pp_primary (ref s);
- } else
- return pp_primary (ref s);
- } else {
- report1517 ();
- return false;
- }
- }
-
- bool pp_eq (ref string s)
- {
- bool va = pp_unary (ref s);
-
- s = s.Trim ();
- int len = s.Length;
- if (len > 0){
- if (s [0] == '='){
- if (len > 2 && s [1] == '='){
- s = s.Substring (2);
- return va == pp_unary (ref s);
- } else {
- report1517 ();
- return false;
- }
- } else if (s [0] == '!' && len > 1 && s [1] == '='){
- s = s.Substring (2);
-
- return va != pp_unary (ref s);
-
- }
- }
-
- return va;
-
- }
-
- bool pp_and (ref string s)
- {
- bool va = pp_eq (ref s);
-
- s = s.Trim ();
- int len = s.Length;
- if (len > 0){
- if (s [0] == '&'){
- if (len > 2 && s [1] == '&'){
- s = s.Substring (2);
- return va && pp_eq (ref s);
- } else {
- report1517 ();
- return false;
- }
- }
- }
- return va;
- }
-
- //
- // Evaluates an expression for `#if' or `#elif'
- //
- bool pp_expr (ref string s)
- {
- bool va = pp_and (ref s);
-
- s = s.Trim ();
- int len = s.Length;
- if (len > 0){
- if (s [0] == '|'){
- if (len > 2 && s [1] == '|'){
- s = s.Substring (2);
- return va || pp_and (ref s);
- } else {
- report1517 ();
- return false;
- }
- } else {
- report1517 ();
- return false;
- }
- }
-
- return va;
- }
-
- bool eval (string s)
- {
- bool v = pp_expr (ref s);
-
- return v;
- }
-
- void report1517 ()
- {
- Report.Error (1517, Location, "Invalid pre-processor directive");
- }
-
- void report1028 (string extra)
- {
- Report.Error (
- 1028, Location,
- "Unexpected processor directive (" + extra + ")");
- }
-
- //
- // if true, then the code continues processing the code
- // if false, the code stays in a loop until another directive is
- // reached.
- //
- bool handle_preprocessing_directive ()
- {
- char [] blank = { ' ', '\t' };
- string cmd, arg;
-
- get_cmd_arg (out cmd, out arg);
-
- switch (cmd){
- case "line":
- if (!PreProcessLine (arg))
- Report.Error (
- 1576, Location,
- "Argument to #line directive is missing or invalid");
- return true;
-
- case "define":
- PreProcessDefinition (true, arg);
- return true;
-
- case "undef":
- PreProcessDefinition (false, arg);
- return true;
-
- case "error":
- Report.Error (1029, Location, "#error: '" + arg + "'");
- return true;
-
- case "warning":
- Report.Warning (1030, Location, "#warning: '" + arg + "'");
- return true;
-
- case "region":
- arg = "true";
- goto case "if";
-
- case "endregion":
- goto case "endif";
-
- case "if":
- if (arg == ""){
- report1517 ();
- return true;
- }
- bool taking = false;
- if (ifstack == null)
- ifstack = new Stack ();
-
- if (ifstack.Count == 0){
- taking = true;
- } else {
- int state = (int) ifstack.Peek ();
- if ((state & TAKING) != 0)
- taking = true;
- }
-
- if (eval (arg) && taking){
- ifstack.Push (TAKING | TAKEN_BEFORE | PARENT_TAKING);
- return true;
- } else {
- ifstack.Push (taking ? PARENT_TAKING : 0);
- return false;
- }
-
- case "endif":
- if (ifstack == null || ifstack.Count == 0){
- report1028 ("no #if for this #endif");
- return true;
- } else {
- ifstack.Pop ();
- if (ifstack.Count == 0)
- return true;
- else {
- int state = (int) ifstack.Peek ();
-
- if ((state & TAKING) != 0)
- return true;
- else
- return false;
- }
- }
-
- case "elif":
- if (ifstack == null || ifstack.Count == 0){
- report1028 ("no #if for this #elif");
- return true;
- } else {
- int state = (int) ifstack.Peek ();
-
- if ((state & ELSE_SEEN) != 0){
- report1028 ("#elif not valid after #else");
- return true;
- }
-
- if ((state & (TAKEN_BEFORE | TAKING)) != 0)
- return false;
-
- if (eval (arg) && ((state & PARENT_TAKING) != 0)){
- state = (int) ifstack.Pop ();
- ifstack.Push (state | TAKING | TAKEN_BEFORE);
- return true;
- } else
- return false;
- }
-
- case "else":
- if (ifstack == null || ifstack.Count == 0){
- Report.Error (
- 1028, Location,
- "Unexpected processor directive (no #if for this #else)");
- return true;
- } else {
- int state = (int) ifstack.Peek ();
-
- if ((state & ELSE_SEEN) != 0){
- report1028 ("#else within #else");
- return true;
- }
-
- ifstack.Pop ();
- ifstack.Push (state | ELSE_SEEN);
-
- if ((state & TAKEN_BEFORE) == 0){
- if ((state & PARENT_TAKING) != 0)
- return true;
- else
- return false;
- }
- return false;
- }
- }
-
- Report.Error (1024, "Preprocessor directive expected (got: " + cmd + ")");
- return true;
- }
-
- public int xtoken ()
- {
- int t;
- bool allow_keyword_as_ident = false;
- bool doread = false;
- int c;
-
- val = null;
- // optimization: eliminate col and implement #directive semantic correctly.
- for (;(c = getChar ()) != -1; col++) {
- if (is_identifier_start_character ((char) c)){
- System.Text.StringBuilder id = new System.Text.StringBuilder ();
- string ids;
-
- tokens_seen = true;
- id.Append ((char) c);
-
- while ((c = peekChar ()) != -1) {
- if (is_identifier_part_character ((char) c)){
- id.Append ((char)getChar ());
- col++;
- } else
- break;
- }
-
- ids = id.ToString ();
-
- if (!is_keyword (ids) || allow_keyword_as_ident) {
- val = ids;
- if (ids.Length > 512){
- Report.Error (
- 645, Location,
- "Identifier too long (limit is 512 chars)");
- }
- allow_keyword_as_ident = false;
- return Token.IDENTIFIER;
- }
-
- // true, false and null are in the hash anyway.
- return GetKeyword (ids);
-
- }
-
- if (c == '.'){
- tokens_seen = true;
- if (Char.IsDigit ((char) peekChar ()))
- return is_number (c);
- return Token.DOT;
- }
-
- if (Char.IsDigit ((char) c)){
- tokens_seen = true;
- return is_number (c);
- }
-
- // Handle double-slash comments.
- if (c == '/'){
- int d = peekChar ();
-
- if (d == '/'){
- getChar ();
- while ((d = getChar ()) != -1 && (d != '\n'))
- col++;
- line++;
- ref_line++;
- col = 0;
- continue;
- } else if (d == '*'){
- getChar ();
-
- while ((d = getChar ()) != -1){
- if (d == '*' && peekChar () == '/'){
- getChar ();
- col++;
- break;
- }
- if (d == '\n'){
- line++;
- ref_line++;
- col = 0;
- }
- }
- continue;
- }
- }
-
- /* For now, ignore pre-processor commands */
- // FIXME: In C# the '#' is not limited to appear
- // on the first column.
- if (c == '#' && !tokens_seen){
- start_again:
-
- bool cont = handle_preprocessing_directive ();
-
- if (cont){
- col = 0;
- continue;
- }
- col = 1;
-
- bool skipping = false;
- for (;(c = getChar ()) != -1; col++){
- if (c == '\n'){
- col = 0;
- line++;
- ref_line++;
- skipping = false;
- } else if (c == ' ' || c == '\t' || c == '\v' || c == '\r')
- continue;
- else if (c != '#')
- skipping = true;
- if (c == '#' && !skipping)
- goto start_again;
- }
- tokens_seen = false;
- if (c == -1)
- Report.Error (1027, Location, "#endif expected");
- continue;
- }
-
- if ((t = is_punct ((char)c, ref doread)) != Token.ERROR){
- tokens_seen = true;
- if (doread){
- getChar ();
- col++;
- }
- return t;
- }
-
- if (c == '"'){
- System.Text.StringBuilder s = new System.Text.StringBuilder ();
- tokens_seen = true;
-
- while ((c = getChar ()) != -1){
- if (c == '"'){
- if (allow_keyword_as_ident && peekChar () == '"'){
- s.Append ((char) c);
- getChar ();
- continue;
- }
- allow_keyword_as_ident = false;
- val = s.ToString ();
- return Token.LITERAL_STRING;
- }
-
- if (!allow_keyword_as_ident){
- c = escape (c);
- if (c == -1)
- return Token.ERROR;
- }
- s.Append ((char) c);
- }
- }
-
- if (c == '\''){
- c = getChar ();
- tokens_seen = true;
- if (c == '\''){
- error_details = "Empty character literal";
- Report.Error (1011, Location, error_details);
- return Token.ERROR;
- }
- c = escape (c);
- if (c == -1)
- return Token.ERROR;
- val = new System.Char ();
- val = (char) c;
- c = getChar ();
-
- if (c != '\''){
- error_details = "Too many characters in character literal";
- Report.Error (1012, Location, error_details);
-
- // Try to recover, read until newline or next "'"
- while ((c = getChar ()) != -1){
- if (c == '\n' || c == '\'')
- break;
-
- }
- return Token.ERROR;
- }
- return Token.LITERAL_CHARACTER;
- }
-
- // white space
- if (c == '\n'){
- line++;
- ref_line++;
- col = 0;
- tokens_seen = false;
- continue;
- }
-
- if (c == ' ' || c == '\t' || c == '\f' || c == '\v' || c == '\r'){
- if (c == '\t')
- col = (((col + 8) / 8) * 8) - 1;
- continue;
- }
-
- if (c == '@'){
- tokens_seen = true;
- allow_keyword_as_ident = true;
- continue;
- }
-
- error_details = ((char)c).ToString ();
-
- return Token.ERROR;
- }
-
- if (ifstack != null && ifstack.Count > 1)
- Report.Error (1027, Location, "#endif expected");
- return Token.EOF;
- }
- }
-}
-
diff --git a/mcs/mcs/decl.cs b/mcs/mcs/decl.cs
deleted file mode 100755
index 012a246f161..00000000000
--- a/mcs/mcs/decl.cs
+++ /dev/null
@@ -1,302 +0,0 @@
-//
-// decl.cs: Declaration base class for structs, classes, enums and interfaces.
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-// TODO: Move the method verification stuff from the class.cs and interface.cs here
-//
-
-using System;
-using System.Collections;
-using System.Reflection.Emit;
-using System.Reflection;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Base representation for members. This is only used to keep track
- /// of Name, Location and Modifier flags.
- /// </summary>
- public abstract class MemberCore {
- /// <summary>
- /// Public name
- /// </summary>
- public string Name;
-
- /// <summary>
- /// Modifier flags that the user specified in the source code
- /// </summary>
- public int ModFlags;
-
- /// <summary>
- /// Location where this declaration happens
- /// </summary>
- public readonly Location Location;
-
- public MemberCore (string name, Location loc)
- {
- Name = name;
- Location = loc;
- }
-
- protected void WarningNotHiding (TypeContainer parent)
- {
- Report.Warning (
- 109, Location,
- "The member `" + parent.Name + "." + Name + "' does not hide an " +
- "inherited member. The keyword new is not required");
-
- }
-
- static string MethodBaseName (MethodBase mb)
- {
- return "`" + mb.ReflectedType.Name + "." + mb.Name + "'";
- }
-
- //
- // Performs various checks on the MethodInfo `mb' regarding the modifier flags
- // that have been defined.
- //
- // `name' is the user visible name for reporting errors (this is used to
- // provide the right name regarding method names and properties)
- //
- protected bool CheckMethodAgainstBase (TypeContainer parent, MethodInfo mb)
- {
- bool ok = true;
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- if (!(mb.IsAbstract || mb.IsVirtual)){
- Report.Error (
- 506, Location, parent.MakeName (Name) +
- ": cannot override inherited member " +
- MethodBaseName (mb) + " because it is not " +
- "virtual, abstract or override");
- ok = false;
- }
-
- // Now we check that the overriden method is not final
-
- if (mb.IsFinal) {
- Report.Error (239, Location, parent.MakeName (Name) + " : cannot " +
- "override inherited member " + MethodBaseName (mb) +
- " because it is sealed.");
- ok = false;
- }
- }
-
- if (mb.IsVirtual || mb.IsAbstract){
- if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
- Report.Warning (
- 114, Location, parent.MakeName (Name) +
- " hides inherited member " + MethodBaseName (mb) +
- ". To make the current member override that " +
- "implementation, add the override keyword, " +
- "otherwise use the new keyword");
- }
- }
-
- return ok;
- }
-
- public abstract bool Define (TypeContainer parent);
-
- //
- // Whehter is it ok to use an unsafe pointer in this type container
- //
- public bool UnsafeOK (DeclSpace parent)
- {
- //
- // First check if this MemberCore modifier flags has unsafe set
- //
- if ((ModFlags & Modifiers.UNSAFE) != 0)
- return true;
-
- if (parent.UnsafeContext)
- return true;
-
- Expression.UnsafeError (Location);
- return false;
- }
- }
-
- //
- // FIXME: This is temporary outside DeclSpace, because I have to fix a bug
- // in MCS that makes it fail the lookup for the enum
- //
-
- /// <summary>
- /// The result value from adding an declaration into
- /// a struct or a class
- /// </summary>
- public enum AdditionResult {
- /// <summary>
- /// The declaration has been successfully
- /// added to the declation space.
- /// </summary>
- Success,
-
- /// <summary>
- /// The symbol has already been defined.
- /// </summary>
- NameExists,
-
- /// <summary>
- /// Returned if the declation being added to the
- /// name space clashes with its container name.
- ///
- /// The only exceptions for this are constructors
- /// and static constructors
- /// </summary>
- EnclosingClash,
-
- /// <summary>
- /// Returned if a constructor was created (because syntactically
- /// it looked like a constructor) but was not (because the name
- /// of the method is not the same as the container class
- /// </summary>
- NotAConstructor,
-
- /// <summary>
- /// This is only used by static constructors to emit the
- /// error 111, but this error for other things really
- /// happens at another level for other functions.
- /// </summary>
- MethodExists
- }
-
- /// <summary>
- /// Base class for structs, classes, enumerations and interfaces.
- /// </summary>
- /// <remarks>
- /// They all create new declaration spaces. This
- /// provides the common foundation for managing those name
- /// spaces.
- /// </remarks>
- public abstract class DeclSpace : MemberCore {
- /// <summary>
- /// this points to the actual definition that is being
- /// created with System.Reflection.Emit
- /// </summary>
- TypeBuilder definition;
- public bool Created = false;
-
- //
- // This is the namespace in which this typecontainer
- // was declared. We use this to resolve names.
- //
- public Namespace Namespace;
-
- public string Basename;
-
- /// <summary>
- /// defined_names is used for toplevel objects
- /// </summary>
- protected Hashtable defined_names;
-
- TypeContainer parent;
-
- public DeclSpace (TypeContainer parent, string name, Location l)
- : base (name, l)
- {
- Basename = name.Substring (1 + name.LastIndexOf ('.'));
- defined_names = new Hashtable ();
- this.parent = parent;
- }
-
- /// <summary>
- /// Returns a status code based purely on the name
- /// of the member being added
- /// </summary>
- protected AdditionResult IsValid (string name)
- {
- if (name == Basename)
- return AdditionResult.EnclosingClash;
-
- if (defined_names.Contains (name))
- return AdditionResult.NameExists;
-
- return AdditionResult.Success;
- }
-
- /// <summary>
- /// Introduce @name into this declaration space and
- /// associates it with the object @o. Note that for
- /// methods this will just point to the first method. o
- /// </summary>
- protected void DefineName (string name, object o)
- {
- defined_names.Add (name, o);
- }
-
- bool in_transit = false;
-
- /// <summary>
- /// This function is used to catch recursive definitions
- /// in declarations.
- /// </summary>
- public bool InTransit {
- get {
- return in_transit;
- }
-
- set {
- in_transit = value;
- }
- }
-
- public TypeBuilder TypeBuilder {
- get {
- return definition;
- }
-
- set {
- definition = value;
- }
- }
-
- public TypeContainer Parent {
- get {
- return parent;
- }
- }
-
- public virtual void CloseType ()
- {
- if (!Created){
- try {
- definition.CreateType ();
- } catch {
- //
- // The try/catch is needed because
- // nested enumerations fail to load when they
- // are defined.
- //
- // Even if this is the right order (enumerations
- // declared after types).
- //
- // Note that this still creates the type and
- // it is possible to save it
- }
- Created = true;
- }
- }
-
- //
- // Whether this is an `unsafe context'
- //
- public bool UnsafeContext {
- get {
- if ((ModFlags & Modifiers.UNSAFE) != 0)
- return true;
- if (parent != null)
- return parent.UnsafeContext;
- return false;
- }
- }
-
- }
-}
diff --git a/mcs/mcs/delegate.cs b/mcs/mcs/delegate.cs
deleted file mode 100644
index 9c61a9d0fe3..00000000000
--- a/mcs/mcs/delegate.cs
+++ /dev/null
@@ -1,694 +0,0 @@
-//
-// delegate.cs: Delegate Handler
-//
-// Author: Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Text;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Holds Delegates
- /// </summary>
- public class Delegate : MemberCore {
- public readonly string ReturnType;
- public Parameters Parameters;
- public Attributes OptAttributes;
- public TypeBuilder TypeBuilder;
-
- public ConstructorBuilder ConstructorBuilder;
- public MethodBuilder InvokeBuilder;
- public MethodBuilder BeginInvokeBuilder;
- public MethodBuilder EndInvokeBuilder;
-
- Type [] param_types;
- Type ret_type;
-
- Expression instance_expr;
- MethodBase delegate_method;
-
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.UNSAFE |
- Modifiers.PRIVATE;
-
- public Delegate (string type, int mod_flags, string name, Parameters param_list,
- Attributes attrs, Location l)
- : base (name, l)
- {
- this.ReturnType = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PUBLIC, l);
- Parameters = param_list;
- OptAttributes = attrs;
- }
-
- public void DefineDelegate (object parent_builder)
- {
- TypeAttributes attr;
- string name = Name.Substring (1 + Name.LastIndexOf ('.'));
-
- if (parent_builder is ModuleBuilder) {
- ModuleBuilder builder = (ModuleBuilder) parent_builder;
- attr = TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.Sealed;
-
- TypeBuilder = builder.DefineType (
- name, attr, TypeManager.multicast_delegate_type);
- } else {
- // FIXME: We could just use TypeBuilder here.
- TypeBuilder builder = (System.Reflection.Emit.TypeBuilder) parent_builder;
- attr = TypeAttributes.NestedPublic | TypeAttributes.Class |
- TypeAttributes.Sealed;
-
- TypeBuilder = builder.DefineNestedType (
- name, attr, TypeManager.multicast_delegate_type);
- }
-
- RootContext.TypeManager.AddDelegateType (Name, TypeBuilder, this);
- }
-
- public override bool Define (TypeContainer parent)
- {
- MethodAttributes mattr;
- int i;
-
- // FIXME: POSSIBLY make this static, as it is always constant
- //
- Type [] const_arg_types = new Type [2];
- const_arg_types [0] = TypeManager.object_type;
- const_arg_types [1] = TypeManager.intptr_type;
-
- mattr = MethodAttributes.RTSpecialName | MethodAttributes.SpecialName |
- MethodAttributes.HideBySig | MethodAttributes.Public;
-
- ConstructorBuilder = TypeBuilder.DefineConstructor (mattr,
- CallingConventions.Standard,
- const_arg_types);
-
- ConstructorBuilder.DefineParameter (1, ParameterAttributes.None, "object");
- ConstructorBuilder.DefineParameter (2, ParameterAttributes.None, "method");
- //
- // HACK because System.Reflection.Emit is lame
- //
- //
- // FIXME: POSSIBLY make these static, as they are always the same
- Parameter [] fixed_pars = new Parameter [2];
- fixed_pars [0] = new Parameter (null, null, Parameter.Modifier.NONE, null);
- fixed_pars [1] = new Parameter (null, null, Parameter.Modifier.NONE, null);
- Parameters const_parameters = new Parameters (fixed_pars, null, Location);
-
- TypeManager.RegisterMethod (
- ConstructorBuilder,
- new InternalParameters (const_arg_types, const_parameters),
- const_arg_types);
-
-
- ConstructorBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- // Here the various methods like Invoke, BeginInvoke etc are defined
-
- //
- // Invoke method
- //
- param_types = Parameters.GetParameterInfo (parent);
- if (param_types == null)
- return false;
-
- // Check accessibility
- foreach (Type partype in param_types)
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- return false;
-
- ret_type = RootContext.LookupType (parent, ReturnType, false, Location);
- if (ret_type == null)
- return false;
-
- if (!TypeContainer.AsAccessible (ret_type, ModFlags))
- return false;
-
- //
- // We don't have to check any others because they are all
- // guaranteed to be accessible - they are standard types.
- //
-
- CallingConventions cc = Parameters.GetCallingConvention ();
-
- mattr = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.Virtual;
-
- InvokeBuilder = TypeBuilder.DefineMethod ("Invoke",
- mattr,
- cc,
- ret_type,
- param_types);
-
- for (i = 0 ; i < param_types.Length; i++) {
- Parameter p = Parameters.FixedParameters [i];
- string name = p.Name;
- ParameterBuilder pb = InvokeBuilder.DefineParameter (i+1, p.Attributes, name);
- }
-
- InvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- TypeManager.RegisterMethod (InvokeBuilder,
- new InternalParameters (parent, Parameters),
- param_types);
-
- //
- // BeginInvoke
- //
- int params_num = param_types.Length;
- Type [] async_param_types = new Type [params_num + 2];
-
- param_types.CopyTo (async_param_types, 0);
-
- async_param_types [params_num] = TypeManager.asynccallback_type;
- async_param_types [params_num + 1] = TypeManager.object_type;
-
- mattr = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.Virtual |
- MethodAttributes.NewSlot;
-
- BeginInvokeBuilder = TypeBuilder.DefineMethod ("BeginInvoke",
- mattr,
- cc,
- TypeManager.iasyncresult_type,
- async_param_types);
-
- for (i = 0 ; i < param_types.Length; i++) {
- Parameter p = Parameters.FixedParameters [i];
- string name = p.Name;
- BeginInvokeBuilder.DefineParameter (i + 1, p.Attributes, name);
- }
-
- BeginInvokeBuilder.DefineParameter (i + 1, ParameterAttributes.None, "callback");
- BeginInvokeBuilder.DefineParameter (i + 2, ParameterAttributes.None, "object");
-
- BeginInvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- Parameter [] async_params = new Parameter [params_num + 2];
- if (params_num > 0)
- Parameters.FixedParameters.CopyTo (async_params, 0);
-
- async_params [params_num] = new Parameter ("System.AsyncCallback", "callback",
- Parameter.Modifier.NONE, null);
- async_params [params_num + 1] = new Parameter ("System.IAsyncResult", "object",
- Parameter.Modifier.NONE, null);
-
- TypeManager.RegisterMethod (BeginInvokeBuilder,
- new InternalParameters (
- parent,
- new Parameters (async_params, null, Location)),
- async_param_types);
-
- //
- // EndInvoke
- //
- Type [] end_param_types = new Type [1];
- end_param_types [0] = TypeManager.iasyncresult_type;
-
- EndInvokeBuilder = TypeBuilder.DefineMethod ("EndInvoke",
- mattr,
- cc,
- ret_type,
- end_param_types);
- EndInvokeBuilder.DefineParameter (1, ParameterAttributes.None, "result");
-
- EndInvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- Parameter [] end_params = new Parameter [1];
- end_params [0] = new Parameter ("System.IAsyncResult", "result",
- Parameter.Modifier.NONE, null);
-
- TypeManager.RegisterMethod (EndInvokeBuilder,
- new InternalParameters (
- parent,
- new Parameters (end_params, null, Location)),
- end_param_types);
-
- return true;
- }
-
- /// <summary>
- /// Verifies whether the method in question is compatible with the delegate
- /// Returns the method itself if okay and null if not.
- /// </summary>
- public static MethodBase VerifyMethod (EmitContext ec, Type delegate_type, MethodBase mb,
- Location loc)
- {
- ParameterData pd = Invocation.GetParameterData (mb);
-
- Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return null;
- }
-
- MethodBase invoke_mb = ((MethodGroupExpr) ml).Methods [0];
-
- ParameterData invoke_pd = Invocation.GetParameterData (invoke_mb);
-
- bool mismatch = false;
- for (int i = pd.Count; i > 0; ) {
- i--;
-
- if (invoke_pd.ParameterType (i) == pd.ParameterType (i))
- continue;
- else {
- mismatch = true;
- break;
- }
- }
-
- if (mismatch) {
- Report.Error (
- 123, loc, "Method '" + Invocation.FullMethodDesc (mb) +
- "' does not match delegate '" +
- FullDelegateDesc (delegate_type, invoke_mb, invoke_pd) + "'");
- return null;
- }
-
- if (((MethodInfo) invoke_mb).ReturnType == ((MethodInfo) mb).ReturnType)
- return mb;
- else
- mismatch = true;
-
- if (mismatch) {
- Report.Error (123, loc, "Method '" + Invocation.FullMethodDesc (mb) +
- "' does not match delegate '" +
- FullDelegateDesc (delegate_type, invoke_mb, invoke_pd) + "'");
- return null;
- }
-
- return null;
- }
-
- // <summary>
- // Verifies whether the invocation arguments are compatible with the
- // delegate's target method
- // </summary>
- public static bool VerifyApplicability (EmitContext ec, Type delegate_type, ArrayList args,
- Location loc)
- {
- int arg_count;
-
- if (args == null)
- arg_count = 0;
- else
- arg_count = args.Count;
-
- Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return false;
- }
-
- MethodBase mb = ((MethodGroupExpr) ml).Methods [0];
-
- ParameterData pd = Invocation.GetParameterData (mb);
-
- if (pd.Count != arg_count) {
- Report.Error (1593, loc,
- "Delegate '" + delegate_type.ToString ()
- + "' does not take '" + arg_count + "' arguments");
- return false;
- }
-
- for (int i = arg_count; i > 0;) {
- i--;
- Expression conv;
- Argument a = (Argument) args [i];
- Expression a_expr = a.Expr;
-
- if (pd.ParameterType (i) != a_expr.Type) {
-
- conv = Expression.ConvertImplicitStandard (ec, a_expr, pd.ParameterType (i), loc);
-
- if (conv == null) {
- Report.Error (1594, loc,
- "Delegate '" + delegate_type.ToString () +
- "' has some invalid arguments.");
-
- Report.Error (1503, loc,
- "Argument " + (i+1) +
- ": Cannot convert from '" +
- TypeManager.CSharpName (a_expr.Type)
- + "' to '" + TypeManager.CSharpName (pd.ParameterType (i)) + "'");
- return false;
- }
-
- if (a_expr != conv)
- a.Expr = conv;
- }
- }
-
- return true;
- }
-
- /// <summary>
- /// Verifies whether the delegate in question is compatible with this one in
- /// order to determine if instantiation from the same is possible.
- /// </summary>
- public static bool VerifyDelegate (EmitContext ec, Type delegate_type, Type probe_type, Location loc)
- {
- Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return false;
- }
-
- MethodBase mb = ((MethodGroupExpr) ml).Methods [0];
- ParameterData pd = Invocation.GetParameterData (mb);
-
- Expression probe_ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(probe_ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return false;
- }
-
- MethodBase probe_mb = ((MethodGroupExpr) probe_ml).Methods [0];
- ParameterData probe_pd = Invocation.GetParameterData (probe_mb);
-
- if (((MethodInfo) mb).ReturnType != ((MethodInfo) probe_mb).ReturnType)
- return false;
-
- if (pd.Count != probe_pd.Count)
- return false;
-
- for (int i = pd.Count; i > 0; ) {
- i--;
-
- if (pd.ParameterType (i) != probe_pd.ParameterType (i) ||
- pd.ParameterModifier (i) != probe_pd.ParameterModifier (i))
- return false;
- }
-
- return true;
- }
-
- public static string FullDelegateDesc (Type del_type, MethodBase mb, ParameterData pd)
- {
- StringBuilder sb = new StringBuilder (TypeManager.CSharpName (((MethodInfo) mb).ReturnType));
-
- sb.Append (" " + del_type.ToString ());
- sb.Append (" (");
-
- int length = pd.Count;
-
- for (int i = length; i > 0; ) {
- i--;
-
- sb.Append (TypeManager.CSharpName (pd.ParameterType (length - i - 1)));
- if (i != 0)
- sb.Append (", ");
- }
-
- sb.Append (")");
- return sb.ToString ();
-
- }
-
- // Hack around System.Reflection as found everywhere else
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf, MemberFilter filter, object criteria)
- {
- ArrayList members = new ArrayList ();
-
- if ((mt & MemberTypes.Method) != 0) {
- if (filter (ConstructorBuilder, criteria))
- members.Add (ConstructorBuilder);
-
- if (filter (InvokeBuilder, criteria))
- members.Add (InvokeBuilder);
-
- if (filter (BeginInvokeBuilder, criteria))
- members.Add (BeginInvokeBuilder);
-
- if (filter (EndInvokeBuilder, criteria))
- members.Add (EndInvokeBuilder);
- }
-
- int count = members.Count;
-
- if (count > 0) {
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi, 0);
- return mi;
- }
-
- return null;
- }
-
- public void CloseDelegate ()
- {
- TypeBuilder.CreateType ();
- }
-
- public Expression InstanceExpression {
- get {
- return instance_expr;
- }
- set {
- instance_expr = value;
- }
- }
-
- public MethodBase TargetMethod {
- get {
- return delegate_method;
- }
- set {
- delegate_method = value;
- }
- }
-
- public Type TargetReturnType {
- get {
- return ret_type;
- }
- }
-
- public Type [] ParameterTypes {
- get {
- return param_types;
- }
- }
-
- }
-
- public class NewDelegate : Expression {
-
- public ArrayList Arguments;
-
- MethodBase constructor_method;
- MethodBase delegate_method;
- Expression delegate_instance_expr;
-
- Location Location;
-
- public NewDelegate (Type type, ArrayList Arguments, Location loc)
- {
- this.type = type;
- this.Arguments = Arguments;
- this.Location = loc;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- if (Arguments == null) {
- Report.Error (-11, Location,
- "Delegate creation expression takes only one argument");
- return null;
- }
-
- if (Arguments.Count != 1) {
- Report.Error (-11, Location,
- "Delegate creation expression takes only one argument");
- return null;
- }
-
- Expression ml = Expression.MemberLookup (
- ec, type, ".ctor", Location);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, Location, "Internal error : Could not find delegate constructor!");
- return null;
- }
-
- constructor_method = ((MethodGroupExpr) ml).Methods [0];
-
- Argument a = (Argument) Arguments [0];
-
- if (!a.Resolve (ec, Location))
- return null;
-
- Expression e = a.Expr;
-
- if (e is MethodGroupExpr) {
- MethodGroupExpr mg = (MethodGroupExpr) e;
-
- if (mg.Methods.Length > 1) {
- Report.Error (-14, Location, "Ambiguous method reference in delegate creation");
- return null;
- }
-
- delegate_method = Delegate.VerifyMethod (ec, type, mg.Methods [0], Location);
-
- if (delegate_method == null)
- return null;
-
- if (mg.InstanceExpression != null)
- delegate_instance_expr = mg.InstanceExpression.Resolve (ec);
- else {
- if (!ec.IsStatic)
- delegate_instance_expr = ec.This;
- else
- delegate_instance_expr = null;
- }
-
- if (delegate_instance_expr != null)
- if (delegate_instance_expr.Type.IsValueType)
- delegate_instance_expr = new BoxedCast (delegate_instance_expr);
-
- eclass = ExprClass.Value;
- return this;
- }
-
- Type e_type = e.Type;
-
- if (!TypeManager.IsDelegateType (e_type)) {
- Report.Error (-12, Location, "Cannot create a delegate from something " +
- "not a delegate or a method.");
- return null;
- }
-
- // This is what MS' compiler reports. We could always choose
- // to be more verbose and actually give delegate-level specifics
-
- if (!Delegate.VerifyDelegate (ec, type, e_type, Location)) {
- Report.Error (29, Location, "Cannot implicitly convert type '" + e_type + "' " +
- "to type '" + type + "'");
- return null;
- }
-
- Expression invoke_method = Expression.MemberLookup (
- ec, e_type, "Invoke", MemberTypes.Method,
- Expression.AllBindingFlags, Location);
-
- if (invoke_method == null) {
- Report.Error (-200, Location, "Internal error ! COuld not find Invoke method!");
- return null;
- }
-
- delegate_instance_expr = e;
- delegate_method = ((MethodGroupExpr) invoke_method).Methods [0];
-
- eclass = ExprClass.Value;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- if (delegate_instance_expr == null)
- ec.ig.Emit (OpCodes.Ldnull);
- else
- delegate_instance_expr.Emit (ec);
-
- ec.ig.Emit (OpCodes.Ldftn, (MethodInfo) delegate_method);
- ec.ig.Emit (OpCodes.Newobj, (ConstructorInfo) constructor_method);
- }
- }
-
- public class DelegateInvocation : ExpressionStatement {
-
- public Expression InstanceExpr;
- public ArrayList Arguments;
- public Location Location;
-
- MethodBase method;
-
- public DelegateInvocation (Expression instance_expr, ArrayList args, Location loc)
- {
- this.InstanceExpr = instance_expr;
- this.Arguments = args;
- this.Location = loc;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Type del_type = InstanceExpr.Type;
-
- if (del_type == null)
- return null;
-
- if (Arguments != null){
- for (int i = Arguments.Count; i > 0;){
- --i;
- Argument a = (Argument) Arguments [i];
-
- if (!a.Resolve (ec, Location))
- return null;
- }
- }
-
- if (!Delegate.VerifyApplicability (ec, del_type, Arguments, Location))
- return null;
-
- Expression ml = Expression.MemberLookup (ec, del_type, "Invoke", Location);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, Location, "Internal error : could not find Invoke method!");
- return null;
- }
-
- method = ((MethodGroupExpr) ml).Methods [0];
-
- type = ((MethodInfo) method).ReturnType;
-
- eclass = ExprClass.Value;
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Delegate del = TypeManager.LookupDelegate (InstanceExpr.Type);
-
- //
- // Invocation on delegates call the virtual Invoke member
- // so we are always `instance' calls
- //
- Invocation.EmitCall (ec, false, false, InstanceExpr, method, Arguments);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- Emit (ec);
- //
- // Pop the return value if there is one
- //
- if (method is MethodInfo){
- if (((MethodInfo) method).ReturnType != TypeManager.void_type)
- ec.ig.Emit (OpCodes.Pop);
- }
- }
-
- }
-}
diff --git a/mcs/mcs/driver.cs b/mcs/mcs/driver.cs
deleted file mode 100755
index 5c8575002a3..00000000000
--- a/mcs/mcs/driver.cs
+++ /dev/null
@@ -1,767 +0,0 @@
-//
-// driver.cs: The compiler command line driver.
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace Mono.CSharp
-{
- using System;
- using System.Reflection;
- using System.Reflection.Emit;
- using System.Collections;
- using System.IO;
- using System.Globalization;
- using Mono.Languages;
-
- enum Target {
- Library, Exe, Module, WinExe
- };
-
- /// <summary>
- /// The compiler driver.
- /// </summary>
- public class Driver
- {
-
- //
- // Assemblies references to be linked. Initialized with
- // mscorlib.dll here.
- static ArrayList references;
-
- // Lookup paths
- static ArrayList link_paths;
-
- // Whether we want Yacc to output its progress
- static bool yacc_verbose = false;
-
- // Whether we want to only run the tokenizer
- static bool tokenize = false;
-
- static int error_count = 0;
-
- static string first_source;
-
- static Target target = Target.Exe;
- static string target_ext = ".exe";
-
- static bool parse_only = false;
- static bool timestamps = false;
-
- static Hashtable response_file_list;
- static Hashtable source_files = new Hashtable ();
-
- //
- // An array of the defines from the command line
- //
- static ArrayList defines;
-
- //
- // Last time we took the time
- //
- static DateTime last_time;
- static void ShowTime (string msg)
- {
- DateTime now = DateTime.Now;
- TimeSpan span = now - last_time;
- last_time = now;
-
- Console.WriteLine (
- "[{0:00}:{1:000}] {2}",
- span.Seconds, span.Milliseconds, msg);
- }
-
- static int tokenize_file (string input_file)
- {
- Stream input;
-
- try {
- input = File.OpenRead (input_file);
-
- } catch {
- Report.Error (2001, "Source file '" + input_file + "' could not be opened");
- return 1;
- }
-
- using (input){
- Tokenizer lexer = new Tokenizer (input, input_file, defines);
- int token, tokens = 0, errors = 0;
-
- while ((token = lexer.token ()) != Token.EOF){
- Location l = lexer.Location;
- tokens++;
- if (token == Token.ERROR)
- errors++;
- }
- Console.WriteLine ("Tokenized: " + tokens + " found " + errors + " errors");
- }
-
- return 0;
- }
-
- static int parse (string input_file)
- {
- CSharpParser parser;
- Stream input;
- int errors;
-
- try {
- input = File.OpenRead (input_file);
- } catch {
- Report.Error (2001, "Source file '" + input_file + "' could not be opened");
- return 1;
- }
-
- parser = new CSharpParser (input_file, input, defines);
- parser.yacc_verbose = yacc_verbose;
- try {
- errors = parser.parse ();
- } catch (Exception ex) {
- Console.WriteLine (ex);
- Console.WriteLine ("Compilation aborted");
- return 1;
- } finally {
- input.Close ();
- }
-
- return errors;
- }
-
- static void Usage (bool is_error)
- {
- Console.WriteLine (
- "Mono C# compiler, (C) 2001 Ximian, Inc.\n" +
- "mcs [options] source-files\n" +
- " --about About the Mono C# compiler\n" +
- " --checked Set default context to checked\n" +
- " --define SYM Defines the symbol SYM\n" +
- " --fatal Makes errors fatal\n" +
- " --stacktrace Shows stack trace at error location\n" +
- " -L PATH Adds PATH to the assembly link path\n" +
- " --nostdlib Does not load core libraries\n" +
- " --nowarn XXX Ignores warning number XXX\n" +
- " -o FNAME Specifies output file\n" +
- " --optimize Optimizes\n" +
- " --parse Only parses the source file\n" +
- " --probe X Probes for the source to generate code X on line L\n" +
- " --target KIND Specifies the target (KIND is one of: exe, winexe, " +
- "library, module)\n" +
- " --timestamp Displays time stamps of various compiler events\n" +
- " --unsafe Allows unsafe code\n" +
- " --werror Treat warnings as errors\n" +
- " --wlevel LEVEL Sets warning level (the highest is 4, the default)\n" +
- " -r References an assembly\n" +
- " -v Verbose parsing (for debugging the parser)\n" +
- " @file Read response file for more options");
- if (is_error)
- error_count++;
- }
-
- static void About ()
- {
- Console.WriteLine (
- "The Mono C# compiler is (C) 2001 Ximian, Inc.\n\n" +
- "The compiler source code is released under the terms of the GNU GPL\n\n" +
-
- "For more information on Mono, visit the project Web site\n" +
- " http://www.go-mono.com\n\n" +
-
- "The compiler was written by Miguel de Icaza and Ravi Pratap");
- }
-
- static void error (string msg)
- {
- Console.WriteLine ("Error: " + msg);
- }
-
- static void notice (string msg)
- {
- Console.WriteLine (msg);
- }
-
- public static int Main (string[] args)
- {
- MainDriver (args);
-
- return error_count;
- }
-
- static public int LoadAssembly (string assembly)
- {
- Assembly a;
- string total_log = "";
-
- try {
- a = Assembly.Load (assembly);
- RootContext.TypeManager.AddAssembly (a);
- return 0;
- } catch (FileNotFoundException){
- foreach (string dir in link_paths){
- string full_path = dir + "/" + assembly + ".dll";
-
- try {
- a = Assembly.LoadFrom (full_path);
- RootContext.TypeManager.AddAssembly (a);
- return 0;
- } catch (FileNotFoundException ff) {
- total_log += ff.FusionLog;
- continue;
- }
- }
- } catch (BadImageFormatException f) {
- error ("// Bad file format while loading assembly");
- error ("Log: " + f.FusionLog);
- return 1;
- } catch (FileLoadException f){
- error ("// File Load Exception: ");
- error ("Log: " + f.FusionLog);
- return 1;
- } catch (ArgumentNullException){
- error ("// Argument Null exception ");
- return 1;
- }
-
- Report.Error (6, "Can not find assembly `" + assembly + "'" );
- Console.WriteLine ("Log: \n" + total_log);
-
- return 0;
- }
-
- /// <summary>
- /// Loads all assemblies referenced on the command line
- /// </summary>
- static public int LoadReferences ()
- {
- int errors = 0;
-
- foreach (string r in references)
- errors += LoadAssembly (r);
-
- return errors;
- }
-
- static void SetupDefaultDefines ()
- {
- defines = new ArrayList ();
- defines.Add ("__MonoCS__");
- }
-
- static string [] LoadArgs (string file)
- {
- StreamReader f;
- ArrayList args = new ArrayList ();
- string line;
- try {
- f = new StreamReader (file);
- } catch {
- return null;
- }
-
- while ((line = f.ReadLine ()) != null){
- string [] line_args = line.Split (new char [] { ' ' });
-
- foreach (string arg in line_args)
- args.Add (arg);
- }
-
- string [] ret_value = new string [args.Count];
- args.CopyTo (ret_value, 0);
-
- return ret_value;
- }
-
- //
- // Returns the directory where the system assemblies are installed
- //
- static string GetSystemDir ()
- {
- Assembly [] assemblies = AppDomain.CurrentDomain.GetAssemblies ();
-
- foreach (Assembly a in assemblies){
- string codebase = a.CodeBase;
- if (codebase.EndsWith ("corlib.dll")){
- return codebase.Substring (0, codebase.LastIndexOf ("/"));
- }
- }
-
- Report.Error (-15, "Can not compute my system path");
- return "";
- }
-
- //
- // Given a path specification, splits the path from the file/pattern
- //
- static void SplitPathAndPattern (string spec, out string path, out string pattern)
- {
- int p = spec.LastIndexOf ("/");
- if (p != -1){
- //
- // Windows does not like /file.cs, switch that to:
- // "\", "file.cs"
- //
- if (p == 0){
- path = "\\";
- pattern = spec.Substring (1);
- } else {
- path = spec.Substring (0, p);
- pattern = spec.Substring (p + 1);
- }
- return;
- }
-
- p = spec.LastIndexOf ("\\");
- if (p != -1){
- path = spec.Substring (0, p - 1);
- pattern = spec.Substring (p);
- return;
- }
-
- path = ".";
- pattern = spec;
- }
-
- static int ProcessFile (string f)
- {
- if (source_files.Contains (f)){
- Report.Error (
- 1516,
- "Source file `" + f + "' specified multiple times");
- Environment.Exit (1);
- } else
- source_files.Add (f, f);
-
- if (tokenize)
- tokenize_file (f);
- else
- return parse (f);
- return 0;
- }
-
- static void RecurseOn (string pattern)
- {
- // FIXME: implement.
- }
-
- /// <summary>
- /// Parses the arguments, and drives the compilation
- /// process.
- /// </summary>
- ///
- /// <remarks>
- /// TODO: Mostly structured to debug the compiler
- /// now, needs to be turned into a real driver soon.
- /// </remarks>
- static void MainDriver (string [] args)
- {
- int errors = 0, i;
- string output_file = null;
- bool parsing_options = true;
-
- references = new ArrayList ();
- link_paths = new ArrayList ();
-
- SetupDefaultDefines ();
-
- //
- // Setup defaults
- //
- // This is not required because Assembly.Load knows about this
- // path.
- //
- link_paths.Add (GetSystemDir ());
-
- int argc = args.Length;
- for (i = 0; i < argc; i++){
- string arg = args [i];
-
- if (arg.StartsWith ("@")){
- string [] new_args, extra_args;
- string response_file = arg.Substring (1);
-
- if (response_file_list == null)
- response_file_list = new Hashtable ();
-
- if (response_file_list.Contains (response_file)){
- Report.Error (
- 1515, "Response file `" + response_file +
- "' specified multiple times");
- Environment.Exit (1);
- }
-
- response_file_list.Add (response_file, response_file);
-
- extra_args = LoadArgs (response_file);
- if (extra_args == null){
- Report.Error (2011, "Unable to open response file: " +
- response_file);
- return;
- }
-
- new_args = new string [extra_args.Length + argc];
- args.CopyTo (new_args, 0);
- extra_args.CopyTo (new_args, argc);
- args = new_args;
- argc = new_args.Length;
- continue;
- }
-
- //
- // Prepare to recurse
- //
-
- if (parsing_options && (arg.StartsWith ("-") || arg.StartsWith ("/"))){
- switch (arg){
- case "-v":
- yacc_verbose = true;
- continue;
-
- case "--":
- parsing_options = false;
- continue;
-
- case "--parse":
- parse_only = true;
- continue;
-
- case "--main": case "-m":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
- RootContext.MainClass = args [++i];
- continue;
-
- case "--unsafe":
- RootContext.Unsafe = true;
- continue;
-
- case "--optimize":
- RootContext.Optimize = true;
- continue;
-
- case "/?": case "/h": case "/help":
- case "--help":
- Usage (false);
- return;
-
- case "--define":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
- defines.Add (args [++i]);
- continue;
-
- case "--probe": {
- int code = 0;
-
- try {
- code = Int32.Parse (
- args [++i], NumberStyles.AllowLeadingSign);
- Report.SetProbe (code);
- } catch {
- Report.Error (-14, "Invalid number specified");
- }
- continue;
- }
-
- case "--tokenize": {
- tokenize = true;
- continue;
- }
-
- case "-o":
- case "--output":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
- output_file = args [++i];
- string bname = CodeGen.Basename (output_file);
- if (bname.IndexOf (".") == -1)
- output_file += ".exe";
- continue;
-
- case "--checked":
- RootContext.Checked = true;
- continue;
-
- case "--stacktrace":
- Report.Stacktrace = true;
- continue;
-
- case "--target":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
-
- string type = args [++i];
- switch (type){
- case "library":
- target = Target.Library;
- target_ext = ".dll";
- break;
-
- case "exe":
- target = Target.Exe;
- break;
-
- case "winexe":
- target = Target.WinExe;
- break;
-
- case "module":
- target = Target.Module;
- target_ext = ".dll";
- break;
- }
- continue;
-
- case "-r":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
-
- references.Add (args [++i]);
- continue;
-
- case "-L":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
- link_paths.Add (args [++i]);
- continue;
-
- case "--nostdlib":
- RootContext.StdLib = false;
- continue;
-
- case "--fatal":
- Report.Fatal = true;
- continue;
-
- case "--werror":
- Report.WarningsAreErrors = true;
- continue;
-
- case "--nowarn":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
- int warn;
-
- try {
- warn = Int32.Parse (args [++i]);
- } catch {
- Usage (true);
- return;
- }
- Report.SetIgnoreWarning (warn);
- continue;
-
- case "--wlevel":
- if ((i + 1) >= argc){
- Usage (true);
- error_count++;
- return;
- }
- int level;
-
- try {
- level = Int32.Parse (args [++i]);
- } catch {
- Usage (true);
- return;
- }
- if (level < 0 || level > 4){
- Report.Error (1900, "Warning level must be 0 to 4");
- return;
- } else
- RootContext.WarningLevel = level;
- continue;
-
- case "--about":
- About ();
- return;
-
- case "--recurse":
- if ((i + 1) >= argc){
- Usage (true);
- error_count++;
- return;
- }
- RecurseOn (args [++i]);
- continue;
-
- case "--timestamp":
- timestamps = true;
- last_time = DateTime.Now;
- continue;
- }
- }
-
- if (first_source == null)
- first_source = arg;
-
- string path, pattern;
- SplitPathAndPattern (arg, out path, out pattern);
- string [] files = null;
- try {
- files = Directory.GetFiles (path, pattern);
- } catch (System.IO.DirectoryNotFoundException) {
- Report.Error (2001, "Source file `" + arg + "' could not be found");
- continue;
- }
-
- foreach (string f in files)
- errors += ProcessFile (f);
- }
-
- if (tokenize)
- return;
-
- if (first_source == null){
- Report.Error (2008, "No files to compile were specified");
- return;
- }
-
- if (Report.Errors > 0)
- return;
-
- if (parse_only)
- return;
-
- //
- // Load Core Library for default compilation
- //
- if (RootContext.StdLib){
- references.Insert (0, "mscorlib");
- references.Insert (1, "System");
- }
-
- if (errors > 0){
- error ("Parsing failed");
- return;
- }
-
- //
- // Load assemblies required
- //
- if (timestamps)
- ShowTime ("Loading references");
- errors += LoadReferences ();
- if (timestamps)
- ShowTime (" References loaded");
-
- if (errors > 0){
- error ("Could not load one or more assemblies");
- return;
- }
-
- error_count = errors;
-
- //
- // Quick hack
- //
- if (output_file == null){
- int pos = first_source.LastIndexOf (".");
-
- if (pos > 0)
- output_file = first_source.Substring (0, pos) + target_ext;
- else
- output_file = first_source + target_ext;
- }
-
- RootContext.CodeGen = new CodeGen (output_file, output_file);
-
- //
- // Before emitting, we need to get the core
- // types emitted from the user defined types
- // or from the system ones.
- //
- if (timestamps)
- ShowTime ("Initializing Core Types");
- RootContext.TypeManager.InitCoreTypes ();
- if (timestamps)
- ShowTime (" Core Types done");
-
- RootContext.TypeManager.AddModule (RootContext.CodeGen.ModuleBuilder);
-
- //
- // The second pass of the compiler
- //
- if (timestamps)
- ShowTime ("Resolving tree");
- RootContext.ResolveTree ();
- if (timestamps)
- ShowTime ("Populate tree");
- RootContext.PopulateTypes ();
-
- if (Report.Errors > 0){
- error ("Compilation failed");
- return;
- }
-
- //
- // The code generator
- //
- if (timestamps)
- ShowTime ("Emitting code");
- RootContext.EmitCode ();
- if (timestamps)
- ShowTime (" done");
-
- if (Report.Errors > 0){
- error ("Compilation failed");
- return;
- }
-
- if (timestamps)
- ShowTime ("Closing types");
-
- RootContext.CloseTypes ();
-
- PEFileKinds k = PEFileKinds.ConsoleApplication;
-
- if (target == Target.Library || target == Target.Module)
- k = PEFileKinds.Dll;
- else if (target == Target.Exe)
- k = PEFileKinds.ConsoleApplication;
- else if (target == Target.WinExe)
- k = PEFileKinds.WindowApplication;
-
- if (target == Target.Exe || target == Target.WinExe){
- MethodInfo ep = RootContext.EntryPoint;
-
- if (ep == null){
- Report.Error (5001, "Program " + output_file +
- " does not have an entry point defined");
- return;
- }
-
- RootContext.CodeGen.AssemblyBuilder.SetEntryPoint (ep, k);
- }
-
- RootContext.CodeGen.Save (output_file);
- if (timestamps)
- ShowTime ("Saved output");
-
- if (Report.Errors > 0){
- error ("Compilation failed");
- return;
- } else if (Report.ProbeCode != 0){
- error ("Failed to report code " + Report.ProbeCode);
- Environment.Exit (124);
- }
- }
-
- }
-}
diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs
deleted file mode 100755
index 831ea4cf416..00000000000
--- a/mcs/mcs/ecore.cs
+++ /dev/null
@@ -1,3536 +0,0 @@
-//
-// ecore.cs: Core of the Expression representation for the intermediate tree.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-
-namespace Mono.CSharp {
- using System;
- using System.Collections;
- using System.Diagnostics;
- using System.Reflection;
- using System.Reflection.Emit;
- using System.Text;
-
- /// <remarks>
- /// The ExprClass class contains the is used to pass the
- /// classification of an expression (value, variable, namespace,
- /// type, method group, property access, event access, indexer access,
- /// nothing).
- /// </remarks>
- public enum ExprClass : byte {
- Invalid,
-
- Value,
- Variable,
- Namespace,
- Type,
- MethodGroup,
- PropertyAccess,
- EventAccess,
- IndexerAccess,
- Nothing,
- }
-
- /// <summary>
- /// This interface is implemented by variables
- /// </summary>
- public interface IMemoryLocation {
- /// <summary>
- /// The AddressOf method should generate code that loads
- /// the address of the object and leaves it on the stack
- /// </summary>
- void AddressOf (EmitContext ec);
- }
-
- /// <remarks>
- /// Base class for expressions
- /// </remarks>
- public abstract class Expression {
- public ExprClass eclass;
- protected Type type;
-
- public Type Type {
- get {
- return type;
- }
-
- set {
- type = value;
- }
- }
-
- /// <summary>
- /// Utility wrapper routine for Error, just to beautify the code
- /// </summary>
- static protected void Error (int error, string s)
- {
- Report.Error (error, s);
- }
-
- static protected void Error (int error, Location loc, string s)
- {
- Report.Error (error, loc, s);
- }
-
- /// <summary>
- /// Utility wrapper routine for Warning, just to beautify the code
- /// </summary>
- static protected void Warning (int warning, string s)
- {
- Report.Warning (warning, s);
- }
-
- static public void error30 (Location loc, Type source, Type target)
- {
- Report.Error (30, loc, "Cannot convert type '" +
- TypeManager.CSharpName (source) + "' to '" +
- TypeManager.CSharpName (target) + "'");
- }
-
- /// <summary>
- /// Performs semantic analysis on the Expression
- /// </summary>
- ///
- /// <remarks>
- /// The Resolve method is invoked to perform the semantic analysis
- /// on the node.
- ///
- /// The return value is an expression (it can be the
- /// same expression in some cases) or a new
- /// expression that better represents this node.
- ///
- /// For example, optimizations of Unary (LiteralInt)
- /// would return a new LiteralInt with a negated
- /// value.
- ///
- /// If there is an error during semantic analysis,
- /// then an error should be reported (using Report)
- /// and a null value should be returned.
- ///
- /// There are two side effects expected from calling
- /// Resolve(): the the field variable "eclass" should
- /// be set to any value of the enumeration
- /// `ExprClass' and the type variable should be set
- /// to a valid type (this is the type of the
- /// expression).
- /// </remarks>
- public abstract Expression DoResolve (EmitContext ec);
-
- public virtual Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- return DoResolve (ec);
- }
-
- /// <summary>
- /// Resolves an expression and performs semantic analysis on it.
- /// </summary>
- ///
- /// <remarks>
- /// Currently Resolve wraps DoResolve to perform sanity
- /// checking and assertion checking on what we expect from Resolve.
- /// </remarks>
- public Expression Resolve (EmitContext ec)
- {
- Expression e = DoResolve (ec);
-
- if (e != null){
- if (e is SimpleName){
- SimpleName s = (SimpleName) e;
-
- Report.Error (
- 103, s.Location,
- "The name `" + s.Name + "' could not be found in `" +
- ec.TypeContainer.Name + "'");
- return null;
- }
-
- if (e.eclass == ExprClass.Invalid)
- throw new Exception ("Expression " + e.GetType () +
- " ExprClass is Invalid after resolve");
-
- if (e.eclass != ExprClass.MethodGroup)
- if (e.type == null)
- throw new Exception (
- "Expression " + e.GetType () +
- " did not set its type after Resolve\n" +
- "called from: " + this.GetType ());
- }
-
- return e;
- }
-
- /// <summary>
- /// Performs expression resolution and semantic analysis, but
- /// allows SimpleNames to be returned.
- /// </summary>
- ///
- /// <remarks>
- /// This is used by MemberAccess to construct long names that can not be
- /// partially resolved (namespace-qualified names for example).
- /// </remarks>
- public Expression ResolveWithSimpleName (EmitContext ec)
- {
- Expression e;
-
- if (this is SimpleName)
- e = ((SimpleName) this).DoResolveAllowStatic (ec);
- else
- e = DoResolve (ec);
-
- if (e != null){
- if (e is SimpleName)
- return e;
-
- if (e.eclass == ExprClass.Invalid)
- throw new Exception ("Expression " + e +
- " ExprClass is Invalid after resolve");
-
- if (e.eclass != ExprClass.MethodGroup)
- if (e.type == null)
- throw new Exception ("Expression " + e +
- " did not set its type after Resolve");
- }
-
- return e;
- }
-
- /// <summary>
- /// Resolves an expression for LValue assignment
- /// </summary>
- ///
- /// <remarks>
- /// Currently ResolveLValue wraps DoResolveLValue to perform sanity
- /// checking and assertion checking on what we expect from Resolve
- /// </remarks>
- public Expression ResolveLValue (EmitContext ec, Expression right_side)
- {
- Expression e = DoResolveLValue (ec, right_side);
-
- if (e != null){
- if (e is SimpleName){
- SimpleName s = (SimpleName) e;
-
- Report.Error (
- 103, s.Location,
- "The name `" + s.Name + "' could not be found in `" +
- ec.TypeContainer.Name + "'");
- return null;
- }
-
- if (e.eclass == ExprClass.Invalid)
- throw new Exception ("Expression " + e +
- " ExprClass is Invalid after resolve");
-
- if (e.eclass != ExprClass.MethodGroup)
- if (e.type == null)
- throw new Exception ("Expression " + e +
- " did not set its type after Resolve");
- }
-
- return e;
- }
-
- /// <summary>
- /// Emits the code for the expression
- /// </summary>
- ///
- /// <remarks>
- /// The Emit method is invoked to generate the code
- /// for the expression.
- /// </remarks>
- public abstract void Emit (EmitContext ec);
-
- /// <summary>
- /// Protected constructor. Only derivate types should
- /// be able to be created
- /// </summary>
-
- protected Expression ()
- {
- eclass = ExprClass.Invalid;
- type = null;
- }
-
- /// <summary>
- /// Returns a literalized version of a literal FieldInfo
- /// </summary>
- ///
- /// <remarks>
- /// The possible return values are:
- /// IntConstant, UIntConstant
- /// LongLiteral, ULongConstant
- /// FloatConstant, DoubleConstant
- /// StringConstant
- ///
- /// The value returned is already resolved.
- /// </remarks>
- public static Constant Constantify (object v, Type t)
- {
- if (t == TypeManager.int32_type)
- return new IntConstant ((int) v);
- else if (t == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- else if (t == TypeManager.int64_type)
- return new LongConstant ((long) v);
- else if (t == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- else if (t == TypeManager.float_type)
- return new FloatConstant ((float) v);
- else if (t == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- else if (t == TypeManager.string_type)
- return new StringConstant ((string) v);
- else if (t == TypeManager.short_type)
- return new ShortConstant ((short)v);
- else if (t == TypeManager.ushort_type)
- return new UShortConstant ((ushort)v);
- else if (t == TypeManager.sbyte_type)
- return new SByteConstant (((sbyte)v));
- else if (t == TypeManager.byte_type)
- return new ByteConstant ((byte)v);
- else if (t == TypeManager.char_type)
- return new CharConstant ((char)v);
- else if (TypeManager.IsEnumType (t)){
- Expression e = Constantify (v, v.GetType ());
-
- return new EnumConstant ((Constant) e, t);
- } else
- throw new Exception ("Unknown type for constant (" + t +
- "), details: " + v);
- }
-
- /// <summary>
- /// Returns a fully formed expression after a MemberLookup
- /// </summary>
- public static Expression ExprClassFromMemberInfo (EmitContext ec, MemberInfo mi, Location loc)
- {
- if (mi is EventInfo)
- return new EventExpr ((EventInfo) mi, loc);
- else if (mi is FieldInfo)
- return new FieldExpr ((FieldInfo) mi, loc);
- else if (mi is PropertyInfo)
- return new PropertyExpr ((PropertyInfo) mi, loc);
- else if (mi is Type){
- return new TypeExpr ((System.Type) mi);
- }
-
- return null;
- }
-
- //
- // Returns whether the array of memberinfos contains the given method
- //
- static bool ArrayContainsMethod (MemberInfo [] array, MethodBase new_method)
- {
- Type [] new_args = TypeManager.GetArgumentTypes (new_method);
-
- foreach (MethodBase method in array){
- if (method.Name != new_method.Name)
- continue;
-
- Type [] old_args = TypeManager.GetArgumentTypes (method);
- int old_count = old_args.Length;
- int i;
-
- if (new_args.Length != old_count)
- continue;
-
- for (i = 0; i < old_count; i++){
- if (old_args [i] != new_args [i])
- break;
- }
- if (i != old_count)
- continue;
-
- if (!(method is MethodInfo && new_method is MethodInfo))
- return true;
-
- if (((MethodInfo) method).ReturnType == ((MethodInfo) new_method).ReturnType)
- return true;
- }
- return false;
- }
-
- //
- // We copy methods from `new_members' into `target_list' if the signature
- // for the method from in the new list does not exist in the target_list
- //
- // The name is assumed to be the same.
- //
- public static ArrayList CopyNewMethods (ArrayList target_list, MemberInfo [] new_members)
- {
- if (target_list == null){
- target_list = new ArrayList ();
-
- target_list.AddRange (new_members);
- return target_list;
- }
-
- MemberInfo [] target_array = new MemberInfo [target_list.Count];
- target_list.CopyTo (target_array, 0);
-
- foreach (MemberInfo mi in new_members){
- MethodBase new_method = (MethodBase) mi;
-
- if (!ArrayContainsMethod (target_array, new_method))
- target_list.Add (new_method);
- }
- return target_list;
- }
-
- //
- // FIXME: Probably implement a cache for (t,name,current_access_set)?
- //
- // This code could use some optimizations, but we need to do some
- // measurements. For example, we could use a delegate to `flag' when
- // something can not any longer be a method-group (because it is something
- // else).
- //
- // Return values:
- // If the return value is an Array, then it is an array of
- // MethodBases
- //
- // If the return value is an MemberInfo, it is anything, but a Method
- //
- // null on error.
- //
- // FIXME: When calling MemberLookup inside an `Invocation', we should pass
- // the arguments here and have MemberLookup return only the methods that
- // match the argument count/type, unlike we are doing now (we delay this
- // decision).
- //
- // This is so we can catch correctly attempts to invoke instance methods
- // from a static body (scan for error 120 in ResolveSimpleName).
- //
- //
- // FIXME: Potential optimization, have a static ArrayList
- //
-
- public static Expression MemberLookup (EmitContext ec, Type t, string name,
- MemberTypes mt, BindingFlags bf, Location loc)
- {
- Type source_type = ec.ContainerType;
-
- if (source_type != null){
- if (source_type == t || source_type.IsSubclassOf (t))
- bf |= BindingFlags.NonPublic;
- }
-
- //
- // Lookup for members starting in the type requested and going
- // up the hierarchy until a match is found.
- //
- // As soon as a non-method match is found, we return.
- //
- // If methods are found though, then the search proceeds scanning
- // for more public methods in the hierarchy with signatures that
- // do not match any of the signatures found so far.
- //
- ArrayList method_list = null;
- Type current_type = t;
- bool searching = true;
- do {
- MemberInfo [] mi;
-
- mi = RootContext.TypeManager.FindMembers (
- current_type, mt, bf | BindingFlags.DeclaredOnly,
- System.Type.FilterName, name);
-
- if (current_type == TypeManager.object_type)
- searching = false;
- else {
- current_type = current_type.BaseType;
-
- //
- // This happens with interfaces, they have a null
- // basetype
- //
- if (current_type == null)
- searching = false;
- }
-
- if (mi == null)
- continue;
-
- int count = mi.Length;
-
- if (count == 0)
- continue;
-
- if (count == 1 && !(mi [0] is MethodBase))
- return Expression.ExprClassFromMemberInfo (ec, mi [0], loc);
-
- //
- // We found methods, turn the search into "method scan"
- // mode.
- //
- method_list = CopyNewMethods (method_list, mi);
- mt &= (MemberTypes.Method | MemberTypes.Constructor);
- } while (searching);
-
- if (method_list != null && method_list.Count > 0)
- return new MethodGroupExpr (method_list);
-
- return null;
- }
-
- public const MemberTypes AllMemberTypes =
- MemberTypes.Constructor |
- MemberTypes.Event |
- MemberTypes.Field |
- MemberTypes.Method |
- MemberTypes.NestedType |
- MemberTypes.Property;
-
- public const BindingFlags AllBindingFlags =
- BindingFlags.Public |
- BindingFlags.Static |
- BindingFlags.Instance;
-
- public static Expression MemberLookup (EmitContext ec, Type t, string name, Location loc)
- {
- return MemberLookup (ec, t, name, AllMemberTypes, AllBindingFlags, loc);
- }
-
- /// <summary>
- /// This is a wrapper for MemberLookup that is not used to "probe", but
- /// to find a final definition. If the final definition is not found, we
- /// look for private members and display a useful debugging message if we
- /// find it.
- /// </summary>
- public static Expression MemberLookupFinal (EmitContext ec, Type t, string name,
- Location loc)
- {
- Expression e;
-
- e = MemberLookup (ec, t, name, AllMemberTypes, AllBindingFlags, loc);
-
- if (e != null)
- return e;
-
- e = MemberLookup (ec, t, name, AllMemberTypes,
- AllBindingFlags | BindingFlags.NonPublic, loc);
- if (e == null){
- Report.Error (
- 117, loc, "`" + t + "' does not contain a definition " +
- "for `" + name + "'");
- } else {
- Report.Error (
- 122, loc, "`" + t + "." + name +
- "' is inaccessible due to its protection level");
- }
-
- return null;
- }
-
- static public Expression ImplicitReferenceConversion (Expression expr, Type target_type)
- {
- Type expr_type = expr.Type;
-
- if (target_type == TypeManager.object_type) {
- //
- // A pointer type cannot be converted to object
- //
- if (expr_type.IsPointer)
- return null;
-
- if (expr_type.IsValueType)
- return new BoxedCast (expr);
- if (expr_type.IsClass)
- return new EmptyCast (expr, target_type);
- } else if (expr_type.IsSubclassOf (target_type)) {
- return new EmptyCast (expr, target_type);
- } else {
-
- // This code is kind of mirrored inside StandardConversionExists
- // with the small distinction that we only probe there
- //
- // Always ensure that the code here and there is in sync
-
- // from the null type to any reference-type.
- if (expr is NullLiteral && !target_type.IsValueType)
- return new EmptyCast (expr, target_type);
-
- // from any class-type S to any interface-type T.
- if (expr_type.IsClass && target_type.IsInterface) {
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return new EmptyCast (expr, target_type);
- else
- return null;
- }
-
- // from any interface type S to interface-type T.
- if (expr_type.IsInterface && target_type.IsInterface) {
-
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return new EmptyCast (expr, target_type);
- else
- return null;
- }
-
- // from an array-type S to an array-type of type T
- if (expr_type.IsArray && target_type.IsArray) {
- if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type expr_element_type = expr_type.GetElementType ();
- Type target_element_type = target_type.GetElementType ();
-
- if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
- if (StandardConversionExists (expr_element_type,
- target_element_type))
- return new EmptyCast (expr, target_type);
- }
- }
-
-
- // from an array-type to System.Array
- if (expr_type.IsArray && target_type == TypeManager.array_type)
- return new EmptyCast (expr, target_type);
-
- // from any delegate type to System.Delegate
- if (expr_type.IsSubclassOf (TypeManager.delegate_type) &&
- target_type == TypeManager.delegate_type)
- return new EmptyCast (expr, target_type);
-
- // from any array-type or delegate type into System.ICloneable.
- if (expr_type.IsArray || expr_type.IsSubclassOf (TypeManager.delegate_type))
- if (target_type == TypeManager.icloneable_type)
- return new EmptyCast (expr, target_type);
-
- return null;
-
- }
-
- return null;
- }
-
- /// <summary>
- /// Handles expressions like this: decimal d; d = 1;
- /// and changes them into: decimal d; d = new System.Decimal (1);
- /// </summary>
- static Expression InternalTypeConstructor (EmitContext ec, Expression expr, Type target)
- {
- ArrayList args = new ArrayList ();
-
- args.Add (new Argument (expr, Argument.AType.Expression));
-
- Expression ne = new New (target.FullName, args,
- new Location (-1));
-
- return ne.Resolve (ec);
- }
-
- /// <summary>
- /// Implicit Numeric Conversions.
- ///
- /// expr is the expression to convert, returns a new expression of type
- /// target_type or null if an implicit conversion is not possible.
- /// </summary>
- static public Expression ImplicitNumericConversion (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
-
- //
- // Attempt to do the implicit constant expression conversions
-
- if (expr is IntConstant){
- Expression e;
-
- e = TryImplicitIntConversion (target_type, (IntConstant) expr);
-
- if (e != null)
- return e;
- } else if (expr is LongConstant && target_type == TypeManager.uint64_type){
- //
- // Try the implicit constant expression conversion
- // from long to ulong, instead of a nice routine,
- // we just inline it
- //
- long v = ((LongConstant) expr).Value;
- if (v > 0)
- return new ULongConstant ((ulong) v);
- }
-
- //
- // If we have an enumeration, extract the underlying type,
- // use this during the comparission, but wrap around the original
- // target_type
- //
- Type real_target_type = target_type;
-
- if (TypeManager.IsEnumType (real_target_type))
- real_target_type = TypeManager.EnumToUnderlying (real_target_type);
-
- if (expr_type == real_target_type)
- return new EmptyCast (expr, target_type);
-
- if (expr_type == TypeManager.sbyte_type){
- //
- // From sbyte to short, int, long, float, double.
- //
- if (real_target_type == TypeManager.int32_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I4);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.short_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I2);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.byte_type){
- //
- // From byte to short, ushort, int, uint, long, ulong, float, double
- //
- if ((real_target_type == TypeManager.short_type) ||
- (real_target_type == TypeManager.ushort_type) ||
- (real_target_type == TypeManager.int32_type) ||
- (real_target_type == TypeManager.uint32_type))
- return new EmptyCast (expr, target_type);
-
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.short_type){
- //
- // From short to int, long, float, double
- //
- if (real_target_type == TypeManager.int32_type)
- return new EmptyCast (expr, target_type);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.ushort_type){
- //
- // From ushort to int, uint, long, ulong, float, double
- //
- if (real_target_type == TypeManager.uint32_type)
- return new EmptyCast (expr, target_type);
-
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.int32_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I4);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.int32_type){
- //
- // From int to long, float, double
- //
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.uint32_type){
- //
- // From uint to long, ulong, float, double
- //
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if ((expr_type == TypeManager.uint64_type) ||
- (expr_type == TypeManager.int64_type)){
- //
- // From long/ulong to float, double
- //
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.char_type){
- //
- // From char to ushort, int, uint, long, ulong, float, double
- //
- if ((real_target_type == TypeManager.ushort_type) ||
- (real_target_type == TypeManager.int32_type) ||
- (real_target_type == TypeManager.uint32_type))
- return new EmptyCast (expr, target_type);
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.float_type){
- //
- // float to double
- //
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- }
-
- return null;
- }
-
- /// <summary>
- /// Determines if a standard implicit conversion exists from
- /// expr_type to target_type
- /// </summary>
- public static bool StandardConversionExists (Type expr_type, Type target_type)
- {
- if (expr_type == target_type)
- return true;
-
- // First numeric conversions
-
- if (expr_type == TypeManager.sbyte_type){
- //
- // From sbyte to short, int, long, float, double.
- //
- if ((target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.short_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.byte_type){
- //
- // From byte to short, ushort, int, uint, long, ulong, float, double
- //
- if ((target_type == TypeManager.short_type) ||
- (target_type == TypeManager.ushort_type) ||
- (target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.uint32_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.short_type){
- //
- // From short to int, long, float, double
- //
- if ((target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.ushort_type){
- //
- // From ushort to int, uint, long, ulong, float, double
- //
- if ((target_type == TypeManager.uint32_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.int32_type){
- //
- // From int to long, float, double
- //
- if ((target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.uint32_type){
- //
- // From uint to long, ulong, float, double
- //
- if ((target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if ((expr_type == TypeManager.uint64_type) ||
- (expr_type == TypeManager.int64_type)) {
- //
- // From long/ulong to float, double
- //
- if ((target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.char_type){
- //
- // From char to ushort, int, uint, long, ulong, float, double
- //
- if ((target_type == TypeManager.ushort_type) ||
- (target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.uint32_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.float_type){
- //
- // float to double
- //
- if (target_type == TypeManager.double_type)
- return true;
- }
-
- // Next reference conversions
-
- if (target_type == TypeManager.object_type) {
- if ((expr_type.IsClass) ||
- (expr_type.IsValueType))
- return true;
-
- } else if (expr_type.IsSubclassOf (target_type)) {
- return true;
-
- } else {
- // Please remember that all code below actuall comes
- // from ImplicitReferenceConversion so make sure code remains in sync
-
- // from any class-type S to any interface-type T.
- if (expr_type.IsClass && target_type.IsInterface) {
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return true;
- }
-
- // from any interface type S to interface-type T.
- // FIXME : Is it right to use IsAssignableFrom ?
- if (expr_type.IsInterface && target_type.IsInterface)
- if (target_type.IsAssignableFrom (expr_type))
- return true;
-
- // from an array-type S to an array-type of type T
- if (expr_type.IsArray && target_type.IsArray) {
- if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type expr_element_type = expr_type.GetElementType ();
- Type target_element_type = target_type.GetElementType ();
-
- if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
- if (StandardConversionExists (expr_element_type,
- target_element_type))
- return true;
- }
- }
-
- // from an array-type to System.Array
- if (expr_type.IsArray && target_type.IsAssignableFrom (expr_type))
- return true;
-
- // from any delegate type to System.Delegate
- if (expr_type.IsSubclassOf (TypeManager.delegate_type) &&
- target_type == TypeManager.delegate_type)
- if (target_type.IsAssignableFrom (expr_type))
- return true;
-
- // from any array-type or delegate type into System.ICloneable.
- if (expr_type.IsArray || expr_type.IsSubclassOf (TypeManager.delegate_type))
- if (target_type == TypeManager.icloneable_type)
- return true;
-
- // from the null type to any reference-type.
- // FIXME : How do we do this ?
-
- }
-
- return false;
- }
-
- static EmptyExpression MyEmptyExpr;
- /// <summary>
- /// Tells whether an implicit conversion exists from expr_type to
- /// target_type
- /// </summary>
- public bool ImplicitConversionExists (EmitContext ec, Type expr_type, Type target_type,
- Location l)
- {
- if (MyEmptyExpr == null)
- MyEmptyExpr = new EmptyExpression (expr_type);
- else
- MyEmptyExpr.SetType (expr_type);
-
- return ConvertImplicit (ec, MyEmptyExpr, target_type, l) != null;
- }
-
- /// <summary>
- /// Finds "most encompassed type" according to the spec (13.4.2)
- /// amongst the methods in the MethodGroupExpr which convert from a
- /// type encompassing source_type
- /// </summary>
- static Type FindMostEncompassedType (MethodGroupExpr me, Type source_type)
- {
- Type best = null;
-
- for (int i = me.Methods.Length; i > 0; ) {
- i--;
-
- MethodBase mb = me.Methods [i];
- ParameterData pd = Invocation.GetParameterData (mb);
- Type param_type = pd.ParameterType (0);
-
- if (StandardConversionExists (source_type, param_type)) {
- if (best == null)
- best = param_type;
-
- if (StandardConversionExists (param_type, best))
- best = param_type;
- }
- }
-
- return best;
- }
-
- /// <summary>
- /// Finds "most encompassing type" according to the spec (13.4.2)
- /// amongst the methods in the MethodGroupExpr which convert to a
- /// type encompassed by target_type
- /// </summary>
- static Type FindMostEncompassingType (MethodGroupExpr me, Type target)
- {
- Type best = null;
-
- for (int i = me.Methods.Length; i > 0; ) {
- i--;
-
- MethodInfo mi = (MethodInfo) me.Methods [i];
- Type ret_type = mi.ReturnType;
-
- if (StandardConversionExists (ret_type, target)) {
- if (best == null)
- best = ret_type;
-
- if (!StandardConversionExists (ret_type, best))
- best = ret_type;
- }
-
- }
-
- return best;
-
- }
-
-
- /// <summary>
- /// User-defined Implicit conversions
- /// </summary>
- static public Expression ImplicitUserConversion (EmitContext ec, Expression source,
- Type target, Location loc)
- {
- return UserDefinedConversion (ec, source, target, loc, false);
- }
-
- /// <summary>
- /// User-defined Explicit conversions
- /// </summary>
- static public Expression ExplicitUserConversion (EmitContext ec, Expression source,
- Type target, Location loc)
- {
- return UserDefinedConversion (ec, source, target, loc, true);
- }
-
- /// <summary>
- /// User-defined conversions
- /// </summary>
- static public Expression UserDefinedConversion (EmitContext ec, Expression source,
- Type target, Location loc,
- bool look_for_explicit)
- {
- Expression mg1 = null, mg2 = null, mg3 = null, mg4 = null;
- Expression mg5 = null, mg6 = null, mg7 = null, mg8 = null;
- Expression e;
- MethodBase method = null;
- Type source_type = source.Type;
-
- string op_name;
-
- // If we have a boolean type, we need to check for the True operator
-
- // FIXME : How does the False operator come into the picture ?
- // FIXME : This doesn't look complete and very correct !
- if (target == TypeManager.bool_type)
- op_name = "op_True";
- else
- op_name = "op_Implicit";
-
- mg1 = MemberLookup (ec, source_type, op_name, loc);
-
- if (source_type.BaseType != null)
- mg2 = MemberLookup (ec, source_type.BaseType, op_name, loc);
-
- mg3 = MemberLookup (ec, target, op_name, loc);
-
- if (target.BaseType != null)
- mg4 = MemberLookup (ec, target.BaseType, op_name, loc);
-
- MethodGroupExpr union1 = Invocation.MakeUnionSet (mg1, mg2);
- MethodGroupExpr union2 = Invocation.MakeUnionSet (mg3, mg4);
-
- MethodGroupExpr union3 = Invocation.MakeUnionSet (union1, union2);
-
- MethodGroupExpr union4 = null;
-
- if (look_for_explicit) {
-
- op_name = "op_Explicit";
-
- mg5 = MemberLookup (ec, source_type, op_name, loc);
-
- if (source_type.BaseType != null)
- mg6 = MemberLookup (ec, source_type.BaseType, op_name, loc);
-
- mg7 = MemberLookup (ec, target, op_name, loc);
-
- if (target.BaseType != null)
- mg8 = MemberLookup (ec, target.BaseType, op_name, loc);
-
- MethodGroupExpr union5 = Invocation.MakeUnionSet (mg5, mg6);
- MethodGroupExpr union6 = Invocation.MakeUnionSet (mg7, mg8);
-
- union4 = Invocation.MakeUnionSet (union5, union6);
- }
-
- MethodGroupExpr union = Invocation.MakeUnionSet (union3, union4);
-
- if (union != null) {
-
- Type most_specific_source, most_specific_target;
-
- most_specific_source = FindMostEncompassedType (union, source_type);
- if (most_specific_source == null)
- return null;
-
- most_specific_target = FindMostEncompassingType (union, target);
- if (most_specific_target == null)
- return null;
-
- int count = 0;
-
- for (int i = union.Methods.Length; i > 0;) {
- i--;
-
- MethodBase mb = union.Methods [i];
- ParameterData pd = Invocation.GetParameterData (mb);
- MethodInfo mi = (MethodInfo) union.Methods [i];
-
- if (pd.ParameterType (0) == most_specific_source &&
- mi.ReturnType == most_specific_target) {
- method = mb;
- count++;
- }
- }
-
- if (method == null || count > 1) {
- Report.Error (-11, loc, "Ambiguous user defined conversion");
- return null;
- }
-
- //
- // This will do the conversion to the best match that we
- // found. Now we need to perform an implict standard conversion
- // if the best match was not the type that we were requested
- // by target.
- //
- if (look_for_explicit)
- source = ConvertExplicitStandard (ec, source, most_specific_source, loc);
- else
- source = ConvertImplicitStandard (ec, source,
- most_specific_source, loc);
-
- if (source == null)
- return null;
-
- e = new UserCast ((MethodInfo) method, source);
-
- if (e.Type != target){
- if (!look_for_explicit)
- e = ConvertImplicitStandard (ec, e, target, loc);
- else
- e = ConvertExplicitStandard (ec, e, target, loc);
-
- return e;
- } else
- return e;
- }
-
- return null;
- }
-
- /// <summary>
- /// Converts implicitly the resolved expression `expr' into the
- /// `target_type'. It returns a new expression that can be used
- /// in a context that expects a `target_type'.
- /// </summary>
- static public Expression ConvertImplicit (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
- Expression e;
-
- if (expr_type == target_type)
- return expr;
-
- if (target_type == null)
- throw new Exception ("Target type is null");
-
- e = ConvertImplicitStandard (ec, expr, target_type, loc);
- if (e != null)
- return e;
-
- e = ImplicitUserConversion (ec, expr, target_type, loc);
- if (e != null)
- return e;
-
- return null;
- }
-
-
- /// <summary>
- /// Attempts to apply the `Standard Implicit
- /// Conversion' rules to the expression `expr' into
- /// the `target_type'. It returns a new expression
- /// that can be used in a context that expects a
- /// `target_type'.
- ///
- /// This is different from `ConvertImplicit' in that the
- /// user defined implicit conversions are excluded.
- /// </summary>
- static public Expression ConvertImplicitStandard (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
- Expression e;
-
- if (expr_type == target_type)
- return expr;
-
- e = ImplicitNumericConversion (ec, expr, target_type, loc);
- if (e != null)
- return e;
-
- e = ImplicitReferenceConversion (expr, target_type);
- if (e != null)
- return e;
-
- if (target_type.IsSubclassOf (TypeManager.enum_type) && expr is IntLiteral){
- IntLiteral i = (IntLiteral) expr;
-
- if (i.Value == 0)
- return new EmptyCast (expr, target_type);
- }
-
- if (ec.InUnsafe) {
- if (expr_type.IsPointer){
- if (target_type == TypeManager.void_ptr_type)
- return new EmptyCast (expr, target_type);
-
- //
- // yep, comparing pointer types cant be done with
- // t1 == t2, we have to compare their element types.
- //
- if (target_type.IsPointer){
- if (target_type.GetElementType()==expr_type.GetElementType())
- return expr;
- }
- }
-
- if (target_type.IsPointer){
- if (expr is NullLiteral)
- return new EmptyCast (expr, target_type);
- }
- }
-
- return null;
- }
-
- /// <summary>
- /// Attemps to perform an implict constant conversion of the IntConstant
- /// into a different data type using casts (See Implicit Constant
- /// Expression Conversions)
- /// </summary>
- static protected Expression TryImplicitIntConversion (Type target_type, IntConstant ic)
- {
- int value = ic.Value;
-
- //
- // FIXME: This should really return constants instead of EmptyCasts
- //
- if (target_type == TypeManager.sbyte_type){
- if (value >= SByte.MinValue && value <= SByte.MaxValue)
- return new SByteConstant ((sbyte) value);
- } else if (target_type == TypeManager.byte_type){
- if (Byte.MinValue >= 0 && value <= Byte.MaxValue)
- return new ByteConstant ((byte) value);
- } else if (target_type == TypeManager.short_type){
- if (value >= Int16.MinValue && value <= Int16.MaxValue)
- return new ShortConstant ((short) value);
- } else if (target_type == TypeManager.ushort_type){
- if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
- return new UShortConstant ((ushort) value);
- } else if (target_type == TypeManager.uint32_type){
- if (value >= 0)
- return new UIntConstant ((uint) value);
- } else if (target_type == TypeManager.uint64_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint64. But we need an opcode
- // to do it.
- //
- if (value >= 0)
- return new ULongConstant ((ulong) value);
- }
-
- if (value == 0 && ic is IntLiteral && TypeManager.IsEnumType (target_type))
- return new EnumConstant (ic, target_type);
-
- return null;
- }
-
- /// <summary>
- /// Attemptes to implicityly convert `target' into `type', using
- /// ConvertImplicit. If there is no implicit conversion, then
- /// an error is signaled
- /// </summary>
- static public Expression ConvertImplicitRequired (EmitContext ec, Expression source,
- Type target_type, Location loc)
- {
- Expression e;
-
- e = ConvertImplicit (ec, source, target_type, loc);
- if (e != null)
- return e;
-
- if (source is DoubleLiteral && target_type == TypeManager.float_type){
- Error (664, loc,
- "Double literal cannot be implicitly converted to " +
- "float type, use F suffix to create a float literal");
- }
-
- string msg = "Cannot convert implicitly from `"+
- TypeManager.CSharpName (source.Type) + "' to `" +
- TypeManager.CSharpName (target_type) + "'";
-
- Error (29, loc, msg);
-
- return null;
- }
-
- /// <summary>
- /// Performs the explicit numeric conversions
- /// </summary>
- static Expression ConvertNumericExplicit (EmitContext ec, Expression expr,
- Type target_type)
- {
- Type expr_type = expr.Type;
-
- //
- // If we have an enumeration, extract the underlying type,
- // use this during the comparission, but wrap around the original
- // target_type
- //
- Type real_target_type = target_type;
-
- if (TypeManager.IsEnumType (real_target_type))
- real_target_type = TypeManager.EnumToUnderlying (real_target_type);
-
- if (expr_type == TypeManager.sbyte_type){
- //
- // From sbyte to byte, ushort, uint, ulong, char
- //
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I1_U1);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I1_U2);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I1_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I1_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I1_CH);
- } else if (expr_type == TypeManager.byte_type){
- //
- // From byte to sbyte and char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U1_I1);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U1_CH);
- } else if (expr_type == TypeManager.short_type){
- //
- // From short to sbyte, byte, ushort, uint, ulong, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I2_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I2_U1);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I2_U2);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I2_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I2_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I2_CH);
- } else if (expr_type == TypeManager.ushort_type){
- //
- // From ushort to sbyte, byte, short, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U2_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U2_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U2_I2);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U2_CH);
- } else if (expr_type == TypeManager.int32_type){
- //
- // From int to sbyte, byte, short, ushort, uint, ulong, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I4_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I4_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I4_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I4_U2);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I4_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I4_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I4_CH);
- } else if (expr_type == TypeManager.uint32_type){
- //
- // From uint to sbyte, byte, short, ushort, int, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U4_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U4_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U4_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U4_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U4_I4);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U4_CH);
- } else if (expr_type == TypeManager.int64_type){
- //
- // From long to sbyte, byte, short, ushort, int, uint, ulong, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I8_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I8_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I8_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I8_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I8_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I8_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I8_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.I8_CH);
- } else if (expr_type == TypeManager.uint64_type){
- //
- // From ulong to sbyte, byte, short, ushort, int, uint, long, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U8_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U8_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U8_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U8_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U8_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U8_U4);
- if (real_target_type == TypeManager.int64_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U8_I8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.U8_CH);
- } else if (expr_type == TypeManager.char_type){
- //
- // From char to sbyte, byte, short
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.CH_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.CH_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.CH_I2);
- } else if (expr_type == TypeManager.float_type){
- //
- // From float to sbyte, byte, short,
- // ushort, int, uint, long, ulong, char
- // or decimal
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R4_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R4_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R4_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R4_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R4_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R4_U4);
- if (real_target_type == TypeManager.int64_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R4_I8);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R4_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R4_CH);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.double_type){
- //
- // From double to byte, byte, short,
- // ushort, int, uint, long, ulong,
- // char, float or decimal
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_U4);
- if (real_target_type == TypeManager.int64_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_I8);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_CH);
- if (real_target_type == TypeManager.float_type)
- return new ConvCast (expr, target_type, ConvCast.Mode.R8_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- }
-
- // decimal is taken care of by the op_Explicit methods.
-
- return null;
- }
-
- /// <summary>
- /// Returns whether an explicit reference conversion can be performed
- /// from source_type to target_type
- /// </summary>
- static bool ExplicitReferenceConversionExists (Type source_type, Type target_type)
- {
- bool target_is_value_type = target_type.IsValueType;
-
- if (source_type == target_type)
- return true;
-
- //
- // From object to any reference type
- //
- if (source_type == TypeManager.object_type && !target_is_value_type)
- return true;
-
- //
- // From any class S to any class-type T, provided S is a base class of T
- //
- if (target_type.IsSubclassOf (source_type))
- return true;
-
- //
- // From any interface type S to any interface T provided S is not derived from T
- //
- if (source_type.IsInterface && target_type.IsInterface){
- if (!target_type.IsSubclassOf (source_type))
- return true;
- }
-
- //
- // From any class type S to any interface T, provides S is not sealed
- // and provided S does not implement T.
- //
- if (target_type.IsInterface && !source_type.IsSealed &&
- !target_type.IsAssignableFrom (source_type))
- return true;
-
- //
- // From any interface-type S to to any class type T, provided T is not
- // sealed, or provided T implements S.
- //
- if (source_type.IsInterface &&
- (!target_type.IsSealed || source_type.IsAssignableFrom (target_type)))
- return true;
-
- // From an array type S with an element type Se to an array type T with an
- // element type Te provided all the following are true:
- // * S and T differe only in element type, in other words, S and T
- // have the same number of dimensions.
- // * Both Se and Te are reference types
- // * An explicit referenc conversions exist from Se to Te
- //
- if (source_type.IsArray && target_type.IsArray) {
- if (source_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type source_element_type = source_type.GetElementType ();
- Type target_element_type = target_type.GetElementType ();
-
- if (!source_element_type.IsValueType && !target_element_type.IsValueType)
- if (ExplicitReferenceConversionExists (source_element_type,
- target_element_type))
- return true;
- }
- }
-
-
- // From System.Array to any array-type
- if (source_type == TypeManager.array_type &&
- target_type.IsSubclassOf (TypeManager.array_type)){
- return true;
- }
-
- //
- // From System delegate to any delegate-type
- //
- if (source_type == TypeManager.delegate_type &&
- target_type.IsSubclassOf (TypeManager.delegate_type))
- return true;
-
- //
- // From ICloneable to Array or Delegate types
- //
- if (source_type == TypeManager.icloneable_type &&
- (target_type == TypeManager.array_type ||
- target_type == TypeManager.delegate_type))
- return true;
-
- return false;
- }
-
- /// <summary>
- /// Implements Explicit Reference conversions
- /// </summary>
- static Expression ConvertReferenceExplicit (Expression source, Type target_type)
- {
- Type source_type = source.Type;
- bool target_is_value_type = target_type.IsValueType;
-
- //
- // From object to any reference type
- //
- if (source_type == TypeManager.object_type && !target_is_value_type)
- return new ClassCast (source, target_type);
-
-
- //
- // From any class S to any class-type T, provided S is a base class of T
- //
- if (target_type.IsSubclassOf (source_type))
- return new ClassCast (source, target_type);
-
- //
- // From any interface type S to any interface T provided S is not derived from T
- //
- if (source_type.IsInterface && target_type.IsInterface){
-
- Type [] ifaces = source_type.GetInterfaces ();
-
- if (TypeManager.ImplementsInterface (source_type, target_type))
- return null;
- else
- return new ClassCast (source, target_type);
- }
-
- //
- // From any class type S to any interface T, provides S is not sealed
- // and provided S does not implement T.
- //
- if (target_type.IsInterface && !source_type.IsSealed) {
-
- if (TypeManager.ImplementsInterface (source_type, target_type))
- return null;
- else
- return new ClassCast (source, target_type);
-
- }
-
- //
- // From any interface-type S to to any class type T, provided T is not
- // sealed, or provided T implements S.
- //
- if (source_type.IsInterface) {
-
- if (target_type.IsSealed)
- return null;
-
- if (TypeManager.ImplementsInterface (target_type, source_type))
- return new ClassCast (source, target_type);
- else
- return null;
- }
-
- // From an array type S with an element type Se to an array type T with an
- // element type Te provided all the following are true:
- // * S and T differe only in element type, in other words, S and T
- // have the same number of dimensions.
- // * Both Se and Te are reference types
- // * An explicit referenc conversions exist from Se to Te
- //
- if (source_type.IsArray && target_type.IsArray) {
- if (source_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type source_element_type = source_type.GetElementType ();
- Type target_element_type = target_type.GetElementType ();
-
- if (!source_element_type.IsValueType && !target_element_type.IsValueType)
- if (ExplicitReferenceConversionExists (source_element_type,
- target_element_type))
- return new ClassCast (source, target_type);
- }
- }
-
-
- // From System.Array to any array-type
- if (source_type == TypeManager.array_type &&
- target_type.IsSubclassOf (TypeManager.array_type)){
- return new ClassCast (source, target_type);
- }
-
- //
- // From System delegate to any delegate-type
- //
- if (source_type == TypeManager.delegate_type &&
- target_type.IsSubclassOf (TypeManager.delegate_type))
- return new ClassCast (source, target_type);
-
- //
- // From ICloneable to Array or Delegate types
- //
- if (source_type == TypeManager.icloneable_type &&
- (target_type == TypeManager.array_type ||
- target_type == TypeManager.delegate_type))
- return new ClassCast (source, target_type);
-
- return null;
- }
-
- /// <summary>
- /// Performs an explicit conversion of the expression `expr' whose
- /// type is expr.Type to `target_type'.
- /// </summary>
- static public Expression ConvertExplicit (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
- Expression ne = ConvertImplicitStandard (ec, expr, target_type, loc);
-
- if (ne != null)
- return ne;
-
- ne = ConvertNumericExplicit (ec, expr, target_type);
- if (ne != null)
- return ne;
-
- //
- // Unboxing conversion.
- //
- if (expr_type == TypeManager.object_type && target_type.IsValueType)
- return new UnboxCast (expr, target_type);
-
- //
- // Enum types
- //
- if (expr_type.IsSubclassOf (TypeManager.enum_type)) {
- Expression e;
-
- //
- // FIXME: Is there any reason we should have EnumConstant
- // dealt with here instead of just using always the
- // UnderlyingSystemType to wrap the type?
- //
- if (expr is EnumConstant)
- e = ((EnumConstant) expr).Child;
- else {
- e = new EmptyCast (expr, TypeManager.EnumToUnderlying (expr_type));
- }
-
- Expression t = ConvertImplicit (ec, e, target_type, loc);
- if (t != null)
- return t;
-
- return ConvertNumericExplicit (ec, e, target_type);
- }
-
- ne = ConvertReferenceExplicit (expr, target_type);
- if (ne != null)
- return ne;
-
- if (ec.InUnsafe){
- if (target_type.IsPointer){
- if (expr_type.IsPointer)
- return new EmptyCast (expr, target_type);
-
- if (expr_type == TypeManager.sbyte_type ||
- expr_type == TypeManager.byte_type ||
- expr_type == TypeManager.short_type ||
- expr_type == TypeManager.ushort_type ||
- expr_type == TypeManager.int32_type ||
- expr_type == TypeManager.uint32_type ||
- expr_type == TypeManager.uint64_type ||
- expr_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U);
- }
- if (expr_type.IsPointer){
- if (target_type == TypeManager.sbyte_type ||
- target_type == TypeManager.byte_type ||
- target_type == TypeManager.short_type ||
- target_type == TypeManager.ushort_type ||
- target_type == TypeManager.int32_type ||
- target_type == TypeManager.uint32_type ||
- target_type == TypeManager.uint64_type ||
- target_type == TypeManager.int64_type){
- Expression e = new EmptyCast (expr, TypeManager.uint32_type);
- Expression ci, ce;
-
- ci = ConvertImplicitStandard (ec, e, target_type, loc);
-
- if (ci != null)
- return ci;
-
- ce = ConvertNumericExplicit (ec, e, target_type);
- if (ce != null)
- return ce;
- //
- // We should always be able to go from an uint32
- // implicitly or explicitly to the other integral
- // types
- //
- throw new Exception ("Internal compiler error");
- }
- }
- }
-
- ne = ExplicitUserConversion (ec, expr, target_type, loc);
- if (ne != null)
- return ne;
-
- error30 (loc, expr_type, target_type);
- return null;
- }
-
- /// <summary>
- /// Same as ConverExplicit, only it doesn't include user defined conversions
- /// </summary>
- static public Expression ConvertExplicitStandard (EmitContext ec, Expression expr,
- Type target_type, Location l)
- {
- Expression ne = ConvertImplicitStandard (ec, expr, target_type, l);
-
- if (ne != null)
- return ne;
-
- ne = ConvertNumericExplicit (ec, expr, target_type);
- if (ne != null)
- return ne;
-
- ne = ConvertReferenceExplicit (expr, target_type);
- if (ne != null)
- return ne;
-
- error30 (l, expr.Type, target_type);
- return null;
- }
-
- static string ExprClassName (ExprClass c)
- {
- switch (c){
- case ExprClass.Invalid:
- return "Invalid";
- case ExprClass.Value:
- return "value";
- case ExprClass.Variable:
- return "variable";
- case ExprClass.Namespace:
- return "namespace";
- case ExprClass.Type:
- return "type";
- case ExprClass.MethodGroup:
- return "method group";
- case ExprClass.PropertyAccess:
- return "property access";
- case ExprClass.EventAccess:
- return "event access";
- case ExprClass.IndexerAccess:
- return "indexer access";
- case ExprClass.Nothing:
- return "null";
- }
- throw new Exception ("Should not happen");
- }
-
- /// <summary>
- /// Reports that we were expecting `expr' to be of class `expected'
- /// </summary>
- protected void report118 (Location loc, Expression expr, string expected)
- {
- string kind = "Unknown";
-
- if (expr != null)
- kind = ExprClassName (expr.eclass);
-
- Error (118, loc, "Expression denotes a `" + kind +
- "' where a `" + expected + "' was expected");
- }
-
- static void error31 (Location l, string val, Type t)
- {
- Report.Error (31, l, "Constant value `" + val + "' cannot be converted to " +
- TypeManager.CSharpName (t));
- }
-
- public static void UnsafeError (Location loc)
- {
- Report.Error (214, loc, "Pointers may only be used in an unsafe context");
- }
-
- /// <summary>
- /// Converts the IntConstant, UIntConstant, LongConstant or
- /// ULongConstant into the integral target_type. Notice
- /// that we do not return an `Expression' we do return
- /// a boxed integral type.
- ///
- /// FIXME: Since I added the new constants, we need to
- /// also support conversions from CharConstant, ByteConstant,
- /// SByteConstant, UShortConstant, ShortConstant
- ///
- /// This is used by the switch statement, so the domain
- /// of work is restricted to the literals above, and the
- /// targets are int32, uint32, char, byte, sbyte, ushort,
- /// short, uint64 and int64
- /// </summary>
- public static object ConvertIntLiteral (Constant c, Type target_type, Location loc)
- {
- string s = "";
-
- if (c.Type == target_type)
- return ((Constant) c).GetValue ();
-
- //
- // Make into one of the literals we handle, we dont really care
- // about this value as we will just return a few limited types
- //
- if (c is EnumConstant)
- c = ((EnumConstant)c).WidenToCompilerConstant ();
-
- if (c is IntConstant){
- int v = ((IntConstant) c).Value;
-
- if (target_type == TypeManager.uint32_type){
- if (v >= 0)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v >= SByte.MinValue && v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v >= Int16.MinValue && v <= UInt16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v >= UInt16.MinValue && v <= UInt16.MaxValue)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type){
- if (v > 0)
- return (ulong) v;
- }
-
- s = v.ToString ();
- } else if (c is UIntConstant){
- uint v = ((UIntConstant) c).Value;
-
- if (target_type == TypeManager.int32_type){
- if (v <= Int32.MaxValue)
- return (int) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v <= UInt16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v <= UInt16.MaxValue)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
- s = v.ToString ();
- } else if (c is LongConstant){
- long v = ((LongConstant) c).Value;
-
- if (target_type == TypeManager.int32_type){
- if (v >= UInt32.MinValue && v <= UInt32.MaxValue)
- return (int) v;
- } else if (target_type == TypeManager.uint32_type){
- if (v >= 0 && v <= UInt32.MaxValue)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v >= SByte.MinValue && v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v >= Int16.MinValue && v <= UInt16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v >= UInt16.MinValue && v <= UInt16.MaxValue)
- return (ushort) v;
- } else if (target_type == TypeManager.uint64_type){
- if (v > 0)
- return (ulong) v;
- }
- s = v.ToString ();
- } else if (c is ULongConstant){
- ulong v = ((ULongConstant) c).Value;
-
- if (target_type == TypeManager.int32_type){
- if (v <= Int32.MaxValue)
- return (int) v;
- } else if (target_type == TypeManager.uint32_type){
- if (v <= UInt32.MaxValue)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v <= (int) SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v <= UInt16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v <= UInt16.MaxValue)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type){
- if (v <= Int64.MaxValue)
- return (long) v;
- }
- s = v.ToString ();
- } else if (c is ByteConstant){
- byte v = ((ByteConstant) c).Value;
-
- if (target_type == TypeManager.int32_type)
- return (int) v;
- else if (target_type == TypeManager.uint32_type)
- return (uint) v;
- else if (target_type == TypeManager.char_type)
- return (char) v;
- else if (target_type == TypeManager.sbyte_type){
- if (v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type)
- return (short) v;
- else if (target_type == TypeManager.ushort_type)
- return (ushort) v;
- else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
- s = v.ToString ();
- } else if (c is SByteConstant){
- sbyte v = ((SByteConstant) c).Value;
-
- if (target_type == TypeManager.int32_type)
- return (int) v;
- else if (target_type == TypeManager.uint32_type){
- if (v >= 0)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= 0)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= 0)
- return (byte) v;
- } else if (target_type == TypeManager.short_type)
- return (short) v;
- else if (target_type == TypeManager.ushort_type){
- if (v >= 0)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type){
- if (v >= 0)
- return (ulong) v;
- }
- s = v.ToString ();
- } else if (c is ShortConstant){
- short v = ((ShortConstant) c).Value;
-
- if (target_type == TypeManager.int32_type){
- return (int) v;
- } else if (target_type == TypeManager.uint32_type){
- if (v >= 0)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= 0)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v >= SByte.MinValue && v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v >= 0)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
-
- s = v.ToString ();
- } else if (c is UShortConstant){
- ushort v = ((UShortConstant) c).Value;
-
- if (target_type == TypeManager.int32_type)
- return (int) v;
- else if (target_type == TypeManager.uint32_type)
- return (uint) v;
- else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v <= SByte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.short_type){
- if (v <= Int16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
-
- s = v.ToString ();
- } else if (c is CharConstant){
- char v = ((CharConstant) c).Value;
-
- if (target_type == TypeManager.int32_type)
- return (int) v;
- else if (target_type == TypeManager.uint32_type)
- return (uint) v;
- else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v <= Int16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type)
- return (short) v;
- else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
-
- s = v.ToString ();
- }
- error31 (loc, s, target_type);
- return null;
- }
-
- //
- // Load the object from the pointer. The `IsReference' is used
- // to control whether we should use Ldind_Ref or LdObj if the
- // value is not a `core' type.
- //
- // Maybe we should try to extract this infromation form the type?
- // TODO: Maybe this is a bug. The reason we have this flag is because
- // I had almost identical code in ParameterReference (for handling
- // references) and in UnboxCast.
- //
- public static void LoadFromPtr (ILGenerator ig, Type t, bool IsReference)
- {
- if (t == TypeManager.int32_type)
- ig.Emit (OpCodes.Ldind_I4);
- else if (t == TypeManager.uint32_type)
- ig.Emit (OpCodes.Ldind_U4);
- else if (t == TypeManager.short_type)
- ig.Emit (OpCodes.Ldind_I2);
- else if (t == TypeManager.ushort_type)
- ig.Emit (OpCodes.Ldind_U2);
- else if (t == TypeManager.char_type)
- ig.Emit (OpCodes.Ldind_U2);
- else if (t == TypeManager.byte_type)
- ig.Emit (OpCodes.Ldind_U1);
- else if (t == TypeManager.sbyte_type)
- ig.Emit (OpCodes.Ldind_I1);
- else if (t == TypeManager.uint64_type)
- ig.Emit (OpCodes.Ldind_I8);
- else if (t == TypeManager.int64_type)
- ig.Emit (OpCodes.Ldind_I8);
- else if (t == TypeManager.float_type)
- ig.Emit (OpCodes.Ldind_R4);
- else if (t == TypeManager.double_type)
- ig.Emit (OpCodes.Ldind_R8);
- else if (t == TypeManager.bool_type)
- ig.Emit (OpCodes.Ldind_I1);
- else if (t == TypeManager.intptr_type)
- ig.Emit (OpCodes.Ldind_I);
- else if (TypeManager.IsEnumType (t)){
- LoadFromPtr (ig, TypeManager.EnumToUnderlying (t), IsReference);
- } else {
- if (IsReference)
- ig.Emit (OpCodes.Ldind_Ref);
- else
- ig.Emit (OpCodes.Ldobj, t);
- }
- }
-
- //
- // The stack contains the pointer and the value of type `type'
- //
- public static void StoreFromPtr (ILGenerator ig, Type type)
- {
- if (type == TypeManager.int32_type || type == TypeManager.uint32_type)
- ig.Emit (OpCodes.Stind_I4);
- else if (type == TypeManager.int64_type || type == TypeManager.uint64_type)
- ig.Emit (OpCodes.Stind_I8);
- else if (type == TypeManager.char_type || type == TypeManager.short_type ||
- type == TypeManager.ushort_type)
- ig.Emit (OpCodes.Stind_I2);
- else if (type == TypeManager.float_type)
- ig.Emit (OpCodes.Stind_R4);
- else if (type == TypeManager.double_type)
- ig.Emit (OpCodes.Stind_R8);
- else if (type == TypeManager.byte_type || type == TypeManager.sbyte_type ||
- type == TypeManager.bool_type)
- ig.Emit (OpCodes.Stind_I1);
- else if (type == TypeManager.intptr_type)
- ig.Emit (OpCodes.Stind_I);
- else
- ig.Emit (OpCodes.Stind_Ref);
- }
-
- //
- // Returns the size of type `t' if known, otherwise, 0
- //
- public static int GetTypeSize (Type t)
- {
- if (t == TypeManager.int32_type ||
- t == TypeManager.uint32_type ||
- t == TypeManager.float_type)
- return 4;
- else if (t == TypeManager.int64_type ||
- t == TypeManager.uint64_type ||
- t == TypeManager.double_type)
- return 8;
- else if (t == TypeManager.byte_type ||
- t == TypeManager.sbyte_type ||
- t == TypeManager.bool_type)
- return 1;
- else if (t == TypeManager.short_type ||
- t == TypeManager.char_type ||
- t == TypeManager.ushort_type)
- return 2;
- else
- return 0;
- }
- }
-
- /// <summary>
- /// This is just a base class for expressions that can
- /// appear on statements (invocations, object creation,
- /// assignments, post/pre increment and decrement). The idea
- /// being that they would support an extra Emition interface that
- /// does not leave a result on the stack.
- /// </summary>
- public abstract class ExpressionStatement : Expression {
-
- /// <summary>
- /// Requests the expression to be emitted in a `statement'
- /// context. This means that no new value is left on the
- /// stack after invoking this method (constrasted with
- /// Emit that will always leave a value on the stack).
- /// </summary>
- public abstract void EmitStatement (EmitContext ec);
- }
-
- /// <summary>
- /// This kind of cast is used to encapsulate the child
- /// whose type is child.Type into an expression that is
- /// reported to return "return_type". This is used to encapsulate
- /// expressions which have compatible types, but need to be dealt
- /// at higher levels with.
- ///
- /// For example, a "byte" expression could be encapsulated in one
- /// of these as an "unsigned int". The type for the expression
- /// would be "unsigned int".
- ///
- /// </summary>
- public class EmptyCast : Expression {
- protected Expression child;
-
- public EmptyCast (Expression child, Type return_type)
- {
- eclass = child.eclass;
- type = return_type;
- this.child = child;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- child.Emit (ec);
- }
- }
-
- /// <summary>
- /// This class is used to wrap literals which belong inside Enums
- /// </summary>
- public class EnumConstant : Constant {
- public Constant Child;
-
- public EnumConstant (Constant child, Type enum_type)
- {
- eclass = child.eclass;
- this.Child = child;
- type = enum_type;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Child.Emit (ec);
- }
-
- public override object GetValue ()
- {
- return Child.GetValue ();
- }
-
- //
- // Converts from one of the valid underlying types for an enumeration
- // (int32, uint32, int64, uint64, short, ushort, byte, sbyte) to
- // one of the internal compiler literals: Int/UInt/Long/ULong Literals.
- //
- public Constant WidenToCompilerConstant ()
- {
- Type t = TypeManager.EnumToUnderlying (Child.Type);
- object v = ((Constant) Child).GetValue ();;
-
- if (t == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (t == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (t == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (t == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (t == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (t == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (t == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (t == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
-
- throw new Exception ("Invalid enumeration underlying type: " + t);
- }
-
- //
- // Extracts the value in the enumeration on its native representation
- //
- public object GetPlainValue ()
- {
- Type t = TypeManager.EnumToUnderlying (Child.Type);
- object v = ((Constant) Child).GetValue ();;
-
- if (t == TypeManager.int32_type)
- return (int) v;
- if (t == TypeManager.uint32_type)
- return (uint) v;
- if (t == TypeManager.int64_type)
- return (long) v;
- if (t == TypeManager.uint64_type)
- return (ulong) v;
- if (t == TypeManager.short_type)
- return (short) v;
- if (t == TypeManager.ushort_type)
- return (ushort) v;
- if (t == TypeManager.byte_type)
- return (byte) v;
- if (t == TypeManager.sbyte_type)
- return (sbyte) v;
-
- return null;
- }
-
- public override string AsString ()
- {
- return Child.AsString ();
- }
- }
-
- /// <summary>
- /// This kind of cast is used to encapsulate Value Types in objects.
- ///
- /// The effect of it is to box the value type emitted by the previous
- /// operation.
- /// </summary>
- public class BoxedCast : EmptyCast {
-
- public BoxedCast (Expression expr)
- : base (expr, TypeManager.object_type)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- base.Emit (ec);
-
- ec.ig.Emit (OpCodes.Box, child.Type);
- }
- }
-
- public class UnboxCast : EmptyCast {
- public UnboxCast (Expression expr, Type return_type)
- : base (expr, return_type)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Type t = type;
- ILGenerator ig = ec.ig;
-
- base.Emit (ec);
- ig.Emit (OpCodes.Unbox, t);
-
- LoadFromPtr (ig, t, false);
- }
- }
-
- /// <summary>
- /// This is used to perform explicit numeric conversions.
- ///
- /// Explicit numeric conversions might trigger exceptions in a checked
- /// context, so they should generate the conv.ovf opcodes instead of
- /// conv opcodes.
- /// </summary>
- public class ConvCast : EmptyCast {
- public enum Mode : byte {
- I1_U1, I1_U2, I1_U4, I1_U8, I1_CH,
- U1_I1, U1_CH,
- I2_I1, I2_U1, I2_U2, I2_U4, I2_U8, I2_CH,
- U2_I1, U2_U1, U2_I2, U2_CH,
- I4_I1, I4_U1, I4_I2, I4_U2, I4_U4, I4_U8, I4_CH,
- U4_I1, U4_U1, U4_I2, U4_U2, U4_I4, U4_CH,
- I8_I1, I8_U1, I8_I2, I8_U2, I8_I4, I8_U4, I8_U8, I8_CH,
- U8_I1, U8_U1, U8_I2, U8_U2, U8_I4, U8_U4, U8_I8, U8_CH,
- CH_I1, CH_U1, CH_I2,
- R4_I1, R4_U1, R4_I2, R4_U2, R4_I4, R4_U4, R4_I8, R4_U8, R4_CH,
- R8_I1, R8_U1, R8_I2, R8_U2, R8_I4, R8_U4, R8_I8, R8_U8, R8_CH, R8_R4
- }
-
- Mode mode;
-
- public ConvCast (Expression child, Type return_type, Mode m)
- : base (child, return_type)
- {
- mode = m;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- base.Emit (ec);
-
- if (ec.CheckState){
- switch (mode){
- case Mode.I1_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.I1_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.I1_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.I1_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.I1_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.U1_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.U1_CH: /* nothing */ break;
-
- case Mode.I2_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.I2_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.I2_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.I2_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.I2_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.I2_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.U2_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.U2_U1: ig.Emit (OpCodes.Conv_Ovf_U1_Un); break;
- case Mode.U2_I2: ig.Emit (OpCodes.Conv_Ovf_I2_Un); break;
- case Mode.U2_CH: /* nothing */ break;
-
- case Mode.I4_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.I4_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.I4_I2: ig.Emit (OpCodes.Conv_Ovf_I2); break;
- case Mode.I4_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.I4_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.I4_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.I4_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.U4_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.U4_U1: ig.Emit (OpCodes.Conv_Ovf_U1_Un); break;
- case Mode.U4_I2: ig.Emit (OpCodes.Conv_Ovf_I2_Un); break;
- case Mode.U4_U2: ig.Emit (OpCodes.Conv_Ovf_U2_Un); break;
- case Mode.U4_I4: ig.Emit (OpCodes.Conv_Ovf_I4_Un); break;
- case Mode.U4_CH: ig.Emit (OpCodes.Conv_Ovf_U2_Un); break;
-
- case Mode.I8_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.I8_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.I8_I2: ig.Emit (OpCodes.Conv_Ovf_I2); break;
- case Mode.I8_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.I8_I4: ig.Emit (OpCodes.Conv_Ovf_I4); break;
- case Mode.I8_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.I8_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.I8_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.U8_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.U8_U1: ig.Emit (OpCodes.Conv_Ovf_U1_Un); break;
- case Mode.U8_I2: ig.Emit (OpCodes.Conv_Ovf_I2_Un); break;
- case Mode.U8_U2: ig.Emit (OpCodes.Conv_Ovf_U2_Un); break;
- case Mode.U8_I4: ig.Emit (OpCodes.Conv_Ovf_I4_Un); break;
- case Mode.U8_U4: ig.Emit (OpCodes.Conv_Ovf_U4_Un); break;
- case Mode.U8_I8: ig.Emit (OpCodes.Conv_Ovf_I8_Un); break;
- case Mode.U8_CH: ig.Emit (OpCodes.Conv_Ovf_U2_Un); break;
-
- case Mode.CH_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.CH_U1: ig.Emit (OpCodes.Conv_Ovf_U1_Un); break;
- case Mode.CH_I2: ig.Emit (OpCodes.Conv_Ovf_I2_Un); break;
-
- case Mode.R4_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.R4_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.R4_I2: ig.Emit (OpCodes.Conv_Ovf_I2); break;
- case Mode.R4_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.R4_I4: ig.Emit (OpCodes.Conv_Ovf_I4); break;
- case Mode.R4_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.R4_I8: ig.Emit (OpCodes.Conv_Ovf_I8); break;
- case Mode.R4_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.R4_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.R8_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.R8_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.R8_I2: ig.Emit (OpCodes.Conv_Ovf_I2); break;
- case Mode.R8_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.R8_I4: ig.Emit (OpCodes.Conv_Ovf_I4); break;
- case Mode.R8_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.R8_I8: ig.Emit (OpCodes.Conv_Ovf_I8); break;
- case Mode.R8_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.R8_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.R8_R4: ig.Emit (OpCodes.Conv_R4); break;
- }
- } else {
- switch (mode){
- case Mode.I1_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.I1_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.I1_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.I1_U8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.I1_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.U1_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.U1_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.I2_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.I2_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.I2_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.I2_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.I2_U8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.I2_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.U2_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.U2_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.U2_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.U2_CH: /* nothing */ break;
-
- case Mode.I4_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.I4_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.I4_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.I4_U4: /* nothing */ break;
- case Mode.I4_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.I4_U8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.I4_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.U4_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.U4_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.U4_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.U4_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.U4_I4: /* nothing */ break;
- case Mode.U4_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.I8_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.I8_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.I8_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.I8_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.I8_I4: ig.Emit (OpCodes.Conv_I4); break;
- case Mode.I8_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.I8_U8: /* nothing */ break;
- case Mode.I8_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.U8_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.U8_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.U8_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.U8_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.U8_I4: ig.Emit (OpCodes.Conv_I4); break;
- case Mode.U8_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.U8_I8: /* nothing */ break;
- case Mode.U8_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.CH_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.CH_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.CH_I2: ig.Emit (OpCodes.Conv_I2); break;
-
- case Mode.R4_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.R4_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.R4_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.R4_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.R4_I4: ig.Emit (OpCodes.Conv_I4); break;
- case Mode.R4_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.R4_I8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.R4_U8: ig.Emit (OpCodes.Conv_U8); break;
- case Mode.R4_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.R8_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.R8_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.R8_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.R8_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.R8_I4: ig.Emit (OpCodes.Conv_I4); break;
- case Mode.R8_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.R8_I8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.R8_U8: ig.Emit (OpCodes.Conv_U8); break;
- case Mode.R8_CH: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.R8_R4: ig.Emit (OpCodes.Conv_R4); break;
- }
- }
- }
- }
-
- public class OpcodeCast : EmptyCast {
- OpCode op, op2;
- bool second_valid;
-
- public OpcodeCast (Expression child, Type return_type, OpCode op)
- : base (child, return_type)
-
- {
- this.op = op;
- second_valid = false;
- }
-
- public OpcodeCast (Expression child, Type return_type, OpCode op, OpCode op2)
- : base (child, return_type)
-
- {
- this.op = op;
- this.op2 = op2;
- second_valid = true;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- base.Emit (ec);
- ec.ig.Emit (op);
-
- if (second_valid)
- ec.ig.Emit (op2);
- }
- }
-
- /// <summary>
- /// This kind of cast is used to encapsulate a child and cast it
- /// to the class requested
- /// </summary>
- public class ClassCast : EmptyCast {
- public ClassCast (Expression child, Type return_type)
- : base (child, return_type)
-
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- base.Emit (ec);
-
- ec.ig.Emit (OpCodes.Castclass, type);
- }
-
- }
-
- /// <summary>
- /// SimpleName expressions are initially formed of a single
- /// word and it only happens at the beginning of the expression.
- /// </summary>
- ///
- /// <remarks>
- /// The expression will try to be bound to a Field, a Method
- /// group or a Property. If those fail we pass the name to our
- /// caller and the SimpleName is compounded to perform a type
- /// lookup. The idea behind this process is that we want to avoid
- /// creating a namespace map from the assemblies, as that requires
- /// the GetExportedTypes function to be called and a hashtable to
- /// be constructed which reduces startup time. If later we find
- /// that this is slower, we should create a `NamespaceExpr' expression
- /// that fully participates in the resolution process.
- ///
- /// For example `System.Console.WriteLine' is decomposed into
- /// MemberAccess (MemberAccess (SimpleName ("System"), "Console"), "WriteLine")
- ///
- /// The first SimpleName wont produce a match on its own, so it will
- /// be turned into:
- /// MemberAccess (SimpleName ("System.Console"), "WriteLine").
- ///
- /// System.Console will produce a TypeExpr match.
- ///
- /// The downside of this is that we might be hitting `LookupType' too many
- /// times with this scheme.
- /// </remarks>
- public class SimpleName : Expression {
- public readonly string Name;
- public readonly Location Location;
-
- public SimpleName (string name, Location l)
- {
- Name = name;
- Location = l;
- }
-
- public static void Error120 (Location l, string name)
- {
- Report.Error (
- 120, l,
- "An object reference is required " +
- "for the non-static field `"+name+"'");
- }
-
- //
- // Checks whether we are trying to access an instance
- // property, method or field from a static body.
- //
- Expression MemberStaticCheck (Expression e)
- {
- if (e is FieldExpr){
- FieldInfo fi = ((FieldExpr) e).FieldInfo;
-
- if (!fi.IsStatic){
- Error120 (Location, Name);
- return null;
- }
- } else if (e is MethodGroupExpr){
- MethodGroupExpr mg = (MethodGroupExpr) e;
-
- if (!mg.RemoveInstanceMethods ()){
- Error120 (Location, mg.Methods [0].Name);
- return null;
- }
- return e;
- } else if (e is PropertyExpr){
- if (!((PropertyExpr) e).IsStatic){
- Error120 (Location, Name);
- return null;
- }
- } else if (e is EventExpr) {
- if (!((EventExpr) e).IsStatic) {
- Error120 (Location, Name);
- return null;
- }
- }
-
- return e;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- return SimpleNameResolve (ec, false);
- }
-
- public Expression DoResolveAllowStatic (EmitContext ec)
- {
- return SimpleNameResolve (ec, true);
- }
-
- /// <remarks>
- /// 7.5.2: Simple Names.
- ///
- /// Local Variables and Parameters are handled at
- /// parse time, so they never occur as SimpleNames.
- ///
- /// The `allow_static' flag is used by MemberAccess only
- /// and it is used to inform us that it is ok for us to
- /// avoid the static check, because MemberAccess might end
- /// up resolving the Name as a Type name and the access as
- /// a static type access.
- ///
- /// ie: Type Type; .... { Type.GetType (""); }
- ///
- /// Type is both an instance variable and a Type; Type.GetType
- /// is the static method not an instance method of type.
- /// </remarks>
- Expression SimpleNameResolve (EmitContext ec, bool allow_static)
- {
- Expression e;
-
- //
- // Stage 1: Performed by the parser (binding to locals or parameters).
- //
-
- //
- // Stage 2: Lookup members
- //
- e = MemberLookup (ec, ec.TypeContainer.TypeBuilder, Name, Location);
- if (e == null){
- //
- // Stage 3: Lookup symbol in the various namespaces.
- //
- DeclSpace ds = ec.TypeContainer;
- Type t;
- string alias_value;
-
- if ((t = RootContext.LookupType (ds, Name, true, Location)) != null)
- return new TypeExpr (t);
-
- //
- // Stage 2 part b: Lookup up if we are an alias to a type
- // or a namespace.
- //
- // Since we are cheating: we only do the Alias lookup for
- // namespaces if the name does not include any dots in it
- //
-
- if (Name.IndexOf ('.') == -1 && (alias_value = ec.TypeContainer.LookupAlias (Name)) != null) {
- // System.Console.WriteLine (Name + " --> " + alias_value);
- if ((t = RootContext.LookupType (ds, alias_value, true, Location))
- != null)
- return new TypeExpr (t);
-
- // we have alias value, but it isn't Type, so try if it's namespace
- return new SimpleName (alias_value, Location);
- }
-
- // No match, maybe our parent can compose us
- // into something meaningful.
- return this;
- }
-
- //
- // Stage 2 continues here.
- //
- if (e is TypeExpr)
- return e;
-
- if (e is FieldExpr){
- FieldExpr fe = (FieldExpr) e;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi.FieldType.IsPointer && !ec.InUnsafe){
- UnsafeError (Location);
- }
-
- if (ec.IsStatic){
- if (!allow_static && !fi.IsStatic){
- Error120 (Location, Name);
- return null;
- }
- } else {
- // If we are not in static code and this
- // field is not static, set the instance to `this'.
-
- if (!fi.IsStatic)
- fe.InstanceExpression = ec.This;
- }
-
-
- if (fi is FieldBuilder) {
- Const c = TypeManager.LookupConstant ((FieldBuilder) fi);
-
- if (c != null) {
- object o = c.LookupConstantValue (ec);
- object real_value = ((Constant)c.Expr).GetValue ();
- return Constantify (real_value, fi.FieldType);
- }
- }
-
- return e;
- }
-
- if (e is EventExpr) {
- //
- // If the event is local to this class, we transform ourselves into
- // a FieldExpr
- //
- EventExpr ee = (EventExpr) e;
-
- Expression ml = MemberLookup (
- ec, ec.TypeContainer.TypeBuilder, ee.EventInfo.Name,
- MemberTypes.Event, AllBindingFlags, Location);
-
- if (ml != null) {
- MemberInfo mi = ec.TypeContainer.GetFieldFromEvent ((EventExpr) ml);
-
- if (mi == null) {
- //
- // If this happens, then we have an event with its own
- // accessors and private field etc so there's no need
- // to transform ourselves : we should instead flag an error
- //
- Assign.error70 (ee.EventInfo, Location);
- return null;
- }
-
- ml = ExprClassFromMemberInfo (ec, mi, Location);
-
- if (ml == null) {
- Report.Error (-200, Location, "Internal error!!");
- return null;
- }
-
- Expression instance_expr;
-
- FieldInfo fi = ((FieldExpr) ml).FieldInfo;
-
- if (fi.IsStatic)
- instance_expr = null;
- else
- instance_expr = ec.This;
-
- instance_expr = instance_expr.Resolve (ec);
-
- if (instance_expr != null)
- instance_expr = instance_expr.Resolve (ec);
-
- return MemberAccess.ResolveMemberAccess (ec, ml, instance_expr, Location, null);
- }
- }
-
-
- if (ec.IsStatic){
- if (allow_static)
- return e;
-
- return MemberStaticCheck (e);
- } else
- return e;
- }
-
- public override void Emit (EmitContext ec)
- {
- //
- // If this is ever reached, then we failed to
- // find the name as a namespace
- //
-
- Error (103, Location, "The name `" + Name +
- "' does not exist in the class `" +
- ec.TypeContainer.Name + "'");
- }
- }
-
- /// <summary>
- /// Fully resolved expression that evaluates to a type
- /// </summary>
- public class TypeExpr : Expression {
- public TypeExpr (Type t)
- {
- Type = t;
- eclass = ExprClass.Type;
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- return this;
- }
-
- override public void Emit (EmitContext ec)
- {
- throw new Exception ("Implement me");
- }
- }
-
- /// <summary>
- /// MethodGroup Expression.
- ///
- /// This is a fully resolved expression that evaluates to a type
- /// </summary>
- public class MethodGroupExpr : Expression {
- public MethodBase [] Methods;
- Expression instance_expression = null;
-
- public MethodGroupExpr (MemberInfo [] mi)
- {
- Methods = new MethodBase [mi.Length];
- mi.CopyTo (Methods, 0);
- eclass = ExprClass.MethodGroup;
- }
-
- public MethodGroupExpr (ArrayList l)
- {
- Methods = new MethodBase [l.Count];
-
- l.CopyTo (Methods, 0);
- eclass = ExprClass.MethodGroup;
- }
-
- //
- // `A method group may have associated an instance expression'
- //
- public Expression InstanceExpression {
- get {
- return instance_expression;
- }
-
- set {
- instance_expression = value;
- }
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- return this;
- }
-
- override public void Emit (EmitContext ec)
- {
- throw new Exception ("This should never be reached");
- }
-
- bool RemoveMethods (bool keep_static)
- {
- ArrayList smethods = new ArrayList ();
- int top = Methods.Length;
- int i;
-
- for (i = 0; i < top; i++){
- MethodBase mb = Methods [i];
-
- if (mb.IsStatic == keep_static)
- smethods.Add (mb);
- }
-
- if (smethods.Count == 0)
- return false;
-
- Methods = new MethodBase [smethods.Count];
- smethods.CopyTo (Methods, 0);
-
- return true;
- }
-
- /// <summary>
- /// Removes any instance methods from the MethodGroup, returns
- /// false if the resulting set is empty.
- /// </summary>
- public bool RemoveInstanceMethods ()
- {
- return RemoveMethods (true);
- }
-
- /// <summary>
- /// Removes any static methods from the MethodGroup, returns
- /// false if the resulting set is empty.
- /// </summary>
- public bool RemoveStaticMethods ()
- {
- return RemoveMethods (false);
- }
- }
-
- /// <summary>
- /// Fully resolved expression that evaluates to a Field
- /// </summary>
- public class FieldExpr : Expression, IAssignMethod, IMemoryLocation {
- public readonly FieldInfo FieldInfo;
- public Expression InstanceExpression;
- Location loc;
-
- public FieldExpr (FieldInfo fi, Location l)
- {
- FieldInfo = fi;
- eclass = ExprClass.Variable;
- type = fi.FieldType;
- loc = l;
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- if (!FieldInfo.IsStatic){
- if (InstanceExpression == null){
- throw new Exception ("non-static FieldExpr without instance var\n" +
- "You have to assign the Instance variable\n" +
- "Of the FieldExpr to set this\n");
- }
-
- InstanceExpression = InstanceExpression.Resolve (ec);
- if (InstanceExpression == null)
- return null;
- }
-
- return this;
- }
-
- override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- Expression e = DoResolve (ec);
-
- if (e == null)
- return null;
-
- if (!FieldInfo.IsInitOnly)
- return this;
-
- //
- // InitOnly fields can only be assigned in constructors
- //
-
- if (ec.IsConstructor)
- return this;
-
- Report.Error (191, loc,
- "Readonly field can not be assigned outside " +
- "of constructor or variable initializer");
-
- return null;
- }
-
- override public void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- bool is_volatile = false;
-
- if (FieldInfo is FieldBuilder){
- Field f = TypeManager.GetField (FieldInfo);
- if (f != null && (f.ModFlags & Modifiers.VOLATILE) != 0)
- is_volatile = true;
-
- f.status |= Field.Status.USED;
- }
-
- if (FieldInfo.IsStatic){
- if (is_volatile)
- ig.Emit (OpCodes.Volatile);
-
- ig.Emit (OpCodes.Ldsfld, FieldInfo);
- } else {
- if (InstanceExpression.Type.IsValueType){
- IMemoryLocation ml;
- LocalTemporary tempo = null;
-
- if (!(InstanceExpression is IMemoryLocation)){
- tempo = new LocalTemporary (
- ec, InstanceExpression.Type);
-
- InstanceExpression.Emit (ec);
- tempo.Store (ec);
- ml = tempo;
- } else
- ml = (IMemoryLocation) InstanceExpression;
-
- ml.AddressOf (ec);
- } else
- InstanceExpression.Emit (ec);
-
- if (is_volatile)
- ig.Emit (OpCodes.Volatile);
-
- ig.Emit (OpCodes.Ldfld, FieldInfo);
- }
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- bool is_static = FieldInfo.IsStatic;
- ILGenerator ig = ec.ig;
-
- if (!is_static){
- Expression instance = InstanceExpression;
-
- if (instance.Type.IsValueType){
- if (instance is IMemoryLocation){
- IMemoryLocation ml = (IMemoryLocation) instance;
-
- ml.AddressOf (ec);
- } else
- throw new Exception ("The " + instance + " of type " +
- instance.Type +
- " represents a ValueType and does " +
- "not implement IMemoryLocation");
- } else
- instance.Emit (ec);
- }
- source.Emit (ec);
-
- if (FieldInfo is FieldBuilder){
- Field f = TypeManager.GetField (FieldInfo);
- if (f != null && (f.ModFlags & Modifiers.VOLATILE) != 0)
- ig.Emit (OpCodes.Volatile);
- }
-
- if (is_static)
- ig.Emit (OpCodes.Stsfld, FieldInfo);
- else
- ig.Emit (OpCodes.Stfld, FieldInfo);
-
- if (FieldInfo is FieldBuilder){
- Field f = TypeManager.GetField (FieldInfo);
-
- f.status |= Field.Status.ASSIGNED;
- }
- }
-
- public void AddressOf (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- if (FieldInfo is FieldBuilder){
- Field f = TypeManager.GetField (FieldInfo);
- if (f != null && (f.ModFlags & Modifiers.VOLATILE) != 0)
- ig.Emit (OpCodes.Volatile);
- }
-
- //
- // FIXME:
- //
- // Mhm. We do not know what we are being used for:
- // READING or WRITING the field.
- //
- // I think we want an extra argument to AddressOf to pass
- // this semantic information.
- //
- // For now: just flag both assigned and used.
- //
- if (FieldInfo is FieldBuilder){
- Field f = TypeManager.GetField (FieldInfo);
-
- f.status |= Field.Status.ASSIGNED | Field.Status.USED;
- }
-
- //
- // Handle initonly fields specially: make a copy and then
- // get the address of the copy.
- //
- if (FieldInfo.IsInitOnly){
- LocalBuilder local;
-
- Emit (ec);
- local = ig.DeclareLocal (type);
- ig.Emit (OpCodes.Stloc, local);
- ig.Emit (OpCodes.Ldloca, local);
- return;
- }
-
- if (FieldInfo.IsStatic)
- ig.Emit (OpCodes.Ldsflda, FieldInfo);
- else {
- InstanceExpression.Emit (ec);
- ig.Emit (OpCodes.Ldflda, FieldInfo);
- }
- }
- }
-
- /// <summary>
- /// Expression that evaluates to a Property. The Assign class
- /// might set the `Value' expression if we are in an assignment.
- ///
- /// This is not an LValue because we need to re-write the expression, we
- /// can not take data from the stack and store it.
- /// </summary>
- public class PropertyExpr : ExpressionStatement, IAssignMethod {
- public readonly PropertyInfo PropertyInfo;
- public readonly bool IsStatic;
- public bool IsBase;
- MethodInfo [] Accessors;
- Location loc;
-
- Expression instance_expr;
-
- public PropertyExpr (PropertyInfo pi, Location l)
- {
- PropertyInfo = pi;
- eclass = ExprClass.PropertyAccess;
- IsStatic = false;
- loc = l;
- Accessors = TypeManager.GetAccessors (pi);
-
- if (Accessors != null)
- for (int i = 0; i < Accessors.Length; i++){
- if (Accessors [i] != null)
- if (Accessors [i].IsStatic)
- IsStatic = true;
- }
- else
- Accessors = new MethodInfo [2];
-
- type = pi.PropertyType;
- }
-
- //
- // The instance expression associated with this expression
- //
- public Expression InstanceExpression {
- set {
- instance_expr = value;
- }
-
- get {
- return instance_expr;
- }
- }
-
- public bool VerifyAssignable ()
- {
- if (!PropertyInfo.CanWrite){
- Report.Error (200, loc,
- "The property `" + PropertyInfo.Name +
- "' can not be assigned to, as it has not set accessor");
- return false;
- }
-
- return true;
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- if (!PropertyInfo.CanRead){
- Report.Error (154, loc,
- "The property `" + PropertyInfo.Name +
- "' can not be used in " +
- "this context because it lacks a get accessor");
- return null;
- }
-
- type = PropertyInfo.PropertyType;
-
- return this;
- }
-
- override public void Emit (EmitContext ec)
- {
- Invocation.EmitCall (ec, IsBase, IsStatic, instance_expr, Accessors [0], null);
-
- }
-
- //
- // Implements the IAssignMethod interface for assignments
- //
- public void EmitAssign (EmitContext ec, Expression source)
- {
- Argument arg = new Argument (source, Argument.AType.Expression);
- ArrayList args = new ArrayList ();
-
- args.Add (arg);
- Invocation.EmitCall (ec, false, IsStatic, instance_expr, Accessors [1], args);
- }
-
- override public void EmitStatement (EmitContext ec)
- {
- Emit (ec);
- ec.ig.Emit (OpCodes.Pop);
- }
- }
-
- /// <summary>
- /// Fully resolved expression that evaluates to an Event
- /// </summary>
- public class EventExpr : Expression {
- public readonly EventInfo EventInfo;
- Location loc;
- public Expression InstanceExpression;
-
- public readonly bool IsStatic;
-
- MethodInfo add_accessor, remove_accessor;
-
- public EventExpr (EventInfo ei, Location loc)
- {
- EventInfo = ei;
- this.loc = loc;
- eclass = ExprClass.EventAccess;
-
- add_accessor = TypeManager.GetAddMethod (ei);
- remove_accessor = TypeManager.GetRemoveMethod (ei);
-
- if (add_accessor.IsStatic || remove_accessor.IsStatic)
- IsStatic = true;
-
- if (EventInfo is MyEventBuilder)
- type = ((MyEventBuilder) EventInfo).EventType;
- else
- type = EventInfo.EventHandlerType;
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- // We are born fully resolved
- return this;
- }
-
- override public void Emit (EmitContext ec)
- {
- throw new Exception ("Should not happen I think");
- }
-
- public void EmitAddOrRemove (EmitContext ec, Expression source)
- {
- Expression handler = ((Binary) source).Right;
-
- Argument arg = new Argument (handler, Argument.AType.Expression);
- ArrayList args = new ArrayList ();
-
- args.Add (arg);
-
- if (((Binary) source).Oper == Binary.Operator.Addition)
- Invocation.EmitCall (
- ec, false, IsStatic, InstanceExpression, add_accessor, args);
- else
- Invocation.EmitCall (
- ec, false, IsStatic, InstanceExpression, remove_accessor, args);
- }
- }
-}
diff --git a/mcs/mcs/enum.cs b/mcs/mcs/enum.cs
deleted file mode 100755
index c689d6daa8c..00000000000
--- a/mcs/mcs/enum.cs
+++ /dev/null
@@ -1,409 +0,0 @@
-//
-// enum.cs: Enum handling.
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-// Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Enumeration container
- /// </summary>
- public class Enum : DeclSpace {
-
- ArrayList ordered_enums;
- public readonly string BaseType;
- public Attributes OptAttributes;
-
- public Type UnderlyingType;
-
- Hashtable member_to_location;
-
- //
- // This is for members that have been defined
- //
- Hashtable member_to_value;
-
- ArrayList field_builders;
-
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE;
-
- public Enum (TypeContainer parent, string type, int mod_flags, string name, Attributes attrs, Location l)
- : base (parent, name, l)
- {
- this.BaseType = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PUBLIC, l);
- OptAttributes = attrs;
-
- ordered_enums = new ArrayList ();
- member_to_location = new Hashtable ();
- member_to_value = new Hashtable ();
- field_builders = new ArrayList ();
- }
-
- /// <summary>
- /// Adds @name to the enumeration space, with @expr
- /// being its definition.
- /// </summary>
- public AdditionResult AddEnumMember (string name, Expression expr, Location loc)
- {
- if (defined_names.Contains (name))
- return AdditionResult.NameExists;
-
- DefineName (name, expr);
-
- ordered_enums.Add (name);
- member_to_location.Add (name, loc);
-
- return AdditionResult.Success;
- }
-
- public void DefineEnum (object parent_builder)
- {
- TypeAttributes attr = TypeAttributes.Class | TypeAttributes.Sealed;
-
- UnderlyingType = RootContext.TypeManager.LookupType (BaseType);
-
- if (UnderlyingType != TypeManager.int32_type &&
- UnderlyingType != TypeManager.uint32_type &&
- UnderlyingType != TypeManager.int64_type &&
- UnderlyingType != TypeManager.uint64_type &&
- UnderlyingType != TypeManager.short_type &&
- UnderlyingType != TypeManager.ushort_type &&
- UnderlyingType != TypeManager.byte_type &&
- UnderlyingType != TypeManager.sbyte_type) {
- Report.Error (1008, Location,
- "Type byte, sbyte, short, ushort, int, uint, " +
- "long, or ulong expected");
- return;
- }
-
- if (parent_builder is ModuleBuilder) {
- ModuleBuilder builder = (ModuleBuilder) parent_builder;
-
- if ((ModFlags & Modifiers.PUBLIC) != 0)
- attr |= TypeAttributes.Public;
- else
- attr |= TypeAttributes.NotPublic;
-
- TypeBuilder = builder.DefineType (Name, attr, TypeManager.enum_type);
- } else {
- TypeBuilder builder = (System.Reflection.Emit.TypeBuilder) parent_builder;
-
- if ((ModFlags & Modifiers.PUBLIC) != 0)
- attr |= TypeAttributes.NestedPublic;
- else
- attr |= TypeAttributes.NestedPrivate;
-
-
- TypeBuilder = builder.DefineNestedType (
- Basename, attr, TypeManager.enum_type);
- }
-
- TypeBuilder.DefineField ("value__", UnderlyingType,
- FieldAttributes.Public | FieldAttributes.SpecialName
- | FieldAttributes.RTSpecialName);
-
- RootContext.TypeManager.AddEnumType (Name, TypeBuilder, this);
-
- return;
- }
-
- bool IsValidEnumConstant (Expression e)
- {
- if (!(e is Constant))
- return false;
-
- if (e is IntConstant || e is UIntConstant || e is LongConstant ||
- e is ByteConstant || e is SByteConstant || e is ShortConstant ||
- e is UShortConstant || e is ULongConstant || e is EnumConstant)
- return true;
- else
- return false;
- }
-
- object GetNextDefaultValue (object default_value)
- {
- if (UnderlyingType == TypeManager.int32_type) {
- int i = (int) default_value;
-
- if (i < System.Int32.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.uint32_type) {
- uint i = (uint) default_value;
-
- if (i < System.UInt32.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.int64_type) {
- long i = (long) default_value;
-
- if (i < System.Int64.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.uint64_type) {
- ulong i = (ulong) default_value;
-
- if (i < System.UInt64.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.short_type) {
- short i = (short) default_value;
-
- if (i < System.Int16.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.ushort_type) {
- ushort i = (ushort) default_value;
-
- if (i < System.UInt16.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.byte_type) {
- byte i = (byte) default_value;
-
- if (i < System.Byte.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.sbyte_type) {
- sbyte i = (sbyte) default_value;
-
- if (i < System.SByte.MaxValue)
- return ++i;
- else
- return null;
- }
-
- return null;
- }
-
- void error31 (object val, Location loc)
- {
- if (val is Constant)
- Report.Error (31, loc, "Constant value '" + ((Constant) val).AsString () +
- "' cannot be converted" +
- " to a " + TypeManager.CSharpName (UnderlyingType));
- else
- Report.Error (31, loc, "Constant value '" + val +
- "' cannot be converted" +
- " to a " + TypeManager.CSharpName (UnderlyingType));
- return;
- }
-
- /// <summary>
- /// This is used to lookup the value of an enum member. If the member is undefined,
- /// it attempts to define it and return its value
- /// </summary>
- public object LookupEnumValue (EmitContext ec, string name, Location loc)
- {
- object default_value = null;
- Constant c = null;
-
- default_value = member_to_value [name];
-
- if (default_value != null)
- return default_value;
-
- if (!defined_names.Contains (name)) {
- Report.Error (117, loc, "'"+ Name + "' does not contain a definition for '"
- + name + "'");
- return null;
- }
-
- //
- // So if the above doesn't happen, we have a member that is undefined
- // We now proceed to define it
- //
- Expression val = this [name];
-
- if (val == null) {
-
- int idx = ordered_enums.IndexOf (name);
-
- if (idx == 0)
- default_value = 0;
- else {
- for (int i = 0; i < idx; ++i) {
- string n = (string) ordered_enums [i];
- Location m_loc = (Mono.CSharp.Location)
- member_to_location [n];
- default_value = LookupEnumValue (ec, n, m_loc);
- }
-
- default_value = GetNextDefaultValue (default_value);
- }
-
- } else {
- val = val.Resolve (ec);
-
- if (val == null) {
- Report.Error (-12, loc, "Definition is circular.");
- return null;
- }
-
- if (IsValidEnumConstant (val)) {
- c = (Constant) val;
- default_value = c.GetValue ();
-
- if (default_value == null) {
- error31 (c, loc);
- return null;
- }
-
- } else {
- Report.Error (
- 1008, loc,
- "Type byte, sbyte, short, ushort, int, uint, long, or " +
- "ulong expected");
- return null;
- }
- }
-
- FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
- | FieldAttributes.Literal;
-
- FieldBuilder fb = TypeBuilder.DefineField (name, UnderlyingType, attr);
-
- try {
- default_value = Convert.ChangeType (default_value, UnderlyingType);
- } catch {
- error31 (c, loc);
- return null;
- }
-
- fb.SetConstant (default_value);
- field_builders.Add (fb);
- member_to_value [name] = default_value;
-
- if (!TypeManager.RegisterFieldValue (fb, default_value))
- return null;
-
- return default_value;
- }
-
- public override bool Define (TypeContainer parent)
- {
- //
- // If there was an error during DefineEnum, return
- //
- if (TypeBuilder == null)
- return false;
-
- EmitContext ec = new EmitContext (parent, Location, null, UnderlyingType, ModFlags);
-
- object default_value = 0;
-
- FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
- | FieldAttributes.Literal;
-
-
- foreach (string name in ordered_enums) {
- //
- // Have we already been defined, thanks to some cross-referencing ?
- //
- if (member_to_value.Contains (name))
- continue;
-
- Location loc = (Mono.CSharp.Location) member_to_location [name];
-
- if (this [name] != null) {
- default_value = LookupEnumValue (ec, name, loc);
-
- if (default_value == null)
- return true;
-
- } else {
- FieldBuilder fb = TypeBuilder.DefineField (
- name, UnderlyingType, attr);
-
- if (default_value == null) {
- Report.Error (543, loc, "Enumerator value for '" + name + "' is too large to " +
- "fit in its type");
- return false;
- }
-
- try {
- default_value = Convert.ChangeType (default_value, UnderlyingType);
- } catch {
- error31 (default_value, loc);
- return false;
- }
-
- fb.SetConstant (default_value);
- field_builders.Add (fb);
- member_to_value [name] = default_value;
-
- if (!TypeManager.RegisterFieldValue (fb, default_value))
- return false;
- }
-
- default_value = GetNextDefaultValue (default_value);
- }
-
- Attribute.ApplyAttributes (ec, TypeBuilder, this, OptAttributes, Location);
-
- return true;
- }
-
- //
- // Hack around System.Reflection as found everywhere else
- //
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
- {
- ArrayList members = new ArrayList ();
-
- if ((mt & MemberTypes.Field) != 0) {
- foreach (FieldBuilder fb in field_builders)
- if (filter (fb, criteria) == true)
- members.Add (fb);
- }
-
- int count = members.Count;
-
- if (count > 0) {
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi, 0);
- return mi;
- }
-
- return null;
- }
-
- public ArrayList ValueNames {
- get {
- return ordered_enums;
- }
- }
-
- // indexer
- public Expression this [string name] {
- get {
- return (Expression) defined_names [name];
- }
- }
- }
-}
diff --git a/mcs/mcs/errors.cs b/mcs/mcs/errors.cs
deleted file mode 100755
index e69de29bb2d..00000000000
--- a/mcs/mcs/errors.cs
+++ /dev/null
diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs
deleted file mode 100755
index 5f71af90a02..00000000000
--- a/mcs/mcs/expression.cs
+++ /dev/null
@@ -1,5908 +0,0 @@
-//
-// expression.cs: Expression representation for the IL tree.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-#define USE_OLD
-
-namespace Mono.CSharp {
- using System;
- using System.Collections;
- using System.Diagnostics;
- using System.Reflection;
- using System.Reflection.Emit;
- using System.Text;
-
- /// <summary>
- /// This is just a helper class, it is generated by Unary, UnaryMutator
- /// when an overloaded method has been found. It just emits the code for a
- /// static call.
- /// </summary>
- public class StaticCallExpr : ExpressionStatement {
- ArrayList args;
- MethodInfo mi;
-
- StaticCallExpr (MethodInfo m, ArrayList a)
- {
- mi = m;
- args = a;
-
- type = m.ReturnType;
- eclass = ExprClass.Value;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are born fully resolved
- //
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- if (args != null)
- Invocation.EmitArguments (ec, mi, args);
-
- ec.ig.Emit (OpCodes.Call, mi);
- return;
- }
-
- static public Expression MakeSimpleCall (EmitContext ec, MethodGroupExpr mg,
- Expression e, Location loc)
- {
- ArrayList args;
- MethodBase method;
-
- args = new ArrayList (1);
- args.Add (new Argument (e, Argument.AType.Expression));
- method = Invocation.OverloadResolve (ec, (MethodGroupExpr) mg, args, loc);
-
- if (method == null)
- return null;
-
- return new StaticCallExpr ((MethodInfo) method, args);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- Emit (ec);
- if (type != TypeManager.void_type)
- ec.ig.Emit (OpCodes.Pop);
- }
- }
-
- /// <summary>
- /// Unary expressions.
- /// </summary>
- ///
- /// <remarks>
- /// Unary implements unary expressions. It derives from
- /// ExpressionStatement becuase the pre/post increment/decrement
- /// operators can be used in a statement context.
- /// </remarks>
- public class Unary : Expression {
- public enum Operator : byte {
- UnaryPlus, UnaryNegation, LogicalNot, OnesComplement,
- Indirection, AddressOf, TOP
- }
-
- Operator oper;
- Expression expr;
- Location loc;
-
- public Unary (Operator op, Expression expr, Location loc)
- {
- this.oper = op;
- this.expr = expr;
- this.loc = loc;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
-
- set {
- expr = value;
- }
- }
-
- public Operator Oper {
- get {
- return oper;
- }
-
- set {
- oper = value;
- }
- }
-
- /// <summary>
- /// Returns a stringified representation of the Operator
- /// </summary>
- string OperName ()
- {
- switch (oper){
- case Operator.UnaryPlus:
- return "+";
- case Operator.UnaryNegation:
- return "-";
- case Operator.LogicalNot:
- return "!";
- case Operator.OnesComplement:
- return "~";
- case Operator.AddressOf:
- return "&";
- case Operator.Indirection:
- return "*";
- }
-
- return oper.ToString ();
- }
-
- static string [] oper_names;
-
- static Unary ()
- {
- oper_names = new string [(int)Operator.TOP];
-
- oper_names [(int) Operator.UnaryPlus] = "op_UnaryPlus";
- oper_names [(int) Operator.UnaryNegation] = "op_UnaryNegation";
- oper_names [(int) Operator.LogicalNot] = "op_LogicalNot";
- oper_names [(int) Operator.OnesComplement] = "op_OnesComplement";
- oper_names [(int) Operator.Indirection] = "op_Indirection";
- oper_names [(int) Operator.AddressOf] = "op_AddressOf";
- }
-
- void error23 (Type t)
- {
- Report.Error (
- 23, loc, "Operator " + OperName () +
- " cannot be applied to operand of type `" +
- TypeManager.CSharpName (t) + "'");
- }
-
- /// <remarks>
- /// The result has been already resolved:
- ///
- /// FIXME: a minus constant -128 sbyte cant be turned into a
- /// constant byte.
- /// </remarks>
- static Expression TryReduceNegative (Expression expr)
- {
- Expression e = null;
-
- if (expr is IntConstant)
- e = new IntConstant (-((IntConstant) expr).Value);
- else if (expr is UIntConstant)
- e = new LongConstant (-((UIntConstant) expr).Value);
- else if (expr is LongConstant)
- e = new LongConstant (-((LongConstant) expr).Value);
- else if (expr is FloatConstant)
- e = new FloatConstant (-((FloatConstant) expr).Value);
- else if (expr is DoubleConstant)
- e = new DoubleConstant (-((DoubleConstant) expr).Value);
- else if (expr is DecimalConstant)
- e = new DecimalConstant (-((DecimalConstant) expr).Value);
- else if (expr is ShortConstant)
- e = new IntConstant (-((ShortConstant) expr).Value);
- else if (expr is UShortConstant)
- e = new IntConstant (-((UShortConstant) expr).Value);
-
- return e;
- }
-
- Expression Reduce (EmitContext ec, Expression e)
- {
- Type expr_type = e.Type;
-
- switch (oper){
- case Operator.UnaryPlus:
- return e;
-
- case Operator.UnaryNegation:
- return TryReduceNegative (e);
-
- case Operator.LogicalNot:
- if (expr_type != TypeManager.bool_type) {
- error23 (expr_type);
- return null;
- }
-
- BoolConstant b = (BoolConstant) e;
- return new BoolConstant (!(b.Value));
-
- case Operator.OnesComplement:
- if (!((expr_type == TypeManager.int32_type) ||
- (expr_type == TypeManager.uint32_type) ||
- (expr_type == TypeManager.int64_type) ||
- (expr_type == TypeManager.uint64_type) ||
- (expr_type.IsSubclassOf (TypeManager.enum_type)))){
- error23 (expr_type);
- return null;
- }
-
- if (e is EnumConstant){
- EnumConstant enum_constant = (EnumConstant) e;
-
- Expression reduced = Reduce (ec, enum_constant.Child);
-
- return new EnumConstant ((Constant) reduced, enum_constant.Type);
- }
-
- if (expr_type == TypeManager.int32_type)
- return new IntConstant (~ ((IntConstant) e).Value);
- if (expr_type == TypeManager.uint32_type)
- return new UIntConstant (~ ((UIntConstant) e).Value);
- if (expr_type == TypeManager.int64_type)
- return new LongConstant (~ ((LongConstant) e).Value);
- if (expr_type == TypeManager.uint64_type)
- return new ULongConstant (~ ((ULongConstant) e).Value);
-
- throw new Exception (
- "FIXME: Implement constant OnesComplement of:" +
- expr_type);
- }
- throw new Exception ("Can not constant fold");
- }
-
- Expression ResolveOperator (EmitContext ec)
- {
- Type expr_type = expr.Type;
-
- //
- // Step 1: Perform Operator Overload location
- //
- Expression mg;
- string op_name;
-
- op_name = oper_names [(int) oper];
-
- mg = MemberLookup (ec, expr_type, op_name, MemberTypes.Method, AllBindingFlags, loc);
-
- if (mg != null) {
- Expression e = StaticCallExpr.MakeSimpleCall (
- ec, (MethodGroupExpr) mg, expr, loc);
-
- if (e == null){
- error23 (expr_type);
- return null;
- }
-
- return e;
- }
-
- // Only perform numeric promotions on:
- // +, -
-
- if (expr_type == null)
- return null;
-
- //
- // Step 2: Default operations on CLI native types.
- //
- if (expr is Constant)
- return Reduce (ec, expr);
-
- if (oper == Operator.LogicalNot){
- if (expr_type != TypeManager.bool_type) {
- error23 (expr.Type);
- return null;
- }
-
- type = TypeManager.bool_type;
- return this;
- }
-
- if (oper == Operator.OnesComplement) {
- if (!((expr_type == TypeManager.int32_type) ||
- (expr_type == TypeManager.uint32_type) ||
- (expr_type == TypeManager.int64_type) ||
- (expr_type == TypeManager.uint64_type) ||
- (expr_type.IsSubclassOf (TypeManager.enum_type)))){
- error23 (expr.Type);
- return null;
- }
- type = expr_type;
- return this;
- }
-
- if (oper == Operator.UnaryPlus) {
- //
- // A plus in front of something is just a no-op, so return the child.
- //
- return expr;
- }
-
- //
- // Deals with -literals
- // int operator- (int x)
- // long operator- (long x)
- // float operator- (float f)
- // double operator- (double d)
- // decimal operator- (decimal d)
- //
- if (oper == Operator.UnaryNegation){
- Expression e = null;
-
- //
- // perform numeric promotions to int,
- // long, double.
- //
- //
- // The following is inneficient, because we call
- // ConvertImplicit too many times.
- //
- // It is also not clear if we should convert to Float
- // or Double initially.
- //
- if (expr_type == TypeManager.uint32_type){
- //
- // FIXME: handle exception to this rule that
- // permits the int value -2147483648 (-2^31) to
- // bt wrote as a decimal interger literal
- //
- type = TypeManager.int64_type;
- expr = ConvertImplicit (ec, expr, type, loc);
- return this;
- }
-
- if (expr_type == TypeManager.uint64_type){
- //
- // FIXME: Handle exception of `long value'
- // -92233720368547758087 (-2^63) to be wrote as
- // decimal integer literal.
- //
- error23 (expr_type);
- return null;
- }
-
- if (expr_type == TypeManager.float_type){
- type = expr_type;
- return this;
- }
-
- e = ConvertImplicit (ec, expr, TypeManager.int32_type, loc);
- if (e != null){
- expr = e;
- type = e.Type;
- return this;
- }
-
- e = ConvertImplicit (ec, expr, TypeManager.int64_type, loc);
- if (e != null){
- expr = e;
- type = e.Type;
- return this;
- }
-
- e = ConvertImplicit (ec, expr, TypeManager.double_type, loc);
- if (e != null){
- expr = e;
- type = e.Type;
- return this;
- }
-
- error23 (expr_type);
- return null;
- }
-
- if (oper == Operator.AddressOf){
- if (expr.eclass != ExprClass.Variable){
- Error (211, loc, "Cannot take the address of non-variables");
- return null;
- }
-
- if (!ec.InUnsafe) {
- UnsafeError (loc);
- return null;
- }
-
- if (!TypeManager.VerifyUnManaged (expr.Type, loc)){
- return null;
- }
-
- //
- // This construct is needed because dynamic types
- // are not known by Type.GetType, so we have to try then to use
- // ModuleBuilder.GetType.
- //
- string ptr_type_name = expr.Type.FullName + "*";
- type = Type.GetType (ptr_type_name);
- if (type == null)
- type = RootContext.ModuleBuilder.GetType (ptr_type_name);
-
- return this;
- }
-
- if (oper == Operator.Indirection){
- if (!ec.InUnsafe){
- UnsafeError (loc);
- return null;
- }
-
- if (!expr_type.IsPointer){
- Report.Error (
- 193, loc,
- "The * or -> operator can only be applied to pointers");
- return null;
- }
-
- //
- // We create an Indirection expression, because
- // it can implement the IMemoryLocation.
- //
- return new Indirection (expr);
- }
-
- Error (187, loc, "No such operator '" + OperName () + "' defined for type '" +
- TypeManager.CSharpName (expr_type) + "'");
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- expr = expr.Resolve (ec);
-
- if (expr == null)
- return null;
-
- eclass = ExprClass.Value;
- return ResolveOperator (ec);
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Type expr_type = expr.Type;
-
- switch (oper) {
- case Operator.UnaryPlus:
- throw new Exception ("This should be caught by Resolve");
-
- case Operator.UnaryNegation:
- expr.Emit (ec);
- ig.Emit (OpCodes.Neg);
- break;
-
- case Operator.LogicalNot:
- expr.Emit (ec);
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Ceq);
- break;
-
- case Operator.OnesComplement:
- expr.Emit (ec);
- ig.Emit (OpCodes.Not);
- break;
-
- case Operator.AddressOf:
- ((IMemoryLocation)expr).AddressOf (ec);
- break;
-
- default:
- throw new Exception ("This should not happen: Operator = "
- + oper.ToString ());
- }
- }
-
- /// <summary>
- /// This will emit the child expression for `ec' avoiding the logical
- /// not. The parent will take care of changing brfalse/brtrue
- /// </summary>
- public void EmitLogicalNot (EmitContext ec)
- {
- if (oper != Operator.LogicalNot)
- throw new Exception ("EmitLogicalNot can only be called with !expr");
-
- expr.Emit (ec);
- }
-
- public override string ToString ()
- {
- return "Unary (" + oper + ", " + expr + ")";
- }
-
- }
-
- //
- // Unary operators are turned into Indirection expressions
- // after semantic analysis (this is so we can take the address
- // of an indirection).
- //
- public class Indirection : Expression, IMemoryLocation, IAssignMethod {
- Expression expr;
-
- public Indirection (Expression expr)
- {
- this.expr = expr;
- this.type = expr.Type.GetElementType ();
- eclass = ExprClass.Variable;
- }
-
- public override void Emit (EmitContext ec)
- {
- expr.Emit (ec);
- LoadFromPtr (ec.ig, Type, false);
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- expr.Emit (ec);
- source.Emit (ec);
- StoreFromPtr (ec.ig, type);
- }
-
- public void AddressOf (EmitContext ec)
- {
- expr.Emit (ec);
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // Born fully resolved
- //
- return this;
- }
- }
-
- /// <summary>
- /// Unary Mutator expressions (pre and post ++ and --)
- /// </summary>
- ///
- /// <remarks>
- /// UnaryMutator implements ++ and -- expressions. It derives from
- /// ExpressionStatement becuase the pre/post increment/decrement
- /// operators can be used in a statement context.
- ///
- /// FIXME: Idea, we could split this up in two classes, one simpler
- /// for the common case, and one with the extra fields for more complex
- /// classes (indexers require temporary access; overloaded require method)
- ///
- /// Maybe we should have classes PreIncrement, PostIncrement, PreDecrement,
- /// PostDecrement, that way we could save the `Mode' byte as well.
- /// </remarks>
- public class UnaryMutator : ExpressionStatement {
- public enum Mode : byte {
- PreIncrement, PreDecrement, PostIncrement, PostDecrement
- }
-
- Mode mode;
- Location loc;
- Expression expr;
- LocalTemporary temp_storage;
-
- //
- // This is expensive for the simplest case.
- //
- Expression method;
-
- public UnaryMutator (Mode m, Expression e, Location l)
- {
- mode = m;
- loc = l;
- expr = e;
- }
-
- string OperName ()
- {
- return (mode == Mode.PreIncrement || mode == Mode.PostIncrement) ?
- "++" : "--";
- }
-
- void error23 (Type t)
- {
- Report.Error (
- 23, loc, "Operator " + OperName () +
- " cannot be applied to operand of type `" +
- TypeManager.CSharpName (t) + "'");
- }
-
- /// <summary>
- /// Returns whether an object of type `t' can be incremented
- /// or decremented with add/sub (ie, basically whether we can
- /// use pre-post incr-decr operations on it, but it is not a
- /// System.Decimal, which we require operator overloading to catch)
- /// </summary>
- static bool IsIncrementableNumber (Type t)
- {
- return (t == TypeManager.sbyte_type) ||
- (t == TypeManager.byte_type) ||
- (t == TypeManager.short_type) ||
- (t == TypeManager.ushort_type) ||
- (t == TypeManager.int32_type) ||
- (t == TypeManager.uint32_type) ||
- (t == TypeManager.int64_type) ||
- (t == TypeManager.uint64_type) ||
- (t == TypeManager.char_type) ||
- (t.IsSubclassOf (TypeManager.enum_type)) ||
- (t == TypeManager.float_type) ||
- (t == TypeManager.double_type) ||
- (t.IsPointer && t != TypeManager.void_ptr_type);
- }
-
- Expression ResolveOperator (EmitContext ec)
- {
- Type expr_type = expr.Type;
-
- //
- // Step 1: Perform Operator Overload location
- //
- Expression mg;
- string op_name;
-
- if (mode == Mode.PreIncrement || mode == Mode.PostIncrement)
- op_name = "op_Increment";
- else
- op_name = "op_Decrement";
-
- mg = MemberLookup (ec, expr_type, op_name, MemberTypes.Method, AllBindingFlags, loc);
-
- if (mg == null && expr_type.BaseType != null)
- mg = MemberLookup (ec, expr_type.BaseType, op_name,
- MemberTypes.Method, AllBindingFlags, loc);
-
- if (mg != null) {
- method = StaticCallExpr.MakeSimpleCall (
- ec, (MethodGroupExpr) mg, expr, loc);
-
- type = method.Type;
- return this;
- }
-
- //
- // The operand of the prefix/postfix increment decrement operators
- // should be an expression that is classified as a variable,
- // a property access or an indexer access
- //
- type = expr_type;
- if (expr.eclass == ExprClass.Variable){
- if (IsIncrementableNumber (expr_type) ||
- expr_type == TypeManager.decimal_type){
- return this;
- }
- } else if (expr.eclass == ExprClass.IndexerAccess){
- IndexerAccess ia = (IndexerAccess) expr;
-
- temp_storage = new LocalTemporary (ec, expr.Type);
-
- expr = ia.ResolveLValue (ec, temp_storage);
- if (expr == null)
- return null;
-
- return this;
- } else if (expr.eclass == ExprClass.PropertyAccess){
- PropertyExpr pe = (PropertyExpr) expr;
-
- if (pe.VerifyAssignable ())
- return this;
-
- return null;
- } else {
- report118 (loc, expr, "variable, indexer or property access");
- return null;
- }
-
- Error (187, loc, "No such operator '" + OperName () + "' defined for type '" +
- TypeManager.CSharpName (expr_type) + "'");
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- expr = expr.Resolve (ec);
-
- if (expr == null)
- return null;
-
- eclass = ExprClass.Value;
- return ResolveOperator (ec);
- }
-
- static int PtrTypeSize (Type t)
- {
- return GetTypeSize (t.GetElementType ());
- }
-
-
- //
- // FIXME: We need some way of avoiding the use of temp_storage
- // for some types of storage (parameters, local variables,
- // static fields) and single-dimension array access.
- //
- void EmitCode (EmitContext ec, bool is_expr)
- {
- ILGenerator ig = ec.ig;
- IAssignMethod ia = (IAssignMethod) expr;
- Type expr_type = expr.Type;
-
- if (temp_storage == null)
- temp_storage = new LocalTemporary (ec, expr_type);
-
- switch (mode){
- case Mode.PreIncrement:
- case Mode.PreDecrement:
- if (method == null){
- expr.Emit (ec);
-
- if (expr_type == TypeManager.uint64_type ||
- expr_type == TypeManager.int64_type)
- ig.Emit (OpCodes.Ldc_I8, 1L);
- else if (expr_type == TypeManager.double_type)
- ig.Emit (OpCodes.Ldc_R8, 1.0);
- else if (expr_type == TypeManager.float_type)
- ig.Emit (OpCodes.Ldc_R4, 1.0F);
- else if (expr_type.IsPointer){
- int n = PtrTypeSize (expr_type);
-
- if (n == 0)
- ig.Emit (OpCodes.Sizeof, expr_type);
- else
- IntConstant.EmitInt (ig, n);
- } else
- ig.Emit (OpCodes.Ldc_I4_1);
-
- if (mode == Mode.PreDecrement)
- ig.Emit (OpCodes.Sub);
- else
- ig.Emit (OpCodes.Add);
- } else
- method.Emit (ec);
-
- temp_storage.Store (ec);
- ia.EmitAssign (ec, temp_storage);
- if (is_expr)
- temp_storage.Emit (ec);
- break;
-
- case Mode.PostIncrement:
- case Mode.PostDecrement:
- if (is_expr)
- expr.Emit (ec);
-
- if (method == null){
- if (!is_expr)
- expr.Emit (ec);
- else
- ig.Emit (OpCodes.Dup);
-
- if (expr_type == TypeManager.uint64_type ||
- expr_type == TypeManager.int64_type)
- ig.Emit (OpCodes.Ldc_I8, 1L);
- else if (expr_type == TypeManager.double_type)
- ig.Emit (OpCodes.Ldc_R8, 1.0);
- else if (expr_type == TypeManager.float_type)
- ig.Emit (OpCodes.Ldc_R4, 1.0F);
- else if (expr_type.IsPointer){
- int n = PtrTypeSize (expr_type);
-
- if (n == 0)
- ig.Emit (OpCodes.Sizeof, expr_type);
- else
- IntConstant.EmitInt (ig, n);
- } else
- ig.Emit (OpCodes.Ldc_I4_1);
-
- if (mode == Mode.PostDecrement)
- ig.Emit (OpCodes.Sub);
- else
- ig.Emit (OpCodes.Add);
- } else {
- method.Emit (ec);
- }
-
- temp_storage.Store (ec);
- ia.EmitAssign (ec, temp_storage);
- break;
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- EmitCode (ec, true);
-
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- EmitCode (ec, false);
- }
-
- }
-
- /// <summary>
- /// Base class for the `Is' and `As' classes.
- /// </summary>
- ///
- /// <remarks>
- /// FIXME: Split this in two, and we get to save the `Operator' Oper
- /// size.
- /// </remarks>
- public abstract class Probe : Expression {
- public readonly string ProbeType;
- protected Expression expr;
- protected Type probe_type;
- protected Location loc;
-
- public Probe (Expression expr, string probe_type, Location l)
- {
- ProbeType = probe_type;
- loc = l;
- this.expr = expr;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- probe_type = RootContext.LookupType (ec.TypeContainer, ProbeType, false, loc);
-
- if (probe_type == null)
- return null;
-
- expr = expr.Resolve (ec);
-
- return this;
- }
- }
-
- /// <summary>
- /// Implementation of the `is' operator.
- /// </summary>
- public class Is : Probe {
- public Is (Expression expr, string probe_type, Location l)
- : base (expr, probe_type, l)
- {
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- expr.Emit (ec);
-
- ig.Emit (OpCodes.Isinst, probe_type);
- ig.Emit (OpCodes.Ldnull);
- ig.Emit (OpCodes.Cgt_Un);
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Expression e = base.DoResolve (ec);
-
- if (e == null)
- return null;
-
- if (RootContext.WarningLevel >= 1){
- if (expr.Type == probe_type || expr.Type.IsSubclassOf (probe_type)){
- Report.Warning (
- 183, loc,
- "The expression is always of type `" +
- TypeManager.CSharpName (probe_type) + "'");
- }
-
- if (expr.Type != probe_type && !probe_type.IsSubclassOf (expr.Type)){
- if (!probe_type.IsInterface)
- Report.Warning (
- 184, loc,
- "The expression is never of type `" +
- TypeManager.CSharpName (probe_type) + "'");
- }
- }
-
- type = TypeManager.bool_type;
- eclass = ExprClass.Value;
-
- return this;
- }
- }
-
- /// <summary>
- /// Implementation of the `as' operator.
- /// </summary>
- public class As : Probe {
- public As (Expression expr, string probe_type, Location l)
- : base (expr, probe_type, l)
- {
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- expr.Emit (ec);
- ig.Emit (OpCodes.Isinst, probe_type);
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Expression e = base.DoResolve (ec);
-
- if (e == null)
- return null;
-
- type = probe_type;
- eclass = ExprClass.Value;
-
- return this;
- }
- }
-
- /// <summary>
- /// This represents a typecast in the source language.
- ///
- /// FIXME: Cast expressions have an unusual set of parsing
- /// rules, we need to figure those out.
- /// </summary>
- public class Cast : Expression {
- Expression target_type;
- Expression expr;
- Location loc;
-
- public Cast (Expression cast_type, Expression expr, Location loc)
- {
- this.target_type = cast_type;
- this.expr = expr;
- this.loc = loc;
- }
-
- public Expression TargetType {
- get {
- return target_type;
- }
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- set {
- expr = value;
- }
- }
-
- /// <summary>
- /// Attempts to do a compile-time folding of a constant cast.
- /// </summary>
- Expression TryReduce (EmitContext ec, Type target_type)
- {
- if (expr is ByteConstant){
- byte v = ((ByteConstant) expr).Value;
-
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- }
- if (expr is SByteConstant){
- sbyte v = ((SByteConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- }
- if (expr is ShortConstant){
- short v = ((ShortConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- }
- if (expr is UShortConstant){
- ushort v = ((UShortConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- }
- if (expr is IntConstant){
- int v = ((IntConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- }
- if (expr is UIntConstant){
- uint v = ((UIntConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- }
- if (expr is LongConstant){
- long v = ((LongConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- }
- if (expr is ULongConstant){
- ulong v = ((ULongConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- }
- if (expr is FloatConstant){
- float v = ((FloatConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- }
- if (expr is DoubleConstant){
- double v = ((DoubleConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- }
-
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- expr = expr.Resolve (ec);
- if (expr == null)
- return null;
-
- target_type = target_type.Resolve (ec);
- if (target_type == null)
- return null;
-
- if (target_type.eclass != ExprClass.Type){
- report118 (loc, target_type, "class");
- return null;
- }
-
- type = target_type.Type;
- eclass = ExprClass.Value;
-
- if (type == null)
- return null;
-
- if (expr is Constant){
- Expression e = TryReduce (ec, type);
-
- if (e != null)
- return e;
- }
-
- expr = ConvertExplicit (ec, expr, type, loc);
- return expr;
- }
-
- public override void Emit (EmitContext ec)
- {
- //
- // This one will never happen
- //
- throw new Exception ("Should not happen");
- }
- }
-
- /// <summary>
- /// Binary operators
- /// </summary>
- public class Binary : Expression {
- public enum Operator : byte {
- Multiply, Division, Modulus,
- Addition, Subtraction,
- LeftShift, RightShift,
- LessThan, GreaterThan, LessThanOrEqual, GreaterThanOrEqual,
- Equality, Inequality,
- BitwiseAnd,
- ExclusiveOr,
- BitwiseOr,
- LogicalAnd,
- LogicalOr
- }
-
- Operator oper;
- Expression left, right;
- MethodBase method;
- ArrayList Arguments;
- Location loc;
-
- bool DelegateOperation;
-
- public Binary (Operator oper, Expression left, Expression right, Location loc)
- {
- this.oper = oper;
- this.left = left;
- this.right = right;
- this.loc = loc;
- }
-
- public Operator Oper {
- get {
- return oper;
- }
- set {
- oper = value;
- }
- }
-
- public Expression Left {
- get {
- return left;
- }
- set {
- left = value;
- }
- }
-
- public Expression Right {
- get {
- return right;
- }
- set {
- right = value;
- }
- }
-
-
- /// <summary>
- /// Returns a stringified representation of the Operator
- /// </summary>
- string OperName ()
- {
- switch (oper){
- case Operator.Multiply:
- return "*";
- case Operator.Division:
- return "/";
- case Operator.Modulus:
- return "%";
- case Operator.Addition:
- return "+";
- case Operator.Subtraction:
- return "-";
- case Operator.LeftShift:
- return "<<";
- case Operator.RightShift:
- return ">>";
- case Operator.LessThan:
- return "<";
- case Operator.GreaterThan:
- return ">";
- case Operator.LessThanOrEqual:
- return "<=";
- case Operator.GreaterThanOrEqual:
- return ">=";
- case Operator.Equality:
- return "==";
- case Operator.Inequality:
- return "!=";
- case Operator.BitwiseAnd:
- return "&";
- case Operator.BitwiseOr:
- return "|";
- case Operator.ExclusiveOr:
- return "^";
- case Operator.LogicalOr:
- return "||";
- case Operator.LogicalAnd:
- return "&&";
- }
-
- return oper.ToString ();
- }
-
- Expression ForceConversion (EmitContext ec, Expression expr, Type target_type)
- {
- if (expr.Type == target_type)
- return expr;
-
- return ConvertImplicit (ec, expr, target_type, new Location (-1));
- }
-
- //
- // Note that handling the case l == Decimal || r == Decimal
- // is taken care of by the Step 1 Operator Overload resolution.
- //
- bool DoNumericPromotions (EmitContext ec, Type l, Type r)
- {
- if (l == TypeManager.double_type || r == TypeManager.double_type){
- //
- // If either operand is of type double, the other operand is
- // conveted to type double.
- //
- if (r != TypeManager.double_type)
- right = ConvertImplicit (ec, right, TypeManager.double_type, loc);
- if (l != TypeManager.double_type)
- left = ConvertImplicit (ec, left, TypeManager.double_type, loc);
-
- type = TypeManager.double_type;
- } else if (l == TypeManager.float_type || r == TypeManager.float_type){
- //
- // if either operand is of type float, th eother operand is
- // converd to type float.
- //
- if (r != TypeManager.double_type)
- right = ConvertImplicit (ec, right, TypeManager.float_type, loc);
- if (l != TypeManager.double_type)
- left = ConvertImplicit (ec, left, TypeManager.float_type, loc);
- type = TypeManager.float_type;
- } else if (l == TypeManager.uint64_type || r == TypeManager.uint64_type){
- Expression e;
- Type other;
- //
- // If either operand is of type ulong, the other operand is
- // converted to type ulong. or an error ocurrs if the other
- // operand is of type sbyte, short, int or long
- //
- if (l == TypeManager.uint64_type){
- if (r != TypeManager.uint64_type){
- if (right is IntConstant){
- IntConstant ic = (IntConstant) right;
-
- e = TryImplicitIntConversion (l, ic);
- if (e != null)
- right = e;
- } else if (right is LongConstant){
- long ll = ((LongConstant) right).Value;
-
- if (ll > 0)
- right = new ULongConstant ((ulong) ll);
- } else {
- e = ImplicitNumericConversion (ec, right, l, loc);
- if (e != null)
- right = e;
- }
- }
- other = right.Type;
- } else {
- if (left is IntConstant){
- e = TryImplicitIntConversion (r, (IntConstant) left);
- if (e != null)
- left = e;
- } else if (left is LongConstant){
- long ll = ((LongConstant) left).Value;
-
- if (ll > 0)
- left = new ULongConstant ((ulong) ll);
- } else {
- e = ImplicitNumericConversion (ec, left, r, loc);
- if (e != null)
- left = e;
- }
- other = left.Type;
- }
-
- if ((other == TypeManager.sbyte_type) ||
- (other == TypeManager.short_type) ||
- (other == TypeManager.int32_type) ||
- (other == TypeManager.int64_type)){
- string oper = OperName ();
-
- Error (34, loc, "Operator `" + OperName ()
- + "' is ambiguous on operands of type `"
- + TypeManager.CSharpName (l) + "' "
- + "and `" + TypeManager.CSharpName (r)
- + "'");
- }
- type = TypeManager.uint64_type;
- } else if (l == TypeManager.int64_type || r == TypeManager.int64_type){
- //
- // If either operand is of type long, the other operand is converted
- // to type long.
- //
- if (l != TypeManager.int64_type)
- left = ConvertImplicit (ec, left, TypeManager.int64_type, loc);
- if (r != TypeManager.int64_type)
- right = ConvertImplicit (ec, right, TypeManager.int64_type, loc);
-
- type = TypeManager.int64_type;
- } else if (l == TypeManager.uint32_type || r == TypeManager.uint32_type){
- //
- // If either operand is of type uint, and the other
- // operand is of type sbyte, short or int, othe operands are
- // converted to type long.
- //
- Type other = null;
-
- if (l == TypeManager.uint32_type){
- if (right is IntConstant){
- IntConstant ic = (IntConstant) right;
- int val = ic.Value;
-
- if (val >= 0)
- right = new UIntConstant ((uint) val);
-
- type = l;
- return true;
- }
- other = r;
- }
- else if (r == TypeManager.uint32_type){
- if (left is IntConstant){
- IntConstant ic = (IntConstant) left;
- int val = ic.Value;
-
- if (val >= 0)
- left = new UIntConstant ((uint) val);
-
- type = r;
- return true;
- }
-
- other = l;
- }
-
- if ((other == TypeManager.sbyte_type) ||
- (other == TypeManager.short_type) ||
- (other == TypeManager.int32_type)){
- left = ForceConversion (ec, left, TypeManager.int64_type);
- right = ForceConversion (ec, right, TypeManager.int64_type);
- type = TypeManager.int64_type;
- } else {
- //
- // if either operand is of type uint, the other
- // operand is converd to type uint
- //
- left = ForceConversion (ec, left, TypeManager.uint32_type);
- right = ForceConversion (ec, right, TypeManager.uint32_type);
- type = TypeManager.uint32_type;
- }
- } else if (l == TypeManager.decimal_type || r == TypeManager.decimal_type){
- if (l != TypeManager.decimal_type)
- left = ConvertImplicit (ec, left, TypeManager.decimal_type, loc);
- if (r != TypeManager.decimal_type)
- right = ConvertImplicit (ec, right, TypeManager.decimal_type, loc);
-
- type = TypeManager.decimal_type;
- } else {
- Expression l_tmp, r_tmp;
-
- l_tmp = ForceConversion (ec, left, TypeManager.int32_type);
- if (l_tmp == null)
- return false;
-
- r_tmp = ForceConversion (ec, right, TypeManager.int32_type);
- if (r_tmp == null)
- return false;
-
- left = l_tmp;
- right = r_tmp;
-
- type = TypeManager.int32_type;
- }
-
- return true;
- }
-
- void error19 ()
- {
- Error (19, loc,
- "Operator " + OperName () + " cannot be applied to operands of type `" +
- TypeManager.CSharpName (left.Type) + "' and `" +
- TypeManager.CSharpName (right.Type) + "'");
-
- }
-
- static bool is_32_or_64 (Type t)
- {
- return (t == TypeManager.int32_type || t == TypeManager.uint32_type ||
- t == TypeManager.int64_type || t == TypeManager.uint64_type);
- }
-
- Expression CheckShiftArguments (EmitContext ec)
- {
- Expression e;
- Type l = left.Type;
- Type r = right.Type;
-
- e = ForceConversion (ec, right, TypeManager.int32_type);
- if (e == null){
- error19 ();
- return null;
- }
- right = e;
-
- if (((e = ConvertImplicit (ec, left, TypeManager.int32_type, loc)) != null) ||
- ((e = ConvertImplicit (ec, left, TypeManager.uint32_type, loc)) != null) ||
- ((e = ConvertImplicit (ec, left, TypeManager.int64_type, loc)) != null) ||
- ((e = ConvertImplicit (ec, left, TypeManager.uint64_type, loc)) != null)){
- left = e;
- type = e.Type;
-
- return this;
- }
- error19 ();
- return null;
- }
-
- Expression ResolveOperator (EmitContext ec)
- {
- Type l = left.Type;
- Type r = right.Type;
-
- //
- // Step 1: Perform Operator Overload location
- //
- Expression left_expr, right_expr;
-
- string op = "op_" + oper;
-
- MethodGroupExpr union;
- left_expr = MemberLookup (ec, l, op, MemberTypes.Method, AllBindingFlags, loc);
- if (r != l){
- right_expr = MemberLookup (
- ec, r, op, MemberTypes.Method, AllBindingFlags, loc);
- union = Invocation.MakeUnionSet (left_expr, right_expr);
- } else
- union = (MethodGroupExpr) left_expr;
-
- if (union != null) {
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- method = Invocation.OverloadResolve (ec, union, Arguments, loc);
- if (method != null) {
- MethodInfo mi = (MethodInfo) method;
-
- type = mi.ReturnType;
- return this;
- } else {
- error19 ();
- return null;
- }
- }
-
- //
- // Step 2: Default operations on CLI native types.
- //
-
- // Only perform numeric promotions on:
- // +, -, *, /, %, &, |, ^, ==, !=, <, >, <=, >=
- //
- if (oper == Operator.Addition){
- //
- // If any of the arguments is a string, cast to string
- //
- if (l == TypeManager.string_type){
-
- if (r == TypeManager.void_type) {
- error19 ();
- return null;
- }
-
- if (r == TypeManager.string_type){
- if (left is Constant && right is Constant){
- StringConstant ls = (StringConstant) left;
- StringConstant rs = (StringConstant) right;
-
- return new StringConstant (
- ls.Value + rs.Value);
- }
-
- // string + string
- method = TypeManager.string_concat_string_string;
- } else {
- // string + object
- method = TypeManager.string_concat_object_object;
- right = ConvertImplicit (ec, right,
- TypeManager.object_type, loc);
- }
- type = TypeManager.string_type;
-
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- return this;
-
- } else if (r == TypeManager.string_type){
- // object + string
-
- if (l == TypeManager.void_type) {
- error19 ();
- return null;
- }
-
- method = TypeManager.string_concat_object_object;
- left = ConvertImplicit (ec, left, TypeManager.object_type, loc);
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- type = TypeManager.string_type;
-
- return this;
- }
- }
-
- if (oper == Operator.Addition || oper == Operator.Subtraction) {
- if (l.IsSubclassOf (TypeManager.delegate_type) &&
- r.IsSubclassOf (TypeManager.delegate_type)) {
-
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- if (oper == Operator.Addition)
- method = TypeManager.delegate_combine_delegate_delegate;
- else
- method = TypeManager.delegate_remove_delegate_delegate;
-
- DelegateOperation = true;
- type = l;
- return this;
- }
-
- //
- // Pointer arithmetic:
- //
- // T* operator + (T* x, int y);
- // T* operator + (T* x, uint y);
- // T* operator + (T* x, long y);
- // T* operator + (T* x, ulong y);
- //
- // T* operator + (int y, T* x);
- // T* operator + (uint y, T *x);
- // T* operator + (long y, T *x);
- // T* operator + (ulong y, T *x);
- //
- // T* operator - (T* x, int y);
- // T* operator - (T* x, uint y);
- // T* operator - (T* x, long y);
- // T* operator - (T* x, ulong y);
- //
- // long operator - (T* x, T *y)
- //
- if (l.IsPointer){
- if (r.IsPointer && oper == Operator.Subtraction){
- if (r == l)
- return new PointerArithmetic (
- false, left, right, TypeManager.int64_type);
- } else if (is_32_or_64 (r))
- return new PointerArithmetic (
- oper == Operator.Addition, left, right, l);
- } else if (r.IsPointer && is_32_or_64 (l) && oper == Operator.Addition)
- return new PointerArithmetic (
- true, right, left, r);
- }
-
- //
- // Enumeration operators
- //
- bool lie = TypeManager.IsEnumType (l);
- bool rie = TypeManager.IsEnumType (r);
- if (lie || rie){
- Expression temp;
-
- if (!rie){
- temp = ConvertImplicit (ec, right, l, loc);
- if (temp != null)
- right = temp;
- } if (!lie){
- temp = ConvertImplicit (ec, left, r, loc);
- if (temp != null){
- left = temp;
- l = r;
- }
- }
-
- if (oper == Operator.Equality || oper == Operator.Inequality ||
- oper == Operator.LessThanOrEqual || oper == Operator.LessThan ||
- oper == Operator.GreaterThanOrEqual || oper == Operator.GreaterThan){
- type = TypeManager.bool_type;
- return this;
- }
-
- if (oper == Operator.BitwiseAnd ||
- oper == Operator.BitwiseOr ||
- oper == Operator.ExclusiveOr){
- type = l;
- return this;
- }
- }
-
- if (oper == Operator.LeftShift || oper == Operator.RightShift)
- return CheckShiftArguments (ec);
-
- if (oper == Operator.LogicalOr || oper == Operator.LogicalAnd){
- if (l != TypeManager.bool_type || r != TypeManager.bool_type){
- error19 ();
- return null;
- }
-
- type = TypeManager.bool_type;
- return this;
- }
-
- if (oper == Operator.Equality || oper == Operator.Inequality){
- if (l == TypeManager.bool_type || r == TypeManager.bool_type){
- if (r != TypeManager.bool_type || l != TypeManager.bool_type){
- error19 ();
- return null;
- }
-
- type = TypeManager.bool_type;
- return this;
- }
-
- //
- // operator != (object a, object b)
- // operator == (object a, object b)
- //
- // For this to be used, both arguments have to be reference-types.
- // Read the rationale on the spec (14.9.6)
- //
- // Also, if at compile time we know that the classes do not inherit
- // one from the other, then we catch the error there.
- //
- if (!(l.IsValueType || r.IsValueType)){
- type = TypeManager.bool_type;
-
- if (l == r)
- return this;
-
- if (l.IsSubclassOf (r) || r.IsSubclassOf (l))
- return this;
-
- //
- // We are going to have to convert to an object to compare
- //
- if (l != TypeManager.object_type)
- left = new EmptyCast (left, TypeManager.object_type);
- if (r != TypeManager.object_type)
- right = new EmptyCast (right, TypeManager.object_type);
-
- return this;
- }
- }
-
- //
- // Pointer comparison
- //
- if (l.IsPointer && r.IsPointer){
- if (oper == Operator.Equality || oper == Operator.Inequality ||
- oper == Operator.LessThan || oper == Operator.LessThanOrEqual ||
- oper == Operator.GreaterThan || oper == Operator.GreaterThanOrEqual){
- type = TypeManager.bool_type;
- return this;
- }
- }
-
- //
- // We are dealing with numbers
- //
-
- if (!DoNumericPromotions (ec, l, r)){
- error19 ();
- return null;
- }
-
- if (left == null || right == null)
- return null;
-
- //
- // reload our cached types if required
- //
- l = left.Type;
- r = right.Type;
-
- if (oper == Operator.BitwiseAnd ||
- oper == Operator.BitwiseOr ||
- oper == Operator.ExclusiveOr){
- if (l == r){
- if (!((l == TypeManager.int32_type) ||
- (l == TypeManager.uint32_type) ||
- (l == TypeManager.int64_type) ||
- (l == TypeManager.uint64_type)))
- type = l;
- } else {
- error19 ();
- return null;
- }
- }
-
- if (oper == Operator.Equality ||
- oper == Operator.Inequality ||
- oper == Operator.LessThanOrEqual ||
- oper == Operator.LessThan ||
- oper == Operator.GreaterThanOrEqual ||
- oper == Operator.GreaterThan){
- type = TypeManager.bool_type;
- }
-
- return this;
- }
-
- /// <summary>
- /// Constant expression reducer for binary operations
- /// </summary>
- public Expression ConstantFold (EmitContext ec)
- {
- object l = ((Constant) left).GetValue ();
- object r = ((Constant) right).GetValue ();
-
- Type result_type = null;
-
- //
- // Enumerator folding
- //
- if (left.Type == right.Type && left is EnumConstant)
- result_type = left.Type;
-
- switch (oper){
- case Operator.BitwiseOr:
- if ((l is int) && (r is int)){
- IntConstant v;
- int res = (int)l | (int)r;
-
- v = new IntConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- }
- break;
-
- case Operator.BitwiseAnd:
- if ((l is int) && (r is int)){
- IntConstant v;
- int res = (int)l & (int)r;
-
- v = new IntConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- }
- break;
-
- case Operator.Addition:
- if (l is string && r is string)
- return new StringConstant ((string) l + (string) r);
- break;
- }
-
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- left = left.Resolve (ec);
- right = right.Resolve (ec);
-
- if (left == null || right == null)
- return null;
-
- if (left.Type == null)
- throw new Exception (
- "Resolve returned non null, but did not set the type! (" +
- left + ") at Line: " + loc.Row);
- if (right.Type == null)
- throw new Exception (
- "Resolve returned non null, but did not set the type! (" +
- right + ") at Line: "+ loc.Row);
-
- eclass = ExprClass.Value;
-
- if (left is Constant && right is Constant){
- //
- // This is temporary until we do the full folding
- //
- Expression e = ConstantFold (ec);
- if (e != null)
- return e;
- }
-
- return ResolveOperator (ec);
- }
-
- public bool IsBranchable ()
- {
- if (oper == Operator.Equality ||
- oper == Operator.Inequality ||
- oper == Operator.LessThan ||
- oper == Operator.GreaterThan ||
- oper == Operator.LessThanOrEqual ||
- oper == Operator.GreaterThanOrEqual){
- return true;
- } else
- return false;
- }
-
- /// <summary>
- /// This entry point is used by routines that might want
- /// to emit a brfalse/brtrue after an expression, and instead
- /// they could use a more compact notation.
- ///
- /// Typically the code would generate l.emit/r.emit, followed
- /// by the comparission and then a brtrue/brfalse. The comparissions
- /// are sometimes inneficient (there are not as complete as the branches
- /// look for the hacks in Emit using double ceqs).
- ///
- /// So for those cases we provide EmitBranchable that can emit the
- /// branch with the test
- /// </summary>
- public void EmitBranchable (EmitContext ec, int target)
- {
- OpCode opcode;
- bool close_target = false;
- ILGenerator ig = ec.ig;
-
- //
- // short-circuit operators
- //
- if (oper == Operator.LogicalAnd){
- left.Emit (ec);
- ig.Emit (OpCodes.Brfalse, target);
- right.Emit (ec);
- ig.Emit (OpCodes.Brfalse, target);
- } else if (oper == Operator.LogicalOr){
- left.Emit (ec);
- ig.Emit (OpCodes.Brtrue, target);
- right.Emit (ec);
- ig.Emit (OpCodes.Brfalse, target);
- }
-
- left.Emit (ec);
- right.Emit (ec);
-
- switch (oper){
- case Operator.Equality:
- if (close_target)
- opcode = OpCodes.Beq_S;
- else
- opcode = OpCodes.Beq;
- break;
-
- case Operator.Inequality:
- if (close_target)
- opcode = OpCodes.Bne_Un_S;
- else
- opcode = OpCodes.Bne_Un;
- break;
-
- case Operator.LessThan:
- if (close_target)
- opcode = OpCodes.Blt_S;
- else
- opcode = OpCodes.Blt;
- break;
-
- case Operator.GreaterThan:
- if (close_target)
- opcode = OpCodes.Bgt_S;
- else
- opcode = OpCodes.Bgt;
- break;
-
- case Operator.LessThanOrEqual:
- if (close_target)
- opcode = OpCodes.Ble_S;
- else
- opcode = OpCodes.Ble;
- break;
-
- case Operator.GreaterThanOrEqual:
- if (close_target)
- opcode = OpCodes.Bge_S;
- else
- opcode = OpCodes.Ble;
- break;
-
- default:
- throw new Exception ("EmitBranchable called on non-EmitBranchable operator: "
- + oper.ToString ());
- }
-
- ig.Emit (opcode, target);
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Type l = left.Type;
- Type r = right.Type;
- OpCode opcode;
-
- if (method != null) {
-
- // Note that operators are static anyway
-
- if (Arguments != null)
- Invocation.EmitArguments (ec, method, Arguments);
-
- if (method is MethodInfo)
- ig.Emit (OpCodes.Call, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
-
- if (DelegateOperation)
- ig.Emit (OpCodes.Castclass, type);
-
- return;
- }
-
- //
- // Handle short-circuit operators differently
- // than the rest
- //
- if (oper == Operator.LogicalAnd){
- Label load_zero = ig.DefineLabel ();
- Label end = ig.DefineLabel ();
-
- left.Emit (ec);
- ig.Emit (OpCodes.Brfalse, load_zero);
- right.Emit (ec);
- ig.Emit (OpCodes.Br, end);
- ig.MarkLabel (load_zero);
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.MarkLabel (end);
- return;
- } else if (oper == Operator.LogicalOr){
- Label load_one = ig.DefineLabel ();
- Label end = ig.DefineLabel ();
-
- left.Emit (ec);
- ig.Emit (OpCodes.Brtrue, load_one);
- right.Emit (ec);
- ig.Emit (OpCodes.Br, end);
- ig.MarkLabel (load_one);
- ig.Emit (OpCodes.Ldc_I4_1);
- ig.MarkLabel (end);
- return;
- }
-
- left.Emit (ec);
- right.Emit (ec);
-
- switch (oper){
- case Operator.Multiply:
- if (ec.CheckState){
- if (l == TypeManager.int32_type || l == TypeManager.int64_type)
- opcode = OpCodes.Mul_Ovf;
- else if (l==TypeManager.uint32_type || l==TypeManager.uint64_type)
- opcode = OpCodes.Mul_Ovf_Un;
- else
- opcode = OpCodes.Mul;
- } else
- opcode = OpCodes.Mul;
-
- break;
-
- case Operator.Division:
- if (l == TypeManager.uint32_type || l == TypeManager.uint64_type)
- opcode = OpCodes.Div_Un;
- else
- opcode = OpCodes.Div;
- break;
-
- case Operator.Modulus:
- if (l == TypeManager.uint32_type || l == TypeManager.uint64_type)
- opcode = OpCodes.Rem_Un;
- else
- opcode = OpCodes.Rem;
- break;
-
- case Operator.Addition:
- if (ec.CheckState){
- if (l == TypeManager.int32_type || l == TypeManager.int64_type)
- opcode = OpCodes.Add_Ovf;
- else if (l==TypeManager.uint32_type || l==TypeManager.uint64_type)
- opcode = OpCodes.Add_Ovf_Un;
- else
- opcode = OpCodes.Mul;
- } else
- opcode = OpCodes.Add;
- break;
-
- case Operator.Subtraction:
- if (ec.CheckState){
- if (l == TypeManager.int32_type || l == TypeManager.int64_type)
- opcode = OpCodes.Sub_Ovf;
- else if (l==TypeManager.uint32_type || l==TypeManager.uint64_type)
- opcode = OpCodes.Sub_Ovf_Un;
- else
- opcode = OpCodes.Sub;
- } else
- opcode = OpCodes.Sub;
- break;
-
- case Operator.RightShift:
- opcode = OpCodes.Shr;
- break;
-
- case Operator.LeftShift:
- opcode = OpCodes.Shl;
- break;
-
- case Operator.Equality:
- opcode = OpCodes.Ceq;
- break;
-
- case Operator.Inequality:
- ec.ig.Emit (OpCodes.Ceq);
- ec.ig.Emit (OpCodes.Ldc_I4_0);
-
- opcode = OpCodes.Ceq;
- break;
-
- case Operator.LessThan:
- opcode = OpCodes.Clt;
- break;
-
- case Operator.GreaterThan:
- opcode = OpCodes.Cgt;
- break;
-
- case Operator.LessThanOrEqual:
- ec.ig.Emit (OpCodes.Cgt);
- ec.ig.Emit (OpCodes.Ldc_I4_0);
-
- opcode = OpCodes.Ceq;
- break;
-
- case Operator.GreaterThanOrEqual:
- ec.ig.Emit (OpCodes.Clt);
- ec.ig.Emit (OpCodes.Ldc_I4_1);
-
- opcode = OpCodes.Sub;
- break;
-
- case Operator.BitwiseOr:
- opcode = OpCodes.Or;
- break;
-
- case Operator.BitwiseAnd:
- opcode = OpCodes.And;
- break;
-
- case Operator.ExclusiveOr:
- opcode = OpCodes.Xor;
- break;
-
- default:
- throw new Exception ("This should not happen: Operator = "
- + oper.ToString ());
- }
-
- ig.Emit (opcode);
- }
- }
-
- public class PointerArithmetic : Expression {
- Expression left, right;
- bool is_add;
-
- //
- // We assume that `l' is always a pointer
- //
- public PointerArithmetic (bool is_addition, Expression l, Expression r, Type t)
- {
- type = t;
- eclass = ExprClass.Variable;
- left = l;
- right = r;
- is_add = is_addition;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are born fully resolved
- //
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Type op_type = left.Type;
- ILGenerator ig = ec.ig;
- int size = GetTypeSize (op_type.GetElementType ());
-
- if (right.Type.IsPointer){
- //
- // handle (pointer - pointer)
- //
- left.Emit (ec);
- right.Emit (ec);
- ig.Emit (OpCodes.Sub);
-
- if (size != 1){
- if (size == 0)
- ig.Emit (OpCodes.Sizeof, op_type);
- else
- IntLiteral.EmitInt (ig, size);
- ig.Emit (OpCodes.Div);
- }
- ig.Emit (OpCodes.Conv_I8);
- } else {
- //
- // handle + and - on (pointer op int)
- //
- left.Emit (ec);
- ig.Emit (OpCodes.Conv_I);
- right.Emit (ec);
- if (size != 1){
- if (size == 0)
- ig.Emit (OpCodes.Sizeof, op_type);
- else
- IntLiteral.EmitInt (ig, size);
- ig.Emit (OpCodes.Mul);
- }
- if (is_add)
- ig.Emit (OpCodes.Add);
- else
- ig.Emit (OpCodes.Sub);
- }
- }
- }
-
- /// <summary>
- /// Implements the ternary conditiona operator (?:)
- /// </summary>
- public class Conditional : Expression {
- Expression expr, trueExpr, falseExpr;
- Location loc;
-
- public Conditional (Expression expr, Expression trueExpr, Expression falseExpr, Location l)
- {
- this.expr = expr;
- this.trueExpr = trueExpr;
- this.falseExpr = falseExpr;
- this.loc = l;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- }
-
- public Expression TrueExpr {
- get {
- return trueExpr;
- }
- }
-
- public Expression FalseExpr {
- get {
- return falseExpr;
- }
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- expr = expr.Resolve (ec);
-
- if (expr.Type != TypeManager.bool_type)
- expr = Expression.ConvertImplicitRequired (
- ec, expr, TypeManager.bool_type, loc);
-
- trueExpr = trueExpr.Resolve (ec);
- falseExpr = falseExpr.Resolve (ec);
-
- if (expr == null || trueExpr == null || falseExpr == null)
- return null;
-
- eclass = ExprClass.Value;
- if (trueExpr.Type == falseExpr.Type)
- type = trueExpr.Type;
- else {
- Expression conv;
- Type true_type = trueExpr.Type;
- Type false_type = falseExpr.Type;
-
- if (trueExpr is NullLiteral){
- type = false_type;
- return this;
- } else if (falseExpr is NullLiteral){
- type = true_type;
- return this;
- }
-
- //
- // First, if an implicit conversion exists from trueExpr
- // to falseExpr, then the result type is of type falseExpr.Type
- //
- conv = ConvertImplicit (ec, trueExpr, false_type, loc);
- if (conv != null){
- //
- // Check if both can convert implicitl to each other's type
- //
- if (ConvertImplicit (ec, falseExpr, true_type, loc) != null){
- Report.Error (
- 172, loc,
- "Can not compute type of conditional expression " +
- "as `" + TypeManager.CSharpName (trueExpr.Type) +
- "' and `" + TypeManager.CSharpName (falseExpr.Type) +
- "' convert implicitly to each other");
- return null;
- }
- type = false_type;
- trueExpr = conv;
- } else if ((conv = ConvertImplicit(ec, falseExpr, true_type,loc))!= null){
- type = true_type;
- falseExpr = conv;
- } else {
- Error (173, loc, "The type of the conditional expression can " +
- "not be computed because there is no implicit conversion" +
- " from `" + TypeManager.CSharpName (trueExpr.Type) + "'" +
- " and `" + TypeManager.CSharpName (falseExpr.Type) + "'");
- return null;
- }
- }
-
- if (expr is BoolConstant){
- BoolConstant bc = (BoolConstant) expr;
-
- if (bc.Value)
- return trueExpr;
- else
- return falseExpr;
- }
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label false_target = ig.DefineLabel ();
- Label end_target = ig.DefineLabel ();
-
- expr.Emit (ec);
- ig.Emit (OpCodes.Brfalse, false_target);
- trueExpr.Emit (ec);
- ig.Emit (OpCodes.Br, end_target);
- ig.MarkLabel (false_target);
- falseExpr.Emit (ec);
- ig.MarkLabel (end_target);
- }
-
- }
-
- /// <summary>
- /// Local variables
- /// </summary>
- public class LocalVariableReference : Expression, IAssignMethod, IMemoryLocation {
- public readonly string Name;
- public readonly Block Block;
- Location loc;
- VariableInfo variable_info;
-
- public LocalVariableReference (Block block, string name, Location l)
- {
- Block = block;
- Name = name;
- loc = l;
- eclass = ExprClass.Variable;
- }
-
- public VariableInfo VariableInfo {
- get {
- if (variable_info == null)
- variable_info = Block.GetVariableInfo (Name);
- return variable_info;
- }
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- VariableInfo vi = VariableInfo;
-
- if (Block.IsConstant (Name)) {
- Expression e = Block.GetConstantExpression (Name);
-
- vi.Used = true;
- return e;
- }
-
- type = vi.VariableType;
- return this;
- }
-
- override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- Expression e = DoResolve (ec);
-
- if (e == null)
- return null;
-
- VariableInfo vi = VariableInfo;
-
- if (vi.ReadOnly){
- if (vi.Assigned){
- Report.Error (
- 1604, loc,
- "cannot assign to `" + Name + "' because it is readonly");
- return null;
- }
- }
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- VariableInfo vi = VariableInfo;
- ILGenerator ig = ec.ig;
- int idx = vi.Idx;
-
- vi.Used = true;
-
- switch (idx){
- case 0:
- ig.Emit (OpCodes.Ldloc_0);
- break;
-
- case 1:
- ig.Emit (OpCodes.Ldloc_1);
- break;
-
- case 2:
- ig.Emit (OpCodes.Ldloc_2);
- break;
-
- case 3:
- ig.Emit (OpCodes.Ldloc_3);
- break;
-
- default:
- if (idx <= 255)
- ig.Emit (OpCodes.Ldloc_S, (byte) idx);
- else
- ig.Emit (OpCodes.Ldloc, idx);
- break;
- }
- }
-
- public static void Store (ILGenerator ig, int idx)
- {
- switch (idx){
- case 0:
- ig.Emit (OpCodes.Stloc_0);
- break;
-
- case 1:
- ig.Emit (OpCodes.Stloc_1);
- break;
-
- case 2:
- ig.Emit (OpCodes.Stloc_2);
- break;
-
- case 3:
- ig.Emit (OpCodes.Stloc_3);
- break;
-
- default:
- if (idx <= 255)
- ig.Emit (OpCodes.Stloc_S, (byte) idx);
- else
- ig.Emit (OpCodes.Stloc, idx);
- break;
- }
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- ILGenerator ig = ec.ig;
- VariableInfo vi = VariableInfo;
-
- vi.Assigned = true;
-
- source.Emit (ec);
-
- // Funny seems the code below generates optimal code for us, but
- // seems to take too long to generate what we need.
- // ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- Store (ig, vi.Idx);
- }
-
- public void AddressOf (EmitContext ec)
- {
- VariableInfo vi = VariableInfo;
- int idx = vi.Idx;
-
- vi.Used = true;
- vi.Assigned = true;
-
- if (idx <= 255)
- ec.ig.Emit (OpCodes.Ldloca_S, (byte) idx);
- else
- ec.ig.Emit (OpCodes.Ldloca, idx);
- }
- }
-
- /// <summary>
- /// This represents a reference to a parameter in the intermediate
- /// representation.
- /// </summary>
- public class ParameterReference : Expression, IAssignMethod, IMemoryLocation {
- Parameters pars;
- String name;
- int idx;
- public bool is_ref;
-
- public ParameterReference (Parameters pars, int idx, string name)
- {
- this.pars = pars;
- this.idx = idx;
- this.name = name;
- eclass = ExprClass.Variable;
- }
-
- //
- // Notice that for ref/out parameters, the type exposed is not the
- // same type exposed externally.
- //
- // for "ref int a":
- // externally we expose "int&"
- // here we expose "int".
- //
- // We record this in "is_ref". This means that the type system can treat
- // the type as it is expected, but when we generate the code, we generate
- // the alternate kind of code.
- //
- public override Expression DoResolve (EmitContext ec)
- {
- type = pars.GetParameterInfo (ec.TypeContainer, idx, out is_ref);
- eclass = ExprClass.Variable;
-
- return this;
- }
-
- //
- // This method is used by parameters that are references, that are
- // being passed as references: we only want to pass the pointer (that
- // is already stored in the parameter, not the address of the pointer,
- // and not the value of the variable).
- //
- public void EmitLoad (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- int arg_idx = idx;
-
- if (!ec.IsStatic)
- arg_idx++;
-
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Ldarg, arg_idx);
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- int arg_idx = idx;
-
- if (!ec.IsStatic)
- arg_idx++;
-
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Ldarg, arg_idx);
-
- if (!is_ref)
- return;
-
- //
- // If we are a reference, we loaded on the stack a pointer
- // Now lets load the real value
- //
- LoadFromPtr (ig, type, true);
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- ILGenerator ig = ec.ig;
- int arg_idx = idx;
-
- if (!ec.IsStatic)
- arg_idx++;
-
- if (is_ref){
- // Load the pointer
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Ldarg, arg_idx);
- }
-
- source.Emit (ec);
-
- if (is_ref)
- StoreFromPtr (ig, type);
- else {
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Starg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Starg, arg_idx);
- }
-
- }
-
- public void AddressOf (EmitContext ec)
- {
- int arg_idx = idx;
-
- if (!ec.IsStatic)
- arg_idx++;
-
- if (arg_idx <= 255)
- ec.ig.Emit (OpCodes.Ldarga_S, (byte) arg_idx);
- else
- ec.ig.Emit (OpCodes.Ldarga, arg_idx);
- }
- }
-
- /// <summary>
- /// Used for arguments to New(), Invocation()
- /// </summary>
- public class Argument {
- public enum AType : byte {
- Expression,
- Ref,
- Out
- };
-
- public readonly AType ArgType;
- public Expression expr;
-
- public Argument (Expression expr, AType type)
- {
- this.expr = expr;
- this.ArgType = type;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
-
- set {
- expr = value;
- }
- }
-
- public Type Type {
- get {
- return expr.Type;
- }
- }
-
- public Parameter.Modifier GetParameterModifier ()
- {
- if (ArgType == AType.Ref || ArgType == AType.Out)
- return Parameter.Modifier.OUT;
-
- return Parameter.Modifier.NONE;
- }
-
- public static string FullDesc (Argument a)
- {
- return (a.ArgType == AType.Ref ? "ref " :
- (a.ArgType == AType.Out ? "out " : "")) +
- TypeManager.CSharpName (a.Expr.Type);
- }
-
- public bool Resolve (EmitContext ec, Location loc)
- {
- expr = expr.Resolve (ec);
-
- if (ArgType == AType.Expression)
- return expr != null;
-
- if (expr.eclass != ExprClass.Variable){
- //
- // We just probe to match the CSC output
- //
- if (expr.eclass == ExprClass.PropertyAccess ||
- expr.eclass == ExprClass.IndexerAccess){
- Report.Error (
- 206, loc,
- "A property or indexer can not be passed as an out or ref " +
- "parameter");
- } else {
- Report.Error (
- 1510, loc,
- "An lvalue is required as an argument to out or ref");
- }
- return false;
- }
-
- return expr != null;
- }
-
- public void Emit (EmitContext ec)
- {
- //
- // Ref and Out parameters need to have their addresses taken.
- //
- // ParameterReferences might already be references, so we want
- // to pass just the value
- //
- if (ArgType == AType.Ref || ArgType == AType.Out){
- if (expr is ParameterReference){
- ParameterReference pr = (ParameterReference) expr;
-
- if (pr.is_ref)
- pr.EmitLoad (ec);
- else
- pr.AddressOf (ec);
- } else
- ((IMemoryLocation)expr).AddressOf (ec);
- } else
- expr.Emit (ec);
- }
- }
-
- /// <summary>
- /// Invocation of methods or delegates.
- /// </summary>
- public class Invocation : ExpressionStatement {
- public readonly ArrayList Arguments;
- Location loc;
-
- Expression expr;
- MethodBase method = null;
- bool is_base;
-
- static Hashtable method_parameter_cache;
-
- static Invocation ()
- {
- method_parameter_cache = new PtrHashtable ();
- }
-
- //
- // arguments is an ArrayList, but we do not want to typecast,
- // as it might be null.
- //
- // FIXME: only allow expr to be a method invocation or a
- // delegate invocation (7.5.5)
- //
- public Invocation (Expression expr, ArrayList arguments, Location l)
- {
- this.expr = expr;
- Arguments = arguments;
- loc = l;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- }
-
- /// <summary>
- /// Returns the Parameters (a ParameterData interface) for the
- /// Method `mb'
- /// </summary>
- public static ParameterData GetParameterData (MethodBase mb)
- {
- object pd = method_parameter_cache [mb];
- object ip;
-
- if (pd != null)
- return (ParameterData) pd;
-
-
- ip = TypeManager.LookupParametersByBuilder (mb);
- if (ip != null){
- method_parameter_cache [mb] = ip;
-
- return (ParameterData) ip;
- } else {
- ParameterInfo [] pi = mb.GetParameters ();
- ReflectionParameters rp = new ReflectionParameters (pi);
- method_parameter_cache [mb] = rp;
-
- return (ParameterData) rp;
- }
- }
-
- /// <summary>
- /// Determines "better conversion" as specified in 7.4.2.3
- /// Returns : 1 if a->p is better
- /// 0 if a->q or neither is better
- /// </summary>
- static int BetterConversion (EmitContext ec, Argument a, Type p, Type q, Location loc)
- {
- Type argument_type = a.Type;
- Expression argument_expr = a.Expr;
-
- if (argument_type == null)
- throw new Exception ("Expression of type " + a.Expr + " does not resolve its type");
-
- if (p == q)
- return 0;
-
- if (argument_type == p)
- return 1;
-
- if (argument_type == q)
- return 0;
-
- //
- // Now probe whether an implicit constant expression conversion
- // can be used.
- //
- // An implicit constant expression conversion permits the following
- // conversions:
- //
- // * A constant-expression of type `int' can be converted to type
- // sbyte, byute, short, ushort, uint, ulong provided the value of
- // of the expression is withing the range of the destination type.
- //
- // * A constant-expression of type long can be converted to type
- // ulong, provided the value of the constant expression is not negative
- //
- // FIXME: Note that this assumes that constant folding has
- // taken place. We dont do constant folding yet.
- //
-
- if (argument_expr is IntConstant){
- IntConstant ei = (IntConstant) argument_expr;
- int value = ei.Value;
-
- if (p == TypeManager.sbyte_type){
- if (value >= SByte.MinValue && value <= SByte.MaxValue)
- return 1;
- } else if (p == TypeManager.byte_type){
- if (Byte.MinValue >= 0 && value <= Byte.MaxValue)
- return 1;
- } else if (p == TypeManager.short_type){
- if (value >= Int16.MinValue && value <= Int16.MaxValue)
- return 1;
- } else if (p == TypeManager.ushort_type){
- if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
- return 1;
- } else if (p == TypeManager.uint32_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint32
- //
- if (value >= 0)
- return 1;
- } else if (p == TypeManager.uint64_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint64
- //
- if (value >= 0)
- return 1;
- }
- } else if (argument_type == TypeManager.int64_type && argument_expr is LongConstant){
- LongConstant lc = (LongConstant) argument_expr;
-
- if (p == TypeManager.uint64_type){
- if (lc.Value > 0)
- return 1;
- }
- }
-
- if (q == null) {
- Expression tmp = ConvertImplicitStandard (ec, argument_expr, p, loc);
-
- if (tmp != null)
- return 1;
- else
- return 0;
- }
-
- if (StandardConversionExists (p, q) == true &&
- StandardConversionExists (q, p) == false)
- return 1;
-
- if (p == TypeManager.sbyte_type)
- if (q == TypeManager.byte_type || q == TypeManager.ushort_type ||
- q == TypeManager.uint32_type || q == TypeManager.uint64_type)
- return 1;
-
- if (p == TypeManager.short_type)
- if (q == TypeManager.ushort_type || q == TypeManager.uint32_type ||
- q == TypeManager.uint64_type)
- return 1;
-
- if (p == TypeManager.int32_type)
- if (q == TypeManager.uint32_type || q == TypeManager.uint64_type)
- return 1;
-
- if (p == TypeManager.int64_type)
- if (q == TypeManager.uint64_type)
- return 1;
-
- return 0;
- }
-
- /// <summary>
- /// Determines "Better function"
- /// </summary>
- /// <remarks>
- /// and returns an integer indicating :
- /// 0 if candidate ain't better
- /// 1 if candidate is better than the current best match
- /// </remarks>
- static int BetterFunction (EmitContext ec, ArrayList args,
- MethodBase candidate, MethodBase best,
- bool expanded_form, Location loc)
- {
- ParameterData candidate_pd = GetParameterData (candidate);
- ParameterData best_pd;
- int argument_count;
-
-
- if (args == null)
- argument_count = 0;
- else
- argument_count = args.Count;
-
- int cand_count = candidate_pd.Count;
-
- if (cand_count == 0 && argument_count == 0)
- return 1;
-
- if (candidate_pd.ParameterModifier (cand_count - 1) != Parameter.Modifier.PARAMS)
- if (cand_count != argument_count)
- return 0;
-
- if (best == null) {
- int x = 0;
-
- if (argument_count == 0 && cand_count == 1 &&
- candidate_pd.ParameterModifier (cand_count - 1) == Parameter.Modifier.PARAMS)
- return 1;
-
- for (int j = argument_count; j > 0;) {
- j--;
-
- Argument a = (Argument) args [j];
- Type t = candidate_pd.ParameterType (j);
-
- if (candidate_pd.ParameterModifier (j) == Parameter.Modifier.PARAMS)
- if (expanded_form)
- t = t.GetElementType ();
-
- x = BetterConversion (ec, a, t, null, loc);
-
- if (x <= 0)
- break;
- }
-
- if (x > 0)
- return 1;
- else
- return 0;
- }
-
- best_pd = GetParameterData (best);
-
- int rating1 = 0, rating2 = 0;
-
- for (int j = 0; j < argument_count; ++j) {
- int x, y;
-
- Argument a = (Argument) args [j];
-
- Type ct = candidate_pd.ParameterType (j);
- Type bt = best_pd.ParameterType (j);
-
- if (candidate_pd.ParameterModifier (j) == Parameter.Modifier.PARAMS)
- if (expanded_form)
- ct = ct.GetElementType ();
-
- if (best_pd.ParameterModifier (j) == Parameter.Modifier.PARAMS)
- if (expanded_form)
- bt = bt.GetElementType ();
-
- x = BetterConversion (ec, a, ct, bt, loc);
- y = BetterConversion (ec, a, bt, ct, loc);
-
- if (x < y)
- return 0;
-
- rating1 += x;
- rating2 += y;
- }
-
- if (rating1 > rating2)
- return 1;
- else
- return 0;
- }
-
- public static string FullMethodDesc (MethodBase mb)
- {
- string ret_type = "";
-
- if (mb is MethodInfo)
- ret_type = TypeManager.CSharpName (((MethodInfo) mb).ReturnType);
-
- StringBuilder sb = new StringBuilder (ret_type + " " + mb.Name);
- ParameterData pd = GetParameterData (mb);
-
- int count = pd.Count;
- sb.Append (" (");
-
- for (int i = count; i > 0; ) {
- i--;
-
- sb.Append (pd.ParameterDesc (count - i - 1));
- if (i != 0)
- sb.Append (", ");
- }
-
- sb.Append (")");
- return sb.ToString ();
- }
-
- public static MethodGroupExpr MakeUnionSet (Expression mg1, Expression mg2)
- {
- MemberInfo [] miset;
- MethodGroupExpr union;
-
- if (mg1 != null && mg2 != null) {
-
- MethodGroupExpr left_set = null, right_set = null;
- int length1 = 0, length2 = 0;
-
- left_set = (MethodGroupExpr) mg1;
- length1 = left_set.Methods.Length;
-
- right_set = (MethodGroupExpr) mg2;
- length2 = right_set.Methods.Length;
-
- ArrayList common = new ArrayList ();
-
- for (int i = 0; i < left_set.Methods.Length; i++) {
- for (int j = 0; j < right_set.Methods.Length; j++) {
- if (left_set.Methods [i] == right_set.Methods [j])
- common.Add (left_set.Methods [i]);
- }
- }
-
- miset = new MemberInfo [length1 + length2 - common.Count];
-
- left_set.Methods.CopyTo (miset, 0);
-
- int k = 0;
-
- for (int j = 0; j < right_set.Methods.Length; j++)
- if (!common.Contains (right_set.Methods [j]))
- miset [length1 + k++] = right_set.Methods [j];
-
- union = new MethodGroupExpr (miset);
-
- return union;
-
- } else if (mg1 == null && mg2 != null) {
-
- MethodGroupExpr me = (MethodGroupExpr) mg2;
-
- miset = new MemberInfo [me.Methods.Length];
- me.Methods.CopyTo (miset, 0);
-
- union = new MethodGroupExpr (miset);
-
- return union;
-
- } else if (mg2 == null && mg1 != null) {
-
- MethodGroupExpr me = (MethodGroupExpr) mg1;
-
- miset = new MemberInfo [me.Methods.Length];
- me.Methods.CopyTo (miset, 0);
-
- union = new MethodGroupExpr (miset);
-
- return union;
- }
-
- return null;
- }
-
- /// <summary>
- /// Determines is the candidate method, if a params method, is applicable
- /// in its expanded form to the given set of arguments
- /// </summary>
- static bool IsParamsMethodApplicable (ArrayList arguments, MethodBase candidate)
- {
- int arg_count;
-
- if (arguments == null)
- arg_count = 0;
- else
- arg_count = arguments.Count;
-
- ParameterData pd = GetParameterData (candidate);
-
- int pd_count = pd.Count;
-
- if (pd_count == 0)
- return false;
-
- if (pd.ParameterModifier (pd_count - 1) != Parameter.Modifier.PARAMS)
- return false;
-
- if (pd_count - 1 > arg_count)
- return false;
-
- if (pd_count == 1 && arg_count == 0)
- return true;
-
- //
- // If we have come this far, the case which remains is when the number of parameters
- // is less than or equal to the argument count.
-
- for (int i = 0; i < pd_count - 1; ++i) {
-
- Argument a = (Argument) arguments [i];
-
- Parameter.Modifier a_mod = a.GetParameterModifier ();
- Parameter.Modifier p_mod = pd.ParameterModifier (i);
-
- if (a_mod == p_mod) {
-
- if (a_mod == Parameter.Modifier.NONE)
- if (!StandardConversionExists (a.Type, pd.ParameterType (i)))
- return false;
-
- if (a_mod == Parameter.Modifier.REF ||
- a_mod == Parameter.Modifier.OUT)
- if (pd.ParameterType (i) != a.Type)
- return false;
- } else
- return false;
-
- }
-
- Type element_type = pd.ParameterType (pd_count - 1).GetElementType ();
-
- for (int i = pd_count - 1; i < arg_count; i++) {
- Argument a = (Argument) arguments [i];
-
- if (!StandardConversionExists (a.Type, element_type))
- return false;
- }
-
- return true;
- }
-
- /// <summary>
- /// Determines if the candidate method is applicable (section 14.4.2.1)
- /// to the given set of arguments
- /// </summary>
- static bool IsApplicable (ArrayList arguments, MethodBase candidate)
- {
- int arg_count;
-
- if (arguments == null)
- arg_count = 0;
- else
- arg_count = arguments.Count;
-
- ParameterData pd = GetParameterData (candidate);
-
- int pd_count = pd.Count;
-
- if (arg_count != pd.Count)
- return false;
-
- for (int i = arg_count; i > 0; ) {
- i--;
-
- Argument a = (Argument) arguments [i];
-
- Parameter.Modifier a_mod = a.GetParameterModifier ();
- Parameter.Modifier p_mod = pd.ParameterModifier (i);
-
- if (a_mod == p_mod) {
-
- if (a_mod == Parameter.Modifier.NONE)
- if (!StandardConversionExists (a.Type, pd.ParameterType (i)))
- return false;
-
- if (a_mod == Parameter.Modifier.REF ||
- a_mod == Parameter.Modifier.OUT)
- if (pd.ParameterType (i) != a.Type)
- return false;
- } else
- return false;
- }
-
- return true;
- }
-
-
-
- /// <summary>
- /// Find the Applicable Function Members (7.4.2.1)
- ///
- /// me: Method Group expression with the members to select.
- /// it might contain constructors or methods (or anything
- /// that maps to a method).
- ///
- /// Arguments: ArrayList containing resolved Argument objects.
- ///
- /// loc: The location if we want an error to be reported, or a Null
- /// location for "probing" purposes.
- ///
- /// Returns: The MethodBase (either a ConstructorInfo or a MethodInfo)
- /// that is the best match of me on Arguments.
- ///
- /// </summary>
- public static MethodBase OverloadResolve (EmitContext ec, MethodGroupExpr me,
- ArrayList Arguments, Location loc)
- {
- ArrayList afm = new ArrayList ();
- int best_match_idx = -1;
- MethodBase method = null;
- int argument_count;
- ArrayList candidates = new ArrayList ();
-
- for (int i = me.Methods.Length; i > 0; ){
- i--;
- MethodBase candidate = me.Methods [i];
- int x;
-
- // Check if candidate is applicable (section 14.4.2.1)
- if (!IsApplicable (Arguments, candidate))
- continue;
-
- candidates.Add (candidate);
-
- x = BetterFunction (ec, Arguments, candidate, method, false, loc);
-
- if (x == 0)
- continue;
- else {
- best_match_idx = i;
- method = me.Methods [best_match_idx];
- }
- }
-
- if (Arguments == null)
- argument_count = 0;
- else
- argument_count = Arguments.Count;
-
- //
- // Now we see if we can find params functions, applicable in their expanded form
- // since if they were applicable in their normal form, they would have been selected
- // above anyways
- //
- bool chose_params_expanded = false;
-
- if (best_match_idx == -1) {
-
- candidates = new ArrayList ();
- for (int i = me.Methods.Length; i > 0; ) {
- i--;
- MethodBase candidate = me.Methods [i];
-
- if (!IsParamsMethodApplicable (Arguments, candidate))
- continue;
-
- candidates.Add (candidate);
-
- int x = BetterFunction (ec, Arguments, candidate, method, true, loc);
-
- if (x == 0)
- continue;
- else {
- best_match_idx = i;
- method = me.Methods [best_match_idx];
- chose_params_expanded = true;
- }
- }
- }
-
- //
- // Now we see if we can at least find a method with the same number of arguments
- //
- ParameterData pd;
- int method_count = 0;
-
- if (best_match_idx == -1) {
-
- for (int i = me.Methods.Length; i > 0;) {
- i--;
- MethodBase mb = me.Methods [i];
- pd = GetParameterData (mb);
-
- if (pd.Count == argument_count) {
- best_match_idx = i;
- method = me.Methods [best_match_idx];
- method_count++;
- } else
- continue;
- }
- }
-
- if (method == null)
- return null;
-
-
- //
- // Now check that there are no ambiguities i.e the selected method
- // should be better than all the others
- //
-
- for (int i = 0; i < candidates.Count; ++i) {
- MethodBase candidate = (MethodBase) candidates [i];
-
- if (candidate == method)
- continue;
-
- //
- // If a normal method is applicable in the sense that it has the same
- // number of arguments, then the expanded params method is never applicable
- // so we debar the params method.
- //
- if (IsParamsMethodApplicable (Arguments, candidate) &&
- IsApplicable (Arguments, method))
- continue;
-
- int x = BetterFunction (ec, Arguments, method, candidate,
- chose_params_expanded, loc);
-
- if (x != 1) {
- //Console.WriteLine ("Candidate : " + FullMethodDesc (candidate));
- //Console.WriteLine ("Best : " + FullMethodDesc (method));
- Report.Error (
- 121, loc,
- "Ambiguous call when selecting function due to implicit casts");
- return null;
- }
- }
-
- // And now convert implicitly, each argument to the required type
-
- pd = GetParameterData (method);
- int pd_count = pd.Count;
-
- for (int j = 0; j < argument_count; j++) {
- Argument a = (Argument) Arguments [j];
- Expression a_expr = a.Expr;
- Type parameter_type = pd.ParameterType (j);
-
- if (pd.ParameterModifier (j) == Parameter.Modifier.PARAMS && chose_params_expanded)
- parameter_type = parameter_type.GetElementType ();
-
- if (a.Type != parameter_type){
- Expression conv;
-
- conv = ConvertImplicitStandard (ec, a_expr, parameter_type, Location.Null);
-
- if (conv == null) {
- if (!Location.IsNull (loc)) {
- Error (1502, loc,
- "The best overloaded match for method '" +
- FullMethodDesc (method) +
- "' has some invalid arguments");
- Error (1503, loc,
- "Argument " + (j+1) +
- ": Cannot convert from '" + Argument.FullDesc (a)
- + "' to '" + pd.ParameterDesc (j) + "'");
- }
- return null;
- }
-
- //
- // Update the argument with the implicit conversion
- //
- if (a_expr != conv)
- a.Expr = conv;
-
- // FIXME : For the case of params methods, we need to actually instantiate
- // an array and initialize it with the argument values etc etc.
-
- }
-
- if (a.GetParameterModifier () != pd.ParameterModifier (j) &&
- pd.ParameterModifier (pd_count - 1) != Parameter.Modifier.PARAMS) {
- if (!Location.IsNull (loc)) {
- Console.WriteLine ("A:P: " + a.GetParameterModifier ());
- Console.WriteLine ("PP:: " + pd.ParameterModifier (j));
- Console.WriteLine ("PT: " + parameter_type.IsByRef);
- Error (1502, loc,
- "The best overloaded match for method '" + FullMethodDesc (method)+
- "' has some invalid arguments");
- Error (1503, loc,
- "Argument " + (j+1) +
- ": Cannot convert from '" + Argument.FullDesc (a)
- + "' to '" + pd.ParameterDesc (j) + "'");
- }
- return null;
- }
- }
-
- return method;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // First, resolve the expression that is used to
- // trigger the invocation
- //
- if (expr is BaseAccess)
- is_base = true;
-
- expr = expr.Resolve (ec);
- if (expr == null)
- return null;
-
- if (!(expr is MethodGroupExpr)) {
- Type expr_type = expr.Type;
-
- if (expr_type != null){
- bool IsDelegate = TypeManager.IsDelegateType (expr_type);
- if (IsDelegate)
- return (new DelegateInvocation (
- this.expr, Arguments, loc)).Resolve (ec);
- }
- }
-
- if (!(expr is MethodGroupExpr)){
- report118 (loc, this.expr, "method group");
- return null;
- }
-
- //
- // Next, evaluate all the expressions in the argument list
- //
- if (Arguments != null){
- for (int i = Arguments.Count; i > 0;){
- --i;
- Argument a = (Argument) Arguments [i];
-
- if (!a.Resolve (ec, loc))
- return null;
- }
- }
-
- method = OverloadResolve (ec, (MethodGroupExpr) this.expr, Arguments, loc);
-
- if (method == null){
- Error (-6, loc,
- "Could not find any applicable function for this argument list");
- return null;
- }
-
- if (method is MethodInfo)
- type = ((MethodInfo)method).ReturnType;
-
- if (type.IsPointer){
- if (!ec.InUnsafe){
- UnsafeError (loc);
- return null;
- }
- }
-
- eclass = ExprClass.Value;
- return this;
- }
-
- // <summary>
- // Emits the list of arguments as an array
- // </summary>
- static void EmitParams (EmitContext ec, int idx, ArrayList arguments)
- {
- ILGenerator ig = ec.ig;
- int count = arguments.Count - idx;
- Argument a = (Argument) arguments [idx];
- Type t = a.expr.Type;
- string array_type = t.FullName + "[]";
- LocalBuilder array;
-
- array = ig.DeclareLocal (Type.GetType (array_type));
- IntConstant.EmitInt (ig, count);
- ig.Emit (OpCodes.Newarr, t);
- ig.Emit (OpCodes.Stloc, array);
-
- int top = arguments.Count;
- for (int j = idx; j < top; j++){
- a = (Argument) arguments [j];
-
- ig.Emit (OpCodes.Ldloc, array);
- IntConstant.EmitInt (ig, j - idx);
- a.Emit (ec);
-
- ArrayAccess.EmitStoreOpcode (ig, t);
- }
- ig.Emit (OpCodes.Ldloc, array);
- }
-
- /// <summary>
- /// Emits a list of resolved Arguments that are in the arguments
- /// ArrayList.
- ///
- /// The MethodBase argument might be null if the
- /// emission of the arguments is known not to contain
- /// a `params' field (for example in constructors or other routines
- /// that keep their arguments in this structure
- /// </summary>
- public static void EmitArguments (EmitContext ec, MethodBase mb, ArrayList arguments)
- {
- ParameterData pd = null;
- int top;
-
- if (arguments != null)
- top = arguments.Count;
- else
- top = 0;
-
- if (mb != null)
- pd = GetParameterData (mb);
-
- for (int i = 0; i < top; i++){
- Argument a = (Argument) arguments [i];
-
- if (pd != null){
- if (pd.ParameterModifier (i) == Parameter.Modifier.PARAMS){
- EmitParams (ec, i, arguments);
- return;
- }
- }
-
- a.Emit (ec);
- }
- }
-
- /// <remarks>
- /// is_base tells whether we want to force the use of the `call'
- /// opcode instead of using callvirt. Call is required to call
- /// a specific method, while callvirt will always use the most
- /// recent method in the vtable.
- ///
- /// is_static tells whether this is an invocation on a static method
- ///
- /// instance_expr is an expression that represents the instance
- /// it must be non-null if is_static is false.
- ///
- /// method is the method to invoke.
- ///
- /// Arguments is the list of arguments to pass to the method or constructor.
- /// </remarks>
- public static void EmitCall (EmitContext ec, bool is_base,
- bool is_static, Expression instance_expr,
- MethodBase method, ArrayList Arguments)
- {
- ILGenerator ig = ec.ig;
- bool struct_call = false;
-
- if (!is_static){
-
- if (method.DeclaringType.IsValueType)
- struct_call = true;
- //
- // If this is ourselves, push "this"
- //
- if (instance_expr == null){
- ig.Emit (OpCodes.Ldarg_0);
- } else {
- //
- // Push the instance expression
- //
- if (instance_expr.Type.IsSubclassOf (TypeManager.value_type)){
- //
- // Special case: calls to a function declared in a
- // reference-type with a value-type argument need
- // to have their value boxed.
-
- struct_call = true;
- if (method.DeclaringType.IsValueType){
- //
- // If the expression implements IMemoryLocation, then
- // we can optimize and use AddressOf on the
- // return.
- //
- // If not we have to use some temporary storage for
- // it.
- if (instance_expr is IMemoryLocation){
- ((IMemoryLocation)instance_expr).
- AddressOf (ec);
- }
- else {
- Type t = instance_expr.Type;
-
- instance_expr.Emit (ec);
- LocalBuilder temp = ig.DeclareLocal (t);
- ig.Emit (OpCodes.Stloc, temp);
- ig.Emit (OpCodes.Ldloca, temp);
- }
- } else {
- instance_expr.Emit (ec);
- ig.Emit (OpCodes.Box, instance_expr.Type);
- }
- } else
- instance_expr.Emit (ec);
- }
- }
-
- if (Arguments != null)
- EmitArguments (ec, method, Arguments);
-
- if (is_static || struct_call || is_base){
- if (method is MethodInfo)
- ig.Emit (OpCodes.Call, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
- } else {
- if (method is MethodInfo)
- ig.Emit (OpCodes.Callvirt, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Callvirt, (ConstructorInfo) method);
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- MethodGroupExpr mg = (MethodGroupExpr) this.expr;
-
- EmitCall (ec, is_base, method.IsStatic, mg.InstanceExpression, method, Arguments);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- Emit (ec);
-
- //
- // Pop the return value if there is one
- //
- if (method is MethodInfo){
- if (((MethodInfo)method).ReturnType != TypeManager.void_type)
- ec.ig.Emit (OpCodes.Pop);
- }
- }
- }
-
- /// <summary>
- /// Implements the new expression
- /// </summary>
- public class New : ExpressionStatement {
- public readonly ArrayList Arguments;
- public readonly string RequestedType;
-
- Location loc;
- MethodBase method = null;
-
- //
- // If set, the new expression is for a value_target, and
- // we will not leave anything on the stack.
- //
- Expression value_target;
-
- public New (string requested_type, ArrayList arguments, Location l)
- {
- RequestedType = requested_type;
- Arguments = arguments;
- loc = l;
- }
-
- public Expression ValueTypeVariable {
- get {
- return value_target;
- }
-
- set {
- value_target = value;
- }
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = RootContext.LookupType (ec.TypeContainer, RequestedType, false, loc);
-
- if (type == null)
- return null;
-
- bool IsDelegate = TypeManager.IsDelegateType (type);
-
- if (IsDelegate)
- return (new NewDelegate (type, Arguments, loc)).Resolve (ec);
-
- bool is_struct = false;
- is_struct = type.IsSubclassOf (TypeManager.value_type);
- eclass = ExprClass.Value;
-
- //
- // SRE returns a match for .ctor () on structs (the object constructor),
- // so we have to manually ignore it.
- //
- if (is_struct && Arguments == null)
- return this;
-
- Expression ml;
- ml = MemberLookup (ec, type, ".ctor", MemberTypes.Constructor, AllBindingFlags, loc);
-
- if (! (ml is MethodGroupExpr)){
- if (!is_struct){
- report118 (loc, ml, "method group");
- return null;
- }
- }
-
- if (ml != null) {
- if (Arguments != null){
- for (int i = Arguments.Count; i > 0;){
- --i;
- Argument a = (Argument) Arguments [i];
-
- if (!a.Resolve (ec, loc))
- return null;
- }
- }
-
- method = Invocation.OverloadResolve (ec, (MethodGroupExpr) ml,
- Arguments, loc);
-
- }
-
- if (method == null && !is_struct) {
- Error (-6, loc,
- "New invocation: Can not find a constructor for " +
- "this argument list");
- return null;
- }
- return this;
- }
-
- //
- // This DoEmit can be invoked in two contexts:
- // * As a mechanism that will leave a value on the stack (new object)
- // * As one that wont (init struct)
- //
- // You can control whether a value is required on the stack by passing
- // need_value_on_stack. The code *might* leave a value on the stack
- // so it must be popped manually
- //
- // If we are dealing with a ValueType, we have a few
- // situations to deal with:
- //
- // * The target is a ValueType, and we have been provided
- // the instance (this is easy, we are being assigned).
- //
- // * The target of New is being passed as an argument,
- // to a boxing operation or a function that takes a
- // ValueType.
- //
- // In this case, we need to create a temporary variable
- // that is the argument of New.
- //
- // Returns whether a value is left on the stack
- //
- bool DoEmit (EmitContext ec, bool need_value_on_stack)
- {
- bool is_value_type = type.IsSubclassOf (TypeManager.value_type);
- ILGenerator ig = ec.ig;
-
- if (is_value_type){
- IMemoryLocation ml;
-
- if (value_target == null)
- value_target = new LocalTemporary (ec, type);
-
- ml = (IMemoryLocation) value_target;
- ml.AddressOf (ec);
- }
-
- if (method != null)
- Invocation.EmitArguments (ec, method, Arguments);
-
- if (is_value_type){
- if (method == null)
- ig.Emit (OpCodes.Initobj, type);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
-
- if (need_value_on_stack){
- value_target.Emit (ec);
- return true;
- }
- return false;
- } else {
- ig.Emit (OpCodes.Newobj, (ConstructorInfo) method);
- return true;
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- DoEmit (ec, true);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- if (DoEmit (ec, false))
- ec.ig.Emit (OpCodes.Pop);
- }
- }
-
- /// <summary>
- /// Represents an array creation expression.
- /// </summary>
- ///
- /// <remarks>
- /// There are two possible scenarios here: one is an array creation
- /// expression that specifies the dimensions and optionally the
- /// initialization data and the other which does not need dimensions
- /// specified but where initialization data is mandatory.
- /// </remarks>
- public class ArrayCreation : ExpressionStatement {
- string RequestedType;
- string Rank;
- ArrayList Initializers;
- Location loc;
- ArrayList Arguments;
-
- MethodBase method = null;
- Type array_element_type;
- bool IsOneDimensional = false;
- bool IsBuiltinType = false;
- bool ExpectInitializers = false;
-
- int dimensions = 0;
- Type underlying_type;
-
- ArrayList ArrayData;
-
- Hashtable Bounds;
-
- //
- // The number of array initializers that we can handle
- // via the InitializeArray method - through EmitStaticInitializers
- //
- int num_automatic_initializers;
-
- public ArrayCreation (string requested_type, ArrayList exprs,
- string rank, ArrayList initializers, Location l)
- {
- RequestedType = requested_type;
- Rank = rank;
- Initializers = initializers;
- loc = l;
-
- Arguments = new ArrayList ();
-
- foreach (Expression e in exprs)
- Arguments.Add (new Argument (e, Argument.AType.Expression));
- }
-
- public ArrayCreation (string requested_type, string rank, ArrayList initializers, Location l)
- {
- RequestedType = requested_type;
- Initializers = initializers;
- loc = l;
-
- Rank = rank.Substring (0, rank.LastIndexOf ("["));
-
- string tmp = rank.Substring (rank.LastIndexOf ("["));
-
- dimensions = tmp.Length - 1;
- ExpectInitializers = true;
- }
-
- public static string FormArrayType (string base_type, int idx_count, string rank)
- {
- StringBuilder sb = new StringBuilder (base_type);
-
- sb.Append (rank);
-
- sb.Append ("[");
- for (int i = 1; i < idx_count; i++)
- sb.Append (",");
-
- sb.Append ("]");
-
- return sb.ToString ();
- }
-
- public static string FormElementType (string base_type, int idx_count, string rank)
- {
- StringBuilder sb = new StringBuilder (base_type);
-
- sb.Append ("[");
- for (int i = 1; i < idx_count; i++)
- sb.Append (",");
-
- sb.Append ("]");
-
- sb.Append (rank);
-
- string val = sb.ToString ();
-
- return val.Substring (0, val.LastIndexOf ("["));
- }
-
- void error178 ()
- {
- Report.Error (178, loc, "Incorrectly structured array initializer");
- }
-
- public bool CheckIndices (EmitContext ec, ArrayList probe, int idx, bool specified_dims)
- {
- if (specified_dims) {
- Argument a = (Argument) Arguments [idx];
-
- if (!a.Resolve (ec, loc))
- return false;
-
- if (!(a.Expr is Constant)) {
- Report.Error (150, loc, "A constant value is expected");
- return false;
- }
-
- int value = (int) ((Constant) a.Expr).GetValue ();
-
- if (value != probe.Count) {
- error178 ();
- return false;
- }
-
- Bounds [idx] = value;
- }
-
- foreach (object o in probe) {
- if (o is ArrayList) {
- bool ret = CheckIndices (ec, (ArrayList) o, idx + 1, specified_dims);
- if (!ret)
- return false;
- } else {
- Expression tmp = (Expression) o;
- tmp = tmp.Resolve (ec);
- if (tmp == null)
- continue;
-
- // Handle initialization from vars, fields etc.
-
- Expression conv = ConvertImplicitRequired (
- ec, tmp, underlying_type, loc);
-
- if (conv == null)
- return false;
-
- if (conv is StringConstant)
- ArrayData.Add (conv);
- else if (conv is Constant) {
- ArrayData.Add (conv);
- num_automatic_initializers++;
- } else
- ArrayData.Add (conv);
- }
- }
-
- return true;
- }
-
- public void UpdateIndices (EmitContext ec)
- {
- int i = 0;
- for (ArrayList probe = Initializers; probe != null;) {
- if (probe.Count > 0 && probe [0] is ArrayList) {
- Expression e = new IntConstant (probe.Count);
- Arguments.Add (new Argument (e, Argument.AType.Expression));
-
- Bounds [i++] = probe.Count;
-
- probe = (ArrayList) probe [0];
-
- } else {
- Expression e = new IntConstant (probe.Count);
- Arguments.Add (new Argument (e, Argument.AType.Expression));
-
- Bounds [i++] = probe.Count;
- probe = null;
- }
- }
-
- }
-
- public bool ValidateInitializers (EmitContext ec)
- {
- if (Initializers == null) {
- if (ExpectInitializers)
- return false;
- else
- return true;
- }
-
- underlying_type = RootContext.LookupType (
- ec.TypeContainer, RequestedType, false, loc);
-
- //
- // We use this to store all the date values in the order in which we
- // will need to store them in the byte blob later
- //
- ArrayData = new ArrayList ();
- Bounds = new Hashtable ();
-
- bool ret;
-
- if (Arguments != null) {
- ret = CheckIndices (ec, Initializers, 0, true);
- return ret;
-
- } else {
- Arguments = new ArrayList ();
-
- ret = CheckIndices (ec, Initializers, 0, false);
-
- if (!ret)
- return false;
-
- UpdateIndices (ec);
-
- if (Arguments.Count != dimensions) {
- error178 ();
- return false;
- }
-
- return ret;
- }
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- int arg_count;
-
- //
- // First step is to validate the initializers and fill
- // in any missing bits
- //
- if (!ValidateInitializers (ec))
- return null;
-
- if (Arguments == null)
- arg_count = 0;
- else {
- arg_count = Arguments.Count;
- for (int i = arg_count; i > 0;){
- --i;
- Argument a = (Argument) Arguments [i];
-
- if (!a.Resolve (ec, loc))
- return null;
- }
- }
-
- string array_type = FormArrayType (RequestedType, arg_count, Rank);
- string element_type = FormElementType (RequestedType, arg_count, Rank);
-
- type = RootContext.LookupType (ec.TypeContainer, array_type, false, loc);
-
- array_element_type = RootContext.LookupType (
- ec.TypeContainer, element_type, false, loc);
-
- if (type == null)
- return null;
-
- if (arg_count == 1) {
- IsOneDimensional = true;
- eclass = ExprClass.Value;
- return this;
- }
-
- IsBuiltinType = TypeManager.IsBuiltinType (type);
-
- if (IsBuiltinType) {
-
- Expression ml;
-
- ml = MemberLookup (ec, type, ".ctor", MemberTypes.Constructor,
- AllBindingFlags, loc);
-
- if (!(ml is MethodGroupExpr)){
- report118 (loc, ml, "method group");
- return null;
- }
-
- if (ml == null) {
- Report.Error (-6, loc, "New invocation: Can not find a constructor for " +
- "this argument list");
- return null;
- }
-
- method = Invocation.OverloadResolve (ec, (MethodGroupExpr) ml, Arguments, loc);
-
- if (method == null) {
- Report.Error (-6, loc, "New invocation: Can not find a constructor for " +
- "this argument list");
- return null;
- }
-
- eclass = ExprClass.Value;
- return this;
-
- } else {
-
- ModuleBuilder mb = RootContext.ModuleBuilder;
-
- ArrayList args = new ArrayList ();
- if (Arguments != null){
- for (int i = arg_count; i > 0;){
- --i;
- Argument a = (Argument) Arguments [i];
-
- args.Add (a.Type);
- }
- }
-
- Type [] arg_types = null;
-
- if (args.Count > 0)
- arg_types = new Type [args.Count];
-
- args.CopyTo (arg_types, 0);
-
- method = mb.GetArrayMethod (type, ".ctor", CallingConventions.HasThis, null,
- arg_types);
-
- if (method == null) {
- Report.Error (-6, loc, "New invocation: Can not find a constructor for " +
- "this argument list");
- return null;
- }
-
- eclass = ExprClass.Value;
- return this;
-
- }
- }
-
- public static byte [] MakeByteBlob (ArrayList ArrayData, Type underlying_type, Location loc)
- {
- int factor;
- byte [] data;
-
- int count = ArrayData.Count;
-
- factor = GetTypeSize (underlying_type);
- if (factor == 0)
- return null;
-
- data = new byte [(count * factor + 4) & ~3];
- int idx = 0;
-
- for (int i = 0; i < count; ++i) {
- object v = ArrayData [i];
-
- if (v is EnumConstant)
- v = ((EnumConstant) v).Child;
-
- if (v is Constant && !(v is StringConstant))
- v = ((Constant) v).GetValue ();
- else {
- idx += factor;
- continue;
- }
-
- if (underlying_type == TypeManager.int64_type){
- if (!(v is Expression)){
- long val = (long) v;
-
- for (int j = 0; j < factor; ++j) {
- data [idx + j] = (byte) (val & 0xFF);
- val = (val >> 8);
- }
- }
- } else if (underlying_type == TypeManager.uint64_type){
- if (!(v is Expression)){
- ulong val = (ulong) v;
-
- for (int j = 0; j < factor; ++j) {
- data [idx + j] = (byte) (val & 0xFF);
- val = (val >> 8);
- }
- }
- } else if (underlying_type == TypeManager.float_type) {
- unsafe {
- if (!(v is Expression)){
- float val = (float) v;
-
- byte *ptr = (byte *) &val;
-
- for (int j = 0; j < factor; ++j)
- data [idx + j] = (byte) ptr [j];
- }
- }
- } else if (underlying_type == TypeManager.double_type) {
- unsafe {
- if (!(v is Expression)){
- double val = (double) v;
-
- byte *ptr = (byte *) &val;
-
- for (int j = 0; j < factor; ++j)
- data [idx + j] = (byte) ptr [j];
- }
- }
- } else if (underlying_type == TypeManager.char_type){
-
- if (!(v is Expression)){
- int val = (int) ((char) v);
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) (val >> 8);
- }
- } else if (underlying_type == TypeManager.short_type){
- if (!(v is Expression)){
- int val = (int) ((short) v);
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) (val >> 8);
- }
- } else if (underlying_type == TypeManager.ushort_type){
- if (!(v is Expression)){
- int val = (int) ((ushort) v);
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) (val >> 8);
- }
- } else if (underlying_type == TypeManager.int32_type) {
- if (!(v is Expression)){
- int val = (int) v;
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) ((val >> 8) & 0xff);
- data [idx+2] = (byte) ((val >> 16) & 0xff);
- data [idx+3] = (byte) (val >> 24);
- }
- } else if (underlying_type == TypeManager.uint32_type) {
- if (!(v is Expression)){
- uint val = (uint) v;
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) ((val >> 8) & 0xff);
- data [idx+2] = (byte) ((val >> 16) & 0xff);
- data [idx+3] = (byte) (val >> 24);
- }
- } else if (underlying_type == TypeManager.sbyte_type) {
- if (!(v is Expression)){
- sbyte val = (sbyte) v;
- data [idx] = (byte) val;
- }
- } else if (underlying_type == TypeManager.byte_type) {
- if (!(v is Expression)){
- byte val = (byte) v;
- data [idx] = (byte) val;
- }
- } else
- throw new Exception ("Unrecognized type in MakeByteBlob");
-
- idx += factor;
- }
-
- return data;
- }
-
- //
- // Emits the initializers for the array
- //
- void EmitStaticInitializers (EmitContext ec, bool is_expression)
- {
- //
- // First, the static data
- //
- FieldBuilder fb;
- ILGenerator ig = ec.ig;
-
- byte [] data = MakeByteBlob (ArrayData, underlying_type, loc);
-
- if (data != null) {
- fb = RootContext.MakeStaticData (data);
-
- if (is_expression)
- ig.Emit (OpCodes.Dup);
- ig.Emit (OpCodes.Ldtoken, fb);
- ig.Emit (OpCodes.Call,
- TypeManager.void_initializearray_array_fieldhandle);
- }
- }
-
- //
- // Emits pieces of the array that can not be computed at compile
- // time (variables and string locations).
- //
- // This always expect the top value on the stack to be the array
- //
- void EmitDynamicInitializers (EmitContext ec, bool is_expression)
- {
- ILGenerator ig = ec.ig;
- int dims = Bounds.Count;
- int [] current_pos = new int [dims];
- int top = ArrayData.Count;
- LocalBuilder temp = ig.DeclareLocal (type);
-
- ig.Emit (OpCodes.Stloc, temp);
-
- MethodInfo set = null;
-
- if (dims != 1){
- Type [] args;
- ModuleBuilder mb = null;
- mb = RootContext.ModuleBuilder;
- args = new Type [dims + 1];
-
- int j;
- for (j = 0; j < dims; j++)
- args [j] = TypeManager.int32_type;
-
- args [j] = array_element_type;
-
- set = mb.GetArrayMethod (
- type, "Set",
- CallingConventions.HasThis | CallingConventions.Standard,
- TypeManager.void_type, args);
- }
-
- for (int i = 0; i < top; i++){
-
- Expression e = null;
-
- if (ArrayData [i] is Expression)
- e = (Expression) ArrayData [i];
-
- if (e != null) {
- //
- // Basically we do this for string literals and
- // other non-literal expressions
- //
- if (e is StringConstant || !(e is Constant) || num_automatic_initializers <= 2) {
-
- ig.Emit (OpCodes.Ldloc, temp);
-
- for (int idx = dims; idx > 0; ) {
- idx--;
- IntConstant.EmitInt (ig, current_pos [idx]);
- }
-
- e.Emit (ec);
-
- if (dims == 1)
- ArrayAccess.EmitStoreOpcode (ig, array_element_type);
- else
- ig.Emit (OpCodes.Call, set);
-
- }
- }
-
- //
- // Advance counter
- //
- for (int j = 0; j < dims; j++){
- current_pos [j]++;
- if (current_pos [j] < (int) Bounds [j])
- break;
- current_pos [j] = 0;
- }
- }
-
- if (is_expression)
- ig.Emit (OpCodes.Ldloc, temp);
- }
-
- void DoEmit (EmitContext ec, bool is_statement)
- {
- ILGenerator ig = ec.ig;
-
- if (IsOneDimensional) {
- Invocation.EmitArguments (ec, null, Arguments);
- ig.Emit (OpCodes.Newarr, array_element_type);
-
- } else {
- Invocation.EmitArguments (ec, null, Arguments);
-
- if (IsBuiltinType)
- ig.Emit (OpCodes.Newobj, (ConstructorInfo) method);
- else
- ig.Emit (OpCodes.Newobj, (MethodInfo) method);
- }
-
- if (Initializers != null){
- //
- // FIXME: Set this variable correctly.
- //
- bool dynamic_initializers = true;
-
- if (underlying_type != TypeManager.string_type &&
- underlying_type != TypeManager.object_type) {
- if (num_automatic_initializers > 2)
- EmitStaticInitializers (ec, dynamic_initializers || !is_statement);
- }
-
- if (dynamic_initializers)
- EmitDynamicInitializers (ec, !is_statement);
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- DoEmit (ec, false);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- DoEmit (ec, true);
- }
-
- }
-
- /// <summary>
- /// Represents the `this' construct
- /// </summary>
- public class This : Expression, IAssignMethod, IMemoryLocation {
- Location loc;
-
- public This (Location loc)
- {
- this.loc = loc;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- eclass = ExprClass.Variable;
- type = ec.TypeContainer.TypeBuilder;
-
- if (ec.IsStatic){
- Report.Error (26, loc,
- "Keyword this not valid in static code");
- return null;
- }
-
- return this;
- }
-
- override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- DoResolve (ec);
-
- if (ec.TypeContainer is Class){
- Report.Error (1604, loc, "Cannot assign to `this'");
- return null;
- }
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldarg_0);
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- source.Emit (ec);
- ec.ig.Emit (OpCodes.Starg, 0);
- }
-
- public void AddressOf (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldarg_0);
-
- // FIMXE
- // FIGURE OUT WHY LDARG_S does not work
- //
- // consider: struct X { int val; int P { set { val = value; }}}
- //
- // Yes, this looks very bad. Look at `NOTAS' for
- // an explanation.
- // ec.ig.Emit (OpCodes.Ldarga_S, (byte) 0);
- }
- }
-
- /// <summary>
- /// Implements the typeof operator
- /// </summary>
- public class TypeOf : Expression {
- public readonly string QueriedType;
- Type typearg;
- Location loc;
-
- public TypeOf (string queried_type, Location l)
- {
- QueriedType = queried_type;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- typearg = RootContext.LookupType (
- ec.TypeContainer, QueriedType, false, loc);
-
- if (typearg == null)
- return null;
-
- type = TypeManager.type_type;
- eclass = ExprClass.Type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldtoken, typearg);
- ec.ig.Emit (OpCodes.Call, TypeManager.system_type_get_type_from_handle);
- }
- }
-
- /// <summary>
- /// Implements the sizeof expression
- /// </summary>
- public class SizeOf : Expression {
- public readonly string QueriedType;
- Type type_queried;
- Location loc;
-
- public SizeOf (string queried_type, Location l)
- {
- this.QueriedType = queried_type;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type_queried = RootContext.LookupType (
- ec.TypeContainer, QueriedType, false, loc);
- if (type_queried == null)
- return null;
-
- type = TypeManager.int32_type;
- eclass = ExprClass.Value;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- int size = GetTypeSize (type_queried);
-
- if (size == 0)
- ec.ig.Emit (OpCodes.Sizeof, type_queried);
- else
- IntConstant.EmitInt (ec.ig, size);
- }
- }
-
- /// <summary>
- /// Implements the member access expression
- /// </summary>
- public class MemberAccess : Expression {
- public readonly string Identifier;
- Expression expr;
- Expression member_lookup;
- Location loc;
-
- public MemberAccess (Expression expr, string id, Location l)
- {
- this.expr = expr;
- Identifier = id;
- loc = l;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- }
-
- static void error176 (Location loc, string name)
- {
- Report.Error (176, loc, "Static member `" +
- name + "' cannot be accessed " +
- "with an instance reference, qualify with a " +
- "type name instead");
- }
-
- static bool IdenticalNameAndTypeName (EmitContext ec, Expression left_original, Location loc)
- {
- if (left_original == null)
- return false;
-
- if (!(left_original is SimpleName))
- return false;
-
- SimpleName sn = (SimpleName) left_original;
-
- Type t = RootContext.LookupType (ec.TypeContainer, sn.Name, true, loc);
- if (t != null)
- return true;
-
- return false;
- }
-
- public static Expression ResolveMemberAccess (EmitContext ec, Expression member_lookup,
- Expression left, Location loc,
- Expression left_original)
- {
- //
- // Method Groups
- //
- if (member_lookup is MethodGroupExpr){
- MethodGroupExpr mg = (MethodGroupExpr) member_lookup;
-
- //
- // Type.MethodGroup
- //
- if (left is TypeExpr){
- if (!mg.RemoveInstanceMethods ()){
- SimpleName.Error120 (loc, mg.Methods [0].Name);
- return null;
- }
-
- return member_lookup;
- }
-
- //
- // Instance.MethodGroup
- //
- if (IdenticalNameAndTypeName (ec, left_original, loc)){
- if (mg.RemoveInstanceMethods ())
- return member_lookup;
- }
-
- if (!mg.RemoveStaticMethods ()){
- error176 (loc, mg.Methods [0].Name);
- return null;
- }
-
- mg.InstanceExpression = left;
- return member_lookup;
-#if ORIGINAL
- if (!mg.RemoveStaticMethods ()){
- if (IdenticalNameAndTypeName (ec, left_original, loc)){
- if (!mg.RemoveInstanceMethods ()){
- SimpleName.Error120 (loc, mg.Methods [0].Name);
- return null;
- }
- return member_lookup;
- }
-
- error176 (loc, mg.Methods [0].Name);
- return null;
- }
-
- mg.InstanceExpression = left;
-
- return member_lookup;
-#endif
- }
-
- if (member_lookup is FieldExpr){
- FieldExpr fe = (FieldExpr) member_lookup;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi is FieldBuilder) {
- Const c = TypeManager.LookupConstant ((FieldBuilder) fi);
-
- if (c != null) {
- object o = c.LookupConstantValue (ec);
- object real_value = ((Constant) c.Expr).GetValue ();
-
- return Constantify (real_value, fi.FieldType);
- }
- }
-
- if (fi.IsLiteral) {
- Type t = fi.FieldType;
- Type decl_type = fi.DeclaringType;
- object o;
-
- if (fi is FieldBuilder)
- o = TypeManager.GetValue ((FieldBuilder) fi);
- else
- o = fi.GetValue (fi);
-
- if (decl_type.IsSubclassOf (TypeManager.enum_type)) {
- Expression enum_member = MemberLookup (
- ec, decl_type, "value__", MemberTypes.Field,
- AllBindingFlags, loc);
-
- Enum en = TypeManager.LookupEnum (decl_type);
-
- Constant c;
- if (en != null)
- c = Constantify (o, en.UnderlyingType);
- else
- c = Constantify (o, enum_member.Type);
-
- return new EnumConstant (c, decl_type);
- }
-
- Expression exp = Constantify (o, t);
-
- if (!(left is TypeExpr)) {
- error176 (loc, fe.FieldInfo.Name);
- return null;
- }
-
- return exp;
- }
-
- if (fi.FieldType.IsPointer && !ec.InUnsafe){
- UnsafeError (loc);
- return null;
- }
-
- if (left is TypeExpr){
- // and refers to a type name or an
- if (!fe.FieldInfo.IsStatic){
- error176 (loc, fe.FieldInfo.Name);
- return null;
- }
- return member_lookup;
- } else {
- if (fe.FieldInfo.IsStatic){
- if (IdenticalNameAndTypeName (ec, left_original, loc))
- return member_lookup;
-
- error176 (loc, fe.FieldInfo.Name);
- return null;
- }
- fe.InstanceExpression = left;
-
- return fe;
- }
- }
-
- if (member_lookup is PropertyExpr){
- PropertyExpr pe = (PropertyExpr) member_lookup;
-
- if (left is TypeExpr){
- if (!pe.IsStatic){
- SimpleName.Error120 (loc, pe.PropertyInfo.Name);
- return null;
- }
- return pe;
- } else {
- if (pe.IsStatic){
- if (IdenticalNameAndTypeName (ec, left_original, loc))
- return member_lookup;
- error176 (loc, pe.PropertyInfo.Name);
- return null;
- }
- pe.InstanceExpression = left;
-
- return pe;
- }
- }
-
- if (member_lookup is EventExpr) {
-
- EventExpr ee = (EventExpr) member_lookup;
-
- //
- // If the event is local to this class, we transform ourselves into
- // a FieldExpr
- //
-
- Expression ml = MemberLookup (
- ec, ec.TypeContainer.TypeBuilder,
- ee.EventInfo.Name, MemberTypes.Event, AllBindingFlags, loc);
-
- if (ml != null) {
- MemberInfo mi = ec.TypeContainer.GetFieldFromEvent ((EventExpr) ml);
-
- if (mi == null) {
- //
- // If this happens, then we have an event with its own
- // accessors and private field etc so there's no need
- // to transform ourselves : we should instead flag an error
- //
- Assign.error70 (ee.EventInfo, loc);
- return null;
- }
-
- ml = ExprClassFromMemberInfo (ec, mi, loc);
-
- if (ml == null) {
- Report.Error (-200, loc, "Internal error!!");
- return null;
- }
- return ResolveMemberAccess (ec, ml, left, loc, left_original);
- }
-
- if (left is TypeExpr) {
- if (!ee.IsStatic) {
- SimpleName.Error120 (loc, ee.EventInfo.Name);
- return null;
- }
-
- return ee;
-
- } else {
- if (ee.IsStatic) {
- if (IdenticalNameAndTypeName (ec, left_original, loc))
- return ee;
-
- error176 (loc, ee.EventInfo.Name);
- return null;
- }
-
- ee.InstanceExpression = left;
-
- return ee;
- }
- }
-
- if (member_lookup is TypeExpr){
- member_lookup.Resolve (ec);
- return member_lookup;
- }
-
- Console.WriteLine ("Left is: " + left);
- Report.Error (-100, loc, "Support for [" + member_lookup + "] is not present yet");
- Environment.Exit (0);
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are the sole users of ResolveWithSimpleName (ie, the only
- // ones that can cope with it
- //
- Expression original = expr;
- expr = expr.ResolveWithSimpleName (ec);
-
- if (expr == null)
- return null;
-
- if (expr is SimpleName){
- SimpleName child_expr = (SimpleName) expr;
-
- expr = new SimpleName (child_expr.Name + "." + Identifier, loc);
-
- return expr.ResolveWithSimpleName (ec);
- }
-
- //
- // TODO: I mailed Ravi about this, and apparently we can get rid
- // of this and put it in the right place.
- //
- // Handle enums here when they are in transit.
- // Note that we cannot afford to hit MemberLookup in this case because
- // it will fail to find any members at all
- //
-
- Type expr_type = expr.Type;
- if ((expr is TypeExpr) && (expr_type.IsSubclassOf (TypeManager.enum_type))){
-
- Enum en = TypeManager.LookupEnum (expr_type);
-
- if (en != null) {
- object value = en.LookupEnumValue (ec, Identifier, loc);
-
- if (value != null){
- Constant c = Constantify (value, en.UnderlyingType);
- return new EnumConstant (c, expr_type);
- }
- }
- }
-
- if (expr_type.IsPointer){
- Report.Error (23, loc,
- "The `.' operator can not be applied to pointer operands (" +
- TypeManager.CSharpName (expr_type) + ")");
- return null;
- }
-
- member_lookup = MemberLookup (ec, expr_type, Identifier, loc);
-
- if (member_lookup == null){
- Report.Error (117, loc, "`" + expr_type + "' does not contain a " +
- "definition for `" + Identifier + "'");
-
- return null;
- }
-
- return ResolveMemberAccess (ec, member_lookup, expr, loc, original);
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Should not happen");
- }
- }
-
- /// <summary>
- /// Implements checked expressions
- /// </summary>
- public class CheckedExpr : Expression {
-
- public Expression Expr;
-
- public CheckedExpr (Expression e)
- {
- Expr = e;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Expr = Expr.Resolve (ec);
-
- if (Expr == null)
- return null;
-
- eclass = Expr.eclass;
- type = Expr.Type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- bool last_check = ec.CheckState;
-
- ec.CheckState = true;
- Expr.Emit (ec);
- ec.CheckState = last_check;
- }
-
- }
-
- /// <summary>
- /// Implements the unchecked expression
- /// </summary>
- public class UnCheckedExpr : Expression {
-
- public Expression Expr;
-
- public UnCheckedExpr (Expression e)
- {
- Expr = e;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Expr = Expr.Resolve (ec);
-
- if (Expr == null)
- return null;
-
- eclass = Expr.eclass;
- type = Expr.Type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- bool last_check = ec.CheckState;
-
- ec.CheckState = false;
- Expr.Emit (ec);
- ec.CheckState = last_check;
- }
-
- }
-
- /// <summary>
- /// An Element Access expression.
- ///
- /// During semantic analysis these are transformed into
- /// IndexerAccess or ArrayAccess
- /// </summary>
- public class ElementAccess : Expression {
- public ArrayList Arguments;
- public Expression Expr;
- public Location loc;
-
- public ElementAccess (Expression e, ArrayList e_list, Location l)
- {
- Expr = e;
-
- loc = l;
-
- if (e_list == null)
- return;
-
- Arguments = new ArrayList ();
- foreach (Expression tmp in e_list)
- Arguments.Add (new Argument (tmp, Argument.AType.Expression));
-
- }
-
- bool CommonResolve (EmitContext ec)
- {
- Expr = Expr.Resolve (ec);
-
- if (Expr == null)
- return false;
-
- if (Arguments == null)
- return false;
-
- for (int i = Arguments.Count; i > 0;){
- --i;
- Argument a = (Argument) Arguments [i];
-
- if (!a.Resolve (ec, loc))
- return false;
- }
-
- return true;
- }
-
- Expression MakePointerAccess ()
- {
- Type t = Expr.Type;
-
- if (t == TypeManager.void_ptr_type){
- Report.Error (
- 242, loc,
- "The array index operation is not valid for void pointers");
- return null;
- }
- if (Arguments.Count != 1){
- Report.Error (
- 196, loc,
- "A pointer must be indexed by a single value");
- return null;
- }
- Expression p = new PointerArithmetic (true, Expr, ((Argument)Arguments [0]).Expr, t);
- return new Indirection (p);
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- if (!CommonResolve (ec))
- return null;
-
- //
- // We perform some simple tests, and then to "split" the emit and store
- // code we create an instance of a different class, and return that.
- //
- // I am experimenting with this pattern.
- //
- Type t = Expr.Type;
-
- if (t.IsSubclassOf (TypeManager.array_type))
- return (new ArrayAccess (this)).Resolve (ec);
- else if (t.IsPointer)
- return MakePointerAccess ();
- else
- return (new IndexerAccess (this)).Resolve (ec);
- }
-
- public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- if (!CommonResolve (ec))
- return null;
-
- Type t = Expr.Type;
- if (t.IsSubclassOf (TypeManager.array_type))
- return (new ArrayAccess (this)).ResolveLValue (ec, right_side);
- else if (t.IsPointer)
- return MakePointerAccess ();
- else
- return (new IndexerAccess (this)).ResolveLValue (ec, right_side);
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Should never be reached");
- }
- }
-
- /// <summary>
- /// Implements array access
- /// </summary>
- public class ArrayAccess : Expression, IAssignMethod, IMemoryLocation {
- //
- // Points to our "data" repository
- //
- ElementAccess ea;
-
- public ArrayAccess (ElementAccess ea_data)
- {
- ea = ea_data;
- eclass = ExprClass.Variable;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- if (ea.Expr.eclass != ExprClass.Variable) {
- report118 (ea.loc, ea.Expr, "variable");
- return null;
- }
-
- Type t = ea.Expr.Type;
- if (t.GetArrayRank () != ea.Arguments.Count){
- Report.Error (22, ea.loc,
- "Incorrect number of indexes for array " +
- " expected: " + t.GetArrayRank () + " got: " +
- ea.Arguments.Count);
- return null;
- }
- type = t.GetElementType ();
- if (type.IsPointer && !ec.InUnsafe){
- UnsafeError (ea.loc);
- return null;
- }
-
- eclass = ExprClass.Variable;
-
- return this;
- }
-
- /// <summary>
- /// Emits the right opcode to load an object of Type `t'
- /// from an array of T
- /// </summary>
- static public void EmitLoadOpcode (ILGenerator ig, Type type)
- {
- if (type == TypeManager.byte_type || type == TypeManager.bool_type)
- ig.Emit (OpCodes.Ldelem_I1);
- else if (type == TypeManager.sbyte_type)
- ig.Emit (OpCodes.Ldelem_U1);
- else if (type == TypeManager.short_type)
- ig.Emit (OpCodes.Ldelem_I2);
- else if (type == TypeManager.ushort_type)
- ig.Emit (OpCodes.Ldelem_U2);
- else if (type == TypeManager.int32_type)
- ig.Emit (OpCodes.Ldelem_I4);
- else if (type == TypeManager.uint32_type)
- ig.Emit (OpCodes.Ldelem_U4);
- else if (type == TypeManager.uint64_type)
- ig.Emit (OpCodes.Ldelem_I8);
- else if (type == TypeManager.int64_type)
- ig.Emit (OpCodes.Ldelem_I8);
- else if (type == TypeManager.float_type)
- ig.Emit (OpCodes.Ldelem_R4);
- else if (type == TypeManager.double_type)
- ig.Emit (OpCodes.Ldelem_R8);
- else if (type == TypeManager.intptr_type)
- ig.Emit (OpCodes.Ldelem_I);
- else if (type.IsValueType){
- ig.Emit (OpCodes.Ldelema, type);
- ig.Emit (OpCodes.Ldobj, type);
- } else
- ig.Emit (OpCodes.Ldelem_Ref);
- }
-
- /// <summary>
- /// Emits the right opcode to store an object of Type `t'
- /// from an array of T.
- /// </summary>
- static public void EmitStoreOpcode (ILGenerator ig, Type t)
- {
- if (t == TypeManager.byte_type || t == TypeManager.sbyte_type ||
- t == TypeManager.bool_type)
- ig.Emit (OpCodes.Stelem_I1);
- else if (t == TypeManager.short_type || t == TypeManager.ushort_type || t == TypeManager.char_type)
- ig.Emit (OpCodes.Stelem_I2);
- else if (t == TypeManager.int32_type || t == TypeManager.uint32_type)
- ig.Emit (OpCodes.Stelem_I4);
- else if (t == TypeManager.int64_type || t == TypeManager.uint64_type)
- ig.Emit (OpCodes.Stelem_I8);
- else if (t == TypeManager.float_type)
- ig.Emit (OpCodes.Stelem_R4);
- else if (t == TypeManager.double_type)
- ig.Emit (OpCodes.Stelem_R8);
- else if (t == TypeManager.intptr_type)
- ig.Emit (OpCodes.Stelem_I);
- else if (t.IsValueType)
- ig.Emit (OpCodes.Stobj, t);
- else
- ig.Emit (OpCodes.Stelem_Ref);
- }
-
- MethodInfo FetchGetMethod ()
- {
- ModuleBuilder mb = RootContext.ModuleBuilder;
- Type [] args = new Type [ea.Arguments.Count];
- MethodInfo get;
-
- int i = 0;
-
- foreach (Argument a in ea.Arguments)
- args [i++] = a.Type;
-
- get = mb.GetArrayMethod (
- ea.Expr.Type, "Get",
- CallingConventions.HasThis |
- CallingConventions.Standard,
- type, args);
- return get;
- }
-
-
- MethodInfo FetchAddressMethod ()
- {
- ModuleBuilder mb = RootContext.ModuleBuilder;
- Type [] args = new Type [ea.Arguments.Count];
- MethodInfo address;
- string ptr_type_name;
- Type ret_type;
- int i = 0;
-
- ptr_type_name = type.FullName + "&";
- ret_type = Type.GetType (ptr_type_name);
-
- //
- // It is a type defined by the source code we are compiling
- //
- if (ret_type == null){
- ret_type = mb.GetType (ptr_type_name);
- }
-
- foreach (Argument a in ea.Arguments)
- args [i++] = a.Type;
-
- address = mb.GetArrayMethod (
- ea.Expr.Type, "Address",
- CallingConventions.HasThis |
- CallingConventions.Standard,
- ret_type, args);
-
- return address;
- }
-
- public override void Emit (EmitContext ec)
- {
- int rank = ea.Expr.Type.GetArrayRank ();
- ILGenerator ig = ec.ig;
-
- ea.Expr.Emit (ec);
-
- foreach (Argument a in ea.Arguments)
- a.Expr.Emit (ec);
-
- if (rank == 1)
- EmitLoadOpcode (ig, type);
- else {
- MethodInfo method;
-
- method = FetchGetMethod ();
- ig.Emit (OpCodes.Call, method);
- }
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- int rank = ea.Expr.Type.GetArrayRank ();
- ILGenerator ig = ec.ig;
-
- ea.Expr.Emit (ec);
-
- foreach (Argument a in ea.Arguments)
- a.Expr.Emit (ec);
-
- Type t = source.Type;
-
- //
- // The stobj opcode used by value types will need
- // an address on the stack, not really an array/array
- // pair
- //
- if (rank == 1){
- if (t.IsValueType && !TypeManager.IsBuiltinType (t))
- ig.Emit (OpCodes.Ldelema, t);
- }
-
- source.Emit (ec);
-
- if (rank == 1)
- EmitStoreOpcode (ig, t);
- else {
- ModuleBuilder mb = RootContext.ModuleBuilder;
- Type [] args = new Type [ea.Arguments.Count + 1];
- MethodInfo set;
-
- int i = 0;
-
- foreach (Argument a in ea.Arguments)
- args [i++] = a.Type;
-
- args [i] = type;
-
- set = mb.GetArrayMethod (
- ea.Expr.Type, "Set",
- CallingConventions.HasThis |
- CallingConventions.Standard,
- TypeManager.void_type, args);
-
- ig.Emit (OpCodes.Call, set);
- }
- }
-
- public void AddressOf (EmitContext ec)
- {
- int rank = ea.Expr.Type.GetArrayRank ();
- ILGenerator ig = ec.ig;
-
- ea.Expr.Emit (ec);
-
- foreach (Argument a in ea.Arguments)
- a.Expr.Emit (ec);
-
- if (rank == 1){
- ig.Emit (OpCodes.Ldelema, type);
- } else {
- MethodInfo address = FetchAddressMethod ();
- ig.Emit (OpCodes.Call, address);
- }
- }
- }
-
-
- class Indexers {
- public ArrayList getters, setters;
- static Hashtable map;
-
- static Indexers ()
- {
- map = new Hashtable ();
- }
-
- Indexers (MemberInfo [] mi)
- {
- foreach (PropertyInfo property in mi){
- MethodInfo get, set;
-
- get = property.GetGetMethod (true);
- if (get != null){
- if (getters == null)
- getters = new ArrayList ();
-
- getters.Add (get);
- }
-
- set = property.GetSetMethod (true);
- if (set != null){
- if (setters == null)
- setters = new ArrayList ();
- setters.Add (set);
- }
- }
- }
-
- static public Indexers GetIndexersForType (Type t, TypeManager tm, Location loc)
- {
- Indexers ix = (Indexers) map [t];
- string p_name = TypeManager.IndexerPropertyName (t);
-
- if (ix != null)
- return ix;
-
- MemberInfo [] mi = tm.FindMembers (
- t, MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance,
- Type.FilterName, p_name);
-
- if (mi == null || mi.Length == 0){
- Report.Error (21, loc,
- "Type `" + TypeManager.CSharpName (t) + "' does not have " +
- "any indexers defined");
- return null;
- }
-
- ix = new Indexers (mi);
- map [t] = ix;
-
- return ix;
- }
- }
-
- /// <summary>
- /// Expressions that represent an indexer call.
- /// </summary>
- public class IndexerAccess : Expression, IAssignMethod {
- //
- // Points to our "data" repository
- //
- ElementAccess ea;
- MethodInfo get, set;
- Indexers ilist;
- ArrayList set_arguments;
-
- public IndexerAccess (ElementAccess ea_data)
- {
- ea = ea_data;
- eclass = ExprClass.Value;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Type indexer_type = ea.Expr.Type;
-
- //
- // Step 1: Query for all `Item' *properties*. Notice
- // that the actual methods are pointed from here.
- //
- // This is a group of properties, piles of them.
-
- if (ilist == null)
- ilist = Indexers.GetIndexersForType (
- indexer_type, RootContext.TypeManager, ea.loc);
-
-
- //
- // Step 2: find the proper match
- //
- if (ilist != null && ilist.getters != null && ilist.getters.Count > 0)
- get = (MethodInfo) Invocation.OverloadResolve (
- ec, new MethodGroupExpr (ilist.getters), ea.Arguments, ea.loc);
-
- if (get == null){
- Report.Error (154, ea.loc,
- "indexer can not be used in this context, because " +
- "it lacks a `get' accessor");
- return null;
- }
-
- type = get.ReturnType;
- if (type.IsPointer && !ec.InUnsafe){
- UnsafeError (ea.loc);
- return null;
- }
-
- eclass = ExprClass.IndexerAccess;
- return this;
- }
-
- public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- Type indexer_type = ea.Expr.Type;
- Type right_type = right_side.Type;
-
- if (ilist == null)
- ilist = Indexers.GetIndexersForType (
- indexer_type, RootContext.TypeManager, ea.loc);
-
- if (ilist != null && ilist.setters != null && ilist.setters.Count > 0){
- set_arguments = (ArrayList) ea.Arguments.Clone ();
- set_arguments.Add (new Argument (right_side, Argument.AType.Expression));
-
- set = (MethodInfo) Invocation.OverloadResolve (
- ec, new MethodGroupExpr (ilist.setters), set_arguments, ea.loc);
- }
-
- if (set == null){
- Report.Error (200, ea.loc,
- "indexer X.this [" + TypeManager.CSharpName (right_type) +
- "] lacks a `set' accessor");
- return null;
- }
-
- type = TypeManager.void_type;
- eclass = ExprClass.IndexerAccess;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Invocation.EmitCall (ec, false, false, ea.Expr, get, ea.Arguments);
- }
-
- //
- // source is ignored, because we already have a copy of it from the
- // LValue resolution and we have already constructed a pre-cached
- // version of the arguments (ea.set_arguments);
- //
- public void EmitAssign (EmitContext ec, Expression source)
- {
- Invocation.EmitCall (ec, false, false, ea.Expr, set, set_arguments);
- }
- }
-
- /// <summary>
- /// The base operator for method names
- /// </summary>
- public class BaseAccess : Expression {
- string member;
- Location loc;
-
- public BaseAccess (string member, Location l)
- {
- this.member = member;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Expression member_lookup;
- Type current_type = ec.TypeContainer.TypeBuilder;
- Type base_type = current_type.BaseType;
- Expression e;
-
- if (ec.IsStatic){
- Report.Error (1511, loc,
- "Keyword base is not allowed in static method");
- return null;
- }
-
- member_lookup = MemberLookup (ec, base_type, member, loc);
- if (member_lookup == null)
- return null;
-
- Expression left;
-
- if (ec.IsStatic)
- left = new TypeExpr (base_type);
- else
- left = ec.This;
-
- e = MemberAccess.ResolveMemberAccess (ec, member_lookup, left, loc, null);
- if (e is PropertyExpr){
- PropertyExpr pe = (PropertyExpr) e;
-
- pe.IsBase = true;
- }
-
- return e;
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Should never be called");
- }
- }
-
- /// <summary>
- /// The base indexer operator
- /// </summary>
- public class BaseIndexerAccess : Expression {
- ArrayList Arguments;
- Location loc;
-
- public BaseIndexerAccess (ArrayList args, Location l)
- {
- Arguments = args;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Type current_type = ec.TypeContainer.TypeBuilder;
- Type base_type = current_type.BaseType;
- Expression member_lookup;
-
- if (ec.IsStatic){
- Report.Error (1511, loc,
- "Keyword base is not allowed in static method");
- return null;
- }
-
- member_lookup = MemberLookup (ec, base_type, "get_Item", MemberTypes.Method, AllBindingFlags, loc);
- if (member_lookup == null)
- return null;
-
- return MemberAccess.ResolveMemberAccess (ec, member_lookup, ec.This, loc, null);
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Should never be called");
- }
- }
-
- /// <summary>
- /// This class exists solely to pass the Type around and to be a dummy
- /// that can be passed to the conversion functions (this is used by
- /// foreach implementation to typecast the object return value from
- /// get_Current into the proper type. All code has been generated and
- /// we only care about the side effect conversions to be performed
- /// </summary>
- public class EmptyExpression : Expression {
- public EmptyExpression ()
- {
- type = TypeManager.object_type;
- eclass = ExprClass.Value;
- }
-
- public EmptyExpression (Type t)
- {
- type = t;
- eclass = ExprClass.Value;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- // nothing, as we only exist to not do anything.
- }
-
- //
- // This is just because we might want to reuse this bad boy
- // instead of creating gazillions of EmptyExpressions.
- // (CanConvertImplicit uses it)
- //
- public void SetType (Type t)
- {
- type = t;
- }
- }
-
- public class UserCast : Expression {
- MethodBase method;
- Expression source;
-
- public UserCast (MethodInfo method, Expression source)
- {
- this.method = method;
- this.source = source;
- type = method.ReturnType;
- eclass = ExprClass.Value;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are born fully resolved
- //
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- source.Emit (ec);
-
- if (method is MethodInfo)
- ig.Emit (OpCodes.Call, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
-
- }
- }
-
- // <summary>
- // This class is used to "construct" the type during a typecast
- // operation. Since the Type.GetType class in .NET can parse
- // the type specification, we just use this to construct the type
- // one bit at a time.
- // </summary>
- public class ComposedCast : Expression {
- Expression left;
- string dim;
- Location loc;
-
- public ComposedCast (Expression left, string dim, Location l)
- {
- this.left = left;
- this.dim = dim;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- left = left.Resolve (ec);
- if (left == null)
- return null;
-
- if (left.eclass != ExprClass.Type){
- report118 (loc, left, "type");
- return null;
- }
-
- type = RootContext.LookupType (
- ec.TypeContainer, left.Type.FullName + dim, false, loc);
- if (type == null)
- return null;
-
- if (!ec.InUnsafe && type.IsPointer){
- UnsafeError (loc);
- return null;
- }
-
- eclass = ExprClass.Type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("This should never be called");
- }
- }
-
- //
- // This class is used to represent the address of an array, used
- // only by the Fixed statement, this is like the C "&a [0]" construct.
- //
- public class ArrayPtr : Expression {
- Expression array;
-
- public ArrayPtr (Expression array)
- {
- Type array_type = array.Type.GetElementType ();
-
- this.array = array;
-
- string array_ptr_type_name = array_type.FullName + "*";
-
- type = Type.GetType (array_ptr_type_name);
- if (type == null){
- ModuleBuilder mb = RootContext.ModuleBuilder;
-
- type = mb.GetType (array_ptr_type_name);
- }
-
- eclass = ExprClass.Value;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- array.Emit (ec);
- IntLiteral.EmitInt (ig, 0);
- ig.Emit (OpCodes.Ldelema, array.Type.GetElementType ());
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are born fully resolved
- //
- return this;
- }
- }
-
- //
- // Used by the fixed statement
- //
- public class StringPtr : Expression {
- LocalBuilder b;
-
- public StringPtr (LocalBuilder b)
- {
- this.b = b;
- eclass = ExprClass.Value;
- type = TypeManager.char_ptr_type;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- ig.Emit (OpCodes.Ldloc, b);
- ig.Emit (OpCodes.Conv_I);
- ig.Emit (OpCodes.Call, TypeManager.int_get_offset_to_string_data);
- ig.Emit (OpCodes.Add);
- }
- }
-
- //
- // Implements the `stackalloc' keyword
- //
- public class StackAlloc : Expression {
- Type otype;
- string t;
- Expression count;
- Location loc;
-
- public StackAlloc (string type, Expression count, Location l)
- {
- t = type;
- this.count = count;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- count = count.Resolve (ec);
- if (count == null)
- return null;
-
- if (count.Type != TypeManager.int32_type){
- count = ConvertImplicitRequired (ec, count, TypeManager.int32_type, loc);
- if (count == null)
- return null;
- }
-
- if (ec.InCatch || ec.InFinally){
- Report.Error (255, loc,
- "stackalloc can not be used in a catch or finally block");
- return null;
- }
-
- otype = RootContext.LookupType (ec.TypeContainer, t, false, loc);
-
- if (otype == null)
- return null;
-
- if (!TypeManager.VerifyUnManaged (otype, loc))
- return null;
-
- string ptr_name = otype.FullName + "*";
- type = Type.GetType (ptr_name);
- if (type == null){
- ModuleBuilder mb = RootContext.ModuleBuilder;
-
- type = mb.GetType (ptr_name);
- }
- eclass = ExprClass.Value;
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- int size = GetTypeSize (otype);
- ILGenerator ig = ec.ig;
-
- if (size == 0)
- ig.Emit (OpCodes.Sizeof, otype);
- else
- IntConstant.EmitInt (ig, size);
- count.Emit (ec);
- ig.Emit (OpCodes.Mul);
- ig.Emit (OpCodes.Localloc);
- }
- }
-}
diff --git a/mcs/mcs/gen-il.cs b/mcs/mcs/gen-il.cs
deleted file mode 100755
index 2dfeecc974c..00000000000
--- a/mcs/mcs/gen-il.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-// gen-il.cs: Generates MSIL code from the CIR.Tree
-//
-// Author: Miguel de Icaza (miguel@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc. (http://www.ximian.com)
-//
-
-using System;
-using System.IO;
-using System.Collections;
-using CIR;
-
-namespace MSIL {
-
- public class Generator : CIR.ITreeDump {
- StreamWriter o;
- int indent = 0;
-
- void output (string s)
- {
- Console.Write (s);
- o.Write (s);
- }
-
- void space ()
- {
- output (new String (' ', indent * 2));
- }
-
- void ioutput (string s)
- {
- space ();
- output (s);
- }
-
- void ioutputl (string s)
- {
- ioutput (s + "\n");
- }
-
- string ClassAttributes (Class c)
- {
- // FIXME
- return "";
- }
-
- string ILName (string name)
- {
- return name;
- }
-
- string ClassExtends (Class c)
- {
- return "";
- }
-
- void GenerateFromClass (Class c)
- {
- ioutputl (".class " + ClassAttributes (c) + " " + ILName (c.Name));
- ioutputl (ClassExtends (c));
- ioutputl ("{");
- indent++;
-
-
-
- indent--;
- ioutputl ("}");
- }
-
- void GenerateFromTypes (TypeContainer types)
- {
- if (types.Types == null)
- return;
-
- foreach (DictionaryEntry de in types.Types){
- TypeContainer type = (TypeContainer) de.Value;
-
- if (type is Class)
- GenerateFromClass ((Class) type);
- }
-
- }
-
- public int GenerateFromTree (Tree tree, StreamWriter os)
- {
- this.o = os;
-
- ioutputl (".assembly test.exe { }");
- GenerateFromTypes (tree.Types);
- return 0;
- }
-
- public void ParseOptions (string options)
- {
- }
-
- }
-}
diff --git a/mcs/mcs/gen-treedump.cs b/mcs/mcs/gen-treedump.cs
deleted file mode 100755
index 8ad20e812d7..00000000000
--- a/mcs/mcs/gen-treedump.cs
+++ /dev/null
@@ -1,988 +0,0 @@
-// cs-treedump.cs: Dumps the parsed tree to standard output
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc. (http://www.ximian.com)
-//
-// TODO:
-// Variable declarations
-// Fix precedence rules to lower the number of parenthesis.
-//
-
-using System;
-using System.IO;
-using System.Collections;
-using CIR;
-
-namespace Generator {
-
- public class TreeDump : CIR.ITreeDump {
- StreamWriter o;
- int indent;
- bool indented;
- bool tag_values;
-
- void space ()
- {
- if (!indented)
- output (new String (' ', indent * 8));
- indented = true;
- }
-
- void output (string s)
- {
- Console.Write (s);
- //o.Write (s);
- }
-
- void newline ()
- {
- output ("\n");
- indented = false;
- }
-
- void output_newline (string s)
- {
- output (s);
- newline ();
- }
-
- void ioutput (string s)
- {
- space ();
- output (s);
- }
-
- string GetParameter (Parameter par)
- {
- Parameter.Modifier f = par.ModFlags;
- string mod = "";
-
- switch (f){
- case Parameter.Modifier.REF:
- mod = "ref "; break;
- case Parameter.Modifier.OUT:
- mod = "out "; break;
- case Parameter.Modifier.PARAMS:
- mod = "params "; break;
- case Parameter.Modifier.NONE:
- mod = ""; break;
- }
- return mod + par.Type + " " + par.Name;
- }
-
- string GetUnary (Unary u, int paren_level)
- {
- string e;
- bool left = true;
- string s = "0_ERROR>";
- int prec = 0;
-
- switch (u.Oper){
- case Unary.Operator.UnaryPlus:
- prec = 10;
- s = "+";
- break;
-
- case Unary.Operator.UnaryNegation:
- prec = 10;
- s = "-";
- break;
-
- case Unary.Operator.LogicalNot:
- s = "!";
- prec = 10;
- break;
-
- case Unary.Operator.OnesComplement:
- prec = 10;
- s = "~";
- break;
-
- case Unary.Operator.Indirection:
- prec = 10;
- s = "*";
- break;
-
- case Unary.Operator.AddressOf:
- prec = 10;
- s = "&";
- break;
-
- case Unary.Operator.PreIncrement:
- prec = 11;
- s = "++";
- break;
-
- case Unary.Operator.PreDecrement:
- prec = 11;
- s = "--";
- break;
-
- case Unary.Operator.PostDecrement:
- left = false;
- prec = 12;
- s = "--";
- break;
-
- case Unary.Operator.PostIncrement:
- s = "++";
- prec = 12;
- left = false;
- break;
- }
-
- e = GetExpression (u.Expr, prec);
- if (left)
- e = s + e;
- else
- e = e + s;
-
- if (prec < paren_level)
- return "(" + e + ")";
- else
- return e;
- }
-
- string GetBinary (Binary b, int paren_level)
- {
- string l, r;
- string op = null;
- bool assoc_left = true;
- int prec = 0;
-
- switch (b.Oper){
- case Binary.Operator.Multiply:
- prec = 9;
- op = "*"; break;
-
- case Binary.Operator.Division:
- prec = 9;
- op = "/"; break;
-
- case Binary.Operator.Modulus:
- prec = 9;
- op = "%"; break;
-
- case Binary.Operator.Addition:
- prec = 8;
- op = "+"; break;
-
- case Binary.Operator.Subtraction:
- prec = 8;
- op = "-"; break;
-
- case Binary.Operator.LeftShift:
- prec = 7;
- op = "<<"; break;
-
- case Binary.Operator.RightShift:
- prec = 7;
- op = ">>"; break;
-
- case Binary.Operator.LessThan:
- prec = 6;
- op = "<"; break;
-
- case Binary.Operator.GreaterThan:
- prec = 6;
- op = ">"; break;
-
- case Binary.Operator.LessThanOrEqual:
- prec = 6;
- op = "<="; break;
-
- case Binary.Operator.GreaterThanOrEqual:
- prec = 6;
- op = ">="; break;
-
- case Binary.Operator.Equality:
- prec = 5;
- op = "=="; break;
-
- case Binary.Operator.Inequality:
- prec = 5;
- op = "!="; break;
-
- case Binary.Operator.BitwiseAnd:
- prec = 4;
- op = "&"; break;
-
- case Binary.Operator.BitwiseOr:
- prec = 2;
- op = "|"; break;
-
- case Binary.Operator.LogicalAnd:
- prec = 1;
- op = "&&"; break;
-
- case Binary.Operator.LogicalOr:
- prec = 0;
- op = "||"; break;
-
- case Binary.Operator.ExclusiveOr:
- prec = 3;
- op = "^"; break;
- }
-
- l = GetExpression (b.Left, prec - (assoc_left ? 0 : 1));
- r = GetExpression (b.Right, prec - (assoc_left ? 0 : 1));
-
- if (prec <= paren_level)
- return "(" + l + " " + op + " " + r + ")";
- else
- return l + " " + op + " " + r;
- }
-
- string GetCast (Cast c)
- {
- return "(" + c.TargetType + ") (" + GetExpression (c.Expr, 0) + ")";
- }
-
- string GetConditional (Conditional c)
- {
- return "(" + GetExpression (c.Expr, 0) + ") ? (" +
- GetExpression (c.TrueExpr, 0) + ") : (" +
- GetExpression (c.FalseExpr, 0) + ")";
- }
-
- string GetAssign (Assign a)
- {
- return GetExpression (a.Target, 0) + " = " + GetExpression (a.Source, 0);
- }
-
- string GetArguments (ArrayList args)
- {
- string r = "";
-
- if (args != null){
- int top = args.Count;
-
- for (int i = 0; i < top; i++){
- Argument arg = (Argument) args [i];
-
- switch (arg.ArgType){
- case Argument.AType.Ref:
- r += "ref "; break;
- case Argument.AType.Out:
- r += "out "; break;
- }
- r += GetExpression (arg.Expr, 0);
-
- if (i+1 != top)
- r += ", ";
- }
- }
-
- return "(" + r + ")";
- }
-
- string GetInvocation (Invocation i)
- {
- return GetExpression (i.Expr, 0) + " " + GetArguments (i.Arguments);
- }
-
- string GetNew (New n)
- {
- return "new " + n.RequestedType + GetArguments (n.Arguments);
- }
-
- string GetTypeOf (TypeOf t)
- {
- return "typeof (" + t.QueriedType + ")";
- }
-
- string GetSizeOf (SizeOf t)
- {
- return "sizeof (" + t.QueriedType + ")";
- }
-
- string GetMemberAccess (MemberAccess m)
- {
- return GetExpression (m.Expr, 0) +
- (tag_values ? "/* member access */ . " : ".") +
- m.Identifier;
- }
-
- string GetSimpleName (SimpleName n)
- {
- string s = n.Name;
-
- if (s.StartsWith ("0_"))
- return "id_" + s;
- else
- return s;
- }
-
- string GetProbe (Probe p)
- {
- string s = GetExpression (p.Expr, 6);
-
- if (p.Oper == CIR.Probe.Operator.Is)
- s += " is ";
- else if (p.Oper == CIR.Probe.Operator.As)
- s += " as ";
- else
- s += "UNHANDLED";
-
- s += p.ProbeType;
-
- return s;
- }
-
- string GetLocalVariableReference (LocalVariableReference l)
- {
- if (tag_values)
- return "/* local var: */" + l.Name;
- else
- return l.Name;
- }
-
- string GetParameterReference (ParameterReference r)
- {
- if (tag_values)
- return "/* par: */ " + r.Name;
- else
- return r.Name;
- }
-
- string GetExpression (Expression e, int paren_level)
- {
- if (e == null){
- return "<NULL EXPRESSION>";
- }
-
- if (e is Unary)
- return GetUnary ((Unary) e, paren_level);
- else if (e is Binary)
- return GetBinary ((Binary) e, paren_level);
- else if (e is Cast)
- return GetCast ((Cast) e);
- else if (e is Conditional)
- return GetConditional ((Conditional) e);
- else if (e is SimpleName)
- return GetSimpleName ((SimpleName)e);
- else if (e is LocalVariableReference)
- return GetLocalVariableReference ((LocalVariableReference) e);
- else if (e is ParameterReference)
- return GetParameterReference ((ParameterReference) e);
- else if (e is Assign)
- return GetAssign ((Assign) e);
- else if (e is Literal)
- return e.ToString ();
- else if (e is Invocation)
- return GetInvocation ((Invocation) e);
- else if (e is New)
- return GetNew ((New) e);
- else if (e is This)
- return "this";
- else if (e is TypeOf)
- return GetTypeOf ((TypeOf) e);
- else if (e is SizeOf)
- return GetSizeOf ((SizeOf) e);
- else if (e is MemberAccess)
- return GetMemberAccess ((MemberAccess) e);
- else if (e is Probe)
- return GetProbe ((Probe) e);
- else
- return "WARNING {" + e.ToString () + "} WARNING";
- }
-
- void GenerateParameters (Parameters pars)
- {
- Parameter [] pfixed;
- Parameter parray;
-
- pfixed = pars.FixedParameters;
-
- if (pfixed != null){
- for (int i = 0; i < pfixed.Length; i++){
- output (GetParameter (pfixed [i]));
- if (i+1 != pfixed.Length)
- output (", ");
- }
- }
-
- parray = pars.ArrayParameter;
- if (parray != null){
- output (GetParameter (parray));
- }
- }
-
- void GenerateIf (If s)
- {
- bool do_indent;
-
- output ("if (" + GetExpression (s.Expr, 0) + ") ");
- do_indent = !(s.TrueStatement is Block);
- if (do_indent)
- indent++;
- GenerateStatement (s.TrueStatement, true, false, false);
- if (do_indent)
- indent--;
- if (s.FalseStatement != null){
- ioutput ("else");
- newline ();
- GenerateStatement (s.FalseStatement, false, true, false);
- }
- }
-
- void GenerateDo (Do s)
- {
- output ("do"); newline ();
- indent++;
- GenerateStatement (s.EmbeddedStatement, false, false, false);
- indent--;
- output (" while (" + GetExpression (s.Expr, 0) + ");");
- newline ();
- }
-
- void GenerateWhile (While s)
- {
- output ("while (" + GetExpression (s.Expr, 0) + ")");
- GenerateStatement (s.Statement, true, true, false);
- }
-
- void GenerateFor (For s)
- {
- output ("for (");
- if (! (s.InitStatement is EmptyStatement))
- GenerateStatement (s.InitStatement, true, true, true);
- output ("; ");
- output (GetExpression (s.Test, 0));
- output ("; ");
- if (! (s.Increment is EmptyStatement))
- GenerateStatement (s.Increment, true, true, true);
- output (") ");
- GenerateStatement (s.Statement, true, true, false);
- }
-
- void GenerateReturn (Return s)
- {
- output ("return " +
- (s.Expr != null ?
- GetExpression (s.Expr, 0) : "" + ";") +
- ";");
- newline ();
- }
-
- void GenerateGoto (Goto s)
- {
- output ("goto " + s.Target + ";");
- newline ();
- }
-
- void GenerateThrow (Throw s)
- {
- }
-
- void GenerateStatementExpression (StatementExpression s)
- {
- output (GetExpression (s.Expr, 0) + ";");
- newline ();
- }
-
- void GenerateSwitchLabels (ArrayList labels)
- {
- foreach (SwitchLabel sl in labels){
- Expression lab = sl.Label;
-
- if (lab == null){
- ioutput ("default:");
- newline ();
- } else {
- ioutput ("case " + GetExpression (lab, 0) + ":");
- newline ();
- }
- }
- }
-
- void GenerateSwitch (Switch s)
- {
- output_newline ("switch (" + GetExpression (s.Expr, 0) + ")");
- foreach (SwitchSection ss in s.Sections){
- GenerateSwitchLabels (ss.Labels);
- GenerateBlock (ss.Block, false, false);
- }
- }
-
- void GenerateChecked (Checked c)
- {
- output ("checked ");
- GenerateBlock (c.Block, false, false);
- }
-
- void GenerateUnchecked (Unchecked c)
- {
- output ("unchecked ");
- GenerateBlock (c.Block, false, false);
- }
-
- void GenerateCatchClauses (ArrayList list)
- {
- foreach (Catch c in list){
- space ();
- output ("catch ");
-
- if (c.Type != null){
- output ("(" + c.Type +
- (c.Name != null ? " " + c.Name : "") + ")");
- }
- GenerateBlock (c.Block, false, false);
- }
- }
-
- void GenerateTry (Try t)
- {
- output ("try");
- GenerateBlock (t.Block, false, false);
-
- if (t.Specific != null){
- GenerateCatchClauses (t.Specific);
- }
-
- if (t.General != null){
- space ();
- output ("catch");
- GenerateBlock (t.Block, false, false);
- }
-
- if (t.Fini != null){
- GenerateBlock (t.Fini, false, false);
- }
- }
-
- void GenerateStatement (Statement s, bool doPlacement, bool blockFlushesLine, bool embedded)
- {
- if (s == null){
- output ("WARNING: got a null Statement");
- newline ();
- return;
- }
-
- if (doPlacement){
- if (s is Block){
- GenerateBlock ((Block) s, doPlacement, embedded);
- return;
- } else
- newline ();
- }
-
- space ();
- if (s is If)
- GenerateIf ((If) s);
- else if (s is Do)
- GenerateDo ((Do) s);
- else if (s is While)
- GenerateWhile ((While) s);
- else if (s is For)
- GenerateFor ((For) s);
- else if (s is Return)
- GenerateReturn ((Return) s);
- else if (s is Goto)
- GenerateGoto ((Goto) s);
- else if (s is Throw)
- GenerateThrow ((Throw) s);
- else if (s is Break)
- output_newline ("break;");
- else if (s is Continue)
- output_newline ("continue;");
- else if (s is EmptyStatement)
- output_newline ("/* empty statement */;");
- else if (s is Block)
- GenerateBlock ((Block) s, doPlacement, embedded);
- else if (s is StatementExpression)
- GenerateStatementExpression ((StatementExpression) s);
- else if (s is Switch)
- GenerateSwitch ((Switch) s);
- else if (s is Checked)
- GenerateChecked ((Checked) s);
- else if (s is Unchecked)
- GenerateUnchecked ((Unchecked) s);
- else if (s is Try)
- GenerateTry ((Try) s);
- else {
- System.Type t = s.GetType ();
-
- output ("\n*****UNKNOWN Statement:" + t.ToString ());
- }
- }
-
- //
- // embedded is used only for things like the For thing
- // that has blocks but for display purposes we want to keep
- // without newlines.
- void GenerateBlock (Block b, bool doPlacement, bool embedded)
- {
- if (b.Label != null)
- output (b.Label + ":");
-
- if (!b.Implicit){
- if (!doPlacement)
- space ();
-
- output ("{");
- if (!embedded)
- newline ();
- indent++;
- }
-
- if (b.Variables != null){
- foreach (DictionaryEntry entry in b.Variables){
- VariableInfo vi = (VariableInfo) entry.Value;
-
- space ();
- output_newline (
- vi.Type + " " +
- (string) entry.Key + ";");
- }
- newline ();
- }
-
- foreach (Statement s in b.Statements){
- GenerateStatement (s, false, true, false);
- }
-
- if (!b.Implicit){
- indent--;
- ioutput ("}");
- if (!embedded)
- newline ();
- }
- }
-
- void GenerateMethod (Method m)
- {
- ioutput (GetModifiers (m.ModFlags) +
- m.ReturnType + " " +
- m.Name + " (");
- GenerateParameters (m.Parameters);
- output_newline (")");
-
-
- GenerateBlock (m.Block, false, false);
- newline ();
- }
-
- void GenerateInterfaceMethod (InterfaceMethod imethod)
- {
- space ();
- output (imethod.IsNew ? "new " : "");
- output (imethod.ReturnType + " " + imethod.Name + " (");
- GenerateParameters (imethod.Parameters);
- output (");");
- newline ();
- }
-
- void GenerateInterfaceProperty (InterfaceProperty iprop)
- {
- space ();
- output (iprop.IsNew ? "new " : "");
- output (iprop.Type + " " + iprop.Name + " { ");
- if (iprop.HasGet) output ("get; ");
- if (iprop.HasSet) output ("set; ");
- output ("}");
- newline ();
- }
-
- void GenerateInterfaceEvent (InterfaceEvent ievent)
- {
- space ();
- output ((ievent.IsNew ? "new " : "") + "event ");
- output (ievent.Type + " " + ievent.Name + ";");
- newline ();
- }
-
- void GenerateInterfaceIndexer (InterfaceIndexer iindexer)
- {
- space ();
- output (iindexer.IsNew ? "new " : "");
- output (iindexer.Type + " this [");
- output (iindexer.Parameters + "] {");
- if (iindexer.HasGet) output ("get; ");
- if (iindexer.HasSet) output ("set; ");
- output ("}");
- newline ();
- }
-
- string GenIfaceBases (Interface iface)
- {
- return GenBases (iface.Bases);
- }
-
- void GenerateInterface (Interface iface)
- {
- ioutput (GetModifiers (iface.ModFlags) + "interface " +
- ClassName (iface.Name) + GenIfaceBases (iface) + " {");
- newline ();
- indent++;
-
- if (iface.InterfaceMethods != null){
- foreach (DictionaryEntry de in iface.InterfaceMethods){
- InterfaceMethod method = (InterfaceMethod) de.Value;
- GenerateInterfaceMethod (method);
- }
- }
-
- if (iface.InterfaceProperties != null){
- foreach (DictionaryEntry de in iface.InterfaceProperties){
- InterfaceProperty iprop = (InterfaceProperty) de.Value;
- GenerateInterfaceProperty (iprop);
- }
- }
-
- if (iface.InterfaceEvents != null){
- foreach (DictionaryEntry de in iface.InterfaceEvents){
- InterfaceEvent ievent = (InterfaceEvent) de.Value;
- GenerateInterfaceEvent (ievent);
- }
- }
-
- if (iface.InterfaceIndexers != null){
- foreach (DictionaryEntry de in iface.InterfaceIndexers){
- InterfaceIndexer iindexer = (InterfaceIndexer) de.Value;
- GenerateInterfaceIndexer (iindexer);
- }
- }
- indent--;
- ioutput ("}");
- newline ();
- newline ();
- }
-
- void GenerateField (Field f)
- {
- space ();
- output (GetModifiers (f.ModFlags) +
- f.Type + " " + f.Name);
- if (f.Initializer != null){
- if (f.Initializer is Expression)
- output (" = " + GetExpression ((Expression) f.Initializer, 0));
- else
- output ("ADD SUPPORT FOR ARRAYS");
- }
- output (";");
- newline ();
- }
-
- void GenerateConstructor (Constructor c)
- {
- ConstructorInitializer init = c.Initializer;
-
- space ();
- output (GetModifiers (c.ModFlags) + c.Name + " (");
- GenerateParameters (c.Parameters);
- output (")");
-
- if (init != null){
- if (init is ConstructorThisInitializer)
- output (": this (");
- else
- output (": base (");
- output (GetArguments (init.Arguments));
- output (")");
- }
- newline ();
- GenerateBlock (c.Block, false, false);
- }
-
- void GenerateProperty (Property prop)
- {
- space ();
- output (GetModifiers (prop.ModFlags) + prop.Type +
- " " + prop.Name + " {");
- newline ();
- indent++;
- if (prop.Get != null){
- space ();
- output ("get ");
- GenerateBlock (prop.Get, false, false);
- newline ();
- }
-
- if (prop.Set != null){
- space ();
- output ("set ");
- GenerateBlock (prop.Set, false, false);
- }
- indent--;
- space ();
- output ("}");
- newline ();
- }
-
- void GenerateEnum (CIR.Enum e)
- {
- space ();
- output ("enum " + e.Name + " {");
- newline ();
-
- indent++;
- foreach (string name in e.ValueNames){
- Expression expr = e [name];
-
- space ();
-
- output (name);
- if (expr != null)
- output (" = " + GetExpression (expr, 0));
-
- output (",");
- newline ();
- }
- indent--;
- space ();
- output_newline ("}");
- }
-
- void GenerateTypeContainerData (TypeContainer tc)
- {
- if (tc.Constants != null){
- foreach (Constant c in tc.Constants){
- space ();
-
- output ("const " + c.ConstantType + " " + c.Name + " = " +
- GetExpression (c.Expr, 0) + ";");
- newline ();
- }
- newline ();
- }
-
- if (tc.Enums != null){
- foreach (CIR.Enum e in tc.Enums)
- GenerateEnum (e);
- }
-
- if (tc.Fields != null){
- foreach (Field f in tc.Fields)
- GenerateField (f);
- newline ();
- }
-
- if (tc.Constructors != null){
- foreach (Constructor c in tc.Constructors)
- GenerateConstructor (c);
-
- newline ();
-
- }
-
- if (tc.Properties != null){
- foreach (Property prop in tc.Properties)
- GenerateProperty (prop);
- }
-
- GenerateFromTypes (tc);
-
- if (tc.Methods != null){
- foreach (Method m in tc.Methods){
- GenerateMethod (m);
- }
- }
- }
-
- string GetModifiers (int mod_flags)
- {
- string s = "";
-
- for (int i = 1; i <= (int) CIR.Modifiers.TOP; i <<= 1){
- if ((mod_flags & i) != 0)
- s += Modifiers.Name (i) + " ";
- }
-
- return s;
- }
-
- string ClassName (string name)
- {
- return name;
- //return name.Substring (1 + name.LastIndexOf ("."));
- }
-
- string GenBases (ArrayList bases)
- {
- if (bases == null)
- return "";
-
- string res = ": ";
- int top = bases.Count;
- for (int i = 0; i < bases.Count; i++){
- Type t = (Type) bases [i];
-
- res += t.Name;
- if (i + 1 != top)
- res += ", ";
- }
- return res;
- }
-
- string GenClassBases (Class c)
- {
- return GenBases (c.Bases);
- }
-
- void GenerateFromClass (Class c)
- {
- ioutput (GetModifiers (c.ModFlags) + "class " + ClassName (c.Name) +
- " " + GenClassBases (c) + " {");
- newline ();
- indent++;
-
- GenerateTypeContainerData (c);
-
- indent--;
- ioutput ("}");
- newline ();
- newline ();
- }
-
- void GenerateFromStruct (Struct s)
- {
- GenerateTypeContainerData (s);
- }
-
- void GenerateFromTypes (TypeContainer types)
- {
- if (types.Types == null)
- return;
-
- foreach (DictionaryEntry de in types.Types){
- TypeContainer type = (TypeContainer) de.Value;
-
- if (type is Class)
- GenerateFromClass ((Class) type);
- if (type is Struct)
- GenerateFromStruct ((Struct) type);
-
- }
-
- if (types.Interfaces != null){
- foreach (DictionaryEntry de in types.Interfaces){
- Interface iface = (Interface) de.Value;
-
- GenerateInterface (iface);
- }
- }
- }
-
- public int Dump (Tree tree, StreamWriter output)
- {
- this.o = output;
-
- indent = 0;
- GenerateFromTypes (tree.Types);
-
- return 0;
- }
-
- public void ParseOptions (string options)
- {
- if (options == "tag")
- tag_values = true;
- }
- }
-}
-
-
diff --git a/mcs/mcs/generator.cs b/mcs/mcs/generator.cs
deleted file mode 100755
index e6d73296b66..00000000000
--- a/mcs/mcs/generator.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// generator.cs: Generator interfaces.
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-using System.IO;
-
-namespace CIR {
-
- public interface IGenerator {
- int GenerateFromTree (Tree tree, StreamWriter output);
- void ParseOptions (string options);
- }
-}
diff --git a/mcs/mcs/genericparser.cs b/mcs/mcs/genericparser.cs
deleted file mode 100644
index 71f70c9db5e..00000000000
--- a/mcs/mcs/genericparser.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// GenericParser.cs: The Base Parser for the Mono compilers
-//
-// Author: A Rafael D Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// Copyright (C) 2001 Ximian, Inc.
-//
-using System;
-using System.Text;
-
-namespace Mono.Languages
-{
- using System.Collections;
-
- /// <summary>
- /// Base class to support multiple Jay generated parsers
- /// </summary>
- public abstract class GenericParser
- {
- static protected int global_errors;
-
- // Name of the file we are parsing
- public string name;
-
- // Input stream to parse from.
- public System.IO.Stream input;
-
- public abstract int parse ();
-
- public virtual string[] extensions()
- {
- string [] list = { ".cs" };
- return list;
- }
-
- /// <summary>
- /// Emits error messages and increments a global count of them
- /// </summary>
- /// <param name="code"></param>
- /// <param name="desc"></param>
- static public void error (int code, string desc)
- {
- Console.WriteLine ("Error "+code+": "+ desc);
- global_errors++;
- }
-
- // Emits error messages with location info.
- // FIXME : Ideally, all error reporting should happen
- // with Report.Error but how do you get at that non-static
- // method everywhere you need it ?
- static public void error (int code, Mono.CSharp.Location l, string text)
- {
- Console.WriteLine (l.Name + "(" + l.Row + "," +
- "): Error CS" + code + ": " + text);
- global_errors++;
- }
-
- public GenericParser()
- {
- //
- // DO NOTHING: Derived classes should do their iniatilization here duties
- //
- }
-
- protected bool yacc_verbose_flag = false;
-
- public bool yacc_verbose
- {
- set
- {
- yacc_verbose_flag = value;
- }
-
- get
- {
- return yacc_verbose_flag;
- }
- }
- }
-}
-
-
-
diff --git a/mcs/mcs/interface.cs b/mcs/mcs/interface.cs
deleted file mode 100755
index 3b7fb3ed03c..00000000000
--- a/mcs/mcs/interface.cs
+++ /dev/null
@@ -1,848 +0,0 @@
-//
-// interface.cs: Interface handler
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-using System.Collections;
-using System;
-using System.IO;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Interfaces
- /// </summary>
- public class Interface : DeclSpace {
- const MethodAttributes interface_method_attributes =
- MethodAttributes.Public |
- MethodAttributes.Abstract |
- MethodAttributes.HideBySig |
- MethodAttributes.NewSlot |
- MethodAttributes.Virtual;
-
- const MethodAttributes property_attributes =
- MethodAttributes.Public |
- MethodAttributes.Abstract |
- MethodAttributes.HideBySig |
- MethodAttributes.NewSlot |
- MethodAttributes.SpecialName |
- MethodAttributes.Virtual;
-
- ArrayList bases;
-
- ArrayList defined_method;
- ArrayList defined_indexer;
- ArrayList defined_events;
- ArrayList defined_properties;
-
- ArrayList method_builders;
- ArrayList property_builders;
-
- Attributes OptAttributes;
-
- // These will happen after the semantic analysis
-
- // Hashtable defined_indexers;
- // Hashtable defined_methods;
-
- /// <summary>
- /// Modifiers allowed in a class declaration
- /// </summary>
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.UNSAFE |
- Modifiers.PRIVATE;
-
- public Interface (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, l)
- {
- ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
- OptAttributes = attrs;
-
- method_builders = new ArrayList ();
- property_builders = new ArrayList ();
- }
-
- public AdditionResult AddMethod (InterfaceMethod imethod)
- {
- string name = imethod.Name;
- Object value = defined_names [name];
-
- if (value != null){
- if (!(value is InterfaceMethod))
- return AdditionResult.NameExists;
- }
-
- if (defined_method == null)
- defined_method = new ArrayList ();
-
- defined_method.Add (imethod);
- if (value == null)
- DefineName (name, imethod);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddProperty (InterfaceProperty iprop)
- {
- AdditionResult res;
- string name = iprop.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- DefineName (name, iprop);
-
- if (defined_properties == null)
- defined_properties = new ArrayList ();
-
- defined_properties.Add (iprop);
- return AdditionResult.Success;
- }
-
- public AdditionResult AddEvent (InterfaceEvent ievent)
- {
- string name = ievent.Name;
- AdditionResult res;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- DefineName (name, ievent);
-
- if (defined_events == null)
- defined_events = new ArrayList ();
-
- defined_events.Add (ievent);
- return AdditionResult.Success;
- }
-
- public bool AddIndexer (InterfaceIndexer iindexer)
- {
- if (defined_indexer == null)
- defined_indexer = new ArrayList ();
-
- defined_indexer.Add (iindexer);
- return true;
- }
-
- public ArrayList InterfaceMethods {
- get {
- return defined_method;
- }
- }
-
- public ArrayList InterfaceProperties {
- get {
- return defined_properties;
- }
- }
-
- public ArrayList InterfaceEvents {
- get {
- return defined_events;
- }
- }
-
- public ArrayList InterfaceIndexers {
- get {
- return defined_indexer;
- }
- }
-
- public ArrayList Bases {
- get {
- return bases;
- }
-
- set {
- bases = value;
- }
- }
-
- public bool IsTopLevel {
- get {
- if (Parent != null){
- if (Parent.Parent == null)
- return true;
- }
- return false;
- }
- }
-
- public virtual TypeAttributes InterfaceAttr {
- get {
- TypeAttributes x = 0;
-
- if ((ModFlags & Modifiers.PUBLIC) != 0)
- x |= TypeAttributes.Public;
- else if ((ModFlags & Modifiers.PRIVATE) != 0)
- x |= TypeAttributes.NotPublic;
-
- if (IsTopLevel == false) {
-
- if ((ModFlags & Modifiers.PROTECTED) != 0
- && (ModFlags & Modifiers.INTERNAL) != 0)
- x |= TypeAttributes.NestedFamORAssem;
-
- if ((ModFlags & Modifiers.PROTECTED) != 0)
- x |= TypeAttributes.NestedFamily;
-
- if ((ModFlags & Modifiers.INTERNAL) != 0)
- x |= TypeAttributes.NestedAssembly;
-
- }
-
- if ((ModFlags & Modifiers.ABSTRACT) != 0)
- x |= TypeAttributes.Abstract;
-
- if ((ModFlags & Modifiers.SEALED) != 0)
- x |= TypeAttributes.Sealed;
-
- return x;
- }
- }
-
- void Error111 (InterfaceMemberBase ib)
- {
- Report.Error (
- 111,
- "Interface `" + Name + "' already contains a definition with the " +
- "same return value and parameter types for member `" + ib.Name + "'");
- }
-
- bool RegisterMethod (MethodBase mb, InternalParameters ip, Type [] types)
- {
- if (!TypeManager.RegisterMethod (mb, ip, types))
- return false;
-
- method_builders.Add (mb);
- return true;
- }
-
- public MethodInfo [] GetMethods ()
- {
- int n = method_builders.Count;
- MethodInfo [] mi = new MethodInfo [n];
-
- method_builders.CopyTo (mi, 0);
-
- return mi;
- }
-
- // Hack around System.Reflection as found everywhere else
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf, MemberFilter filter, object criteria)
- {
- ArrayList members = new ArrayList ();
-
- if ((mt & MemberTypes.Method) != 0) {
- foreach (MethodBuilder mb in method_builders)
- if (filter (mb, criteria))
- members.Add (mb);
- }
-
- if ((mt & MemberTypes.Property) != 0) {
- foreach (PropertyBuilder pb in property_builders)
- if (filter (pb, criteria))
- members.Add (pb);
- }
-
- // The rest of the cases, if any, are unhandled at present.
-
- int count = members.Count;
-
- if (count > 0) {
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi, 0);
- return mi;
- }
-
- return null;
- }
-
- //
- // Populates the methods in the interface
- //
- void PopulateMethod (InterfaceMethod im)
- {
- Type return_type = RootContext.LookupType (this, im.ReturnType, false, im.Location);
- Type [] arg_types = im.ParameterTypes (this);
- MethodBuilder mb;
- Parameter [] p;
- int i;
-
- if (return_type == null)
- return;
-
- if (return_type.IsPointer && !UnsafeOK (this))
- return;
-
- foreach (Type t in arg_types){
-
- if (t == null)
- return;
-
- if (t.IsPointer && !UnsafeOK (this))
- return;
- }
-
- //
- // Create the method
- //
- mb = TypeBuilder.DefineMethod (
- im.Name, interface_method_attributes,
- return_type, arg_types);
-
- InternalParameters ip = new InternalParameters (arg_types, im.Parameters);
-
- if (!RegisterMethod (mb, ip, arg_types)) {
- Error111 (im);
- return;
- }
-
- //
- // Define each type attribute (in/out/ref) and
- // the argument names.
- //
- p = im.Parameters.FixedParameters;
- if (p != null){
- for (i = 0; i < p.Length; i++)
- mb.DefineParameter (i + 1, p [i].Attributes, p [i].Name);
-
- if (i != arg_types.Length)
- Console.WriteLine ("Implement the type definition for params");
- }
- }
-
- //
- // Populates the properties in the interface
- //
- void PopulateProperty (InterfaceProperty ip)
- {
- PropertyBuilder pb;
- MethodBuilder get = null, set = null;
- Type prop_type = RootContext.LookupType (this, ip.Type, false, ip.Location);
- Type [] setter_args = new Type [1];
-
- if (prop_type == null)
- return;
-
- if (prop_type.IsPointer && !UnsafeOK (this))
- return;
-
- setter_args [0] = prop_type;
-
- //
- // FIXME: properties are missing the following
- // flags: hidebysig newslot specialname
- //
- pb = TypeBuilder.DefineProperty (
- ip.Name, PropertyAttributes.None,
- prop_type, null);
-
- if (ip.HasGet){
- get = TypeBuilder.DefineMethod (
- "get_" + ip.Name, property_attributes ,
- prop_type, null);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- Type [] null_types = null;
- InternalParameters inp = new InternalParameters
- (null_types, Parameters.GetEmptyReadOnlyParameters ());
-
- if (!RegisterMethod (get, inp, null)) {
- Error111 (ip);
- return;
- }
-
- pb.SetGetMethod (get);
- }
-
- if (ip.HasSet){
- setter_args [0] = prop_type;
-
- set = TypeBuilder.DefineMethod (
- "set_" + ip.Name, property_attributes,
- TypeManager.void_type, setter_args);
-
- set.DefineParameter (1, ParameterAttributes.None, "value");
- pb.SetSetMethod (set);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- Parameter [] parms = new Parameter [1];
- parms [0] = new Parameter (ip.Type, "value", Parameter.Modifier.NONE, null);
- InternalParameters ipp = new InternalParameters (
- Parent, new Parameters (parms, null, Location.Null));
-
- if (!RegisterMethod (set, ipp, setter_args)) {
- Error111 (ip);
- return;
- }
- }
-
- TypeManager.RegisterProperty (pb, get, set);
- property_builders.Add (pb);
- }
-
- //
- // Populates the events in the interface
- //
- void PopulateEvent (InterfaceEvent ie)
- {
- //
- // FIXME: We need to do this after delegates have been
- // declared or we declare them recursively.
- //
- }
-
- //
- // Populates the indexers in the interface
- //
- void PopulateIndexer (InterfaceIndexer ii)
- {
- PropertyBuilder pb;
- Type prop_type = RootContext.LookupType (this, ii.Type, false, ii.Location);
- Type [] arg_types = ii.ParameterTypes (this);
- Type [] value_arg_types;
-
- if (prop_type == null)
- return;
-
- if (prop_type.IsPointer && !UnsafeOK (this))
- return;
-
- //
- // Sets up the extra invisible `value' argument for setters.
- //
- if (arg_types != null){
- int count = arg_types.Length;
- value_arg_types = new Type [count + 1];
-
- arg_types.CopyTo (value_arg_types, 0);
- value_arg_types [count] = prop_type;
-
- foreach (Type t in arg_types){
- if (t.IsPointer && !UnsafeOK (this))
- return;
- }
- } else {
- value_arg_types = new Type [1];
-
- value_arg_types [1] = prop_type;
- }
-
- pb = TypeBuilder.DefineProperty (
- "Item", PropertyAttributes.None,
- prop_type, arg_types);
-
- if (ii.HasGet){
- MethodBuilder get_item;
- Parameter [] p = ii.Parameters.FixedParameters;
-
- get_item = TypeBuilder.DefineMethod (
- "get_Item", property_attributes, prop_type, arg_types);
- pb.SetGetMethod (get_item);
- //
- // HACK because System.Reflection.Emit is lame
- //
- InternalParameters ip = new InternalParameters (
- arg_types, ii.Parameters);
-
- if (!RegisterMethod (get_item, ip, arg_types)) {
- Error111 (ii);
- return;
- }
-
- if (p != null){
- for (int i = 0; i < p.Length; i++)
- get_item.DefineParameter (
- i + 1,
- p [i].Attributes, p [i].Name);
- }
- }
-
- if (ii.HasSet){
- Parameter [] p = ii.Parameters.FixedParameters;
- MethodBuilder set_item;
- int i = 0;
-
- set_item = TypeBuilder.DefineMethod (
- "set_Item", property_attributes,
- TypeManager.void_type, value_arg_types);
- pb.SetSetMethod (set_item);
- //
- // HACK because System.Reflection.Emit is lame
- //
- InternalParameters ip = new InternalParameters (
- value_arg_types, ii.Parameters);
- if (!RegisterMethod (set_item, ip, value_arg_types)) {
- Error111 (ii);
- return;
- }
-
- if (p != null){
- for (; i < p.Length; i++)
- set_item.DefineParameter (
- i + 1,
- p [i].Attributes, p [i].Name);
- }
-
- set_item.DefineParameter (i + 1, ParameterAttributes.None, "value");
- }
- }
-
- /// <summary>
- /// Performs the semantic analysis for all the interface members
- /// that were declared
- /// </summary>
- bool SemanticAnalysis ()
- {
- Hashtable methods = new Hashtable ();
-
-
- if (defined_method != null){
- foreach (InterfaceMethod im in defined_method){
- string sig = im.GetSignature (this);
-
- //
- // If there was an undefined Type on the signatures
- //
- if (sig == null)
- continue;
-
- if (methods [sig] != null){
- Error111 (im);
- return false;
- }
- }
- }
-
- //
- // FIXME: Here I should check i
- //
- return true;
- }
-
- //
- // Returns the Type that represents the interface whose name
- // is `name'.
- //
-
- Type GetInterfaceTypeByName (object builder, string name)
- {
- Interface parent;
- Type t = RootContext.LookupType (this, name, false, Location);
-
- if (t != null) {
- if (t.IsInterface)
- return t;
-
- string cause;
-
- if (t.IsValueType)
- cause = "is a struct";
- else if (t.IsClass)
- cause = "is a class";
- else
- cause = "Should not happen.";
-
- Report.Error (527, Location, "`"+name+"' " + cause +
- ", need an interface instead");
-
- return null;
- }
-
- Tree tree = RootContext.Tree;
- parent = (Interface) tree.Interfaces [name];
- if (parent == null){
- string cause = null;
- Hashtable container;
-
- container = tree.Classes;
- if (container != null && container [name] != null)
- cause = "is a class";
- else {
- container = tree.Structs;
-
- if (container != null && container [name] != null)
- cause = "is a struct";
- }
-
- if (cause == null){
- Report.Error (246, Location, "Can not find type `"+name+"'");
- } else {
- Report.Error (527, Location, "`"+name+"' " + cause +
- ", need an interface instead");
- }
- return null;
- }
-
- t = parent.DefineInterface (builder);
- if (t == null){
- Report.Error (529,
- "Inherited interface `"+name+"' is circular");
- return null;
- }
-
- return t;
- }
-
- //
- // Returns the list of interfaces that this interface implements
- // Or null if it does not implement any interface.
- //
- // Sets the error boolean accoringly.
- //
- Type [] GetInterfaceBases (object builder, out bool error)
- {
- Type [] tbases;
- int i;
-
- error = false;
- if (Bases == null)
- return null;
-
- tbases = new Type [Bases.Count];
- i = 0;
-
- foreach (string name in Bases){
- Type t;
-
- t = GetInterfaceTypeByName (builder, name);
- if (t == null){
- error = true;
- return null;
- }
-
- tbases [i++] = t;
- }
-
- return tbases;
- }
-
- //
- // <summary>
- // Defines the Interface in the appropriate ModuleBuilder or TypeBuilder
- // </summary>
- // TODO:
- // Rework the way we recurse, because for recursive
- // definitions of interfaces (A:B and B:A) we report the
- // error twice, rather than once.
-
- public TypeBuilder DefineInterface (object parent_builder)
- {
- Type [] ifaces;
- bool error;
-
- if (InTransit)
- return null;
-
- InTransit = true;
-
- ifaces = GetInterfaceBases (parent_builder, out error);
-
- if (error)
- return null;
-
- if (parent_builder is ModuleBuilder) {
- ModuleBuilder builder = (ModuleBuilder) parent_builder;
-
- TypeBuilder = builder.DefineType (Name,
- TypeAttributes.Interface |
- InterfaceAttr |
- TypeAttributes.Abstract,
- null, // Parent Type
- ifaces);
- } else {
- TypeBuilder builder = (System.Reflection.Emit.TypeBuilder) parent_builder;
-
- TypeBuilder = builder.DefineNestedType (Basename,
- TypeAttributes.Interface |
- InterfaceAttr |
- TypeAttributes.Abstract,
- null, // Parent Type
- ifaces);
- }
-
- RootContext.TypeManager.AddUserInterface (Name, TypeBuilder, this);
- RootContext.RegisterOrder (this);
-
- InTransit = false;
-
- return TypeBuilder;
- }
-
- /// <summary>
- /// Performs semantic analysis, and then generates the IL interfaces
- /// </summary>
- public override bool Define (TypeContainer parent)
- {
- if (!SemanticAnalysis ())
- return false;
-
- if (defined_method != null){
- foreach (InterfaceMethod im in defined_method)
- PopulateMethod (im);
- }
-
- if (defined_properties != null){
- foreach (InterfaceProperty ip in defined_properties)
- PopulateProperty (ip);
- }
-
- if (defined_events != null)
- foreach (InterfaceEvent ie in defined_events)
- PopulateEvent (ie);
-
- if (defined_indexer != null) {
- foreach (InterfaceIndexer ii in defined_indexer)
- PopulateIndexer (ii);
-
- CustomAttributeBuilder cb = EmitDefaultMemberAttr (parent, ModFlags, Location);
- TypeBuilder.SetCustomAttribute (cb);
- }
-
- return true;
- }
-
- public static CustomAttributeBuilder EmitDefaultMemberAttr (TypeContainer parent, int flags,
- Location loc)
- {
- EmitContext ec = new EmitContext (parent, loc, null, null, flags);
-
- Expression ml = Expression.MemberLookup (ec, TypeManager.default_member_type,
- ".ctor", MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance,
- Location.Null);
-
- if (!(ml is MethodGroupExpr)) {
- Console.WriteLine ("Internal error !!!!");
- return null;
- }
-
- MethodGroupExpr mg = (MethodGroupExpr) ml;
-
- MethodBase constructor = mg.Methods [0];
-
- string [] vals = { "Item" };
-
- CustomAttributeBuilder cb = new CustomAttributeBuilder ((ConstructorInfo) constructor, vals);
-
- return cb;
- }
-
- }
-
- public class InterfaceMemberBase {
- public readonly string Name;
- public readonly bool IsNew;
- public Attributes OptAttributes;
-
- public InterfaceMemberBase (string name, bool is_new, Attributes attrs)
- {
- Name = name;
- IsNew = is_new;
- OptAttributes = attrs;
- }
- }
-
- public class InterfaceProperty : InterfaceMemberBase {
- public readonly bool HasSet;
- public readonly bool HasGet;
- public readonly string Type;
- public readonly string type;
- public readonly Location Location;
-
- public InterfaceProperty (string type, string name,
- bool is_new, bool has_get, bool has_set,
- Attributes attrs, Location loc)
- : base (name, is_new, attrs)
- {
- Type = type;
- HasGet = has_get;
- HasSet = has_set;
- Location = loc;
- }
- }
-
- public class InterfaceEvent : InterfaceMemberBase {
- public readonly string Type;
-
- public InterfaceEvent (string type, string name, bool is_new, Attributes attrs)
- : base (name, is_new, attrs)
- {
- Type = type;
- }
- }
-
- public class InterfaceMethod : InterfaceMemberBase {
- public readonly string ReturnType;
- public readonly Parameters Parameters;
- public readonly Location Location;
-
- public InterfaceMethod (string return_type, string name, bool is_new, Parameters args,
- Attributes attrs, Location l)
- : base (name, is_new, attrs)
- {
- this.ReturnType = return_type;
- this.Parameters = args;
- Location = l;
- }
-
- /// <summary>
- /// Returns the signature for this interface method
- /// </summary>
- public string GetSignature (DeclSpace ds)
- {
- Type ret = RootContext.LookupType (ds, ReturnType, false, Location);
- string args = Parameters.GetSignature (ds);
-
- if ((ret == null) || (args == null))
- return null;
-
- return (IsNew ? "new-" : "") + ret.FullName + "(" + args + ")";
- }
-
- public Type [] ParameterTypes (DeclSpace ds)
- {
- return Parameters.GetParameterInfo (ds);
- }
- }
-
- public class InterfaceIndexer : InterfaceMemberBase {
- public readonly bool HasGet, HasSet;
- public readonly Parameters Parameters;
- public readonly string Type;
- public readonly Location Location;
-
- public InterfaceIndexer (string type, Parameters args, bool do_get, bool do_set,
- bool is_new, Attributes attrs, Location loc)
- : base ("", is_new, attrs)
- {
- Type = type;
- Parameters = args;
- HasGet = do_get;
- HasSet = do_set;
- Location = loc;
- }
-
- public Type [] ParameterTypes (DeclSpace ds)
- {
- return Parameters.GetParameterInfo (ds);
- }
- }
-}
diff --git a/mcs/mcs/literal.cs b/mcs/mcs/literal.cs
deleted file mode 100755
index 842bbe6641f..00000000000
--- a/mcs/mcs/literal.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// literal.cs: Literal representation for the IL tree.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-// Notice that during parsing we create objects of type Literal, but the
-// types are not loaded (thats why the Resolve method has to assign the
-// type at that point).
-//
-// Literals differ from the constants in that we know we encountered them
-// as a literal in the source code (and some extra rules apply there) and
-// they have to be resolved (since during parsing we have not loaded the
-// types yet) while constants are created only after types have been loaded
-// and are fully resolved when born.
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- public class NullLiteral : Constant {
- public static readonly NullLiteral Null;
-
- static NullLiteral ()
- {
- Null = new NullLiteral ();
- }
-
- public NullLiteral ()
- {
- if (Null != null)
- throw new Exception ("More than one null has been created!");
- }
-
- override public string AsString ()
- {
- return "null";
- }
-
- public override object GetValue ()
- {
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.object_type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldnull);
- }
- }
-
- public class BoolLiteral : BoolConstant {
- public BoolLiteral (bool val) : base (val)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.bool_type;
- return this;
- }
- }
-
- public class CharLiteral : CharConstant {
- public CharLiteral (char c) : base (c)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.char_type;
- return this;
- }
- }
-
- public class IntLiteral : IntConstant {
- public IntLiteral (int l) : base (l)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.int32_type;
- return this;
- }
- }
-
- public class UIntLiteral : UIntConstant {
- public UIntLiteral (uint l) : base (l)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.uint32_type;
- return this;
- }
- }
-
- public class LongLiteral : LongConstant {
- public LongLiteral (long l) : base (l)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.int64_type;
-
- return this;
- }
- }
-
- public class ULongLiteral : ULongConstant {
- public ULongLiteral (ulong l) : base (l)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.uint64_type;
- return this;
- }
- }
-
- public class FloatLiteral : FloatConstant {
-
- public FloatLiteral (float f) : base (f)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.float_type;
- return this;
- }
- }
-
- public class DoubleLiteral : DoubleConstant {
- public DoubleLiteral (double d) : base (d)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.double_type;
-
- return this;
- }
- }
-
- public class DecimalLiteral : DecimalConstant {
- public DecimalLiteral (decimal d) : base (d)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.decimal_type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Implement me");
- }
- }
-
- public class StringLiteral : StringConstant {
- public StringLiteral (string s) : base (s)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.string_type;
-
- return this;
- }
- }
-}
diff --git a/mcs/mcs/location.cs b/mcs/mcs/location.cs
deleted file mode 100644
index 4b598528c9a..00000000000
--- a/mcs/mcs/location.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// location.cs: Keeps track of the location of source code entity
-//
-// Author:
-// Miguel de Icaza
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace Mono.CSharp {
- /// <summary>
- /// Keeps track of the location in the program
- /// </summary>
- ///
- /// <remarks>
- /// This uses a compact representation and a couple of auxiliary
- /// structures to keep track of tokens to (file,line) mappings.
- ///
- /// We could probably also keep track of columns by storing those
- /// in 8 bits (and say, map anything after char 255 to be `255+').
- /// </remarks>
- public struct Location {
- public int token;
-
- static Hashtable map;
- static ArrayList list;
- static int global_count;
- static int module_base;
-
- static Location ()
- {
- map = new Hashtable ();
- list = new ArrayList ();
- global_count = 0;
- module_base = 0;
- }
-
- static public void Push (string name)
- {
- map.Remove (global_count);
- map.Add (global_count, name);
- list.Add (global_count);
- module_base = global_count;
- }
-
- public Location (int row)
- {
- if (row < 0)
- token = -1;
- else {
- token = module_base + row;
- if (global_count < token)
- global_count = token;
- }
- }
-
- public override string ToString ()
- {
- return Name + ": (" + Row + ")";
- }
-
- /// <summary>
- /// Whether the Location is Null
- /// </summary>
- static public bool IsNull (Location l)
- {
- return l.token == -1;
- }
-
- static public Location Null {
- get {
- return new Location (-1);
- }
- }
-
- public string Name {
- get {
- int best = 0;
-
- if (token < 0)
- return "Internal";
-
- foreach (int b in list){
- if (token > b)
- best = b;
- }
- return (string) map [best];
- }
- }
-
- public int Row {
- get {
- int best = 0;
-
- if (token < 0)
- return 1;
-
- foreach (int b in list){
- if (token > b)
- best = b;
- }
- return token - best;
- }
- }
- }
-}
diff --git a/mcs/mcs/makefile b/mcs/mcs/makefile
deleted file mode 100755
index 54a40e27692..00000000000
--- a/mcs/mcs/makefile
+++ /dev/null
@@ -1,99 +0,0 @@
-CSC=csc.exe
-CSCFLAGS=/nologo /debug+ /debug:full /optimize /unsafe
-
-VERSION=0.13
-
-COMMON_SOURCES = cs-parser.cs cs-tokenizer.cs tree.cs location.cs
-
-COMPILER_SOURCES = \
- assign.cs \
- driver.cs $(COMMON_SOURCES) \
- class.cs \
- delegate.cs \
- attribute.cs \
- codegen.cs \
- const.cs \
- constant.cs \
- decl.cs \
- enum.cs \
- ecore.cs \
- expression.cs \
- genericparser.cs \
- interface.cs \
- literal.cs \
- modifiers.cs \
- namespace.cs \
- parameter.cs \
- report.cs \
- rootcontext.cs \
- statement.cs \
- statementCollection.cs \
- support.cs \
- typemanager.cs
-
-TEST_TOKENIZER_SOURCES = test-token.cs $(COMMON_SOURCES)
-
-all: mcs.exe
-
-mcs.exe: cs-parser.cs $(COMPILER_SOURCES)
- $(CSC) $(CSCFLAGS) /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES)
-
-res:
- echo --target exe -o mcs2.exe $(COMPILER_SOURCES) > response
-
-dum: cs-parser.cs
- ./mcs --fatal --target exe -o mcs2.exe $(COMPILER_SOURCES)
-
-mcs2.exe: mcs.exe
- ./mcs --target exe --unsafe -o mcs2.exe $(COMPILER_SOURCES)
-
-mcs3.exe: mcs2.exe
- ./mcs2 --target exe --unsafe -o mcs3.exe $(COMPILER_SOURCES)
-
-mm:
- mint ./mcs.exe --target exe -o mcs4.exe $(COMPILER_SOURCES)
-
-test: mcs3.exe
- ls -l mcs2.exe mcs3.exe
-
-docs: cs-parser.cs
- $(CSC) $(CSCFLAGS) /doc:docs.xml /nowarn:1591 /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES)
-
-windows: all
-
-linux: all
-
-opt:
- $(CSC) /optimize+ /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES)
-
-old: test-tokenizer.exe
-test-tokenizer.exe: $(TEST_TOKENIZER_SOURCES)
- $(CSC) /target:exe /out:test-tokenizer.exe $(TEST_TOKENIZER_SOURCES)
-
-bison:
- perl -pe 's/\015//' < cs-parser.jay > x.y
- bison --debug --verbose x.y
-
-cs-parser.cs: cs-parser.jay
- ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay > cs-parser.cs
-
-pn:
- ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay | grep -v '#line' > cs-parser.cs
-
-#statementCollection.cs: X-Collection.cs
-# sed -e "s/@CONTAINEE@/Statement/g" -e "s/@arrayname@/statements/g" < X-Collection.cs > statementCollection.cs
-
-#parameterCollection.cs: X-Collection.cs
-# sed -e "s/@CONTAINEE@/Parameter/g" -e "s/@arrayname@/parameters/g" < X-Collection.cs > parameterCollection.cs
-
-clean:
- rm -f mcs.exe cs-parser.cs y.output mcs.pdb *~ .*~ mb-parser.cs mcs.log response
-
-MBAS_SOURCES = mb-parser.cs mb-tokenizer.cs
-
-mbas: cs-parser.cs MonoBASIC.Parser.cs
- $(CSC) $(CSCFLAGS) /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES) $(MBAS_SOURCES)
-
-mb-parser.cs: mb-parser.jay
- ../jay/jay -ctv < ../jay/skeleton.cs mb-parser.jay > mb-parser.cs
-
diff --git a/mcs/mcs/mb-parser.jay b/mcs/mcs/mb-parser.jay
deleted file mode 100644
index ebfb758b5bc..00000000000
--- a/mcs/mcs/mb-parser.jay
+++ /dev/null
@@ -1,480 +0,0 @@
-%{
-//
-// MonoBASIC.Parser.cs (from .jay): The Parser for the MonoBASIC compiler
-//
-// Author: A Rafael D Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// Copyright (C) 2001 A Rafael D Teixeira
-//
-// TODO:
-// Nearly everything
-//
-
-namespace Mono.Languages.MonoBASIC
-{
- using System.Text;
- using System;
- using System.Collections;
-
- using CIR;
- using Mono.Languages;
- using Mono.Languages.MonoBASIC; // To get the tokenizer
-
- /// <summary>
- /// The MonoBASIC Parser
- /// </summary>
- public class Parser : GenericParser {
- Namespace current_namespace;
- TypeContainer current_container;
-
-/*
- /// <summary>
- /// Current block is used to add statements as we find
- /// them.
- /// </summary>
- Block current_block;
-
- /// <summary>
- /// Current interface is used by the various declaration
- /// productions in the interface declaration to "add"
- /// the interfaces as we find them.
- /// </summary>
- Interface current_interface;
-
- /// <summary>
- /// This is used by the unary_expression code to resolve
- /// a name against a parameter.
- /// </summary>
- Parameters current_local_parameters;
-
- /// <summary>
- /// Using during property parsing to describe the implicit
- /// value parameter that is passed to the "set" accessor
- /// method
- /// </summary>
- Parameter [] implicit_value_parameters;
-
-*/
- /// <summary>
- /// Used to record all types defined
- /// </summary>
- Tree tree;
-
- bool UseExtendedSyntax; // for ".mbs" files
-
- public override string[] GetExtensions()
- {
- string [] list = { ".vb", ".mbs" };
- return list;
- }
-
-%}
-
-%token EOF
-%token NONE /* This token is never returned by our lexer */
-%token ERROR // This is used not by the parser, but by the tokenizer.
- // do not remove.
-
-/*
- *These are the MonoBASIC keywords
- */
-%token ADDHANDLER
-%token ADDRESSOF
-%token ALIAS
-%token AND
-%token ANDALSO
-%token ANSI
-%token AS
-%token ASSEMBLY
-%token AUTO
-%token BOOLEAN
-%token BYREF
-%token BYTE
-%token BYVAL
-%token CALL
-%token CASE
-%token CATCH
-%token CBOOL
-%token CBYTE
-%token CCHAR
-%token CDATE
-%token CDEC
-%token CDBL
-%token CHAR
-%token CINT
-%token CLASS
-%token CLNG
-%token COBJ
-//%token COMPARE
-%token CONST
-%token CSHORT
-%token CSNG
-%token CSTR
-%token CTYPE
-%token DATE
-%token DECIMAL
-%token DECLARE
-%token DEFAULT
-%token DELEGATE
-%token DIM
-%token DO
-%token DOUBLE
-%token EACH
-%token ELSE
-%token ELSEIF
-%token END
-%token ENUM
-%token EOL
-%token ERASE
-%token ERROR
-%token EVENT
-%token EXIT
-//%token EXPLICIT
-%token FALSE
-%token FINALLY
-%token FOR
-%token FRIEND
-%token FUNCTION
-%token GET
-%token GETTYPE
-%token GOTO
-%token HANDLES
-%token IF
-%token IMPLEMENTS
-%token IMPORTS
-%token IN
-%token INHERITS
-%token INTEGER
-%token INTERFACE
-%token IS
-%token LET
-%token LIB
-%token LIKE
-%token LONG
-%token LOOP
-%token ME
-%token MOD
-%token MODULE
-%token MUSTINHERIT
-%token MUSTOVERRIDE
-%token MYBASE
-%token MYCLASS
-%token NAMESPACE
-%token NEW
-%token NEXT
-%token NOT
-%token NOTHING
-%token NOTINHERITABLE
-%token NOTOVERRIDABLE
-%token OBJECT
-%token ON
-%token OPTION
-%token OPTIONAL
-%token OR
-%token ORELSE
-%token OVERLOADS
-%token OVERRIDABLE
-%token OVERRIDES
-%token PARAM_ARRAY
-%token PRESERVE
-%token PRIVATE
-%token PROPERTY
-%token PROTECTED
-%token PUBLIC
-%token RAISEEVENT
-%token READONLY
-%token REDIM
-%token REM
-%token REMOVEHANDLER
-%token RESUME
-%token RETURN
-%token SELECT
-%token SET
-%token SHADOWS
-%token SHARED
-%token SHORT
-%token SINGLE
-%token SIZEOF
-%token STATIC
-%token STEP
-%token STOP
-%token STRING
-%token STRUCTURE
-%token SUB
-%token SYNCLOCK
-%token THEN
-%token THROW
-%token TO
-%token TRUE
-%token TRY
-%token TYPEOF
-%token UNICODE
-%token UNTIL
-%token VARIANT
-%token WHEN
-%token WHILE
-%token WITH
-%token WITHEVENTS
-%token WRITEONLY
-%token XOR
-
-/* MonoBASIC single character operators/punctuation. */
-%token OPEN_BRACKET "["
-%token CLOSE_BRACKET "]"
-%token OPEN_PARENS "("
-%token CLOSE_PARENS ")"
-%token DOT "."
-%token COMMA ","
-%token COLON ":"
-
-%token PLUS "+"
-%token MINUS "-"
-%token ASSIGN "="
-%token OP_LT "<"
-%token OP_GT ">"
-%token STAR "*"
-%token PERCENT "%"
-%token DIV "/"
-%token OP_EXP "^"
-%token INTERR "?"
-%token OP_IDIV "\\"
-%token OP_CONCAT "&"
-
-/* MonoBASIC multi-character operators. */
-%token OP_LE "<="
-%token OP_GE ">="
-%token OP_EQ "=="
-%token OP_NE "<>"
-%token OP_AND //"and"
-%token OP_OR //"or"
-%token OP_XOR //"xor"
-%token OP_MODULUS //"mod"
-%token OP_MULT_ASSIGN "*="
-%token OP_DIV_ASSIGN "/="
-%token OP_IDIV_ASSIGN "\\="
-%token OP_ADD_ASSIGN "+="
-%token OP_SUB_ASSIGN "-="
-%token OP_CONCAT_ASSIGN "&="
-%token OP_EXP_ASSIGN "^="
-
-/* Numbers */
-%token LITERAL_INTEGER "int literal"
-%token LITERAL_SINGLE "float literal"
-%token LITERAL_DOUBLE "double literal"
-%token LITERAL_DECIMAL "decimal literal"
-%token LITERAL_CHARACTER "character literal"
-%token LITERAL_STRING "string literal"
-
-%token IDENTIFIER
-
-/* Add precedence rules to solve dangling else s/r conflict */
-%nonassoc LOWPREC
-%nonassoc IF
-%nonassoc ELSE
-%right ASSIGN
-%left OP_OR
-%left OP_AND
-%left BITWISE_OR
-%left BITWISE_AND
-%left OP_SHIFT_LEFT OP_SHIFT_RIGHT
-%left PLUS MINUS
-%left STAR DIV PERCENT
-%right BITWISE_NOT CARRET UMINUS
-%nonassoc OP_INC OP_DEC
-%left OPEN_PARENS
-%left OPEN_BRACKET OPEN_BRACE
-%left DOT
-%nonassoc HIGHPREC
-
-%start compilation_unit
-%%
-
-compilation_unit
- : opt_imports_directives
- /* opt_attributes */
- opt_namespace_member_declarations
- EOF
- {
- $$ = $3;
- }
- ;
-
-qualified_identifier
- : IDENTIFIER
- | qualified_identifier DOT IDENTIFIER
- {
- $$ = (($1).ToString ()) + "." + ($3.ToString ());
- }
- ;
-
-opt_imports_directives
- : /* empty */
- | imports_directives
- ;
-
-imports_directives
- : imports_directive
- | imports_directives imports_directive
- ;
-
-imports_directive
- : /* imports_alias_directive
- | */ imports_namespace_directive
- ;
-
-imports_namespace_directive
- : IMPORTS namespace_name EOL
- {
- current_namespace.Using ((string) $2);
- }
- ;
-
-opt_attributes
- : /* empty */
- ;
-
-namespace_declaration
- : NAMESPACE qualified_identifier EOL
- {
- current_namespace = new Namespace (current_namespace, (string) $2);
- }
- opt_imports_directives
- opt_namespace_member_declarations
- END NAMESPACE EOL
- {
- current_namespace = current_namespace.Parent;
- }
- ;
-
-namespace_name
- : qualified_identifier
- ;
-
-
-
-opt_namespace_member_declarations
- : /* empty */
- | namespace_member_declarations
- ;
-
-namespace_member_declarations
- : namespace_member_declaration
- | namespace_member_declarations namespace_member_declaration
- ;
-
-namespace_member_declaration
- : namespace_declaration
- | type_declaration
- {
- int mod_flags = 0;
- string name = "";
-
- if ($1 is Class){
- Class c = (Class) $1;
- mod_flags = c.ModFlags;
- name = c.Name;
- } else if ($1 is Struct){
- Struct s = (Struct) $1;
- mod_flags = s.ModFlags;
- name = s.Name;
- } else
- break;
-
- }
- ;
-
-
-type_declaration
- : class_declaration
- ;
-
-
-class_declaration
- : /* opt_attributes opt_modifiers */
- CLASS IDENTIFIER /* opt_class_interfaces */ EOL
- {
- }
- opt_class_member_declarations
- END CLASS EOL
- {
- }
- ;
-
-opt_class_member_declarations
- : /* empty */
- | class_member_declarations
- ;
-
-class_member_declarations
- : class_member_declaration
- | class_member_declarations class_member_declaration
- ;
-
-class_member_declaration
- : type_declaration
- | sub_declaration
- ;
-
-sub_declaration
- : SUB qualified_identifier OPEN_PARENS opt_formal_parameters CLOSE_PARENS EOL
- opt_statements
- END SUB EOL
- ;
-
-opt_statements
- : /* empty */
- | qualified_identifier OPEN_PARENS opt_actual_parameters CLOSE_PARENS EOL
- ;
-
-opt_formal_parameters
- : /* empty */
- | qualified_identifier AS qualified_identifier
- ;
-
-opt_actual_parameters
- : /* empty */
- | qualified_identifier
- | LITERAL_STRING
- ;
-
-%%
-
-
-Tokenizer lexer;
-
-public override int parse ()
-{
- current_namespace = new Namespace (null, "");
- this.tree = rc.Tree;
- current_container = tree.Types;
- current_container.Namespace = current_namespace;
-
- UseExtendedSyntax = name.EndsWith(".mbs");
-
- lexer = new Tokenizer (input, name);
- StringBuilder value = new StringBuilder ();
-
- global_errors = 0;
- try
- {
- if (yacc_verbose_flag)
- yyparse (lexer, new yydebug.yyDebugSimple ());
- else
- yyparse (lexer);
- }
- catch (Exception e)
- {
- Console.WriteLine (lexer.location + " : Parsing error ");
- Console.WriteLine (e);
- global_errors++;
- }
-
- return global_errors;
-}
-
-/* end end end */
-}
-
-
diff --git a/mcs/mcs/mb-tokenizer.cs b/mcs/mcs/mb-tokenizer.cs
deleted file mode 100644
index e6252742edb..00000000000
--- a/mcs/mcs/mb-tokenizer.cs
+++ /dev/null
@@ -1,824 +0,0 @@
-//
-// MonoBASIC.Tokenizer.cs: The Tokenizer for the MonoBASIC compiler
-//
-// Author: A Rafael D Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// Based on cs-tokenizer.cs by Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// Copyright (C) 2001 A Rafael D Teixeira
-//
-
-/*
- Todo:
-
- EVERYTHING
-
-*/
-
-
-namespace Mono.Languages.MonoBASIC
-{
- using System;
- using System.Text;
- using System.Collections;
- using System.IO;
- using System.Globalization;
- using Mono.Languages.MonoBASIC;
- using Mono.CSharp;
-
- /// <summary>
- /// Tokenizer for MonoBASIC source code.
- /// </summary>
-
- public class Tokenizer : yyParser.yyInput
- {
- TextReader reader;
- public string ref_name;
- public int ref_line = 1;
- public int line = 1;
- public int col = 1;
- public int current_token;
- bool handle_get_set = false;
-
- public string location {
- get {
- string det;
-
- if (current_token == Token.ERROR)
- det = "detail: " + error_details;
- else
- det = "";
-
- return "Line: "+line+" Col: "+col + "\n" +
- "VirtLine: "+ref_line +
- " Token: "+current_token + " " + det;
- }
- }
-
- public bool properties {
- get {
- return handle_get_set;
- }
-
- set {
- handle_get_set = value;
- }
- }
-
- //
- // Class variables
- //
- static Hashtable keywords;
- static NumberStyles styles;
- static NumberFormatInfo csharp_format_info;
-
- //
- // Values for the associated token returned
- //
- System.Text.StringBuilder number;
- int putback_char;
- Object val;
-
- //
- // Details about the error encoutered by the tokenizer
- //
- string error_details;
-
- public string error {
- get {
- return error_details;
- }
- }
-
- public int Line {
- get {
- return line;
- }
- }
-
- public int Col {
- get {
- return col;
- }
- }
-
- static void initTokens ()
- {
- keywords = new Hashtable ();
-
- keywords.Add ("addhandler", Token.ADDHANDLER);
- keywords.Add ("addressof", Token.ADDRESSOF);
- keywords.Add ("alias", Token.ALIAS);
- keywords.Add ("and", Token.AND);
- keywords.Add ("andalso", Token.ANDALSO);
- keywords.Add ("ansi", Token.ANSI);
- keywords.Add ("as", Token.AS);
- keywords.Add ("assembly", Token.ASSEMBLY);
- keywords.Add ("auto", Token.AUTO);
- keywords.Add ("boolean", Token.BOOLEAN);
- keywords.Add ("byref", Token.BYREF);
- keywords.Add ("byte", Token.BYTE);
- keywords.Add ("byval", Token.BYVAL);
- keywords.Add ("call", Token.CALL);
- keywords.Add ("case", Token.CASE);
- keywords.Add ("catch", Token.CATCH);
- keywords.Add ("cbool", Token.CBOOL);
- keywords.Add ("cbyte", Token.CBYTE);
- keywords.Add ("cchar", Token.CCHAR);
- keywords.Add ("cdate", Token.CDATE);
- keywords.Add ("cdec", Token.CDEC);
- keywords.Add ("cdbl", Token.CDBL);
- keywords.Add ("char", Token.CHAR);
- keywords.Add ("cint", Token.CINT);
- keywords.Add ("class", Token.CLASS);
- keywords.Add ("clng", Token.CLNG);
- keywords.Add ("cobj", Token.COBJ);
- //keywords.Add ("compare", Token.COMPARE);
- keywords.Add ("const", Token.CONST);
- keywords.Add ("cshort", Token.CSHORT);
- keywords.Add ("csng", Token.CSNG);
- keywords.Add ("cstr", Token.CSTR);
- keywords.Add ("ctype", Token.CTYPE);
- keywords.Add ("date", Token.DATE);
- keywords.Add ("decimal", Token.DECIMAL);
- keywords.Add ("declare", Token.DECLARE);
- keywords.Add ("default", Token.DEFAULT);
- keywords.Add ("delegate", Token.DELEGATE);
- keywords.Add ("dim", Token.DIM);
- keywords.Add ("do", Token.DO);
- keywords.Add ("double", Token.DOUBLE);
- keywords.Add ("each", Token.EACH);
- keywords.Add ("else", Token.ELSE);
- keywords.Add ("elseif", Token.ELSEIF);
- keywords.Add ("end", Token.END);
- keywords.Add ("enum", Token.ENUM);
- keywords.Add ("erase", Token.ERASE);
- keywords.Add ("error", Token.ERROR);
- keywords.Add ("event", Token.EVENT);
- keywords.Add ("exit", Token.EXIT);
- //keywords.Add ("explicit", Token.EXPLICIT);
- keywords.Add ("false", Token.FALSE);
- keywords.Add ("finally", Token.FINALLY);
- keywords.Add ("for", Token.FOR);
- keywords.Add ("friend", Token.FRIEND);
- keywords.Add ("function", Token.FUNCTION);
- keywords.Add ("get", Token.GET);
- keywords.Add ("gettype", Token.GETTYPE);
- keywords.Add ("goto", Token.GOTO);
- keywords.Add ("handles", Token.HANDLES);
- keywords.Add ("if", Token.IF);
- keywords.Add ("implements", Token.IMPLEMENTS);
- keywords.Add ("imports", Token.IMPORTS);
- keywords.Add ("in", Token.IN);
- keywords.Add ("inherits", Token.INHERITS);
- keywords.Add ("integer", Token.INTEGER);
- keywords.Add ("interface", Token.INTERFACE);
- keywords.Add ("is", Token.IS);
- keywords.Add ("let ", Token.LET );
- keywords.Add ("lib ", Token.LIB );
- keywords.Add ("like ", Token.LIKE );
- keywords.Add ("long", Token.LONG);
- keywords.Add ("loop", Token.LOOP);
- keywords.Add ("me", Token.ME);
- keywords.Add ("mod", Token.MOD);
- keywords.Add ("module", Token.MODULE);
- keywords.Add ("mustinherit", Token.MUSTINHERIT);
- keywords.Add ("mustoverride", Token.MUSTOVERRIDE);
- keywords.Add ("mybase", Token.MYBASE);
- keywords.Add ("myclass", Token.MYCLASS);
- keywords.Add ("namespace", Token.NAMESPACE);
- keywords.Add ("new", Token.NEW);
- keywords.Add ("next", Token.NEXT);
- keywords.Add ("not", Token.NOT);
- keywords.Add ("nothing", Token.NOTHING);
- keywords.Add ("notinheritable", Token.NOTINHERITABLE);
- keywords.Add ("notoverridable", Token.NOTOVERRIDABLE);
- keywords.Add ("object", Token.OBJECT);
- keywords.Add ("on", Token.ON);
- keywords.Add ("option", Token.OPTION);
- keywords.Add ("optional", Token.OPTIONAL);
- keywords.Add ("or", Token.OR);
- keywords.Add ("orelse", Token.ORELSE);
- keywords.Add ("overloads", Token.OVERLOADS);
- keywords.Add ("overridable", Token.OVERRIDABLE);
- keywords.Add ("overrides", Token.OVERRIDES);
- keywords.Add ("paramarray", Token.PARAM_ARRAY);
- keywords.Add ("preserve", Token.PRESERVE);
- keywords.Add ("private", Token.PRIVATE);
- keywords.Add ("property", Token.PROPERTY);
- keywords.Add ("protected", Token.PROTECTED);
- keywords.Add ("public", Token.PUBLIC);
- keywords.Add ("raiseevent", Token.RAISEEVENT);
- keywords.Add ("readonly", Token.READONLY);
- keywords.Add ("redim", Token.REDIM);
- keywords.Add ("rem", Token.REM);
- keywords.Add ("removehandler", Token.REMOVEHANDLER);
- keywords.Add ("resume", Token.RESUME);
- keywords.Add ("return", Token.RETURN);
- keywords.Add ("select", Token.SELECT);
- keywords.Add ("set", Token.SET);
- keywords.Add ("shadows", Token.SHADOWS);
- keywords.Add ("shared", Token.SHARED);
- keywords.Add ("short", Token.SHORT);
- keywords.Add ("single", Token.SINGLE);
- keywords.Add ("sizeof", Token.SIZEOF);
- keywords.Add ("static", Token.STATIC);
- keywords.Add ("step", Token.STEP);
- keywords.Add ("stop", Token.STOP);
- keywords.Add ("string", Token.STRING);
- keywords.Add ("structure", Token.STRUCTURE);
- keywords.Add ("sub", Token.SUB);
- keywords.Add ("synclock", Token.SYNCLOCK);
- keywords.Add ("then", Token.THEN);
- keywords.Add ("throw", Token.THROW);
- keywords.Add ("to", Token.TO);
- keywords.Add ("true", Token.TRUE);
- keywords.Add ("try", Token.TRY);
- keywords.Add ("typeof", Token.TYPEOF);
- keywords.Add ("unicode", Token.UNICODE);
- keywords.Add ("until", Token.UNTIL);
- keywords.Add ("variant", Token.VARIANT);
- keywords.Add ("when", Token.WHEN);
- keywords.Add ("while", Token.WHILE);
- keywords.Add ("with", Token.WITH);
- keywords.Add ("withevents", Token.WITHEVENTS);
- keywords.Add ("writeonly", Token.WRITEONLY);
- keywords.Add ("xor", Token.XOR);
- }
-
- //
- // Class initializer
- //
- static Tokenizer ()
- {
- initTokens ();
- csharp_format_info = new NumberFormatInfo ();
- csharp_format_info.CurrencyDecimalSeparator = ".";
- styles = NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint;
- }
-
- bool is_keyword (string name)
- {
- bool res;
-
- res = keywords.Contains(name.ToLower());
- if ((name == "get" || name == "set") && handle_get_set == false)
- return false;
- return res;
- }
-
- int getKeyword (string name)
- {
- return (int) (keywords [name.ToLower()]);
- }
-
- public Location Location {
- get {
- return new Location (ref_line);
- }
- }
-
- public Tokenizer (System.IO.TextReader input, string fname)
- {
- this.ref_name = fname;
- reader = input;
- putback_char = -1;
-
- Location.Push (fname);
- }
-
- bool is_identifier_start_character (char c)
- {
- return Char.IsLetter (c) || c == '_' ;
- }
-
- bool is_identifier_part_character (char c)
- {
- return (Char.IsLetter (c) || Char.IsDigit (c) || c == '_');
- }
-
- int is_punct (char c, ref bool doread)
- {
- int idx = "{}[](),:;~+-*/%&|^!=<>?".IndexOf (c);
- int d;
- int t;
-
- doread = false;
-
- switch (c){
- case '[':
- return Token.OPEN_BRACKET;
- case ']':
- return Token.CLOSE_BRACKET;
- case '(':
- return Token.OPEN_PARENS;
- case ')':
- return Token.CLOSE_PARENS;
- case ',':
- return Token.COMMA;
- case ':':
- return Token.COLON;
- case '?':
- return Token.INTERR;
- }
-
- d = peekChar ();
- if (c == '+'){
-
- if (d == '+')
- t = Token.OP_INC;
- else if (d == '=')
- t = Token.OP_ADD_ASSIGN;
- else
- return Token.PLUS;
- doread = true;
- return t;
- }
- if (c == '-'){
- if (d == '=')
- t = Token.OP_SUB_ASSIGN;
- else
- return Token.MINUS;
- doread = true;
- return t;
- }
-
- if (c == '='){
- /*if (d == '='){
- doread = true;
- return Token.OP_EQ;
- }*/
- return Token.ASSIGN;
- }
-
- if (c == '*'){
- if (d == '='){
- doread = true;
- return Token.OP_MULT_ASSIGN;
- }
- return Token.STAR;
- }
-
- if (c == '/'){
- if (d == '='){
- doread = true;
- return Token.OP_DIV_ASSIGN;
- }
- return Token.DIV;
- }
-
- if (c == '\\'){
- if (d == '='){
- doread = true;
- return Token.OP_IDIV_ASSIGN;
- }
- return Token.OP_IDIV;
- }
-
- if (c == '^'){
- if (d == '='){
- doread = true;
- return Token.OP_EXP_ASSIGN;
- }
- return Token.OP_EXP;
- }
-
- if (c == '<'){
- if (d == '>')
- {
- doread = true;
- return Token.OP_NE;
- }
- if (d == '='){
- doread = true;
- return Token.OP_LE;
- }
- return Token.OP_LT;
- }
-
- if (c == '>'){
- if (d == '='){
- doread = true;
- return Token.OP_GE;
- }
- return Token.OP_GT;
- }
- return Token.ERROR;
- }
-
- bool decimal_digits (int c)
- {
- int d;
- bool seen_digits = false;
-
- if (c != -1)
- number.Append ((char) c);
-
- while ((d = peekChar ()) != -1){
- if (Char.IsDigit ((char)d)){
- number.Append ((char) d);
- getChar ();
- seen_digits = true;
- } else
- break;
- }
- return seen_digits;
- }
-
- void hex_digits (int c)
- {
- int d;
-
- if (c != -1)
- number.Append ((char) c);
- while ((d = peekChar ()) != -1){
- char e = Char.ToUpper ((char) d);
-
- if (Char.IsDigit (e) ||
- (e >= 'A' && e <= 'F')){
- number.Append ((char) e);
- getChar ();
- } else
- break;
- }
- }
-
- int real_type_suffix (int c)
- {
- int t;
-
- switch (c){
- case 'F': case 'f':
- t = Token.LITERAL_SINGLE;
- break;
- case 'D': case 'd':
- t = Token.LITERAL_DOUBLE;
- break;
- case 'M': case 'm':
- t= Token.LITERAL_DECIMAL;
- break;
- default:
- return Token.NONE;
- }
- getChar ();
- return t;
- }
-
- int integer_type_suffix (int c)
- {
- // FIXME: Handle U and L suffixes.
- // We also need to see in which kind of
- // Int the thing fits better according to the spec.
- return Token.LITERAL_INTEGER;
- }
-
- void adjust_int (int t)
- {
- val = new System.Int32();
- val = System.Int32.Parse (number.ToString (), 0);
- }
-
- int adjust_real (int t)
- {
- string s = number.ToString ();
-
- Console.WriteLine (s);
- switch (t){
- case Token.LITERAL_DECIMAL:
- val = new System.Decimal ();
- val = System.Decimal.Parse (
- s, styles, csharp_format_info);
- break;
- case Token.LITERAL_DOUBLE:
- val = new System.Double ();
- val = System.Double.Parse (
- s, styles, csharp_format_info);
- break;
- case Token.LITERAL_SINGLE:
- val = new System.Double ();
- val = (float) System.Double.Parse (
- s, styles, csharp_format_info);
- break;
-
- case Token.NONE:
- val = new System.Double ();
- val = System.Double.Parse (
- s, styles, csharp_format_info);
- t = Token.LITERAL_DOUBLE;
- break;
- }
- return t;
- }
-
- //
- // Invoked if we know we have .digits or digits
- //
- int is_number (int c)
- {
- bool is_real = false;
- number = new System.Text.StringBuilder ();
- int type;
-
- number.Length = 0;
-
- if (Char.IsDigit ((char)c)){
- if (c == '0' && peekChar () == 'x' || peekChar () == 'X'){
- getChar ();
- hex_digits (-1);
- val = new System.Int32 ();
- val = System.Int32.Parse (number.ToString (), NumberStyles.HexNumber);
- return integer_type_suffix (peekChar ());
- }
- decimal_digits (c);
- c = getChar ();
- }
-
- //
- // We need to handle the case of
- // "1.1" vs "1.string" (LITERAL_SINGLE vs NUMBER DOT IDENTIFIER)
- //
- if (c == '.'){
- if (decimal_digits ('.')){
- is_real = true;
- c = peekChar ();
- } else {
- putback ('.');
- number.Length -= 1;
- adjust_int (Token.LITERAL_INTEGER);
- return Token.LITERAL_INTEGER;
- }
- }
-
- if (c == 'e' || c == 'E'){
- is_real = true;
- number.Append ("e");
- getChar ();
-
- c = peekChar ();
- if (c == '+'){
- number.Append ((char) c);
- getChar ();
- c = peekChar ();
- } else if (c == '-'){
- number.Append ((char) c);
- getChar ();
- c = peekChar ();
- }
- decimal_digits (-1);
- c = peekChar ();
- }
-
- type = real_type_suffix (c);
- if (type == Token.NONE && !is_real){
- type = integer_type_suffix (c);
- adjust_int (type);
- putback (c);
- return type;
- } else
- is_real = true;
-
- if (is_real)
- return adjust_real (type);
-
- Console.WriteLine ("This should not be reached");
- throw new Exception ("Is Number should never reach this point");
- }
-
- int escape (int c)
- {
- int d;
- int v;
-
- d = peekChar ();
- if (c != '\\')
- return c;
-
- switch (d){
- case 'a':
- v = '\a'; break;
- case 'b':
- v = '\b'; break;
- case 'n':
- v = '\n'; break;
- case 't':
- v = '\t'; break;
- case 'v':
- v = '\v'; break;
- case 'r':
- v = 'c'; break;
- case '\\':
- v = '\\'; break;
- case 'f':
- v = '\f'; break;
- case '0':
- v = 0; break;
- case '"':
- v = '"'; break;
- case '\'':
- v = '\''; break;
- default:
- error_details = "cs1009: Unrecognized escape sequence " + (char)d;
- return -1;
- }
- getChar ();
- return v;
- }
-
- int getChar ()
- {
- if (putback_char != -1){
- int x = putback_char;
- putback_char = -1;
-
- return x;
- }
- return reader.Read ();
- }
-
- int peekChar ()
- {
- if (putback_char != -1)
- return putback_char;
- return reader.Peek ();
- }
-
- void putback (int c)
- {
- if (putback_char != -1)
- throw new Exception ("This should not happen putback on putback");
- putback_char = c;
- }
-
- public bool advance ()
- {
- return current_token != Token.EOF ;
- }
-
- public Object Value {
- get {
- return val;
- }
- }
-
- public Object value ()
- {
- return val;
- }
-
- public int token ()
- {
- current_token = xtoken ();
- if (current_token == 0)
- return Token.EOF;
- return current_token;
- }
-
- public int xtoken ()
- {
- int t;
- bool allow_keyword_as_ident = false;
- bool doread = false;
- int c;
-
- val = null;
- for (;(c = getChar ()) != -1; col++) {
-
- // Handle line comments.
- if (c == '\''){
- int d = getChar ();
- while ((d = getChar ()) != -1 && (d != '\n'))
- col++;
- line++;
- ref_line++;
- col = 0;
- if (current_token == Token.EOL) // if last token was also EOL keep skipping
- continue;
- return Token.EOL;
- }
-
- // Handle EOL.
- if (c == '\n')
- {
- line++;
- ref_line++;
- col = 0;
- if (current_token == Token.EOL) // if last token was also EOL keep skipping
- continue;
- return Token.EOL;
- }
-
- // Handle identifiers
- if (is_identifier_start_character ((char) c)){
- System.Text.StringBuilder id = new System.Text.StringBuilder ();
- string ids;
-
- id.Append ((char) c);
-
- while ((c = peekChar ()) != -1) {
- if (is_identifier_part_character ((char) c)){
- id.Append ((char)getChar ());
- col++;
- } else
- break;
- }
-
- ids = id.ToString ();
-
- if (!is_keyword (ids) || allow_keyword_as_ident) {
- val = ids;
- return Token.IDENTIFIER;
- }
-
- // true, false and null are in the hash anyway.
- return getKeyword (ids);
-
- }
-
- if (c == '.'){
- if (Char.IsDigit ((char) peekChar ()))
- return is_number (c);
- return Token.DOT;
- }
-
- if (Char.IsDigit ((char) c))
- return is_number (c);
-
- /* For now, ignore pre-processor commands */
- if (col == 1 && c == '#'){
- System.Text.StringBuilder s = new System.Text.StringBuilder ();
-
- while ((c = getChar ()) != -1 && (c != '\n')){
- s.Append ((char) c);
- }
- if (String.Compare (s.ToString (), 0, "line", 0, 4) == 0){
- string arg = s.ToString ().Substring (5);
- int pos;
-
- if ((pos = arg.IndexOf (' ')) != -1 && pos != 0){
- ref_line = System.Int32.Parse (arg.Substring (0, pos));
- pos++;
-
- char [] quotes = { '\"' };
-
- ref_name = arg.Substring (pos);
- ref_name.TrimStart (quotes);
- ref_name.TrimEnd (quotes);
- } else
- ref_line = System.Int32.Parse (arg);
- }
- line++;
- ref_line++;
- continue;
- }
-
- if ((t = is_punct ((char)c, ref doread)) != Token.ERROR){
- if (doread){
- getChar ();
- col++;
- }
- return t;
- }
-
- if (c == '"'){
- System.Text.StringBuilder s = new System.Text.StringBuilder ();
-
- while ((c = getChar ()) != -1){
- if (c == '"'){
- val = s.ToString ();
- return Token.LITERAL_STRING;
- }
-
- c = escape (c);
- if (c == -1)
- return Token.ERROR;
- s.Append ((char) c);
- }
- }
-
- // white space
- if (c == ' ' || c == '\t' || c == '\f' || c == '\v' || c == '\r'){
- if (c == '\t')
- col = (((col + 8) / 8) * 8) - 1;
-
- continue;
- }
-
- if (c == '@'){
- allow_keyword_as_ident = true;
- continue;
- }
-
- error_details = ((char)c).ToString ();
-
- return Token.ERROR;
- }
-
- if (current_token != Token.EOL) // if last token wasn´t EOL send it before EOF
- return Token.EOL;
-
- return Token.EOF;
- }
- }
-}
diff --git a/mcs/mcs/mcs.exe.config b/mcs/mcs/mcs.exe.config
deleted file mode 100644
index cf61d4baa0b..00000000000
--- a/mcs/mcs/mcs.exe.config
+++ /dev/null
@@ -1,11 +0,0 @@
-<configuration>
- <system.diagnostics>
- <trace autoflush="true" indentsize="4">
- <listeners>
- <add name="compilerLogListener" type="System.Diagnostics.TextWriterTraceListener,System"
- initializeData="mcs.log" />
- <remove type="System.Diagnostics.DefaultTraceListener,System"/>
- </listeners>
- </trace>
- </system.diagnostics>
-</configuration>
diff --git a/mcs/mcs/modifiers.cs b/mcs/mcs/modifiers.cs
deleted file mode 100755
index d2fa14d04ef..00000000000
--- a/mcs/mcs/modifiers.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-//
-// modifiers.cs: Modifier handling.
-//
-using System;
-using System.Reflection;
-
-namespace Mono.CSharp {
- public class Modifiers {
-
- //
- // The ordering of the following 4 constants
- // has been carefully done.
- //
- public const int PROTECTED = 0x0001;
- public const int PUBLIC = 0x0002;
- public const int PRIVATE = 0x0004;
- public const int INTERNAL = 0x0008;
- public const int NEW = 0x0010;
- public const int ABSTRACT = 0x0020;
- public const int SEALED = 0x0040;
- public const int STATIC = 0x0080;
- public const int READONLY = 0x0100;
- public const int VIRTUAL = 0x0200;
- public const int OVERRIDE = 0x0400;
- public const int EXTERN = 0x0800;
- public const int VOLATILE = 0x1000;
- public const int UNSAFE = 0x2000;
- public const int TOP = 0x2000;
-
- public const int Accessibility =
- PUBLIC | PROTECTED | INTERNAL | PRIVATE;
-
- static public string Name (int i)
- {
- string s = "";
-
- switch (i) {
- case Modifiers.NEW:
- s = "new"; break;
- case Modifiers.PUBLIC:
- s = "public"; break;
- case Modifiers.PROTECTED:
- s = "protected"; break;
- case Modifiers.INTERNAL:
- s = "internal"; break;
- case Modifiers.PRIVATE:
- s = "private"; break;
- case Modifiers.ABSTRACT:
- s = "abstract"; break;
- case Modifiers.SEALED:
- s = "sealed"; break;
- case Modifiers.STATIC:
- s = "static"; break;
- case Modifiers.READONLY:
- s = "readonly"; break;
- case Modifiers.VIRTUAL:
- s = "virtual"; break;
- case Modifiers.OVERRIDE:
- s = "override"; break;
- case Modifiers.EXTERN:
- s = "extern"; break;
- case Modifiers.VOLATILE:
- s = "volatile"; break;
- }
-
- return s;
- }
-
- public static TypeAttributes TypeAttr (int mod_flags, TypeContainer caller)
- {
- TypeAttributes t = 0;
- bool top_level = caller.IsTopLevel;
-
- if (top_level){
- if ((mod_flags & PUBLIC) != 0)
- t |= TypeAttributes.Public;
- if ((mod_flags & PRIVATE) != 0)
- t |= TypeAttributes.NotPublic;
- } else {
- if ((mod_flags & PUBLIC) != 0)
- t |= TypeAttributes.NestedPublic;
- if ((mod_flags & PRIVATE) != 0)
- t |= TypeAttributes.NestedPrivate;
- if ((mod_flags & PROTECTED) != 0 && (mod_flags & INTERNAL) != 0)
- t |= TypeAttributes.NestedFamORAssem;
- if ((mod_flags & PROTECTED) != 0)
- t |= TypeAttributes.NestedFamily;
- if ((mod_flags & INTERNAL) != 0)
- t |= TypeAttributes.NestedAssembly;
- }
-
- if ((mod_flags & SEALED) != 0)
- t |= TypeAttributes.Sealed;
- if ((mod_flags & ABSTRACT) != 0)
- t |= TypeAttributes.Abstract;
-
- // If we do not have static constructors, static methods
- // can be invoked without initializing the type.
- if (!caller.HaveStaticConstructor)
- t |= TypeAttributes.BeforeFieldInit;
-
- return t;
- }
-
- public static FieldAttributes FieldAttr (int mod_flags)
- {
- FieldAttributes fa = 0;
-
- if ((mod_flags & PUBLIC) != 0)
- fa |= FieldAttributes.Public;
- if ((mod_flags & PRIVATE) != 0)
- fa |= FieldAttributes.Private;
- if ((mod_flags & PROTECTED) != 0 && (mod_flags & INTERNAL) != 0)
- fa |= FieldAttributes.FamORAssem;
- if ((mod_flags & PROTECTED) != 0)
- fa |= FieldAttributes.Family;
- if ((mod_flags & INTERNAL) != 0)
- fa |= FieldAttributes.Assembly;
-
- if ((mod_flags & STATIC) != 0)
- fa |= FieldAttributes.Static;
- if ((mod_flags & READONLY) != 0)
- fa |= FieldAttributes.InitOnly;
-
- return fa;
- }
-
- public static MethodAttributes MethodAttr (int mod_flags)
- {
- MethodAttributes ma = 0;
-
- if ((mod_flags & PUBLIC) != 0)
- ma |= MethodAttributes.Public;
- if ((mod_flags & PRIVATE) != 0)
- ma |= MethodAttributes.Private;
- if ((mod_flags & PROTECTED) != 0 && (mod_flags & INTERNAL) != 0)
- ma |= MethodAttributes.FamORAssem;
- if ((mod_flags & PROTECTED) != 0)
- ma |= MethodAttributes.Family;
- if ((mod_flags & INTERNAL) != 0)
- ma |= MethodAttributes.Assembly;
-
-
- if ((mod_flags & STATIC) != 0)
- ma |= MethodAttributes.Static;
- if ((mod_flags & ABSTRACT) != 0){
- ma |= MethodAttributes.Abstract | MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
- }
- if ((mod_flags & SEALED) != 0)
- ma |= MethodAttributes.Final;
- if ((mod_flags & VIRTUAL) != 0)
- ma |= MethodAttributes.Virtual;
-
- if ((mod_flags & OVERRIDE) != 0)
- ma |= MethodAttributes.Virtual | MethodAttributes.HideBySig;
- else {
- if ((ma & MethodAttributes.Virtual) != 0)
- ma |= MethodAttributes.NewSlot;
- }
-
- if ((mod_flags & NEW) != 0)
- ma |= MethodAttributes.HideBySig;
-
- return ma;
- }
-
- // <summary>
- // Checks the object @mod modifiers to be in @allowed.
- // Returns the new mask. Side effect: reports any
- // incorrect attributes.
- // </summary>
- public static int Check (int allowed, int mod, int def_access, Location l)
- {
- int invalid_flags = (~allowed) & mod;
- int i;
-
- if (invalid_flags == 0){
- int a = mod;
-
- if ((mod & Modifiers.UNSAFE) != 0){
- if (!RootContext.Unsafe){
- Report.Error (227, l,
- "Unsafe code requires the --unsafe command " +
- "line option to be specified");
- }
- }
-
- //
- // If no accessibility bits provided
- // then provide the defaults.
- //
- if ((mod & Accessibility) == 0){
- mod |= def_access;
- return mod;
- }
-
- //
- // Make sure that no conflicting accessibility
- // bits have been set. Protected+Internal is
- // allowed, that is why they are placed on bits
- // 1 and 4 (so the shift 3 basically merges them)
- //
- a &= 15;
- a |= (a >> 3);
- a = ((a & 2) >> 1) + (a & 5);
- a = ((a & 4) >> 2) + (a & 3);
- if (a > 1)
- Report.Error (107, l, "More than one protection modifier specified");
-
- return mod;
- }
-
- for (i = 1; i < TOP; i <<= 1){
- if ((i & invalid_flags) == 0)
- continue;
-
- Report.Error (106, l, "the modifier `" + Name (i) +
- "' is not valid for this item");
- }
-
- return allowed & mod;
- }
- }
-}
diff --git a/mcs/mcs/namespace.cs b/mcs/mcs/namespace.cs
deleted file mode 100755
index f9ccd2e9369..00000000000
--- a/mcs/mcs/namespace.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// namespace.cs: Tracks namespaces
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-using System;
-using System.Collections;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Keeps track of the namespaces defined in the C# code.
- /// </summary>
- public class Namespace {
- Namespace parent;
- string name;
- ArrayList using_clauses;
- Hashtable aliases;
- bool decl_found = false;
-
- /// <summary>
- /// Constructor Takes the current namespace and the
- /// name. This is bootstrapped with parent == null
- /// and name = ""
- /// </summary>
- public Namespace (Namespace parent, string name)
- {
- this.name = name;
- this.parent = parent;
- }
-
- /// <summary>
- /// The qualified name of the current namespace
- /// </summary>
- public string Name {
- get {
- string pname = parent != null ? parent.Name : "";
-
- if (pname == "")
- return name;
- else
- return parent.Name + "." + name;
- }
- }
-
- /// <summary>
- /// The parent of this namespace, used by the parser to "Pop"
- /// the current namespace declaration
- /// </summary>
- public Namespace Parent {
- get {
- return parent;
- }
- }
-
- /// <summary>
- /// When a declaration is found in a namespace,
- /// we call this function, to emit an error if the
- /// program attempts to use a using clause afterwards
- /// </summary>
- public void DeclarationFound ()
- {
- decl_found = true;
- }
-
- /// <summary>
- /// Records a new namespace for resolving name references
- /// </summary>
- public void Using (string ns)
- {
- if (decl_found){
- CSharpParser.error (1529, "A using clause must precede all other namespace elements");
- return;
- }
-
- if (using_clauses == null)
- using_clauses = new ArrayList ();
-
- using_clauses.Add (ns);
- }
-
- public ArrayList UsingTable {
- get {
- return using_clauses;
- }
- }
-
- public void UsingAlias (string alias, string namespace_or_type, Location loc)
- {
- if (aliases == null)
- aliases = new Hashtable ();
-
- if (aliases.Contains (alias)){
- Report.Error (1537, loc, "The using alias `" + alias +
- "' appeared previously in this namespace");
- return;
- }
-
- aliases [alias] = namespace_or_type;
- }
-
- public string LookupAlias (string alias)
- {
- string value = null;
-
- // System.Console.WriteLine ("Lookup " + alias + " in " + name);
-
- if (aliases != null)
- value = (string) (aliases [alias]);
- if (value == null && Parent != null)
- value = Parent.LookupAlias (alias);
-
- return value;
- }
-
- /// <summary>
- /// Used to validate that all the using clauses are correct
- /// after we are finished parsing all the files
- /// </summary>
- public void VerifyUsing ()
- {
- foreach (DictionaryEntry de in using_clauses){
- if (de.Value == null){
- string name = (string) de.Key;
-
- CSharpParser.error (234, "The type or namespace `" +
- name + "' does not exist in the " +
- "class or namespace `" + name + "'");
- }
- }
- }
-
- }
-}
-
diff --git a/mcs/mcs/old-code.cs b/mcs/mcs/old-code.cs
deleted file mode 100755
index 271ffa2a7f5..00000000000
--- a/mcs/mcs/old-code.cs
+++ /dev/null
@@ -1,216 +0,0 @@
-#else
-
- bla bla bla
- //
- // This code is more conformant to the spec (it follows it step by step),
- // but it has not been tested yet, and there is nothing here that is not
- // caught by the above code. But it might be a better foundation to improve
- // on in the future
- //
- public ResolveTypeMemberAccess (EmitContext ec, Expression member_lookup,
- Expression left, Location loc)
- {
- if (member_lookup is TypeExpr){
- member_lookup.Resolve (ec);
- return member_lookup;
- }
-
- if (member_lookup is MethodGroupExpr){
- if (!mg.RemoveStaticMethods ()){
- SimpleName.Error120 (loc, mg.Methods [0].Name);
- return null;
- }
-
- return member_lookup;
- }
-
- if (member_lookup is PropertyExpr){
- PropertyExpr pe = (PropertyExpr) member_lookup;
-
- if (!pe.IsStatic){
- SimpleName.Error120 (loc, pe.PropertyInfo.Name);
- return null;
- }
- return pe;
- }
-
- if (member_lookup is FieldExpr){
- FieldExpr fe = (FieldExpr) member_lookup;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi is FieldBuilder) {
- Const c = TypeManager.LookupConstant ((FieldBuilder) fi);
-
- if (c != null) {
- object o = c.LookupConstantValue (ec);
- return Constantify (o, fi.FieldType);
- }
- }
-
- if (fi.IsLiteral) {
- Type t = fi.FieldType;
- Type decl_type = fi.DeclaringType;
- object o;
-
- if (fi is FieldBuilder)
- o = TypeManager.GetValue ((FieldBuilder) fi);
- else
- o = fi.GetValue (fi);
-
- if (decl_type.IsSubclassOf (TypeManager.enum_type)) {
- Expression enum_member = MemberLookup (
- ec, decl_type, "value__", loc);
-
- Enum en = TypeManager.LookupEnum (decl_type);
-
- Constant c;
- if (en != null)
- c = Constantify (o, en.UnderlyingType);
- else
- c = Constantify (o, enum_member.Type);
-
- return new EnumConstant (c, decl_type);
- }
-
- Expression exp = Constantify (o, t);
-
- return exp;
- }
-
- if (!fe.FieldInfo.IsStatic){
- error176 (loc, fe.FieldInfo.Name);
- return null;
- }
- return member_lookup;
- }
-
- if (member_lookup is EventExpr){
-
- EventExpr ee = (EventExpr) member_lookup;
-
- //
- // If the event is local to this class, we transform ourselves into
- // a FieldExpr
- //
-
- Expression ml = MemberLookup (
- ec, ec.TypeContainer.TypeBuilder, ee.EventInfo.Name,
- MemberTypes.Event, AllBindingFlags, loc);
-
- if (ml != null) {
- MemberInfo mi = ec.TypeContainer.GetFieldFromEvent ((EventExpr) ml);
-
- ml = ExprClassFromMemberInfo (ec, mi, loc);
-
- if (ml == null) {
- Report.Error (-200, loc, "Internal error!!");
- return null;
- }
-
- return ResolveMemberAccess (ec, ml, left, loc);
- }
-
- if (!ee.IsStatic) {
- SimpleName.Error120 (loc, ee.EventInfo.Name);
- return null;
- }
-
- return ee;
- }
-
- Console.WriteLine ("Left is: " + left);
- Report.Error (-100, loc, "Support for [" + member_lookup + "] is not present yet");
- Environment.Exit (0);
-
- return null;
- }
-
- public ResolveInstanceMemberAccess (EmitContext ec, Expression member_lookup,
- Expression left, Location loc)
- {
- if (member_lookup is MethodGroupExpr){
- //
- // Instance.MethodGroup
- //
- if (!mg.RemoveStaticMethods ()){
- error176 (loc, mg.Methods [0].Name);
- return null;
- }
-
- mg.InstanceExpression = left;
-
- return member_lookup;
- }
-
- if (member_lookup is PropertyExpr){
- PropertyExpr pe = (PropertyExpr) member_lookup;
-
- if (pe.IsStatic){
- error176 (loc, pe.PropertyInfo.Name);
- return null;
- }
- pe.InstanceExpression = left;
-
- return pe;
- }
-
- Type left_type = left.type;
-
- if (left_type.IsValueType){
- } else {
-
- }
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are the sole users of ResolveWithSimpleName (ie, the only
- // ones that can cope with it
- //
- expr = expr.ResolveWithSimpleName (ec);
-
- if (expr == null)
- return null;
-
- if (expr is SimpleName){
- SimpleName child_expr = (SimpleName) expr;
-
- expr = new SimpleName (child_expr.Name + "." + Identifier, loc);
-
- return expr.ResolveWithSimpleName (ec);
- }
-
- //
- // Handle enums here when they are in transit.
- // Note that we cannot afford to hit MemberLookup in this case because
- // it will fail to find any members at all (Why?)
- //
-
- Type expr_type = expr.Type;
- if (expr_type.IsSubclassOf (TypeManager.enum_type)) {
-
- Enum en = TypeManager.LookupEnum (expr_type);
-
- if (en != null) {
- object value = en.LookupEnumValue (ec, Identifier, loc);
-
- if (value == null)
- return null;
-
- Constant c = Constantify (value, en.UnderlyingType);
- return new EnumConstant (c, expr_type);
- }
- }
-
- member_lookup = MemberLookup (ec, expr.Type, Identifier, loc);
-
- if (member_lookup == null)
- return null;
-
- if (expr is TypeExpr)
- return ResolveTypeMemberAccess (ec, member_lookup, expr, loc);
- else
- return ResolveInstanceMemberAccess (ec, member_lookup, expr, loc);
- }
-#endif
diff --git a/mcs/mcs/parameter.cs b/mcs/mcs/parameter.cs
deleted file mode 100755
index 843028f9208..00000000000
--- a/mcs/mcs/parameter.cs
+++ /dev/null
@@ -1,335 +0,0 @@
-//
-// parameter.cs: Parameter definition.
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-//
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Collections;
-
-namespace Mono.CSharp {
-
-
- /// <summary>
- /// Represents a single method parameter
- /// </summary>
- public class Parameter {
- [Flags]
- public enum Modifier : byte {
- NONE = 0,
- REF = 1,
- OUT = 2,
- PARAMS = 4,
- }
-
- public readonly string TypeName;
- public readonly string Name;
- public readonly Modifier ModFlags;
- public Attributes OptAttributes;
- public Type ParameterType;
-
- public Parameter (string type, string name, Modifier mod, Attributes attrs)
- {
- Name = name;
- ModFlags = mod;
- TypeName = type;
- OptAttributes = attrs;
- }
-
- public bool Resolve (DeclSpace ds, Location l)
- {
- ParameterType = RootContext.LookupType (ds, TypeName, false, l);
- return ParameterType != null;
- }
-
- public Type ExternalType (DeclSpace ds, Location l)
- {
- if ((ModFlags & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0){
- string n = ParameterType.FullName + "&";
-
- Type t = RootContext.LookupType (ds, n, false, l);
-
- return t;
- }
-
- return ParameterType;
- }
-
- public ParameterAttributes Attributes {
- get {
- switch (ModFlags){
- case Modifier.NONE:
- return ParameterAttributes.None;
- case Modifier.REF:
- return ParameterAttributes.None;
- case Modifier.OUT:
- return ParameterAttributes.Out;
- case Modifier.PARAMS:
- return 0;
- }
-
- return ParameterAttributes.None;
- }
- }
-
- /// <summary>
- /// Returns the signature for this parameter evaluating it on the
- /// @tc context
- /// </summary>
- public string GetSignature (DeclSpace ds, Location loc)
- {
- if (ParameterType == null){
- if (!Resolve (ds, loc))
- return null;
- }
-
- return ExternalType (ds, loc).FullName;
- }
- }
-
- /// <summary>
- /// Represents the methods parameters
- /// </summary>
- public class Parameters {
- public Parameter [] FixedParameters;
- public readonly Parameter ArrayParameter;
- string signature;
- Type [] types;
- Location loc;
-
- static Parameters empty_parameters;
-
- public Parameters (Parameter [] fixed_parameters, Parameter array_parameter, Location l)
- {
- FixedParameters = fixed_parameters;
- ArrayParameter = array_parameter;
- loc = l;
- }
-
- /// <summary>
- /// This is used to reuse a set of empty parameters, because they
- /// are common
- /// </summary>
- public static Parameters GetEmptyReadOnlyParameters ()
- {
- if (empty_parameters == null)
- empty_parameters = new Parameters (null, null, Location.Null);
-
- return empty_parameters;
- }
-
- public bool Empty {
- get {
- return (FixedParameters == null) && (ArrayParameter == null);
- }
- }
-
- public void ComputeSignature (DeclSpace ds)
- {
- signature = "";
- if (FixedParameters != null){
- for (int i = 0; i < FixedParameters.Length; i++){
- Parameter par = FixedParameters [i];
-
- signature += par.GetSignature (ds, loc);
- }
- }
- //
- // Note: as per the spec, the `params' arguments (ArrayParameter)
- // are not used in the signature computation for a method
- //
- }
-
- static void error100 (string name)
- {
- Report.Error (
- 100, "The parameter name `" + name + "' is a duplicate");
- }
-
- public bool VerifyArgs ()
- {
- int count;
- int i, j;
-
- if (FixedParameters == null)
- return true;
-
- count = FixedParameters.Length;
- string array_par_name = ArrayParameter != null ? ArrayParameter.Name : null;
- for (i = 0; i < count; i++){
- string base_name = FixedParameters [i].Name;
-
- for (j = i + 1; j < count; j++){
- if (base_name != FixedParameters [j].Name)
- continue;
- error100 (base_name);
- return false;
- }
-
- if (base_name == array_par_name){
- error100 (base_name);
- return false;
- }
- }
- return true;
- }
-
- /// <summary>
- /// Returns the signature of the Parameters evaluated in
- /// the @tc environment
- /// </summary>
- public string GetSignature (DeclSpace ds)
- {
- if (signature == null){
- VerifyArgs ();
- ComputeSignature (ds);
- }
-
- return signature;
- }
-
- /// <summary>
- /// Returns the paramenter information based on the name
- /// </summary>
- public Parameter GetParameterByName (string name, out int idx)
- {
- idx = 0;
- int i = 0;
-
- if (FixedParameters != null){
- foreach (Parameter par in FixedParameters){
- if (par.Name == name){
- idx = i;
- return par;
- }
- i++;
- }
- }
-
- if (ArrayParameter != null){
- if (name == ArrayParameter.Name){
- idx = i;
- return ArrayParameter;
- }
- }
-
- return null;
- }
-
- bool ComputeParameterTypes (DeclSpace ds)
- {
- int extra = (ArrayParameter != null) ? 1 : 0;
- int i = 0;
- int pc;
-
- if (FixedParameters == null)
- pc = extra;
- else
- pc = extra + FixedParameters.Length;
-
- types = new Type [pc];
-
- if (!VerifyArgs ()){
- FixedParameters = null;
- return false;
- }
-
- if (FixedParameters != null){
- foreach (Parameter p in FixedParameters){
- Type t = null;
-
- if (p.Resolve (ds, loc))
- t = p.ExternalType (ds, loc);
-
- types [i] = t;
- i++;
- }
- }
-
- if (extra > 0){
- if (ArrayParameter.Resolve (ds, loc))
- types [i] = ArrayParameter.ExternalType (ds, loc);
- }
-
- return true;
- }
-
- /// <summary>
- /// Returns the argument types as an array
- /// </summary>
- static Type [] no_types = new Type [0];
-
- public Type [] GetParameterInfo (DeclSpace ds)
- {
- if (types != null)
- return types;
-
- if (FixedParameters == null && ArrayParameter == null)
- return no_types;
-
- if (ComputeParameterTypes (ds) == false)
- return null;
-
- return types;
- }
-
- /// <summary>
- /// Returns the type of a given parameter, and stores in the `is_out'
- /// boolean whether this is an out or ref parameter.
- ///
- /// Note that the returned type will not contain any dereference in this
- /// case (ie, you get "int" for a ref int instead of "int&"
- /// </summary>
- public Type GetParameterInfo (DeclSpace ds, int idx, out bool is_out)
- {
- is_out = false;
-
- if (!VerifyArgs ()){
- FixedParameters = null;
- return null;
- }
-
- if (FixedParameters == null && ArrayParameter == null)
- return null;
-
- if (types == null)
- if (ComputeParameterTypes (ds) == false){
- is_out = false;
- return null;
- }
-
- //
- // If this is a request for the variable lenght arg.
- //
- int array_idx = (FixedParameters != null ? FixedParameters.Length : 0);
- if (idx == array_idx){
- is_out = false;
- return types [idx];
- }
-
- //
- // Otherwise, it is a fixed parameter
- //
- Parameter p = FixedParameters [idx];
- is_out = ((p.ModFlags & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0);
-
- return p.ParameterType;
- }
-
- public CallingConventions GetCallingConvention ()
- {
- // For now this is the only correc thing to do
- return CallingConventions.Standard;
- }
- }
-}
-
-
-
diff --git a/mcs/mcs/parameterCollection.cs b/mcs/mcs/parameterCollection.cs
deleted file mode 100755
index 222742544b1..00000000000
--- a/mcs/mcs/parameterCollection.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// System.CodeDOM CodeParameterCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace Mono.CSharp {
-
- using System.Collections;
- using System;
-
- public class ParameterCollection : IList, ICollection, IEnumerable {
-
- ArrayList parameters;
-
- //
- // Constructors
- //
- public ParameterCollection ()
- {
- parameters = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return parameters.Count;
- }
- }
-
- //
- // Methods
- //
- public void Add (Parameter value)
- {
- parameters.Add (value);
- }
-
- public void AddRange (Parameter [] values)
- {
- foreach (Parameter ca in values)
- parameters.Add (ca);
-
- }
-
- public void Clear ()
- {
- parameters.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private ParameterCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (ParameterCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new ParameterCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return parameters.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return parameters.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return parameters.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- parameters [index] = value;
- }
-
- public object this[int index] {
- get {
- return parameters [index];
- }
-
- set {
- parameters [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- parameters.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- parameters.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- parameters.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return parameters.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return parameters.IsSynchronized;
- }
- }
-
- public bool IsFixedSize {
- get {
- return false;
- }
- }
- }
-}
diff --git a/mcs/mcs/parser.cs b/mcs/mcs/parser.cs
deleted file mode 100755
index c30a354ff91..00000000000
--- a/mcs/mcs/parser.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-
-namespace Compiler {
-
- using System;
-
- abstract public class Parser {
- public string name;
- public System.IO.Stream input;
-
- public Parser (Mono.CSharp.Tree tree, string name, System.IO.Stream stream)
- {
- this.tree = tree;
- this.name = name;
- this.input = stream;
- }
-
- public string getName (){
- return name;
- }
-
- abstract public int parse ();
- }
-}
diff --git a/mcs/mcs/report.cs b/mcs/mcs/report.cs
deleted file mode 100644
index 574ec6588b7..00000000000
--- a/mcs/mcs/report.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-//
-// report.cs: report errors and warnings.
-//
-// Author: Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc. (http://www.ximian.com)
-//
-
-//
-// FIXME: currently our class library does not support custom number format strings
-//
-using System;
-using System.Collections;
-using System.Diagnostics;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// This class is used to report errors and warnings t te user.
- /// </summary>
- public class Report {
- /// <summary>
- /// Errors encountered so far
- /// </summary>
- static public int Errors;
-
- /// <summary>
- /// Warnings encountered so far
- /// </summary>
- static public int Warnings;
-
- /// <summary>
- /// Whether errors should be throw an exception
- /// </summary>
- static public bool Fatal;
-
- /// <summary>
- /// Whether warnings should be considered errors
- /// </summary>
- static public bool WarningsAreErrors;
-
- /// <summary>
- /// Whether to dump a stack trace on errors.
- /// </summary>
- static public bool Stacktrace;
-
- //
- // If the error code is reported on the given line,
- // then the process exits with a unique error code.
- //
- // Used for the test suite to excercise the error codes
- //
- static int probe_error = 0;
-
- //
- // Keeps track of the warnings that we are ignoring
- //
- static Hashtable warning_ignore_table;
-
- static void Check (int code)
- {
- if (code == probe_error){
- Environment.Exit (123);
- }
- }
-
- static public void RealError (string msg)
- {
- Errors++;
- Console.WriteLine (msg);
-
- if (Stacktrace)
- Console.WriteLine (new StackTrace ().ToString ());
- if (Fatal)
- throw new Exception (msg);
- }
-
- static public void Error (int code, Location l, string text)
- {
- string msg = String.Format (
-// "{0}({1}) error CS{2:0000}: {3}", l.Name, l.Row, code, text);
- "{0}({1}) error CS{2}: {3}", l.Name, l.Row, code, text);
-
- RealError (msg);
- Check (code);
- }
-
- static public void Warning (int code, Location l, string text)
- {
- if (warning_ignore_table != null){
- if (warning_ignore_table.Contains (code))
- return;
- }
-
- if (WarningsAreErrors)
- Error (code, l, text);
- else {
- string row;
-
- if (Location.IsNull (l))
- row = "";
- else
- row = l.Row.ToString ();
-
- Console.WriteLine (String.Format (
-// "{0}({1}) warning CS{2:0000}: {3}",
- "{0}({1}) warning CS{2}: {3}",
- l.Name, row, code, text));
- Warnings++;
- Check (code);
- }
- }
-
- static public void Warning (int code, string text)
- {
- Warning (code, Location.Null, text);
- }
-
- static public void Error (int code, string text)
- {
-// string msg = String.Format ("error CS{0:0000}: {1}", code, text);
- string msg = String.Format ("error CS{0}: {1}", code, text);
-
- RealError (msg);
- Check (code);
- }
-
- static public void Message (Message m)
- {
- if (m is ErrorMessage)
- Error (m.code, m.text);
- else
- Warning (m.code, m.text);
- }
-
- static public void SetIgnoreWarning (int code)
- {
- if (warning_ignore_table == null)
- warning_ignore_table = new Hashtable ();
-
- warning_ignore_table [code] = true;
- }
-
- static public void SetProbe (int code)
- {
- probe_error = code;
- }
-
- static public int ProbeCode {
- get {
- return probe_error;
- }
- }
- }
-
- public class Message {
- public int code;
- public string text;
-
- public Message (int code, string text)
- {
- this.code = code;
- this.text = text;
- }
- }
-
- public class WarningMessage : Message {
- public WarningMessage (int code, string text) : base (code, text)
- {
- }
- }
-
- public class ErrorMessage : Message {
- public ErrorMessage (int code, string text) : base (code, text)
- {
- }
-
- //
- // For compatibility reasons with old code.
- //
- public static void report_error (string error)
- {
- Console.Write ("ERROR: ");
- Console.WriteLine (error);
- }
- }
-}
-
-
diff --git a/mcs/mcs/rootcontext.cs b/mcs/mcs/rootcontext.cs
deleted file mode 100755
index c3a6ac55f67..00000000000
--- a/mcs/mcs/rootcontext.cs
+++ /dev/null
@@ -1,453 +0,0 @@
-//
-// rootcontext.cs: keeps track of our tree representation, and assemblies loaded.
-//
-// Author: Miguel de Icaza (miguel@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Diagnostics;
-
-namespace Mono.CSharp {
-
- public class RootContext {
-
- //
- // Contains the parsed tree
- //
- static Tree tree;
-
- //
- // Contains loaded assemblies and our generated code as we go.
- //
- static public TypeManager TypeManager;
-
- //
- // The System.Reflection.Emit CodeGenerator
- //
- static CodeGen cg;
-
- static public bool Optimize;
-
- //
- // The module builder pointer.
- //
- static ModuleBuilder mb;
-
- //
- // The list of global attributes (those that target the assembly)
- //
- static Attributes global_attributes;
-
- //
- // Whether we are being linked against the standard libraries.
- // This is only used to tell whether `System.Object' should
- // have a parent or not.
- //
- public static bool StdLib = true;
-
- //
- // This keeps track of the order in which classes were defined
- // so that we can poulate them in that order.
- //
- // Order is important, because we need to be able to tell by
- // examining the parent's list of methods which ones are virtual
- // or abstract as well as the parent names (to implement new,
- // override).
- //
- static ArrayList type_container_resolve_order;
- static ArrayList interface_resolve_order;
-
- //
- // Holds a reference to the Private Implementation Details
- // class.
- //
- static TypeBuilder impl_details_class;
-
- public static int WarningLevel = 2;
-
- //
- // Constructor
- //
- static RootContext ()
- {
- tree = new Tree ();
- TypeManager = new TypeManager ();
- }
-
- static public Tree Tree {
- get {
- return tree;
- }
- }
-
- static public string MainClass;
-
- static public CodeGen CodeGen {
- get {
- return cg;
- }
-
- set {
- //
- // Temporary hack, we should probably
- // intialize `cg' rather than depending on
- // external initialization of it.
- //
- cg = value;
- mb = cg.ModuleBuilder;
- }
- }
-
- public static void RegisterOrder (Interface iface)
- {
- interface_resolve_order.Add (iface);
- }
-
- public static void RegisterOrder (TypeContainer tc)
- {
- type_container_resolve_order.Add (tc);
- }
-
- //
- // The default compiler checked state
- //
- static public bool Checked = false;
-
- //
- // Whether to allow Unsafe code
- //
- static public bool Unsafe = false;
-
- static string MakeFQN (string nsn, string name)
- {
- string prefix = (nsn == "" ? "" : nsn + ".");
-
- return prefix + name;
- }
-
- // <remarks>
- // This function is used to resolve the hierarchy tree.
- // It processes interfaces, structs and classes in that order.
- //
- // It creates the TypeBuilder's as it processes the user defined
- // types.
- // </remarks>
- static public void ResolveTree ()
- {
- //
- // Interfaces are processed first, as classes and
- // structs might inherit from an object or implement
- // a set of interfaces, we need to be able to tell
- // them appart by just using the TypeManager.
- //
-
- TypeContainer root = Tree.Types;
-
- ArrayList ifaces = root.Interfaces;
- if (ifaces != null){
- interface_resolve_order = new ArrayList ();
-
- foreach (Interface i in ifaces)
- i.DefineInterface (mb);
- }
-
- type_container_resolve_order = new ArrayList ();
-
- foreach (TypeContainer tc in root.Types)
- tc.DefineType (mb);
-
- if (root.Delegates != null)
- foreach (Delegate d in root.Delegates)
- d.DefineDelegate (mb);
-
- if (root.Enums != null)
- foreach (Enum e in root.Enums)
- e.DefineEnum (mb);
-
- }
-
- // <summary>
- // Closes all open types
- // </summary>
- //
- // <remarks>
- // We usually use TypeBuilder types. When we are done
- // creating the type (which will happen after we have added
- // methods, fields, etc) we need to "Define" them before we
- // can save the Assembly
- // </remarks>
- static public void CloseTypes ()
- {
- TypeContainer root = Tree.Types;
-
- ArrayList ifaces = root.Interfaces;
-
- if (root.Enums != null)
- foreach (Enum en in root.Enums)
- en.CloseType ();
-
- if (interface_resolve_order != null){
- foreach (Interface iface in interface_resolve_order)
- iface.CloseType ();
- }
-
- //
- // We do this in two passes, first we close the structs,
- // then the classes, because it seems the code needs it this
- // way. If this is really what is going on, we should probably
- // make sure that we define the structs in order as well.
- //
- if (type_container_resolve_order != null){
- foreach (TypeContainer tc in type_container_resolve_order){
- if (tc is Struct && tc.Parent == tree.Types){
- tc.CloseType ();
- }
- }
-
- foreach (TypeContainer tc in type_container_resolve_order){
- if (!(tc is Struct && tc.Parent == tree.Types))
- tc.CloseType ();
- }
- }
-
- if (root.Delegates != null)
- foreach (Delegate d in root.Delegates)
- d.CloseDelegate ();
-
-
- //
- // If we have a <PrivateImplementationDetails> class, close it
- //
- if (impl_details_class != null){
- impl_details_class.CreateType ();
- }
- }
-
- //
- // Public function used to locate types, this can only
- // be used after the ResolveTree function has been invoked.
- //
- // Returns: Type or null if they type can not be found.
- //
- static public Type LookupType (DeclSpace ds, string name, bool silent, Location loc)
- {
- Type t;
-
- //
- // For the case the type we are looking for is nested within this one
- // or any base class
- //
- DeclSpace containing_ds = ds;
- while (containing_ds != null){
- Type current_type = containing_ds.TypeBuilder;
-
- while (current_type != null) {
- t = TypeManager.LookupType (current_type.FullName + "+" + name);
- if (t != null)
- return t;
- current_type = current_type.BaseType;
- }
-
- containing_ds = containing_ds.Parent;
- }
-
- t = TypeManager.LookupType (MakeFQN (ds.Namespace.Name, name));
- if (t != null)
- return t;
-
- // It's possible that name already is fully qualified. So we do
- // a simple direct lookup without adding any namespace names
-
- t = TypeManager.LookupType (name);
- if (t != null)
- return t;
-
- for (Namespace ns = ds.Namespace; ns != null; ns = ns.Parent){
- ArrayList using_list = ns.UsingTable;
-
- if (using_list == null)
- continue;
-
- foreach (string n in using_list){
- t = TypeManager.LookupType (MakeFQN (n, name));
- if (t != null)
- return t;
- }
- }
-
- if (!silent)
- Report.Error (246, loc, "Cannot find type `"+name+"'");
-
- return null;
- }
-
- // <summary>
- // This is the silent version of LookupType, you can use this
- // to `probe' for a type
- // </summary>
- static public Type LookupType (TypeContainer tc, string name, Location loc)
- {
- return LookupType (tc, name, true, loc);
- }
-
- static public bool IsNamespace (string name)
- {
- Namespace ns;
-
- if (tree.Namespaces != null){
- ns = (Namespace) tree.Namespaces [name];
-
- if (ns != null)
- return true;
- }
-
- return false;
- }
-
- static void Report1530 (Location loc)
- {
- Report.Error (1530, loc, "Keyword new not allowed for namespace elements");
- }
-
- // <summary>
- // Populates the structs and classes with fields and methods
- // </summary>
- //
- // This is invoked after all interfaces, structs and classes
- // have been defined through `ResolveTree'
- static public void PopulateTypes ()
- {
- TypeContainer root = Tree.Types;
-
- if (interface_resolve_order != null){
- foreach (Interface iface in interface_resolve_order)
- if ((iface.ModFlags & Modifiers.NEW) == 0)
- iface.Define (root);
- else
- Report1530 (iface.Location);
- }
-
-
- if (type_container_resolve_order != null){
- foreach (TypeContainer tc in type_container_resolve_order)
- if ((tc.ModFlags & Modifiers.NEW) == 0)
- tc.Define (root);
- else
- Report1530 (tc.Location);
- }
-
- ArrayList delegates = root.Delegates;
- if (delegates != null){
- foreach (Delegate d in delegates)
- if ((d.ModFlags & Modifiers.NEW) == 0)
- d.Define (root);
- else
- Report1530 (d.Location);
- }
-
- ArrayList enums = root.Enums;
- if (enums != null){
- foreach (Enum en in enums)
- if ((en.ModFlags & Modifiers.NEW) == 0)
- en.Define (root);
- else
- Report1530 (en.Location);
- }
- }
-
- static public void EmitCode ()
- {
- if (type_container_resolve_order != null){
- foreach (TypeContainer tc in type_container_resolve_order)
- tc.EmitConstants ();
-
- foreach (TypeContainer tc in type_container_resolve_order)
- tc.Emit ();
- }
-
- if (global_attributes != null){
- EmitContext ec = new EmitContext (
- tree.Types, Mono.CSharp.Location.Null, null, null, 0, false);
- AssemblyBuilder ab = cg.AssemblyBuilder;
-
- Attribute.ApplyAttributes (ec, ab, ab, global_attributes,
- global_attributes.Location);
- }
-
- if (Unsafe) {
- ConstructorInfo ci = TypeManager.unverifiable_code_type.GetConstructor (new Type [0]);
-
- if (ci == null) {
- Console.WriteLine ("Internal error !");
- return;
- }
-
- CustomAttributeBuilder cb = new CustomAttributeBuilder (ci, new object [0]);
- mb.SetCustomAttribute (cb);
- }
- }
-
- static public ModuleBuilder ModuleBuilder {
- get {
- return mb;
- }
- }
-
- //
- // Public Field, used to track which method is the public entry
- // point.
- //
- static public MethodInfo EntryPoint;
-
- //
- // These are used to generate unique names on the structs and fields.
- //
- static int field_count;
-
- //
- // Makes an initialized struct, returns the field builder that
- // references the data. Thanks go to Sergey Chaban for researching
- // how to do this. And coming up with a shorter mechanism than I
- // was able to figure out.
- //
- // This works but makes an implicit public struct $ArrayType$SIZE and
- // makes the fields point to it. We could get more control if we did
- // use instead:
- //
- // 1. DefineNestedType on the impl_details_class with our struct.
- //
- // 2. Define the field on the impl_details_class
- //
- static public FieldBuilder MakeStaticData (byte [] data)
- {
- FieldBuilder fb;
- int size = data.Length;
-
- if (impl_details_class == null)
- impl_details_class = mb.DefineType (
- "<PrivateImplementationDetails>", TypeAttributes.NotPublic);
-
- fb = impl_details_class.DefineInitializedData (
- "$$field-" + (field_count++), data,
- FieldAttributes.Static | FieldAttributes.Assembly);
-
- return fb;
- }
-
- static public void AddGlobalAttributes (AttributeSection sect, Location loc)
- {
- if (global_attributes == null)
- global_attributes = new Attributes (sect, loc);
-
- global_attributes.AddAttribute (sect);
- }
- }
-}
-
-
diff --git a/mcs/mcs/statement.cs b/mcs/mcs/statement.cs
deleted file mode 100755
index 1d0b8ccdc09..00000000000
--- a/mcs/mcs/statement.cs
+++ /dev/null
@@ -1,2510 +0,0 @@
-//
-// statement.cs: Statement representation for the IL tree.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Diagnostics;
-
-namespace Mono.CSharp {
-
- using System.Collections;
-
- public abstract class Statement {
-
- /// <summary>
- /// Return value indicates whether all code paths emitted return.
- /// </summary>
- public abstract bool Emit (EmitContext ec);
-
- /// <remarks>
- /// Emits a bool expression.
- /// </remarks>
- public static Expression EmitBoolExpression (EmitContext ec, Expression e,
- Label target, bool isTrue, Location loc)
- {
- e = e.Resolve (ec);
-
- if (e == null)
- return null;
-
- if (e.Type != TypeManager.bool_type){
- e = Expression.ConvertImplicit (ec, e, TypeManager.bool_type,
- new Location (-1));
- }
-
- if (e == null){
- Report.Error (
- 31, loc, "Can not convert the expression to a boolean");
- return null;
- }
-
- bool invert = false;
- if (e is Unary){
- Unary u = (Unary) e;
-
- if (u.Oper == Unary.Operator.LogicalNot){
- invert = true;
-
- u.EmitLogicalNot (ec);
- }
- }
-
- if (!invert)
- e.Emit (ec);
-
- if (isTrue){
- if (invert)
- ec.ig.Emit (OpCodes.Brfalse, target);
- else
- ec.ig.Emit (OpCodes.Brtrue, target);
- } else {
- if (invert)
- ec.ig.Emit (OpCodes.Brtrue, target);
- else
- ec.ig.Emit (OpCodes.Brfalse, target);
- }
-
- return e;
- }
-
- }
-
- public class EmptyStatement : Statement {
- public override bool Emit (EmitContext ec)
- {
- return false;
- }
- }
-
- public class If : Statement {
- public readonly Expression Expr;
- public readonly Statement TrueStatement;
- public readonly Statement FalseStatement;
- Location loc;
-
- public If (Expression expr, Statement trueStatement, Location l)
- {
- Expr = expr;
- TrueStatement = trueStatement;
- loc = l;
- }
-
- public If (Expression expr,
- Statement trueStatement,
- Statement falseStatement,
- Location l)
- {
- Expr = expr;
- TrueStatement = trueStatement;
- FalseStatement = falseStatement;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label false_target = ig.DefineLabel ();
- Label end;
- bool is_true_ret, is_false_ret;
-
- if (EmitBoolExpression (ec, Expr, false_target, false, loc) == null)
- return false;
-
- is_true_ret = TrueStatement.Emit (ec);
- is_false_ret = is_true_ret;
-
- if (FalseStatement != null){
- bool branch_emitted = false;
-
- end = ig.DefineLabel ();
- if (!is_true_ret){
- ig.Emit (OpCodes.Br, end);
- branch_emitted = true;
- }
-
- ig.MarkLabel (false_target);
- is_false_ret = FalseStatement.Emit (ec);
-
- if (branch_emitted)
- ig.MarkLabel (end);
- } else {
- ig.MarkLabel (false_target);
- is_false_ret = false;
- }
-
- return is_true_ret && is_false_ret;
- }
- }
-
- public class Do : Statement {
- public readonly Expression Expr;
- public readonly Statement EmbeddedStatement;
- Location loc;
-
- public Do (Statement statement, Expression boolExpr, Location l)
- {
- Expr = boolExpr;
- EmbeddedStatement = statement;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label loop = ig.DefineLabel ();
- Label old_begin = ec.LoopBegin;
- Label old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
- Expression e;
-
- ec.LoopBegin = ig.DefineLabel ();
- ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
-
- ig.MarkLabel (loop);
- EmbeddedStatement.Emit (ec);
- ig.MarkLabel (ec.LoopBegin);
- e = EmitBoolExpression (ec, Expr, loop, true, loc);
- ig.MarkLabel (ec.LoopEnd);
-
- ec.LoopBegin = old_begin;
- ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- //
- // Inform whether we are infinite or not
- //
- if (e is BoolConstant){
- BoolConstant bc = (BoolConstant) e;
-
- if (bc.Value == true)
- return true;
- }
-
- return false;
- }
- }
-
- public class While : Statement {
- public readonly Expression Expr;
- public readonly Statement Statement;
- Location loc;
-
- public While (Expression boolExpr, Statement statement, Location l)
- {
- Expr = boolExpr;
- Statement = statement;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label old_begin = ec.LoopBegin;
- Label old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
- Expression e;
-
- ec.LoopBegin = ig.DefineLabel ();
- ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
-
- ig.MarkLabel (ec.LoopBegin);
- e = EmitBoolExpression (ec, Expr, ec.LoopEnd, false, loc);
- Statement.Emit (ec);
- ig.Emit (OpCodes.Br, ec.LoopBegin);
- ig.MarkLabel (ec.LoopEnd);
-
- ec.LoopBegin = old_begin;
- ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- //
- // Inform whether we are infinite or not
- //
- if (e is BoolConstant){
- BoolConstant bc = (BoolConstant) e;
-
- if (bc.Value == true)
- return true;
- }
- return false;
- }
- }
-
- public class For : Statement {
- public readonly Statement InitStatement;
- public readonly Expression Test;
- public readonly Statement Increment;
- public readonly Statement Statement;
- Location loc;
-
- public For (Statement initStatement,
- Expression test,
- Statement increment,
- Statement statement,
- Location l)
- {
- InitStatement = initStatement;
- Test = test;
- Increment = increment;
- Statement = statement;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label old_begin = ec.LoopBegin;
- Label old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
- Label loop = ig.DefineLabel ();
- Expression e = null;
-
- if (InitStatement != null)
- if (! (InitStatement is EmptyStatement))
- InitStatement.Emit (ec);
-
- ec.LoopBegin = ig.DefineLabel ();
- ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
-
- ig.MarkLabel (loop);
-
- //
- // If test is null, there is no test, and we are just
- // an infinite loop
- //
- if (Test != null)
- e = EmitBoolExpression (ec, Test, ec.LoopEnd, false, loc);
-
- Statement.Emit (ec);
- ig.MarkLabel (ec.LoopBegin);
- if (!(Increment is EmptyStatement))
- Increment.Emit (ec);
- ig.Emit (OpCodes.Br, loop);
- ig.MarkLabel (ec.LoopEnd);
-
- ec.LoopBegin = old_begin;
- ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- //
- // Inform whether we are infinite or not
- //
- if (Test != null){
- if (e is BoolConstant){
- BoolConstant bc = (BoolConstant) e;
-
- if (bc.Value)
- return true;
- }
- return false;
- } else
- return true;
- }
- }
-
- public class StatementExpression : Statement {
- public readonly ExpressionStatement Expr;
-
- public StatementExpression (ExpressionStatement expr)
- {
- Expr = expr;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Expression ne;
-
- ne = Expr.Resolve (ec);
- if (ne != null){
- if (ne is ExpressionStatement)
- ((ExpressionStatement) ne).EmitStatement (ec);
- else {
- ne.Emit (ec);
- ig.Emit (OpCodes.Pop);
- }
- }
-
- return false;
- }
-
- public override string ToString ()
- {
- return "StatementExpression (" + Expr + ")";
- }
- }
-
- /// <summary>
- /// Implements the return statement
- /// </summary>
- public class Return : Statement {
- public Expression Expr;
- public readonly Location loc;
-
- public Return (Expression expr, Location l)
- {
- Expr = expr;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (ec.InFinally){
- Report.Error (157,loc,"Control can not leave the body of the finally block");
- return false;
- }
-
- if (ec.ReturnType == null){
- if (Expr != null){
- Report.Error (127, loc, "Return with a value not allowed here");
- return false;
- }
- } else {
- if (Expr == null){
- Report.Error (126, loc, "An object of type `" +
- TypeManager.CSharpName (ec.ReturnType) + "' is " +
- "expected for the return statement");
- return false;
- }
-
- Expr = Expr.Resolve (ec);
- if (Expr == null)
- return false;
-
- if (Expr.Type != ec.ReturnType)
- Expr = Expression.ConvertImplicitRequired (
- ec, Expr, ec.ReturnType, loc);
-
- if (Expr == null)
- return false;
-
- Expr.Emit (ec);
-
- if (ec.InTry || ec.InCatch)
- ec.ig.Emit (OpCodes.Stloc, ec.TemporaryReturn ());
- }
-
- if (ec.InTry || ec.InCatch){
- ec.ig.Emit (OpCodes.Leave, ec.ReturnLabel);
- return false;
- } else {
- ec.ig.Emit (OpCodes.Ret);
- return true;
- }
- }
- }
-
- public class Goto : Statement {
- string target;
- Location loc;
- Block block;
-
- public Goto (Block parent_block, string label, Location l)
- {
- block = parent_block;
- loc = l;
- target = label;
- }
-
- public string Target {
- get {
- return target;
- }
- }
-
- public override bool Emit (EmitContext ec)
- {
- LabeledStatement label = block.LookupLabel (target);
-
- if (label == null){
- //
- // Maybe we should catch this before?
- //
- Report.Error (
- 159, loc,
- "No such label `" + target + "' in this scope");
- return false;
- }
- Label l = label.LabelTarget (ec);
- ec.ig.Emit (OpCodes.Br, l);
-
- return false;
- }
- }
-
- public class LabeledStatement : Statement {
- string label_name;
- bool defined;
- Label label;
-
- public LabeledStatement (string label_name)
- {
- this.label_name = label_name;
- }
-
- public Label LabelTarget (EmitContext ec)
- {
- if (defined)
- return label;
- label = ec.ig.DefineLabel ();
- defined = true;
-
- return label;
- }
-
- public override bool Emit (EmitContext ec)
- {
- LabelTarget (ec);
- ec.ig.MarkLabel (label);
-
- return false;
- }
- }
-
-
- /// <summary>
- /// `goto default' statement
- /// </summary>
- public class GotoDefault : Statement {
- Location loc;
-
- public GotoDefault (Location l)
- {
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (ec.Switch == null){
- Report.Error (153, loc, "goto default is only valid in a switch statement");
- return false;
- }
-
- if (!ec.Switch.GotDefault){
- Report.Error (159, loc, "No default target on switch statement");
- return false;
- }
- ec.ig.Emit (OpCodes.Br, ec.Switch.DefaultTarget);
- return false;
- }
- }
-
- /// <summary>
- /// `goto case' statement
- /// </summary>
- public class GotoCase : Statement {
- Location loc;
- Expression expr;
-
- public GotoCase (Expression e, Location l)
- {
- expr = e;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (ec.Switch == null){
- Report.Error (153, loc, "goto case is only valid in a switch statement");
- return false;
- }
-
- expr = expr.Resolve (ec);
- if (expr == null)
- return false;
-
- if (!(expr is Constant)){
- Report.Error (159, loc, "Target expression for goto case is not constant");
- return false;
- }
-
- object val = Expression.ConvertIntLiteral (
- (Constant) expr, ec.Switch.SwitchType, loc);
-
- if (val == null)
- return false;
-
- SwitchLabel sl = (SwitchLabel) ec.Switch.Elements [val];
-
- if (sl == null){
- Report.Error (
- 159, loc,
- "No such label 'case " + val + "': for the goto case");
- }
-
- ec.ig.Emit (OpCodes.Br, sl.ILLabel);
- return false;
- }
- }
-
- public class Throw : Statement {
- public readonly Expression Expr;
- Location loc;
-
- public Throw (Expression expr, Location l)
- {
- Expr = expr;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (Expr == null){
- if (ec.InCatch)
- ec.ig.Emit (OpCodes.Rethrow);
- else {
- Report.Error (
- 156, loc,
- "A throw statement with no argument is only " +
- "allowed in a catch clause");
- }
- return false;
- }
-
- Expression e = Expr.Resolve (ec);
-
- if (e == null)
- return false;
-
- e.Emit (ec);
-
- ec.ig.Emit (OpCodes.Throw);
-
- return true;
- }
- }
-
- public class Break : Statement {
- Location loc;
-
- public Break (Location l)
- {
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- if (ec.InLoop == false && ec.Switch == null){
- Report.Error (139, loc, "No enclosing loop or switch to continue to");
- return false;
- }
-
- ig.Emit (OpCodes.Br, ec.LoopEnd);
- return false;
- }
- }
-
- public class Continue : Statement {
- Location loc;
-
- public Continue (Location l)
- {
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- Label begin = ec.LoopBegin;
-
- if (!ec.InLoop){
- Report.Error (139, loc, "No enclosing loop to continue to");
- return false;
- }
-
- //
- // UGH: Non trivial. This Br might cross a try/catch boundary
- // How can we tell?
- //
- // while () {
- // try { ... } catch { continue; }
- // }
- //
- // From:
- // try {} catch { while () { continue; }}
- //
- ec.ig.Emit (OpCodes.Br, begin);
- return false;
- }
- }
-
- public class VariableInfo {
- public readonly string Type;
- public LocalBuilder LocalBuilder;
- public Type VariableType;
- public readonly Location Location;
-
- int idx;
- public bool Used;
- public bool Assigned;
- public bool ReadOnly;
-
- public VariableInfo (string type, Location l)
- {
- Type = type;
- LocalBuilder = null;
- idx = -1;
- Location = l;
- }
-
- public int Idx {
- get {
- if (idx == -1)
- throw new Exception ("Unassigned idx for variable");
-
- return idx;
- }
-
- set {
- idx = value;
- }
- }
-
- public void MakePinned ()
- {
- TypeManager.MakePinned (LocalBuilder);
- }
- }
-
- /// <summary>
- /// Block represents a C# block.
- /// </summary>
- ///
- /// <remarks>
- /// This class is used in a number of places: either to represent
- /// explicit blocks that the programmer places or implicit blocks.
- ///
- /// Implicit blocks are used as labels or to introduce variable
- /// declarations.
- /// </remarks>
- public class Block : Statement {
- public readonly Block Parent;
- public readonly bool Implicit;
-
- //
- // The statements in this block
- //
- StatementCollection statements;
-
- //
- // An array of Blocks. We keep track of children just
- // to generate the local variable declarations.
- //
- // Statements and child statements are handled through the
- // statements.
- //
- ArrayList children;
-
- //
- // Labels. (label, block) pairs.
- //
- Hashtable labels;
-
- //
- // Keeps track of (name, type) pairs
- //
- Hashtable variables;
-
- //
- // Keeps track of constants
- Hashtable constants;
-
- //
- // Maps variable names to ILGenerator.LocalBuilders
- //
- Hashtable local_builders;
-
- bool used = false;
-
- static int id;
-
- int this_id;
-
- public Block (Block parent)
- {
- if (parent != null)
- parent.AddChild (this);
-
- this.Parent = parent;
- this.Implicit = false;
-
- this_id = id++;
- }
-
- public Block (Block parent, bool implicit_block)
- {
- if (parent != null)
- parent.AddChild (this);
-
- this.Parent = parent;
- this.Implicit = true;
- this_id = id++;
- }
-
- public int ID {
- get {
- return this_id;
- }
- }
-
- void AddChild (Block b)
- {
- if (children == null)
- children = new ArrayList ();
-
- children.Add (b);
- }
-
- /// <summary>
- /// Adds a label to the current block.
- /// </summary>
- ///
- /// <returns>
- /// false if the name already exists in this block. true
- /// otherwise.
- /// </returns>
- ///
- public bool AddLabel (string name, LabeledStatement target)
- {
- if (labels == null)
- labels = new Hashtable ();
- if (labels.Contains (name))
- return false;
-
- labels.Add (name, target);
- return true;
- }
-
- public LabeledStatement LookupLabel (string name)
- {
- if (labels != null){
- if (labels.Contains (name))
- return ((LabeledStatement) labels [name]);
- }
-
- if (Parent != null)
- return Parent.LookupLabel (name);
-
- return null;
- }
-
- public VariableInfo AddVariable (string type, string name, Parameters pars, Location l)
- {
- if (variables == null)
- variables = new Hashtable ();
-
- if (GetVariableType (name) != null)
- return null;
-
- if (pars != null) {
- int idx = 0;
- Parameter p = pars.GetParameterByName (name, out idx);
- if (p != null)
- return null;
- }
-
- VariableInfo vi = new VariableInfo (type, l);
-
- variables.Add (name, vi);
-
- return vi;
- }
-
- public bool AddConstant (string type, string name, Expression value, Parameters pars, Location l)
- {
- if (AddVariable (type, name, pars, l) == null)
- return false;
-
- if (constants == null)
- constants = new Hashtable ();
-
- constants.Add (name, value);
- return true;
- }
-
- public Hashtable Variables {
- get {
- return variables;
- }
- }
-
- public VariableInfo GetVariableInfo (string name)
- {
- if (variables != null) {
- object temp;
- temp = variables [name];
-
- if (temp != null){
- return (VariableInfo) temp;
- }
- }
-
- if (Parent != null)
- return Parent.GetVariableInfo (name);
-
- return null;
- }
-
- public string GetVariableType (string name)
- {
- VariableInfo vi = GetVariableInfo (name);
-
- if (vi != null)
- return vi.Type;
-
- return null;
- }
-
- public Expression GetConstantExpression (string name)
- {
- if (constants != null) {
- object temp;
- temp = constants [name];
-
- if (temp != null)
- return (Expression) temp;
- }
-
- if (Parent != null)
- return Parent.GetConstantExpression (name);
-
- return null;
- }
-
- /// <summary>
- /// True if the variable named @name has been defined
- /// in this block
- /// </summary>
- public bool IsVariableDefined (string name)
- {
- if (variables != null) {
- if (variables.Contains (name))
- return true;
- }
-
- if (Parent != null)
- return Parent.IsVariableDefined (name);
-
- return false;
- }
-
- /// <summary>
- /// True if the variable named @name is a constant
- /// </summary>
- public bool IsConstant (string name)
- {
- Expression e = null;
-
- e = GetConstantExpression (name);
-
- return e != null;
- }
-
- /// <summary>
- /// Use to fetch the statement associated with this label
- /// </summary>
- public Statement this [string name] {
- get {
- return (Statement) labels [name];
- }
- }
-
- /// <returns>
- /// A list of labels that were not used within this block
- /// </returns>
- public string [] GetUnreferenced ()
- {
- // FIXME: Implement me
- return null;
- }
-
- public StatementCollection Statements {
- get {
- if (statements == null)
- statements = new StatementCollection ();
-
- return statements;
- }
- }
-
- public void AddStatement (Statement s)
- {
- if (statements == null)
- statements = new StatementCollection ();
-
- statements.Add (s);
- used = true;
- }
-
- public bool Used {
- get {
- return used;
- }
- }
-
- public void Use ()
- {
- used = true;
- }
-
- /// <summary>
- /// Emits the variable declarations and labels.
- /// </summary>
- /// <remarks>
- /// tc: is our typecontainer (to resolve type references)
- /// ig: is the code generator:
- /// toplevel: the toplevel block. This is used for checking
- /// that no two labels with the same name are used.
- /// </remarks>
- public int EmitMeta (EmitContext ec, Block toplevel, int count)
- {
- TypeContainer tc = ec.TypeContainer;
- ILGenerator ig = ec.ig;
-
- //
- // Process this block variables
- //
- if (variables != null){
- local_builders = new Hashtable ();
-
- foreach (DictionaryEntry de in variables){
- string name = (string) de.Key;
- VariableInfo vi = (VariableInfo) de.Value;
- Type t;
-
- t = RootContext.LookupType (tc, vi.Type, false, vi.Location);
- if (t == null)
- continue;
-
- vi.VariableType = t;
- vi.LocalBuilder = ig.DeclareLocal (t);
- vi.Idx = count++;
-
- if (constants == null)
- continue;
-
- Expression cv = (Expression) constants [name];
- if (cv == null)
- continue;
-
- Expression e = cv.Resolve (ec);
- if (e == null)
- continue;
-
- if (!(e is Constant)){
- Report.Error (133, vi.Location,
- "The expression being assigned to `" +
- name + "' must be constant");
- continue;
- }
-
- constants.Remove (name);
- constants.Add (name, e);
- }
- }
-
- //
- // Now, handle the children
- //
- if (children != null){
- foreach (Block b in children)
- count = b.EmitMeta (ec, toplevel, count);
- }
-
- return count;
- }
-
- public void UsageWarning ()
- {
- string name;
-
- if (variables != null){
- foreach (DictionaryEntry de in variables){
- VariableInfo vi = (VariableInfo) de.Value;
-
- if (vi.Used)
- continue;
-
- name = (string) de.Key;
-
- if (vi.Assigned){
- Report.Warning (
- 219, vi.Location, "The variable `" + name +
- "' is assigned but its value is never used");
- } else {
- Report.Warning (
- 168, vi.Location, "The variable `" +
- name +
- "' is declared but never used");
- }
- }
- }
-
- if (children != null)
- foreach (Block b in children)
- b.UsageWarning ();
- }
-
-// static int count;
-
- public override bool Emit (EmitContext ec)
- {
- bool is_ret = false;
- Block prev_block = ec.CurrentBlock;
-
-// count++;
- ec.CurrentBlock = this;
-// if (count == 40)
-// throw new Exception ();
- foreach (Statement s in Statements)
- is_ret = s.Emit (ec);
-// count--;
-
- ec.CurrentBlock = prev_block;
- return is_ret;
- }
- }
-
- public class SwitchLabel {
- Expression label;
- object converted;
- public Location loc;
- public Label ILLabel;
-
- //
- // if expr == null, then it is the default case.
- //
- public SwitchLabel (Expression expr, Location l)
- {
- label = expr;
- loc = l;
- }
-
- public Expression Label {
- get {
- return label;
- }
- }
-
- public object Converted {
- get {
- return converted;
- }
- }
-
- //
- // Resolves the expression, reduces it to a literal if possible
- // and then converts it to the requested type.
- //
- public bool ResolveAndReduce (EmitContext ec, Type required_type)
- {
- ILLabel = ec.ig.DefineLabel ();
-
- if (label == null)
- return true;
-
- Expression e = label.Resolve (ec);
-
- if (e == null)
- return false;
-
- if (!(e is Constant)){
- Console.WriteLine ("Value is: " + label);
- Report.Error (150, loc, "A constant value is expected");
- return false;
- }
-
- if (e is StringConstant || e is NullLiteral){
- if (required_type == TypeManager.string_type){
- converted = label;
- ILLabel = ec.ig.DefineLabel ();
- return true;
- }
- }
-
- converted = Expression.ConvertIntLiteral ((Constant) e, required_type, loc);
- if (converted == null)
- return false;
-
- return true;
- }
- }
-
- public class SwitchSection {
- // An array of SwitchLabels.
- public readonly ArrayList Labels;
- public readonly Block Block;
-
- public SwitchSection (ArrayList labels, Block block)
- {
- Labels = labels;
- Block = block;
- }
- }
-
- public class Switch : Statement {
- public readonly ArrayList Sections;
- public Expression Expr;
-
- /// <summary>
- /// Maps constants whose type type SwitchType to their SwitchLabels.
- /// </summary>
- public Hashtable Elements;
-
- /// <summary>
- /// The governing switch type
- /// </summary>
- public Type SwitchType;
-
- //
- // Computed
- //
- bool got_default;
- Label default_target;
- Location loc;
-
- //
- // The types allowed to be implicitly cast from
- // on the governing type
- //
- static Type [] allowed_types;
-
- public Switch (Expression e, ArrayList sects, Location l)
- {
- Expr = e;
- Sections = sects;
- loc = l;
- }
-
- public bool GotDefault {
- get {
- return got_default;
- }
- }
-
- public Label DefaultTarget {
- get {
- return default_target;
- }
- }
-
- //
- // Determines the governing type for a switch. The returned
- // expression might be the expression from the switch, or an
- // expression that includes any potential conversions to the
- // integral types or to string.
- //
- Expression SwitchGoverningType (EmitContext ec, Type t)
- {
- if (t == TypeManager.int32_type ||
- t == TypeManager.uint32_type ||
- t == TypeManager.char_type ||
- t == TypeManager.byte_type ||
- t == TypeManager.sbyte_type ||
- t == TypeManager.ushort_type ||
- t == TypeManager.short_type ||
- t == TypeManager.uint64_type ||
- t == TypeManager.int64_type ||
- t == TypeManager.string_type ||
- t.IsSubclassOf (TypeManager.enum_type))
- return Expr;
-
- if (allowed_types == null){
- allowed_types = new Type [] {
- TypeManager.sbyte_type,
- TypeManager.byte_type,
- TypeManager.short_type,
- TypeManager.ushort_type,
- TypeManager.int32_type,
- TypeManager.uint32_type,
- TypeManager.int64_type,
- TypeManager.uint64_type,
- TypeManager.char_type,
- TypeManager.string_type
- };
- }
-
- //
- // Try to find a *user* defined implicit conversion.
- //
- // If there is no implicit conversion, or if there are multiple
- // conversions, we have to report an error
- //
- Expression converted = null;
- foreach (Type tt in allowed_types){
- Expression e;
-
- e = Expression.ImplicitUserConversion (ec, Expr, tt, loc);
- if (e == null)
- continue;
-
- if (converted != null){
- Report.Error (-12, loc, "More than one conversion to an integral " +
- " type exists for type `" +
- TypeManager.CSharpName (Expr.Type)+"'");
- return null;
- } else
- converted = e;
- }
- return converted;
- }
-
- void error152 (string n)
- {
- Report.Error (
- 152, "The label `" + n + ":' " +
- "is already present on this switch statement");
- }
-
- //
- // Performs the basic sanity checks on the switch statement
- // (looks for duplicate keys and non-constant expressions).
- //
- // It also returns a hashtable with the keys that we will later
- // use to compute the switch tables
- //
- bool CheckSwitch (EmitContext ec)
- {
- Type compare_type;
- bool error = false;
- Elements = new Hashtable ();
-
- got_default = false;
-
- if (TypeManager.IsEnumType (SwitchType)){
- compare_type = TypeManager.EnumToUnderlying (SwitchType);
- } else
- compare_type = SwitchType;
-
- foreach (SwitchSection ss in Sections){
- foreach (SwitchLabel sl in ss.Labels){
- if (!sl.ResolveAndReduce (ec, SwitchType)){
- error = true;
- continue;
- }
-
- if (sl.Label == null){
- if (got_default){
- error152 ("default");
- error = true;
- }
- got_default = true;
- continue;
- }
-
- object key = sl.Converted;
-
- if (key is Constant)
- key = ((Constant) key).GetValue ();
-
- if (key == null)
- key = NullLiteral.Null;
-
- string lname = null;
- if (compare_type == TypeManager.uint64_type){
- ulong v = (ulong) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.int64_type){
- long v = (long) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.uint32_type){
- uint v = (uint) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.char_type){
- char v = (char) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.byte_type){
- byte v = (byte) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.sbyte_type){
- sbyte v = (sbyte) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.short_type){
- short v = (short) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.ushort_type){
- ushort v = (ushort) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.string_type){
- if (key is NullLiteral){
- if (Elements.Contains (NullLiteral.Null))
- lname = "null";
- else
- Elements.Add (NullLiteral.Null, null);
- } else {
- string s = (string) key;
-
- if (Elements.Contains (s))
- lname = s;
- else
- Elements.Add (s, sl);
- }
- } else if (compare_type == TypeManager.int32_type) {
- int v = (int) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else {
- throw new Exception ("Unknown switch type!" +
- SwitchType + " " + compare_type);
- }
-
- if (lname != null){
- error152 ("case + " + lname);
- error = true;
- }
- }
- }
- if (error)
- return false;
-
- return true;
- }
-
- void EmitObjectInteger (ILGenerator ig, object k)
- {
- if (k is int)
- IntConstant.EmitInt (ig, (int) k);
- else if (k is Constant){
- EmitObjectInteger (ig, ((Constant) k).GetValue ());
- } else if (k is uint)
- IntConstant.EmitInt (ig, unchecked ((int) (uint) k));
- else if (k is long)
- LongConstant.EmitLong (ig, (long) k);
- else if (k is ulong)
- LongConstant.EmitLong (ig, unchecked ((long) (ulong) k));
- else if (k is char)
- IntConstant.EmitInt (ig, (int) ((char) k));
- else if (k is sbyte)
- IntConstant.EmitInt (ig, (int) ((sbyte) k));
- else if (k is byte)
- IntConstant.EmitInt (ig, (int) ((byte) k));
- else
- throw new Exception ("Unhandled case");
- }
-
- //
- // This simple emit switch works, but does not take advantage of the
- // `switch' opcode. The swithc opcode uses a jump table that we are not
- // computing at this point
- //
- bool SimpleSwitchEmit (EmitContext ec, LocalBuilder val)
- {
- ILGenerator ig = ec.ig;
- Label end_of_switch = ig.DefineLabel ();
- Label next_test = ig.DefineLabel ();
- Label null_target = ig.DefineLabel ();
- bool default_found = false;
- bool first_test = true;
- bool pending_goto_end = false;
- bool all_return = true;
- bool is_string = false;
- bool null_found;
-
- //
- // Special processing for strings: we cant compare
- // against null.
- //
- if (SwitchType == TypeManager.string_type){
- ig.Emit (OpCodes.Ldloc, val);
- is_string = true;
-
- if (Elements.Contains (NullLiteral.Null)){
- ig.Emit (OpCodes.Brfalse, null_target);
- } else
- ig.Emit (OpCodes.Brfalse, default_target);
-
- ig.Emit (OpCodes.Ldloc, val);
- ig.Emit (OpCodes.Call, TypeManager.string_isinterneted_string);
- ig.Emit (OpCodes.Stloc, val);
- }
-
- foreach (SwitchSection ss in Sections){
- Label sec_begin = ig.DefineLabel ();
-
- if (pending_goto_end)
- ig.Emit (OpCodes.Br, end_of_switch);
-
- int label_count = ss.Labels.Count;
- null_found = false;
- foreach (SwitchLabel sl in ss.Labels){
- ig.MarkLabel (sl.ILLabel);
-
- if (!first_test){
- ig.MarkLabel (next_test);
- next_test = ig.DefineLabel ();
- }
- //
- // If we are the default target
- //
- if (sl.Label == null){
- ig.MarkLabel (default_target);
- default_found = true;
- } else {
- object lit = sl.Converted;
-
- if (lit is NullLiteral){
- null_found = true;
- if (label_count == 1)
- ig.Emit (OpCodes.Br, next_test);
- continue;
-
- }
- if (is_string){
- StringConstant str = (StringConstant) lit;
-
- ig.Emit (OpCodes.Ldloc, val);
- ig.Emit (OpCodes.Ldstr, str.Value);
- if (label_count == 1)
- ig.Emit (OpCodes.Bne_Un, next_test);
- else
- ig.Emit (OpCodes.Beq, sec_begin);
- } else {
- ig.Emit (OpCodes.Ldloc, val);
- EmitObjectInteger (ig, lit);
- ig.Emit (OpCodes.Ceq);
- if (label_count == 1)
- ig.Emit (OpCodes.Brfalse, next_test);
- else
- ig.Emit (OpCodes.Brtrue, sec_begin);
- }
- }
- }
- if (label_count != 1)
- ig.Emit (OpCodes.Br, next_test);
-
- if (null_found)
- ig.MarkLabel (null_target);
- ig.MarkLabel (sec_begin);
- if (ss.Block.Emit (ec))
- pending_goto_end = false;
- else {
- all_return = false;
- pending_goto_end = true;
- }
- first_test = false;
- }
- if (!default_found)
- ig.MarkLabel (default_target);
- ig.MarkLabel (next_test);
- ig.MarkLabel (end_of_switch);
-
- return all_return;
- }
-
- public override bool Emit (EmitContext ec)
- {
- Expr = Expr.Resolve (ec);
- if (Expr == null)
- return false;
-
- Expression new_expr = SwitchGoverningType (ec, Expr.Type);
- if (new_expr == null){
- Report.Error (151, loc, "An integer type or string was expected for switch");
- return false;
- }
-
- // Validate switch.
- SwitchType = new_expr.Type;
-
- if (!CheckSwitch (ec))
- return false;
-
- // Store variable for comparission purposes
- LocalBuilder value = ec.ig.DeclareLocal (SwitchType);
- new_expr.Emit (ec);
- ec.ig.Emit (OpCodes.Stloc, value);
-
- ILGenerator ig = ec.ig;
-
- default_target = ig.DefineLabel ();
-
- //
- // Setup the codegen context
- //
- Label old_end = ec.LoopEnd;
- Switch old_switch = ec.Switch;
-
- ec.LoopEnd = ig.DefineLabel ();
- ec.Switch = this;
-
- // Emit Code.
- bool all_return = SimpleSwitchEmit (ec, value);
-
- // Restore context state.
- ig.MarkLabel (ec.LoopEnd);
-
- //
- // FIXME: I am emitting a nop, because the switch performs
- // no analysis on whether something ever reaches the end
- //
- // try: b (int a) { switch (a) { default: return 0; } }
- ig.Emit (OpCodes.Nop);
-
- //
- // Restore the previous context
- //
- ec.LoopEnd = old_end;
- ec.Switch = old_switch;
-
- //
- // Because we have a nop at the end
- //
- return false;
- }
- }
-
- public class Lock : Statement {
- public readonly Expression Expr;
- public readonly Statement Statement;
- Location loc;
-
- public Lock (Expression expr, Statement stmt, Location l)
- {
- Expr = expr;
- Statement = stmt;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- Expression e = Expr.Resolve (ec);
- if (e == null)
- return false;
-
- Type type = e.Type;
-
- if (type.IsValueType){
- Report.Error (185, loc, "lock statement requires the expression to be " +
- " a reference type (type is: `" +
- TypeManager.CSharpName (type) + "'");
- return false;
- }
-
- ILGenerator ig = ec.ig;
- LocalBuilder temp = ig.DeclareLocal (type);
-
- e.Emit (ec);
- ig.Emit (OpCodes.Dup);
- ig.Emit (OpCodes.Stloc, temp);
- ig.Emit (OpCodes.Call, TypeManager.void_monitor_enter_object);
-
- // try
- Label end = ig.BeginExceptionBlock ();
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- Label finish = ig.DefineLabel ();
- Statement.Emit (ec);
- ec.InTry = old_in_try;
- // ig.Emit (OpCodes.Leave, finish);
-
- ig.MarkLabel (finish);
-
- // finally
- ig.BeginFinallyBlock ();
- ig.Emit (OpCodes.Ldloc, temp);
- ig.Emit (OpCodes.Call, TypeManager.void_monitor_exit_object);
- ig.EndExceptionBlock ();
-
- return false;
- }
- }
-
- public class Unchecked : Statement {
- public readonly Block Block;
-
- public Unchecked (Block b)
- {
- Block = b;
- }
-
- public override bool Emit (EmitContext ec)
- {
- bool previous_state = ec.CheckState;
- bool val;
-
- ec.CheckState = false;
- val = Block.Emit (ec);
- ec.CheckState = previous_state;
-
- return val;
- }
- }
-
- public class Checked : Statement {
- public readonly Block Block;
-
- public Checked (Block b)
- {
- Block = b;
- }
-
- public override bool Emit (EmitContext ec)
- {
- bool previous_state = ec.CheckState;
- bool val;
-
- ec.CheckState = true;
- val = Block.Emit (ec);
- ec.CheckState = previous_state;
-
- return val;
- }
- }
-
- public class Unsafe : Statement {
- public readonly Block Block;
-
- public Unsafe (Block b)
- {
- Block = b;
- }
-
- public override bool Emit (EmitContext ec)
- {
- bool previous_state = ec.InUnsafe;
- bool val;
-
- ec.InUnsafe = true;
- val = Block.Emit (ec);
- ec.InUnsafe = previous_state;
-
- return val;
- }
- }
-
- //
- // Fixed statement
- //
- public class Fixed : Statement {
- string type;
- ArrayList declarators;
- Statement statement;
- Location loc;
-
- public Fixed (string type, ArrayList decls, Statement stmt, Location l)
- {
- this.type = type;
- declarators = decls;
- statement = stmt;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Type t;
-
- t = RootContext.LookupType (ec.TypeContainer, type, false, loc);
- if (t == null)
- return false;
-
- foreach (Pair p in declarators){
- VariableInfo vi = (VariableInfo) p.First;
- Expression e = (Expression) p.Second;
-
- //
- // The rules for the possible declarators are pretty wise,
- // but the production on the grammar is more concise.
- //
- // So we have to enforce these rules here.
- //
- // We do not resolve before doing the case 1 test,
- // because the grammar is explicit in that the token &
- // is present, so we need to test for this particular case.
- //
-
- //
- // Case 1: & object.
- //
- if (e is Unary && ((Unary) e).Oper == Unary.Operator.AddressOf){
- Expression child = ((Unary) e).Expr;
-
- vi.MakePinned ();
- if (child is ParameterReference || child is LocalVariableReference){
- Report.Error (
- 213, loc,
- "No need to use fixed statement for parameters or " +
- "local variable declarations (address is already " +
- "fixed)");
- continue;
- }
-
- e = e.Resolve (ec);
- if (e == null)
- continue;
-
- child = ((Unary) e).Expr;
-
- if (!TypeManager.VerifyUnManaged (child.Type, loc))
- continue;
-
- //
- // Store pointer in pinned location
- //
- e.Emit (ec);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- statement.Emit (ec);
-
- // Clear the pinned variable.
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Conv_U);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- continue;
- }
-
- e = e.Resolve (ec);
- if (e == null)
- continue;
-
- //
- // Case 2: Array
- //
- if (e.Type.IsArray){
- Type array_type = e.Type.GetElementType ();
-
- vi.MakePinned ();
- //
- // Provided that array_type is unmanaged,
- //
- if (!TypeManager.VerifyUnManaged (array_type, loc))
- continue;
-
- //
- // and T* is implicitly convertible to the
- // pointer type given in the fixed statement.
- //
- ArrayPtr array_ptr = new ArrayPtr (e);
-
- Expression converted = Expression.ConvertImplicitRequired (
- ec, array_ptr, vi.VariableType, loc);
- if (converted == null)
- continue;
-
- //
- // Store pointer in pinned location
- //
- converted.Emit (ec);
-
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- statement.Emit (ec);
-
- // Clear the pinned variable.
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Conv_U);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- continue;
- }
-
- //
- // Case 3: string
- //
- if (e.Type == TypeManager.string_type){
- LocalBuilder pinned_string = ig.DeclareLocal (TypeManager.string_type);
- TypeManager.MakePinned (pinned_string);
-
- e.Emit (ec);
- ig.Emit (OpCodes.Stloc, pinned_string);
-
- Expression sptr = new StringPtr (pinned_string);
- Expression converted = Expression.ConvertImplicitRequired (
- ec, sptr, vi.VariableType, loc);
-
- if (converted == null)
- continue;
-
- converted.Emit (ec);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- statement.Emit (ec);
-
- // Clear the pinned variable
- ig.Emit (OpCodes.Ldnull);
- ig.Emit (OpCodes.Stloc, pinned_string);
- }
- }
-
- return false;
- }
- }
-
- public class Catch {
- public readonly string Type;
- public readonly string Name;
- public readonly Block Block;
- public readonly Location Location;
-
- public Catch (string type, string name, Block block, Location l)
- {
- Type = type;
- Name = name;
- Block = block;
- Location = l;
- }
- }
-
- public class Try : Statement {
- public readonly Block Fini, Block;
- public readonly ArrayList Specific;
- public readonly Catch General;
-
- //
- // specific, general and fini might all be null.
- //
- public Try (Block block, ArrayList specific, Catch general, Block fini)
- {
- if (specific == null && general == null){
- Console.WriteLine ("CIR.Try: Either specific or general have to be non-null");
- }
-
- this.Block = block;
- this.Specific = specific;
- this.General = general;
- this.Fini = fini;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label end;
- Label finish = ig.DefineLabel ();;
- bool returns;
-
- end = ig.BeginExceptionBlock ();
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- returns = Block.Emit (ec);
- ec.InTry = old_in_try;
-
- //
- // System.Reflection.Emit provides this automatically:
- // ig.Emit (OpCodes.Leave, finish);
-
- bool old_in_catch = ec.InCatch;
- ec.InCatch = true;
- DeclSpace ds = ec.TypeContainer;
-
- foreach (Catch c in Specific){
- Type catch_type = RootContext.LookupType (ds, c.Type, false, c.Location);
- VariableInfo vi;
-
- if (catch_type == null)
- return false;
-
- ig.BeginCatchBlock (catch_type);
-
- if (c.Name != null){
- vi = c.Block.GetVariableInfo (c.Name);
- if (vi == null){
- Console.WriteLine ("This should not happen! variable does not exist in this block");
- Environment.Exit (0);
- }
-
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
- } else
- ig.Emit (OpCodes.Pop);
-
- c.Block.Emit (ec);
- }
-
- if (General != null){
- ig.BeginCatchBlock (TypeManager.object_type);
- ig.Emit (OpCodes.Pop);
- General.Block.Emit (ec);
- }
- ec.InCatch = old_in_catch;
-
- ig.MarkLabel (finish);
- if (Fini != null){
- ig.BeginFinallyBlock ();
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- Fini.Emit (ec);
- ec.InFinally = old_in_finally;
- }
-
- ig.EndExceptionBlock ();
-
- //
- // FIXME: Is this correct?
- // Replace with `returns' and check test-18, maybe we can
- // perform an optimization here.
- //
- return false;
- }
- }
-
- //
- // FIXME: We still do not support the expression variant of the using
- // statement.
- //
- public class Using : Statement {
- object expression_or_block;
- Statement Statement;
- Location loc;
-
- public Using (object expression_or_block, Statement stmt, Location l)
- {
- this.expression_or_block = expression_or_block;
- Statement = stmt;
- loc = l;
- }
-
- //
- // Emits the code for the case of using using a local variable declaration.
- //
- bool EmitLocalVariableDecls (EmitContext ec, string type_name, ArrayList var_list)
- {
- ILGenerator ig = ec.ig;
- Expression [] converted_vars;
- bool need_conv = false;
- Type type = RootContext.LookupType (ec.TypeContainer, type_name, false, loc);
- int i = 0;
-
- if (type == null)
- return false;
-
- //
- // The type must be an IDisposable or an implicit conversion
- // must exist.
- //
- converted_vars = new Expression [var_list.Count];
- if (!TypeManager.ImplementsInterface (type, TypeManager.idisposable_type)){
- foreach (DictionaryEntry e in var_list){
- Expression var = (Expression) e.Key;
-
- var = var.Resolve (ec);
- if (var == null)
- return false;
-
- converted_vars [i] = Expression.ConvertImplicit (
- ec, var, TypeManager.idisposable_type, loc);
-
- if (converted_vars [i] == null)
- return false;
- i++;
- }
- need_conv = true;
- }
-
- i = 0;
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- foreach (DictionaryEntry e in var_list){
- LocalVariableReference var = (LocalVariableReference) e.Key;
- Expression expr = (Expression) e.Value;
- Expression a;
-
- a = new Assign (var, expr, loc);
- a.Resolve (ec);
- if (!need_conv)
- converted_vars [i] = var;
- i++;
- if (a == null)
- continue;
- ((ExpressionStatement) a).EmitStatement (ec);
-
- ig.BeginExceptionBlock ();
-
- }
- Statement.Emit (ec);
- ec.InTry = old_in_try;
-
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- var_list.Reverse ();
- foreach (DictionaryEntry e in var_list){
- LocalVariableReference var = (LocalVariableReference) e.Key;
- Label skip = ig.DefineLabel ();
- i--;
-
- ig.BeginFinallyBlock ();
-
- var.Emit (ec);
- ig.Emit (OpCodes.Brfalse, skip);
- converted_vars [i].Emit (ec);
- ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
- ig.MarkLabel (skip);
- ig.EndExceptionBlock ();
- }
- ec.InFinally = old_in_finally;
-
- return false;
- }
-
- bool EmitExpression (EmitContext ec, Expression expr)
- {
- Type expr_type = expr.Type;
- Expression conv = null;
-
- if (!TypeManager.ImplementsInterface (expr_type, TypeManager.idisposable_type)){
- conv = Expression.ConvertImplicit (
- ec, expr, TypeManager.idisposable_type, loc);
-
- if (conv == null)
- return false;
- }
-
- //
- // Make a copy of the expression and operate on that.
- //
- ILGenerator ig = ec.ig;
- LocalBuilder local_copy = ig.DeclareLocal (expr_type);
- if (conv != null)
- conv.Emit (ec);
- else
- expr.Emit (ec);
- ig.Emit (OpCodes.Stloc, local_copy);
-
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- ig.BeginExceptionBlock ();
- Statement.Emit (ec);
- ec.InTry = old_in_try;
-
- Label skip = ig.DefineLabel ();
- bool old_in_finally = ec.InFinally;
- ig.BeginFinallyBlock ();
- ig.Emit (OpCodes.Ldloc, local_copy);
- ig.Emit (OpCodes.Brfalse, skip);
- ig.Emit (OpCodes.Ldloc, local_copy);
- ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
- ig.MarkLabel (skip);
- ec.InFinally = old_in_finally;
- ig.EndExceptionBlock ();
-
- return false;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (expression_or_block is DictionaryEntry){
- string t = (string) ((DictionaryEntry) expression_or_block).Key;
- ArrayList var_list = (ArrayList)((DictionaryEntry)expression_or_block).Value;
-
- return EmitLocalVariableDecls (ec, t, var_list);
- } if (expression_or_block is Expression){
- Expression e = (Expression) expression_or_block;
-
- e = e.Resolve (ec);
- if (e == null)
- return false;
-
- return EmitExpression (ec, e);
- }
- return false;
- }
- }
-
- /// <summary>
- /// Implementation of the foreach C# statement
- /// </summary>
- public class Foreach : Statement {
- string type;
- LocalVariableReference variable;
- Expression expr;
- Statement statement;
- Location loc;
-
- public Foreach (string type, LocalVariableReference var, Expression expr,
- Statement stmt, Location l)
- {
- this.type = type;
- this.variable = var;
- this.expr = expr;
- statement = stmt;
- loc = l;
- }
-
- static bool GetEnumeratorFilter (MemberInfo m, object criteria)
- {
- if (m == null)
- return false;
-
- if (!(m is MethodInfo))
- return false;
-
- if (m.Name != "GetEnumerator")
- return false;
-
- MethodInfo mi = (MethodInfo) m;
-
- if (mi.ReturnType != TypeManager.ienumerator_type){
- if (!TypeManager.ienumerator_type.IsAssignableFrom (mi.ReturnType))
- return false;
- }
-
- Type [] args = TypeManager.GetArgumentTypes (mi);
- if (args == null)
- return true;
-
- if (args.Length == 0)
- return true;
-
- return false;
- }
-
- /// <summary>
- /// This filter is used to find the GetEnumerator method
- /// on which IEnumerator operates
- /// </summary>
- static MemberFilter FilterEnumerator;
-
- static Foreach ()
- {
- FilterEnumerator = new MemberFilter (GetEnumeratorFilter);
- }
-
- void error1579 (Type t)
- {
- Report.Error (1579, loc,
- "foreach statement cannot operate on variables of type `" +
- t.FullName + "' because that class does not provide a " +
- " GetEnumerator method or it is inaccessible");
- }
-
- MethodInfo ProbeCollectionType (Type t)
- {
- MemberInfo [] mi;
-
- mi = TypeContainer.FindMembers (t, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.Instance,
- FilterEnumerator, null);
-
- if (mi == null){
- error1579 (t);
- return null;
- }
-
- if (mi.Length == 0){
- error1579 (t);
- return null;
- }
-
- return (MethodInfo) mi [0];
- }
-
- //
- // FIXME: possible optimization.
- // We might be able to avoid creating `empty' if the type is the sam
- //
- bool EmitCollectionForeach (EmitContext ec, Type var_type, MethodInfo get_enum)
- {
- ILGenerator ig = ec.ig;
- LocalBuilder enumerator, disposable;
- Expression empty = new EmptyExpression ();
- Expression conv;
-
- //
- // FIXME: maybe we can apply the same trick we do in the
- // array handling to avoid creating empty and conv in some cases.
- //
- // Although it is not as important in this case, as the type
- // will not likely be object (what the enumerator will return).
- //
- conv = Expression.ConvertExplicit (ec, empty, var_type, loc);
- if (conv == null)
- return false;
-
- enumerator = ig.DeclareLocal (TypeManager.ienumerator_type);
- disposable = ig.DeclareLocal (TypeManager.idisposable_type);
-
- //
- // Instantiate the enumerator
-
- if (expr.Type.IsValueType){
- if (expr is IMemoryLocation){
- IMemoryLocation ml = (IMemoryLocation) expr;
-
- ml.AddressOf (ec);
- } else
- throw new Exception ("Expr " + expr + " of type " + expr.Type +
- " does not implement IMemoryLocation");
- ig.Emit (OpCodes.Call, get_enum);
- } else {
- expr.Emit (ec);
- ig.Emit (OpCodes.Callvirt, get_enum);
- }
- ig.Emit (OpCodes.Stloc, enumerator);
-
- //
- // Protect the code in a try/finalize block, so that
- // if the beast implement IDisposable, we get rid of it
- //
- Label l = ig.BeginExceptionBlock ();
- bool old_in_try = ec.InTry;
- ec.InTry = true;
-
- Label end_try = ig.DefineLabel ();
-
- ig.MarkLabel (ec.LoopBegin);
- ig.Emit (OpCodes.Ldloc, enumerator);
- ig.Emit (OpCodes.Callvirt, TypeManager.bool_movenext_void);
- ig.Emit (OpCodes.Brfalse, end_try);
- ig.Emit (OpCodes.Ldloc, enumerator);
- ig.Emit (OpCodes.Callvirt, TypeManager.object_getcurrent_void);
- variable.EmitAssign (ec, conv);
- statement.Emit (ec);
- ig.Emit (OpCodes.Br, ec.LoopBegin);
- ig.MarkLabel (end_try);
- ec.InTry = old_in_try;
-
- // The runtime provides this for us.
- // ig.Emit (OpCodes.Leave, end);
-
- //
- // Now the finally block
- //
- Label end_finally = ig.DefineLabel ();
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- ig.BeginFinallyBlock ();
-
- ig.Emit (OpCodes.Ldloc, enumerator);
- ig.Emit (OpCodes.Isinst, TypeManager.idisposable_type);
- ig.Emit (OpCodes.Stloc, disposable);
- ig.Emit (OpCodes.Ldloc, disposable);
- ig.Emit (OpCodes.Brfalse, end_finally);
- ig.Emit (OpCodes.Ldloc, disposable);
- ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
- ig.MarkLabel (end_finally);
- ec.InFinally = old_in_finally;
-
- // The runtime generates this anyways.
- // ig.Emit (OpCodes.Endfinally);
-
- ig.EndExceptionBlock ();
-
- ig.MarkLabel (ec.LoopEnd);
- return false;
- }
-
- //
- // FIXME: possible optimization.
- // We might be able to avoid creating `empty' if the type is the sam
- //
- bool EmitArrayForeach (EmitContext ec, Type var_type)
- {
- Type array_type = expr.Type;
- Type element_type = array_type.GetElementType ();
- Expression conv = null;
- Expression empty = new EmptyExpression (element_type);
-
- conv = Expression.ConvertExplicit (ec, empty, var_type, loc);
- if (conv == null)
- return false;
-
- int rank = array_type.GetArrayRank ();
- ILGenerator ig = ec.ig;
-
- LocalBuilder copy = ig.DeclareLocal (array_type);
-
- //
- // Make our copy of the array
- //
- expr.Emit (ec);
- ig.Emit (OpCodes.Stloc, copy);
-
- if (rank == 1){
- LocalBuilder counter = ig.DeclareLocal (TypeManager.int32_type);
-
- Label loop, test;
-
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Stloc, counter);
- test = ig.DefineLabel ();
- ig.Emit (OpCodes.Br, test);
-
- loop = ig.DefineLabel ();
- ig.MarkLabel (loop);
-
- ig.Emit (OpCodes.Ldloc, copy);
- ig.Emit (OpCodes.Ldloc, counter);
- ArrayAccess.EmitLoadOpcode (ig, var_type);
-
- variable.EmitAssign (ec, conv);
-
- statement.Emit (ec);
-
- ig.MarkLabel (ec.LoopBegin);
- ig.Emit (OpCodes.Ldloc, counter);
- ig.Emit (OpCodes.Ldc_I4_1);
- ig.Emit (OpCodes.Add);
- ig.Emit (OpCodes.Stloc, counter);
-
- ig.MarkLabel (test);
- ig.Emit (OpCodes.Ldloc, counter);
- ig.Emit (OpCodes.Ldloc, copy);
- ig.Emit (OpCodes.Ldlen);
- ig.Emit (OpCodes.Conv_I4);
- ig.Emit (OpCodes.Blt, loop);
- } else {
- LocalBuilder [] dim_len = new LocalBuilder [rank];
- LocalBuilder [] dim_count = new LocalBuilder [rank];
- Label [] loop = new Label [rank];
- Label [] test = new Label [rank];
- int dim;
-
- for (dim = 0; dim < rank; dim++){
- dim_len [dim] = ig.DeclareLocal (TypeManager.int32_type);
- dim_count [dim] = ig.DeclareLocal (TypeManager.int32_type);
- test [dim] = ig.DefineLabel ();
- loop [dim] = ig.DefineLabel ();
- }
-
- for (dim = 0; dim < rank; dim++){
- ig.Emit (OpCodes.Ldloc, copy);
- IntLiteral.EmitInt (ig, dim);
- ig.Emit (OpCodes.Callvirt, TypeManager.int_getlength_int);
- ig.Emit (OpCodes.Stloc, dim_len [dim]);
- }
-
- for (dim = 0; dim < rank; dim++){
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Stloc, dim_count [dim]);
- ig.Emit (OpCodes.Br, test [dim]);
- ig.MarkLabel (loop [dim]);
- }
-
- ig.Emit (OpCodes.Ldloc, copy);
- for (dim = 0; dim < rank; dim++)
- ig.Emit (OpCodes.Ldloc, dim_count [dim]);
-
- //
- // FIXME: Maybe we can cache the computation of `get'?
- //
- Type [] args = new Type [rank];
- MethodInfo get;
-
- for (int i = 0; i < rank; i++)
- args [i] = TypeManager.int32_type;
-
- ModuleBuilder mb = RootContext.ModuleBuilder;
- get = mb.GetArrayMethod (
- array_type, "Get",
- CallingConventions.HasThis| CallingConventions.Standard,
- var_type, args);
- ig.Emit (OpCodes.Call, get);
- variable.EmitAssign (ec, conv);
- statement.Emit (ec);
- ig.MarkLabel (ec.LoopBegin);
- for (dim = rank - 1; dim >= 0; dim--){
- ig.Emit (OpCodes.Ldloc, dim_count [dim]);
- ig.Emit (OpCodes.Ldc_I4_1);
- ig.Emit (OpCodes.Add);
- ig.Emit (OpCodes.Stloc, dim_count [dim]);
-
- ig.MarkLabel (test [dim]);
- ig.Emit (OpCodes.Ldloc, dim_count [dim]);
- ig.Emit (OpCodes.Ldloc, dim_len [dim]);
- ig.Emit (OpCodes.Blt, loop [dim]);
- }
- }
- ig.MarkLabel (ec.LoopEnd);
-
- return false;
- }
-
- public override bool Emit (EmitContext ec)
- {
- Type var_type;
- bool ret_val;
-
- expr = expr.Resolve (ec);
- if (expr == null)
- return false;
-
- var_type = RootContext.LookupType (ec.TypeContainer, type, false, loc);
- if (var_type == null)
- return false;
-
- //
- // We need an instance variable. Not sure this is the best
- // way of doing this.
- //
- // FIXME: When we implement propertyaccess, will those turn
- // out to return values in ExprClass? I think they should.
- //
- if (!(expr.eclass == ExprClass.Variable || expr.eclass == ExprClass.Value ||
- expr.eclass == ExprClass.PropertyAccess)){
- error1579 (expr.Type);
- return false;
- }
-
- ILGenerator ig = ec.ig;
-
- Label old_begin = ec.LoopBegin, old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
- ec.LoopBegin = ig.DefineLabel ();
- ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
-
- if (expr.Type.IsArray)
- ret_val = EmitArrayForeach (ec, var_type);
- else {
- MethodInfo get_enum;
-
- if ((get_enum = ProbeCollectionType (expr.Type)) == null)
- return false;
-
- ret_val = EmitCollectionForeach (ec, var_type, get_enum);
- }
-
- ec.LoopBegin = old_begin;
- ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- return ret_val;
- }
- }
-}
-
diff --git a/mcs/mcs/statementCollection.cs b/mcs/mcs/statementCollection.cs
deleted file mode 100755
index 9e5141dfdc6..00000000000
--- a/mcs/mcs/statementCollection.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// System.CodeDOM CodeStatementCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace Mono.CSharp {
-
- using System.Collections;
- using System;
-
- public class StatementCollection : IList, ICollection, IEnumerable {
-
- ArrayList statements;
-
- //
- // Constructors
- //
- public StatementCollection ()
- {
- statements = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return statements.Count;
- }
- }
-
- //
- // Methods
- //
- public void Add (Statement value)
- {
- statements.Add (value);
- }
-
- public void AddRange (Statement [] values)
- {
- foreach (Statement ca in values)
- statements.Add (ca);
-
- }
-
- public void Clear ()
- {
- statements.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private StatementCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (StatementCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new StatementCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return statements.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return statements.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return statements.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- statements [index] = value;
- }
-
- public object this[int index] {
- get {
- return statements [index];
- }
-
- set {
- statements [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- statements.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- statements.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- statements.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return statements.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return statements.IsSynchronized;
- }
- }
-
- public bool IsFixedSize {
- get {
- return false;
- }
- }
- }
-}
diff --git a/mcs/mcs/support.cs b/mcs/mcs/support.cs
deleted file mode 100755
index 53edbdc9ecb..00000000000
--- a/mcs/mcs/support.cs
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-// support.cs: Support routines to work around the fact that System.Reflection.Emit
-// can not introspect types that are being constructed
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-using System;
-using System.Text;
-using System.Reflection;
-using System.Collections;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- public interface ParameterData {
- Type ParameterType (int pos);
- int Count { get; }
- string ParameterDesc (int pos);
- Parameter.Modifier ParameterModifier (int pos);
- }
-
- public class ReflectionParameters : ParameterData {
- ParameterInfo [] pi;
- bool last_arg_is_params;
-
- public ReflectionParameters (ParameterInfo [] pi)
- {
- object [] a;
-
- this.pi = pi;
-
- int count = pi.Length-1;
-
- if (count > 0) {
- a = pi [count].GetCustomAttributes (TypeManager.param_array_type, false);
-
- if (a != null)
- if (a.Length != 0)
- last_arg_is_params = true;
- }
- }
-
- public Type ParameterType (int pos)
- {
- if (last_arg_is_params && pos >= pi.Length - 1)
- return pi [pi.Length -1].ParameterType;
- else
- return pi [pos].ParameterType;
- }
-
- public string ParameterDesc (int pos)
- {
- StringBuilder sb = new StringBuilder ();
-
- if (pi [pos].IsOut)
- sb.Append ("out ");
-
- if (pi [pos].IsIn)
- sb.Append ("in ");
-
- if (pos >= pi.Length - 1 && last_arg_is_params)
- sb.Append ("params ");
-
- sb.Append (TypeManager.CSharpName (ParameterType (pos)));
-
- return sb.ToString ();
-
- }
-
- public Parameter.Modifier ParameterModifier (int pos)
- {
- if (pos >= pi.Length - 1)
- if (last_arg_is_params)
- return Parameter.Modifier.PARAMS;
-
- Type t = pi [pos].ParameterType;
- if (t.IsByRef)
- return Parameter.Modifier.OUT;
-
- return Parameter.Modifier.NONE;
- }
-
- public int Count {
- get {
- return pi.Length;
- }
- }
-
- }
-
- public class InternalParameters : ParameterData {
- Type [] param_types;
-
- Parameters parameters;
-
- public InternalParameters (Type [] param_types, Parameters parameters)
- {
- this.param_types = param_types;
- this.parameters = parameters;
- }
-
- public InternalParameters (TypeContainer tc, Parameters parameters)
- : this (parameters.GetParameterInfo (tc), parameters)
- {
- }
-
- public int Count {
- get {
- if (param_types == null)
- return 0;
-
- return param_types.Length;
- }
- }
-
- public Type ParameterType (int pos)
- {
- if (param_types == null)
- return null;
-
- Parameter [] fixed_pars = parameters.FixedParameters;
- if (fixed_pars != null){
- int len = fixed_pars.Length;
- if (pos < len)
- return parameters.FixedParameters [pos].ParameterType;
- else
- return parameters.ArrayParameter.ParameterType;
- } else
- return parameters.ArrayParameter.ParameterType;
- }
-
- public string ParameterDesc (int pos)
- {
- string tmp = null;
- Parameter p;
-
- if (pos >= parameters.FixedParameters.Length)
- p = parameters.ArrayParameter;
- else
- p = parameters.FixedParameters [pos];
-
- if (p.ModFlags == Parameter.Modifier.REF)
- tmp = "ref ";
- else if (p.ModFlags == Parameter.Modifier.OUT)
- tmp = "out ";
- else if (p.ModFlags == Parameter.Modifier.PARAMS)
- tmp = "params ";
-
- Type t = ParameterType (pos);
-
- return tmp + TypeManager.CSharpName (t);
- }
-
- public Parameter.Modifier ParameterModifier (int pos)
- {
- if (parameters.FixedParameters == null)
- return parameters.ArrayParameter.ModFlags;
-
- if (pos >= parameters.FixedParameters.Length)
- return parameters.ArrayParameter.ModFlags;
- else {
- Parameter.Modifier m = parameters.FixedParameters [pos].ModFlags;
-
- //
- // We use a return value of "OUT" for "reference" parameters.
- // both out and ref flags in the source map to reference parameters.
- //
- if (m == Parameter.Modifier.OUT || m == Parameter.Modifier.REF)
- return Parameter.Modifier.OUT;
-
- return Parameter.Modifier.NONE;
- }
- }
-
- }
-
- class PtrHashtable : Hashtable {
- class PtrComparer : IComparer {
- public int Compare (object x, object y)
- {
- if (x == y)
- return 0;
- else
- return 1;
- }
- }
-
- public PtrHashtable ()
- {
- comparer = new PtrComparer ();
- }
- }
-
- //
- // Compares member infos based on their name and
- // also allows one argument to be a string
- //
- class MemberInfoCompare : IComparer {
-
- public int Compare (object a, object b)
- {
- if (a == null || b == null){
- Console.WriteLine ("Invalid information passed");
- throw new Exception ();
- }
-
- if (a is string)
- return String.Compare ((string) a, ((MemberInfo)b).Name);
-
- if (b is string)
- return String.Compare (((MemberInfo)a).Name, (string) b);
-
- return String.Compare (((MemberInfo)a).Name, ((MemberInfo)b).Name);
- }
- }
-
- struct Pair {
- public object First;
- public object Second;
-
- public Pair (object f, object s)
- {
- First = f;
- Second = s;
- }
- }
-}
diff --git a/mcs/mcs/tree.cs b/mcs/mcs/tree.cs
deleted file mode 100755
index a4263af1af9..00000000000
--- a/mcs/mcs/tree.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// tree.cs: keeps a tree representation of the generated code
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.IO;
-
-namespace Mono.CSharp
-{
-
- public interface ITreeDump {
- int Dump (Tree tree, StreamWriter output);
- void ParseOptions (string options);
- }
-
- // <summary>
- //
- // We store here all the toplevel types that we have parsed,
- // this is the root of all information we have parsed.
- //
- // </summary>
-
- public class Tree {
- TypeContainer root_types;
-
- // <summary>
- // Keeps track of the interfaces defined in the source code
- // </summary>
- Hashtable ifaces;
-
- // <summary>
- // Keeps track of the structs defined in the source code
- // </summary>
- Hashtable structs;
-
- // <summary>
- // Keeps track of the classes defined in the source code
- // </summary>
- Hashtable classes;
-
- // <summary>
- // Keeps track of namespaces defined in the source code
- // </summary>
- Hashtable namespaces;
-
- public Tree ()
- {
- root_types = new TypeContainer (null, "", new Location (-1));
- }
-
-
- public void RecordInterface (string name, Interface iface)
- {
- if (ifaces == null)
- ifaces = new Hashtable ();
-
- ifaces.Add (name, iface);
- }
-
- public void RecordStruct (string name, Struct s)
- {
- if (structs == null)
- structs = new Hashtable ();
-
- structs.Add (name, s);
- }
-
- public void RecordClass (string name, Class c)
- {
- if (classes == null)
- classes = new Hashtable ();
-
- classes.Add (name, c);
- }
-
- public Namespace RecordNamespace (Namespace parent, string file, string name)
- {
- if (namespaces == null)
- namespaces = new Hashtable ();
-
- Namespace ns = new Namespace (parent, name);
-
- if (namespaces.Contains (file)){
- Hashtable ns_ns = (Hashtable) namespaces [file];
-
- if (ns_ns.Contains (ns.Name))
- return (Namespace) ns_ns [ns.Name];
- ns_ns.Add (ns.Name, ns);
- } else {
- Hashtable new_table = new Hashtable ();
- namespaces [file] = new_table;
-
- new_table.Add (ns.Name, ns);
- }
-
- return ns;
- }
-
- public TypeContainer Types {
- get {
- return root_types;
- }
- }
-
- public Hashtable Interfaces {
- get {
- return ifaces;
- }
- }
-
- public Hashtable Classes {
- get {
- return classes;
- }
- }
-
- public Hashtable Structs {
- get {
- return structs;
- }
- }
-
- public Hashtable Namespaces {
- get {
- return namespaces;
- }
- }
- }
-}
diff --git a/mcs/mcs/type.cs b/mcs/mcs/type.cs
deleted file mode 100755
index 65a59146e53..00000000000
--- a/mcs/mcs/type.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// type.cs: Type container.
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace CIR {
- using System.Collections;
- using System;
-
- public class xUnresolvedType {
- TypeContainer parent;
- string name;
-
- public xUnresolvedType (TypeContainer parent, string name)
- {
- this.parent = parent;
- this.name = name;
- }
-
- public string Name {
- get {
- return name;
- }
- }
-
- public TypeContainer Parent {
- get {
- return parent;
- }
- }
- }
-
- public class xTypeRef {
- object data;
-
- public xTypeRef (object data)
- {
- this.data = data;
- }
-
- public Object Data {
- get {
- return data;
- }
- }
-
- public xUnresolvedType UnresolvedData {
- get {
- if (data is UnresolvedType)
- return (UnresolvedType) data;
- else
- return null;
- }
- }
-
- public Type Type {
- get {
- if (data is UnresolvedType)
- Resolve ();
-
- return (Type) data;
- }
- }
-
- public bool IsResolved {
- get {
- return !(data is UnresolvedType);
- }
- }
-
- public bool Resolve () {
- return false;
- }
- }
-
- public class xTypeRefManager {
- ArrayList pending_types;
-
- public xTypeRefManager ()
- {
- pending_types = new ArrayList ();
- }
-
- public TypeRef GetTypeRef (TypeContainer container, string name)
- {
- object unresolved;
- TypeRef typeref;
-
- unresolved = new UnresolvedType (container, name);
- typeref = new TypeRef (unresolved);
- pending_types.Add (typeref);
-
- return typeref;
- }
- }
-}
-
-
-
diff --git a/mcs/mcs/typemanager.cs b/mcs/mcs/typemanager.cs
deleted file mode 100755
index a4562c22472..00000000000
--- a/mcs/mcs/typemanager.cs
+++ /dev/null
@@ -1,974 +0,0 @@
-//
-// typemanager.cs: C# type manager
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
-public class TypeManager {
- //
- // A list of core types that the compiler requires or uses
- //
- static public Type object_type;
- static public Type value_type;
- static public Type string_type;
- static public Type int32_type;
- static public Type uint32_type;
- static public Type int64_type;
- static public Type uint64_type;
- static public Type float_type;
- static public Type double_type;
- static public Type char_type;
- static public Type char_ptr_type;
- static public Type short_type;
- static public Type decimal_type;
- static public Type bool_type;
- static public Type sbyte_type;
- static public Type byte_type;
- static public Type ushort_type;
- static public Type enum_type;
- static public Type delegate_type;
- static public Type multicast_delegate_type;
- static public Type void_type;
- static public Type enumeration_type;
- static public Type array_type;
- static public Type runtime_handle_type;
- static public Type icloneable_type;
- static public Type type_type;
- static public Type ienumerator_type;
- static public Type idisposable_type;
- static public Type default_member_type;
- static public Type iasyncresult_type;
- static public Type asynccallback_type;
- static public Type intptr_type;
- static public Type monitor_type;
- static public Type runtime_field_handle_type;
- static public Type attribute_usage_type;
- static public Type dllimport_type;
- static public Type unverifiable_code_type;
- static public Type methodimpl_attr_type;
- static public Type param_array_type;
- static public Type void_ptr_type;
-
- //
- // Internal, not really used outside
- //
- Type runtime_helpers_type;
-
- //
- // These methods are called by code generated by the compiler
- //
- static public MethodInfo string_concat_string_string;
- static public MethodInfo string_concat_object_object;
- static public MethodInfo string_isinterneted_string;
- static public MethodInfo system_type_get_type_from_handle;
- static public MethodInfo object_getcurrent_void;
- static public MethodInfo bool_movenext_void;
- static public MethodInfo void_dispose_void;
- static public MethodInfo void_monitor_enter_object;
- static public MethodInfo void_monitor_exit_object;
- static public MethodInfo void_initializearray_array_fieldhandle;
- static public MethodInfo int_getlength_int;
- static public MethodInfo delegate_combine_delegate_delegate;
- static public MethodInfo delegate_remove_delegate_delegate;
- static public MethodInfo int_get_offset_to_string_data;
-
- //
- // The attribute constructors.
- //
- static public ConstructorInfo cons_param_array_attribute;
-
- // <remarks>
- // Holds the Array of Assemblies that have been loaded
- // (either because it is the default or the user used the
- // -r command line option)
- // </remarks>
- ArrayList assemblies;
-
- // <remarks>
- // Keeps a list of module builders. We used this to do lookups
- // on the modulebuilder using GetType -- needed for arrays
- // </remarks>
- ArrayList modules;
-
- // <remarks>
- // This is the type_cache from the assemblies to avoid
- // hitting System.Reflection on every lookup.
- // </summary>
- Hashtable types;
-
- // <remarks>
- // This is used to hotld the corresponding TypeContainer objects
- // since we need this in FindMembers
- // </remarks>
- Hashtable typecontainers;
-
- // <remarks>
- // Keeps track of those types that are defined by the
- // user's program
- // </remarks>
- ArrayList user_types;
-
- // <remarks>
- // Keeps a mapping between TypeBuilders and their TypeContainers
- // </remarks>
- static PtrHashtable builder_to_container;
-
- // <remarks>
- // Maps MethodBase.RuntimeTypeHandle to a Type array that contains
- // the arguments to the method
- // </remarks>
- static Hashtable method_arguments;
-
- // <remarks>
- // Maybe `method_arguments' should be replaced and only
- // method_internal_params should be kept?
- // <remarks>
- static Hashtable method_internal_params;
-
- static PtrHashtable builder_to_interface;
-
- // <remarks>
- // Keeps track of delegate types
- // </remarks>
-
- static Hashtable builder_to_delegate;
-
- // <remarks>
- // Keeps track of enum types
- // </remarks>
-
- static Hashtable builder_to_enum;
-
- // <remarks>
- // Keeps track of attribute types
- // </remarks>
-
- static Hashtable builder_to_attr;
-
- public TypeManager ()
- {
- assemblies = new ArrayList ();
- modules = new ArrayList ();
- user_types = new ArrayList ();
- types = new Hashtable ();
- typecontainers = new Hashtable ();
- builder_to_interface = new PtrHashtable ();
- builder_to_delegate = new PtrHashtable ();
- builder_to_enum = new PtrHashtable ();
- builder_to_attr = new PtrHashtable ();
- }
-
- static TypeManager ()
- {
- method_arguments = new PtrHashtable ();
- method_internal_params = new PtrHashtable ();
- builder_to_container = new PtrHashtable ();
- type_interface_cache = new PtrHashtable ();
- }
-
- public void AddUserType (string name, TypeBuilder t)
- {
- types.Add (name, t);
- user_types.Add (t);
- }
-
- public void AddUserType (string name, TypeBuilder t, TypeContainer tc)
- {
- AddUserType (name, t);
- builder_to_container.Add (t, tc);
- typecontainers.Add (name, tc);
- }
-
- public void AddDelegateType (string name, TypeBuilder t, Delegate del)
- {
- types.Add (name, t);
- builder_to_delegate.Add (t, del);
- }
-
- public void AddEnumType (string name, TypeBuilder t, Enum en)
- {
- types.Add (name, t);
- builder_to_enum.Add (t, en);
- }
-
- public void AddUserInterface (string name, TypeBuilder t, Interface i)
- {
- AddUserType (name, t);
- builder_to_interface.Add (t, i);
- }
-
- public void RegisterAttrType (Type t, TypeContainer tc)
- {
- builder_to_attr.Add (t, tc);
- }
-
- /// <summary>
- /// Returns the TypeContainer whose Type is `t' or null if there is no
- /// TypeContainer for `t' (ie, the Type comes from a library)
- /// </summary>
- public static TypeContainer LookupTypeContainer (Type t)
- {
- return (TypeContainer) builder_to_container [t];
- }
-
- public Interface LookupInterface (Type t)
- {
- return (Interface) builder_to_interface [t];
- }
-
- public static Delegate LookupDelegate (Type t)
- {
- return (Delegate) builder_to_delegate [t];
- }
-
- public static Enum LookupEnum (Type t)
- {
- return (Enum) builder_to_enum [t];
- }
-
- public static TypeContainer LookupAttr (Type t)
- {
- return (TypeContainer) builder_to_attr [t];
- }
-
- /// <summary>
- /// Registers an assembly to load types from.
- /// </summary>
- public void AddAssembly (Assembly a)
- {
- assemblies.Add (a);
- }
-
- /// <summary>
- /// Registers a module builder to lookup types from
- /// </summary>
- public void AddModule (ModuleBuilder mb)
- {
- modules.Add (mb);
- }
-
- /// <summary>
- /// Returns the Type associated with @name
- /// </summary>
- public Type LookupType (string name)
- {
- Type t;
-
- //
- // First lookup in user defined and cached values
- //
-
- t = (Type) types [name];
- if (t != null)
- return t;
-
- foreach (Assembly a in assemblies){
- t = a.GetType (name);
- if (t != null){
- types [name] = t;
-
- return t;
- }
- }
-
- foreach (ModuleBuilder mb in modules) {
- t = mb.GetType (name);
- if (t != null) {
- types [name] = t;
- return t;
- }
- }
-
- return null;
- }
-
- /// <summary>
- /// Returns the C# name of a type if possible, or the full type name otherwise
- /// </summary>
- static public string CSharpName (Type t)
- {
- if (t == int32_type)
- return "int";
- else if (t == uint32_type)
- return "uint";
- else if (t == int64_type)
- return "long";
- else if (t == uint64_type)
- return "ulong";
- else if (t == float_type)
- return "float";
- else if (t == double_type)
- return "double";
- else if (t == char_type)
- return "char";
- else if (t == short_type)
- return "short";
- else if (t == decimal_type)
- return "decimal";
- else if (t == bool_type)
- return "bool";
- else if (t == sbyte_type)
- return "sbyte";
- else if (t == byte_type)
- return "byte";
- else if (t == short_type)
- return "short";
- else if (t == ushort_type)
- return "ushort";
- else if (t == string_type)
- return "string";
- else if (t == object_type)
- return "object";
- else if (t == void_type)
- return "void";
- else
- return t.FullName;
- }
-
- /// <summary>
- /// Looks up a type, and aborts if it is not found. This is used
- /// by types required by the compiler
- /// </summary>
- Type CoreLookupType (string name)
- {
- Type t = LookupType (name);
-
- if (t == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined or imported");
- Environment.Exit (0);
- }
-
- return t;
- }
-
- /// <summary>
- /// Returns the MethodInfo for a method named `name' defined
- /// in type `t' which takes arguments of types `args'
- /// </summary>
- MethodInfo GetMethod (Type t, string name, Type [] args)
- {
- MethodInfo mi = t.GetMethod (name, args);
-
- if (mi == null)
- throw new Exception ("Can not find the core function `" + name + "'");
-
- return mi;
- }
-
- ConstructorInfo GetConstructor (Type t, Type [] args)
- {
- ConstructorInfo ci = t.GetConstructor (args);
-
- if (ci == null)
- throw new Exception ("Can not find the core constructor for `" + t.FullName + "'");
-
- return ci;
- }
-
- /// <remarks>
- /// The types have to be initialized after the initial
- /// population of the type has happened (for example, to
- /// bootstrap the corlib.dll
- /// </remarks>
- public void InitCoreTypes ()
- {
- object_type = CoreLookupType ("System.Object");
- value_type = CoreLookupType ("System.ValueType");
- string_type = CoreLookupType ("System.String");
- int32_type = CoreLookupType ("System.Int32");
- int64_type = CoreLookupType ("System.Int64");
- uint32_type = CoreLookupType ("System.UInt32");
- uint64_type = CoreLookupType ("System.UInt64");
- float_type = CoreLookupType ("System.Single");
- double_type = CoreLookupType ("System.Double");
- byte_type = CoreLookupType ("System.Byte");
- sbyte_type = CoreLookupType ("System.SByte");
- char_type = CoreLookupType ("System.Char");
- char_ptr_type = CoreLookupType ("System.Char*");
- short_type = CoreLookupType ("System.Int16");
- ushort_type = CoreLookupType ("System.UInt16");
- decimal_type = CoreLookupType ("System.Decimal");
- bool_type = CoreLookupType ("System.Boolean");
- enum_type = CoreLookupType ("System.Enum");
-
- multicast_delegate_type = CoreLookupType ("System.MulticastDelegate");
- delegate_type = CoreLookupType ("System.Delegate");
-
- array_type = CoreLookupType ("System.Array");
- void_type = CoreLookupType ("System.Void");
- type_type = CoreLookupType ("System.Type");
-
- runtime_field_handle_type = CoreLookupType ("System.RuntimeFieldHandle");
- runtime_helpers_type = CoreLookupType ("System.Runtime.CompilerServices.RuntimeHelpers");
- default_member_type = CoreLookupType ("System.Reflection.DefaultMemberAttribute");
- runtime_handle_type = CoreLookupType ("System.RuntimeTypeHandle");
- asynccallback_type = CoreLookupType ("System.AsyncCallback");
- iasyncresult_type = CoreLookupType ("System.IAsyncResult");
- ienumerator_type = CoreLookupType ("System.Collections.IEnumerator");
- idisposable_type = CoreLookupType ("System.IDisposable");
- icloneable_type = CoreLookupType ("System.ICloneable");
- monitor_type = CoreLookupType ("System.Threading.Monitor");
- intptr_type = CoreLookupType ("System.IntPtr");
-
- attribute_usage_type = CoreLookupType ("System.AttributeUsageAttribute");
- dllimport_type = CoreLookupType ("System.Runtime.InteropServices.DllImportAttribute");
- methodimpl_attr_type = CoreLookupType ("System.Runtime.CompilerServices.MethodImplAttribute");
- param_array_type = CoreLookupType ("System.ParamArrayAttribute");
-
- unverifiable_code_type = CoreLookupType ("System.Security.UnverifiableCodeAttribute");
-
- void_ptr_type = CoreLookupType ("System.Void*");
-
- //
- // Now load the default methods that we use.
- //
- Type [] string_string = { string_type, string_type };
- string_concat_string_string = GetMethod (
- string_type, "Concat", string_string);
-
- Type [] object_object = { object_type, object_type };
- string_concat_object_object = GetMethod (
- string_type, "Concat", object_object);
-
- Type [] string_ = { string_type };
- string_isinterneted_string = GetMethod (
- string_type, "IsInterned", string_);
-
- Type [] runtime_type_handle = { runtime_handle_type };
- system_type_get_type_from_handle = GetMethod (
- type_type, "GetTypeFromHandle", runtime_type_handle);
-
- Type [] delegate_delegate = { delegate_type, delegate_type };
- delegate_combine_delegate_delegate = GetMethod (
- delegate_type, "Combine", delegate_delegate);
-
- delegate_remove_delegate_delegate = GetMethod (
- delegate_type, "Remove", delegate_delegate);
-
- //
- // Void arguments
- //
- Type [] void_arg = { };
- object_getcurrent_void = GetMethod (
- ienumerator_type, "get_Current", void_arg);
- bool_movenext_void = GetMethod (
- ienumerator_type, "MoveNext", void_arg);
- void_dispose_void = GetMethod (
- idisposable_type, "Dispose", void_arg);
- int_get_offset_to_string_data = GetMethod (
- runtime_helpers_type, "get_OffsetToStringData", void_arg);
-
- //
- // object arguments
- //
- Type [] object_arg = { object_type };
- void_monitor_enter_object = GetMethod (
- monitor_type, "Enter", object_arg);
- void_monitor_exit_object = GetMethod (
- monitor_type, "Exit", object_arg);
-
- Type [] array_field_handle_arg = { array_type, runtime_field_handle_type };
-
- void_initializearray_array_fieldhandle = GetMethod (
- runtime_helpers_type, "InitializeArray", array_field_handle_arg);
-
- //
- // Array functions
- //
- Type [] int_arg = { int32_type };
- int_getlength_int = GetMethod (
- array_type, "GetLength", int_arg);
-
- //
- // Attributes
- //
- cons_param_array_attribute = GetConstructor (
- param_array_type, void_arg);
-
- }
-
- const BindingFlags instance_and_static = BindingFlags.Static | BindingFlags.Instance;
-
- public MemberInfo [] FindMembers (Type t, MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
- {
- //
- // We have to take care of arrays specially, because GetType on
- // a TypeBuilder array will return a Type, not a TypeBuilder,
- // and we can not call FindMembers on this type.
- //
- if (t.IsSubclassOf (TypeManager.array_type))
- return TypeManager.array_type.FindMembers (mt, bf, filter, criteria);
-
- if (!(t is TypeBuilder)){
- //
- // Since FindMembers will not lookup both static and instance
- // members, we emulate this behaviour here.
- //
- if ((bf & instance_and_static) == instance_and_static){
- MemberInfo [] i_members = t.FindMembers (
- mt, bf & ~BindingFlags.Static, filter, criteria);
- MemberInfo [] s_members = t.FindMembers (
- mt, bf & ~BindingFlags.Instance, filter, criteria);
-
- int i_len = i_members.Length;
- int s_len = s_members.Length;
- if (i_len > 0 || s_len > 0){
- MemberInfo [] both = new MemberInfo [i_len + s_len];
-
- i_members.CopyTo (both, 0);
- s_members.CopyTo (both, i_len);
-
- return both;
- } else
- return i_members;
- }
- return t.FindMembers (mt, bf, filter, criteria);
- }
-
- //
- // FIXME: We should not have builder_to_blah everywhere,
- // we should just have a builder_to_findmemberizable
- // and have them implement a new ICanFindMembers interface
- //
- Enum e = (Enum) builder_to_enum [t];
-
- if (e != null)
- return e.FindMembers (mt, bf, filter, criteria);
-
- Delegate del = (Delegate) builder_to_delegate [t];
-
- if (del != null)
- return del.FindMembers (mt, bf, filter, criteria);
-
- Interface iface = (Interface) builder_to_interface [t];
-
- if (iface != null)
- return iface.FindMembers (mt, bf, filter, criteria);
-
- TypeContainer tc = (TypeContainer) builder_to_container [t];
-
- if (tc != null)
- return tc.FindMembers (mt, bf, filter, criteria);
-
- return null;
- }
-
- public static bool IsBuiltinType (Type t)
- {
- if (t == object_type || t == string_type || t == int32_type || t == uint32_type ||
- t == int64_type || t == uint64_type || t == float_type || t == double_type ||
- t == char_type || t == short_type || t == decimal_type || t == bool_type ||
- t == sbyte_type || t == byte_type || t == ushort_type)
- return true;
- else
- return false;
- }
-
- public static bool IsDelegateType (Type t)
- {
- if (t.IsSubclassOf (TypeManager.delegate_type))
- return true;
- else
- return false;
- }
-
- public static bool IsEnumType (Type t)
- {
- if (t.IsSubclassOf (TypeManager.enum_type))
- return true;
- else
- return false;
- }
-
- public static bool IsInterfaceType (Type t)
- {
- Interface iface = (Interface) builder_to_interface [t];
-
- if (iface != null)
- return true;
- else
- return false;
- }
-
- /// <summary>
- /// Returns the User Defined Types
- /// </summary>
- public ArrayList UserTypes {
- get {
- return user_types;
- }
- }
-
- public Hashtable TypeContainers {
- get {
- return typecontainers;
- }
- }
-
- static Hashtable builder_to_constant;
-
- public static void RegisterConstant (FieldBuilder fb, Const c)
- {
- if (builder_to_constant == null)
- builder_to_constant = new PtrHashtable ();
-
- if (builder_to_constant.Contains (fb))
- return;
-
- builder_to_constant.Add (fb, c);
- }
-
- public static Const LookupConstant (FieldBuilder fb)
- {
- if (builder_to_constant == null)
- return null;
-
- return (Const) builder_to_constant [fb];
- }
-
- /// <summary>
- /// Gigantic work around for missing features in System.Reflection.Emit follows.
- /// </summary>
- ///
- /// <remarks>
- /// Since System.Reflection.Emit can not return MethodBase.GetParameters
- /// for anything which is dynamic, and we need this in a number of places,
- /// we register this information here, and use it afterwards.
- /// </remarks>
- static public bool RegisterMethod (MethodBase mb, InternalParameters ip, Type [] args)
- {
- method_arguments.Add (mb, args);
- method_internal_params.Add (mb, ip);
-
- return true;
- }
-
- static public InternalParameters LookupParametersByBuilder (MethodBase mb)
- {
- if (! (mb is ConstructorBuilder || mb is MethodBuilder))
- return null;
-
- if (method_internal_params.Contains (mb))
- return (InternalParameters) method_internal_params [mb];
- else
- throw new Exception ("Argument for Method not registered" + mb);
- }
-
- /// <summary>
- /// Returns the argument types for a method based on its methodbase
- ///
- /// For dynamic methods, we use the compiler provided types, for
- /// methods from existing assemblies we load them from GetParameters,
- /// and insert them into the cache
- /// </summary>
- static public Type [] GetArgumentTypes (MethodBase mb)
- {
- if (method_arguments.Contains (mb))
- return (Type []) method_arguments [mb];
- else {
- ParameterInfo [] pi = mb.GetParameters ();
- int c = pi.Length;
- Type [] types = new Type [c];
-
- for (int i = 0; i < c; i++)
- types [i] = pi [i].ParameterType;
-
- method_arguments.Add (mb, types);
- return types;
- }
- }
-
- // <remarks>
- // This is a workaround the fact that GetValue is not
- // supported for dynamic types
- // </remarks>
- static Hashtable fields = new Hashtable ();
- static public bool RegisterFieldValue (FieldBuilder fb, object value)
- {
- if (fields.Contains (fb))
- return false;
-
- fields.Add (fb, value);
-
- return true;
- }
-
- static public object GetValue (FieldBuilder fb)
- {
- return fields [fb];
- }
-
- static Hashtable fieldbuilders_to_fields = new Hashtable ();
- static public bool RegisterField (FieldBuilder fb, Field f)
- {
- if (fieldbuilders_to_fields.Contains (fb))
- return false;
-
- fieldbuilders_to_fields.Add (fb, f);
- return true;
- }
-
- static public Field GetField (FieldInfo fb)
- {
- return (Field) fieldbuilders_to_fields [fb];
- }
-
- static Hashtable events;
-
- static public bool RegisterEvent (MyEventBuilder eb, MethodBase add, MethodBase remove)
- {
- if (events == null)
- events = new Hashtable ();
-
- if (events.Contains (eb))
- return false;
-
- events.Add (eb, new Pair (add, remove));
-
- return true;
- }
-
- static public MethodInfo GetAddMethod (EventInfo ei)
- {
- if (ei is MyEventBuilder) {
- Pair pair = (Pair) events [ei];
-
- return (MethodInfo) pair.First;
- } else
- return ei.GetAddMethod ();
- }
-
- static public MethodInfo GetRemoveMethod (EventInfo ei)
- {
- if (ei is MyEventBuilder) {
- Pair pair = (Pair) events [ei];
-
- return (MethodInfo) pair.Second;
- } else
- return ei.GetAddMethod ();
- }
-
- static Hashtable properties;
-
- static public bool RegisterProperty (PropertyBuilder pb, MethodBase get, MethodBase set)
- {
- if (properties == null)
- properties = new Hashtable ();
-
- if (properties.Contains (pb))
- return false;
-
- properties.Add (pb, new Pair (get, set));
-
- return true;
- }
-
- //
- // FIXME: we need to return the accessors depending on whether
- // they are visible or not.
- //
- static public MethodInfo [] GetAccessors (PropertyInfo pi)
- {
- MethodInfo [] ret;
-
- if (pi is PropertyBuilder){
- Pair pair = (Pair) properties [pi];
-
- ret = new MethodInfo [2];
- ret [0] = (MethodInfo) pair.First;
- ret [1] = (MethodInfo) pair.Second;
-
- return ret;
- } else {
- MethodInfo [] mi = new MethodInfo [2];
-
- //
- // Why this and not pi.GetAccessors?
- // Because sometimes index 0 is the getter
- // sometimes it is 1
- //
- mi [0] = pi.GetGetMethod (true);
- mi [1] = pi.GetSetMethod (true);
-
- return mi;
- }
- }
-
- static public MethodInfo GetPropertyGetter (PropertyInfo pi)
- {
- if (pi is PropertyBuilder){
- Pair de = (Pair) properties [pi];
-
- return (MethodInfo) de.Second;
- } else
- return pi.GetSetMethod ();
- }
-
- static public MethodInfo GetPropertySetter (PropertyInfo pi)
- {
- if (pi is PropertyBuilder){
- Pair de = (Pair) properties [pi];
-
- return (MethodInfo) de.First;
- } else
- return pi.GetGetMethod ();
- }
-
- // <remarks>
- // The following is used to check if a given type implements an interface.
- // The cache helps us reduce the expense of hitting Type.GetInterfaces everytime.
- // </remarks>
-
- static Hashtable type_interface_cache;
- public static bool ImplementsInterface (Type t, Type iface)
- {
- Type [] interfaces;
-
- do {
- interfaces = t.GetInterfaces ();
-
- for (int i = interfaces.Length; i > 0; ){
- i--;
- if (interfaces [i] == iface)
- return true;
- }
- t = t.BaseType;
- } while (t != null);
-
- return false;
- }
-
- //
- // This is needed, because enumerations from assemblies
- // do not report their underlyingtype, but they report
- // themselves
- //
- public static Type EnumToUnderlying (Type t)
- {
- t = t.UnderlyingSystemType;
- if (!TypeManager.IsEnumType (t))
- return t;
-
- TypeCode tc = Type.GetTypeCode (t);
-
- switch (tc){
- case TypeCode.Boolean:
- return TypeManager.bool_type;
- case TypeCode.Byte:
- return TypeManager.byte_type;
- case TypeCode.SByte:
- return TypeManager.sbyte_type;
- case TypeCode.Char:
- return TypeManager.char_type;
- case TypeCode.Int16:
- return TypeManager.short_type;
- case TypeCode.UInt16:
- return TypeManager.ushort_type;
- case TypeCode.Int32:
- return TypeManager.int32_type;
- case TypeCode.UInt32:
- return TypeManager.uint32_type;
- case TypeCode.Int64:
- return TypeManager.int64_type;
- case TypeCode.UInt64:
- return TypeManager.uint64_type;
- }
- throw new Exception ("Unhandled typecode in enum" + tc);
- }
-
- /// <summary>
- /// Utility function that can be used to probe whether a type
- /// is managed or not.
- /// </summary>
- public static bool VerifyUnManaged (Type t, Location loc)
- {
- if (t.IsValueType){
- //
- // FIXME: this is more complex, we actually need to
- // make sure that the type does not contain any
- // classes itself
- //
- return true;
- }
-
- Report.Error (
- 208, loc,
- "Cannot take the address or size of a variable of a managed type ('" +
- CSharpName (t) + "')");
- return false;
- }
-
- /// <summary>
- /// Returns the name of the indexer in a given type.
- /// </summary>
- /// <remarks>
- /// The default is not always `Item'. The user can change this behaviour by
- /// using the DefaultMemberAttribute in the class.
- ///
- /// For example, the String class indexer is named `Chars' not `Item'
- /// </remarks>
- public static string IndexerPropertyName (Type t)
- {
-
- if (t is TypeBuilder) {
- TypeContainer tc = (TypeContainer) builder_to_container [t];
-
- Attributes attrs = tc.OptAttributes;
-
- if (attrs == null || attrs.AttributeSections == null)
- return "Item";
-
- foreach (AttributeSection asec in attrs.AttributeSections) {
-
- if (asec.Attributes == null)
- continue;
-
- foreach (Attribute a in asec.Attributes) {
- if (a.Name.IndexOf ("DefaultMember") != -1) {
- ArrayList pos_args = (ArrayList) a.Arguments [0];
- Expression e = ((Argument) pos_args [0]).expr;
-
- if (e is StringConstant)
- return ((StringConstant) e).Value;
- }
- }
- }
-
- return "Item";
- }
-
- System.Attribute attr = System.Attribute.GetCustomAttribute (t, TypeManager.default_member_type);
-
- if (attr != null)
- {
- DefaultMemberAttribute dma = (DefaultMemberAttribute) attr;
-
- return dma.MemberName;
- }
-
- return "Item";
- }
-
- public static void MakePinned (LocalBuilder builder)
- {
- //
- // FIXME: Flag the "LocalBuilder" type as being
- // pinned. Figure out API.
- //
- }
-}
-
-}
diff --git a/mcs/nant/.cvsignore b/mcs/nant/.cvsignore
deleted file mode 100755
index 6e95567187d..00000000000
--- a/mcs/nant/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-NAnt.exe
-nant.exe
diff --git a/mcs/nant/README-nant.txt b/mcs/nant/README-nant.txt
deleted file mode 100755
index 66c04bef116..00000000000
--- a/mcs/nant/README-nant.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-NAnt
-
-What is it?
------------
-NAnt is a .NET based build tool. In theory it is kind of like make without
-make's wrinkles. In practice it's a lot like Ant.
-
-If you are not familiar with Jakarta Ant you can get more information at the
-Jakarta project web site.
-http://jakarta.apache.org/
-
-
-Why NAnt?
----------
-Because Ant was too Java specific.
-Because Ant needed the Java runtime. NAnt only needs the .NET runtime.
-
-
-The Latest Version
-------------------
-Details of the latest version can be found on the NAnt project web site
-http://nant.sourceforge.net/
-
-
-Documentation
--------------
-Documentation is available in HTML format, in the doc/ directory.
-
-
-License
--------
-Copyright (C) 2001 Gerry Shaw
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-In addition, as a special exception, Gerry Shaw gives permission to link the
-code of this program with the Microsoft .NET library (or with modified versions
-of Microsoft .NET library that use the same license as the Microsoft .NET
-library), and distribute linked combinations including the two. You must obey
-the GNU General Public License in all respects for all of the code used other
-than the Microsoft .NET library. If you modify this file, you may extend this
-exception to your version of the file, but you are not obligated to do so. If
-you do not wish to do so, delete this exception statement from your version.
-
-A copy of the GNU General Public License is available in the COPYING.txt file
-included with all NAnt distributions.
-
-For more licensing information refer to the GNU General Public License on the
-GNU Project web site.
-http://www.gnu.org/copyleft/gpl.html
diff --git a/mcs/nant/doc/arrow.gif b/mcs/nant/doc/arrow.gif
deleted file mode 100755
index d5e5f8e771d..00000000000
--- a/mcs/nant/doc/arrow.gif
+++ /dev/null
Binary files differ
diff --git a/mcs/nant/doc/authors.html b/mcs/nant/doc/authors.html
deleted file mode 100755
index 3b8ce57e47b..00000000000
--- a/mcs/nant/doc/authors.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt Authors</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->"/> Authors</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> Authors</h1>
-
- <h3>Lead Developer</h3>
- <ul>
- <li>Gerry Shaw (gerry_shaw@yahoo.com)</li>
- </ul>
-
- <h3>Developers</h3>
- <ul>
- <li>Ian MacLean (ian_maclean@another.com)</li>
- </ul>
-
- <h3>Code Contributions (sorted by name)</h3>
- <ul>
- <li>Mike Krueger (mike@icsharpcode.net)</li>
- <li>Sergey Chaban (serge@wildwestsoftware.com)</li>
- </ul>
-
- <h3><a></a>Special Thanks To</h3>
- <ul>
- <li>The <a href="http://jakarta.apache.org/ant/">Ant</a> team on the Jakarta project.</li>
- <li><a href="http://www.hazware.com/">Hazware</a> for the original XBuild source.</li>
- <li><a href="http://nunit.sourceforge.net/">Philip Craig</a> for NUnit.</li>
- <li><a href="http://msdn.microsoft.com/net/">Microsoft</a> for making .NET and C#.</li>
- <li>Ximian for working on the <a href="http://www.go-mono.com">Mono</a> project ot make .NET a true open standard.</li>
- </ul>
-</body>
-
-</html>
diff --git a/mcs/nant/doc/changelog.html b/mcs/nant/doc/changelog.html
deleted file mode 100755
index a5f3ac7e182..00000000000
--- a/mcs/nant/doc/changelog.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt Change Log</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->"/> Change Log</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> Change Log</h1>
-
- <h3>0.6.0 September 18, 2001</h3>
- <ul>
- <li>report build file xml errors in a useful way</li>
- <li>report error location when tasks are missing required attributes</li>
- <li>copy task updated - thanks to Ian MacLean</li>
- <li>**/*.cs type pattern matching now available in file sets via DirectoryScanner class</li>
- <li>Ian MacLean added as a project developer</li>
- <li>added all the environment variables to properites, ie, &lt;echo message="path=${nant.env.PATH}"/&gt;</li>
- <li>move task updated - thanks to Ian MacLean</li>
- <li>sleep task added - thanks to Ian MacLean</li>
- <li>DirectoryScanner and FileSet's scan for files AND directories now</li>
- <li>FileSet's cache scan results, use Scan() to rescan</li>
- <li>FileSet's auto initialize to their containing Task, this helps clean up the code</li>
- <li>copy task can now copy full directory trees</li>
- <li>added verbose attribute to copy task, default off, message gives number of files processed</li>
- <li>fixed bug with any ExternalBase tasks hanging - thanks to Sergey Chaban for reporting</li>
- <li>include task added</li>
- <li>call task added</li>
- <li>-verbose command line option added</li>
- <li>build file can now build complete distribution, try 'nant dist'</li>
- </ul>
-
- <h3>0.5.0 August 22, 2001</h3>
- <ul>
- <li>complete overhaul of the web site and doc folder (all html files)</li>
- <li>made src a parent folder to be able to hold multiple assemblies in anticipation of the NAnt.Tests.dll assembly</li>
- <li>licensed changed to GNU General Public License</li>
- <li>source code placed under CVS</li>
- <li>tasks can now have attributes in base classes, see CompilerBase as an example - thanks to Mike Krueger</li>
- <li>coding conventions posted on SourceForge in the document manager</li>
- <li>task manager in SourceForge is now being used to track currently active tasks</li>
- <li>namespace changed to SourceForge.NAnt</li>
- <li>added basic command line parsing</li>
- <li>added version resource</li>
- <li>support for multiple build targets (try 'nant clean test')</li>
- <li>BuildException added to report text position in the build file where errors occur - thanks to Ian MacLean</li>
- <li>style task (xslt processing) added - thanks to Serge</li>
- <li>executable is now signed with the NAnt.key</li>
- <li>converted all public/protected fields to properties</li>
- <li>added support for user define properties</li>
- <li>added -set option (try 'nant -set:debug=true clean build')</li>
- <li>changed verions number to 0.5 to reflect the number of changes in the code base</li>
- </ul>
-
- <h3>0.1.5 July 22, 2001</h3>
- <ul>
- <li>only compiles program if source file last write time > output last write time</li>
- <li>refactored compiler code into common CompilerBase class</li>
- <li>refactored compiler and exec task into common ExternalProgramBase class</li>
- <li>added &lt;arg value="/win32res:filename"/&gt; element to all external program tasks</li>
- <li>added Int32ValidatorAttribute and BooleanValidatorAttribute classes to perform error checking on task attributes after macro expansion but before task execution. Search for BooleanValidator or Int32Validator in Tasks for examples.</li>
- <li>changed Task attribute names to TaskAttributeAttribute and FileSetAttribute</li>
- <li>removed default value for task attributes (set with initial value)</li>
- <li>changes to Project class on how to initialize a project and run it</li>
- <li>right aligned task prefixes to clean up output</li>
- <li>added or enhanced these tasks
- <ul>
- <li>vbc, jsc, csc</li>
- <li>move</li>
- <li>nant</li>
- <li>taskdef</li>
- <li>tstamp</li>
- <li>exec (failonerror attribute)</li>
- </ul>
- </li>
- </ul>
-
- <h3>0.1.4 July 19, 2001</h3>
- <ul>
- <li>added or enhanced these tasks
- <ul>
- <li>echo</li>
- <li>fail</li>
- <li>property</li>
- <li>copy (respects basedir)</li>
- <li>delete (respects basedir)</li>
- <li>mkdir (respects basedir)</li>
- <li>exec</li>
- </ul>
- </li>
- </ul>
-
- <h3>0.1.3 July 18, 2001</h3>
- <ul>
- <li>dependices working via depends attribute on targets</li>
- <li>changed name from NBuild to NAnt</li>
- <li>using the name "Parameter" to refer to the xml attributes in tasks because it was conflicting badly with .NET Attributes</li>
- <li>added FileSetParameterAttribute so that fileset parameters would autoinit</li>
- <li>renamed TaskAttributeAttribute to StringParameterAttribute</li>
- <li>broke into seperate source files (one per class)</li>
- <li>changed default build file from Project.xml to the first file with a .build extension</li>
- </ul>
-
- <h3>0.1.2 July 16, 2001</h3>
- <ul>
- <li>basic functionality to have NAnt build itself (csc task)</li>
- </ul>
-
- <h3>0.1.1 July 5, 2001</h3>
- <ul>
- <li>initial test version</li>
- </ul>
-</body>
-
-</html>
diff --git a/mcs/nant/doc/index.html b/mcs/nant/doc/index.html
deleted file mode 100755
index 635c2ca1233..00000000000
--- a/mcs/nant/doc/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt - A .NET Build Tool</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><b>NAnt</b> : A .NET Build Tool</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> Home Page</h1>
-
- <p>September 18, 2001 Gerry Shaw -- <a title="Send email to Gerry Shaw" href="mailto:gerry_shaw@yahoo.com">gerry_shaw@yahoo.com</a></p>
- <p>NAnt is a .NET based build tool. In theory it is kind of like make without make's wrinkles. In practice it's a lot like <a title="Ant home page" href="http://jakarta.apache.org/ant/">Ant</a>. NAnt has only been tested with Beta 2 .NET SDK, build 2914.</p>
- <p>The idea for NAnt came from <a title="Hazware home page" href="http://www.hazware.com/xbHome.htm"> Hazware's XBuild</a> project. After emailing the author for a beta 2 version of the tool and getting no response I decided to port the code to .NET beta 2. Due to the number of changes from .NET beta 1 to beta 2 the result was a total rewrite.</p>
- <ul>
- <li><a title="NAnt files page on SourceForge" href="http://sourceforge.net/project/showfiles.php?group_id=31650"><b>Download latest version</b></a> from SourceForge</li>
- <li><a title="NAnt web site on SourceForge" href="http://nant.sourceforge.net">Home page</a> on SourceForge</li>
- <li><a title="NAnt project summary on SourceForge" href="http://sourceforge.net/projects/nant/">Project summary</a> on SourceForge</li>
- <li><a title="Version history of NAnt" href="changelog.html">Changes</a></li>
- <li><a title="Tasks still being worked on" href="todo.html">To do</a></li>
- <li><a title="Project credits" href="authors.html">Authors</a></li>
- <li><a title="Software license agreement" href="license.html">License</a></li>
- </ul>
-
- <h2>Getting Started</h2>
- <p>Since the software is still in heavy development you are going to be on your own. You can see NAnt build itself by doing the following:</p>
- <ol>
- <li>Download the latest released version.</li>
- <li>Unzip the distribution into a new folder.</li>
- <li>Using a command prompt (so you can see the build output) cd into the
- folder where NAnt was unzipped.</li>
- <li>Type <code>bin\nant</code> at the command prompt to build NAnt.</li>
- </ol>
-
- <p><a href="http://sourceforge.net"><img valign="middle" src="http://sourceforge.net/sflogo.php?group_id=31650" width="88" height="31" border="0" alt="SourceForge logo (link to home page)"></a></p>
-</body>
-
-</html>
diff --git a/mcs/nant/doc/license.html b/mcs/nant/doc/license.html
deleted file mode 100755
index 86d993bb13d..00000000000
--- a/mcs/nant/doc/license.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt License</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->"/> License</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> License</h1>
- <p>Copyright &copy 2001 Gerry Shaw</p>
- <p>
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- </p>
- <p>
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- </p>
- <p>
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- </p>
- <p>
- <b>In addition, as a special exception</b>, Gerry Shaw gives permission to link the
- code of this program with the Microsoft .NET library (or with modified versions
- of Microsoft .NET library that use the same license as the Microsoft .NET
- library), and distribute linked combinations including the two. You must obey
- the GNU General Public License in all respects for all of the code used other
- than the Microsoft .NET library. If you modify this file, you may extend this
- exception to your version of the file, but you are not obligated to do so. If
- you do not wish to do so, delete this exception statement from your version.
- </p>
- <p>A copy of the GNU General Public License is available in the COPYING.txt file included with all NAnt distributions.</p>
- <p>The <a title="GNU home page" href="http://www.gnu.org/">GNU Project</a> has more information on the <a title="Full text of the GNU Public License" href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.</p>
-</body>
-
-</html>
diff --git a/mcs/nant/doc/style.css b/mcs/nant/doc/style.css
deleted file mode 100755
index 32613372a4c..00000000000
--- a/mcs/nant/doc/style.css
+++ /dev/null
@@ -1,71 +0,0 @@
-body {
- font-family: Georgia, "Times New Roman", Times, "New York", serif;
- background: white;
- color: black
-}
-
-h1, h2, h3, h4, h5, h6 {
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif
-}
-
-h1.LinkHeader, h2.LinkHeader, h3.LinkHeader { margin-bottom: -18 }
-
-h4 {
- margin-bottom: 0.5em
-}
-
-h5 {
- margin-bottom: -.8em;
-}
-
-
-hr {
- color: gray
-}
-
-input {
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;
-}
-
-a:link { color: #0000cc; }
-a:visited { color: purple }
-a:active { color: #cc0000 }
-a:hover { color: #cc0000; }
-
-/*
-
-Because HTML 4.0 strict does not include the border attribute for images we turn it off with a style
-but this totally messes up Navigator 4.7 so we can't use it.
-
-a:link img, a:visited img, a:active img {
- border: none
-}
-*/
-
-/* have list items flush left against lists in a side bar use this style */
-ul.FlushLeft {
- margin-left: 1.25em;
- list-style-position: outside
-}
-
-.NavBar {
- background-color: #dfff80;
- border-color: #999966;
- border-style: none none solid none;
- border-width: 2px;
-}
-
-.NavBar-Cell {
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;
- font-size: 79%;
-}
-
-.SideBar {
- font-size: 80%;
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;
- padding: 8px;
-}
-
-/* color scheme */
-.N { color: #99cc00; }
-.Ant { color: #ff9900; }
diff --git a/mcs/nant/doc/todo.html b/mcs/nant/doc/todo.html
deleted file mode 100755
index 20cd3ba16ac..00000000000
--- a/mcs/nant/doc/todo.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt To Do</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->" width="13" height="9"/> To Do</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> To Do</h1>
- <p>The following is a rough guide to what features are being worked on and when they will be worked on in the future.</p>
- <p>For a list of what is actively being worked refer to the <a title="SourceForge task manager for NAnt" href="https://sourceforge.net/pm/?group_id=31650">NAnt Task Manager</a> on SourceForge.</p>
-
- <h3>0.7</h3>
- <ul>
- <li>command line parsing using clippy (another tool I'm working on that will be posted soon)</li>
- <li>clippy task (for command line parsing)</li>
- <li>nunit tests</li>
- <li>nunit task</li>
- <li>validate build file for valid xml and against a schema before starting build</li>
- <li>code xml docs for all non private members</li>
- <li>developer docs (code conventions, high level design)</li>
- <li>post newsgroup announcment</li>
- <li>request code review and project help</li>
- </ul>
-
- <h3>0.8</h3>
- <ul>
- <li>task documentation for users</li>
- <li>zip task</li>
- <li>ftp task</li>
- <li>standard input support for tasks that require input (ie, passwords when copying files via scp to SourceForge)</li>
- </ul>
-
- <h3>1.0</h3>
- <ul>
- <li>official release</li>
- <li>general cleanup</li>
- <li>xml documentation</li>
- <li>user documentation</li>
- <li>post newsgroup announcment</li>
- </ul>
-
- <h3>1.1</h3>
- <ul>
- <li>additional optional but useful tasks (sql, touch, email, grep)</li>
- </ul>
-</body>
-
-</html> \ No newline at end of file
diff --git a/mcs/nant/makefile b/mcs/nant/makefile
deleted file mode 100755
index c3d9e40404a..00000000000
--- a/mcs/nant/makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-all: nant.exe
-linux: nant.exe
-windows: nant.exe
-
-nant.exe: NAnt.exe
- -cp NAnt.exe nant.exe
-
-NAnt.exe: makefile
- csc /out:NAnt.exe /recurse:*.cs
diff --git a/mcs/nant/readme.txt b/mcs/nant/readme.txt
deleted file mode 100755
index 816b000c2e5..00000000000
--- a/mcs/nant/readme.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is an import of the Nant sources version 0.6.0 into the
-tree. We are doing this because the binaries were not compatible
-across versions of .NET.
-
diff --git a/mcs/nant/src/AssemblyInfo.cs b/mcs/nant/src/AssemblyInfo.cs
deleted file mode 100755
index 1bd25d5d050..00000000000
--- a/mcs/nant/src/AssemblyInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-[assembly: AssemblyTitle("NAnt")]
-[assembly: AssemblyDescription("A .NET Build Tool")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("http://nant.sourceforge.net/")]
-[assembly: AssemblyProduct("NAnt")]
-[assembly: AssemblyCopyright("Copyright (C) 2001 Gerry Shaw")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("0.6.0.*")]
-
-// This will not compile with Visual Studio. If you want to build a signed
-// executable use the NAnt build file. To build under Visual Studio just
-// exclude this file from the build.
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyName("")]
diff --git a/mcs/nant/src/AssemblyInfo.cs~ b/mcs/nant/src/AssemblyInfo.cs~
deleted file mode 100755
index a59c887180d..00000000000
--- a/mcs/nant/src/AssemblyInfo.cs~
+++ /dev/null
@@ -1,38 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-[assembly: AssemblyTitle("NAnt")]
-[assembly: AssemblyDescription("A .NET Build Tool")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("http://nant.sourceforge.net/")]
-[assembly: AssemblyProduct("NAnt")]
-[assembly: AssemblyCopyright("Copyright (C) 2001 Gerry Shaw")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("0.6.0.*")]
-
-// This will not compile with Visual Studio. If you want to build a signed
-// executable use the NAnt build file. To build under Visual Studio just
-// exclude this file from the build.
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile(@"..\NAnt.key")]
-[assembly: AssemblyKeyName("")]
diff --git a/mcs/nant/src/Attributes/BooleanValidatorAttribute.cs b/mcs/nant/src/Attributes/BooleanValidatorAttribute.cs
deleted file mode 100755
index 932b027d44d..00000000000
--- a/mcs/nant/src/Attributes/BooleanValidatorAttribute.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that field should be able to be converted into a Boolean.</summary>
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]
- public class BooleanValidatorAttribute : ValidatorAttribute {
-
- public BooleanValidatorAttribute() {
- }
-
- public override string Validate(object value) {
- string errorMessage = null;
- try {
- Convert.ToBoolean(value);
- } catch (Exception) {
- errorMessage = String.Format("Cannot resolve to '{0}' to Boolean value.", value.ToString());
- }
- return errorMessage;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Attributes/Int32ValidatorAttribute.cs b/mcs/nant/src/Attributes/Int32ValidatorAttribute.cs
deleted file mode 100755
index 51d967d7520..00000000000
--- a/mcs/nant/src/Attributes/Int32ValidatorAttribute.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that field should be able to be converted into a Int32 within the given range.</summary>
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]
- public class Int32ValidatorAttribute : ValidatorAttribute {
-
- int _minValue = Int32.MinValue;
- int _maxValue = Int32.MaxValue;
-
- public Int32ValidatorAttribute() {
- }
-
- public Int32ValidatorAttribute(int minValue, int maxValue) {
- MinValue = minValue;
- MaxValue = maxValue;
- }
-
- public int MinValue {
- get { return _minValue; }
- set { _minValue = value; }
- }
-
- public int MaxValue {
- get { return _maxValue; }
- set { _maxValue = value; }
- }
-
- public override string Validate(object value) {
- string errorMessage = null;
- try {
- Int32 intValue = Convert.ToInt32(value);
- if (intValue < MinValue || intValue > MaxValue) {
- errorMessage = String.Format("Cannot resolve '{0}' to integer between '{1}' and '{2}'.", value.ToString(), MinValue, MaxValue);
- }
- } catch (Exception) {
- errorMessage = String.Format("Cannot resolve '{0}' to integer value.", value.ToString());
- }
- return errorMessage;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Attributes/TaskAttributeAttribute.cs b/mcs/nant/src/Attributes/TaskAttributeAttribute.cs
deleted file mode 100755
index 060e25c3a31..00000000000
--- a/mcs/nant/src/Attributes/TaskAttributeAttribute.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that field should be treated as a xml attribute for the task.</summary>
- /// <example>
- /// Examples of how to specify task attributes
- /// <code>
- /// // task XmlType default is string
- /// [TaskAttribute("out", Required=true)]
- /// string _out = null; // assign default value here
- ///
- /// [TaskAttribute("optimize")]
- /// [BooleanValidator()]
- /// // during ExecuteTask you can safely use Convert.ToBoolean(_optimize)
- /// string _optimize = Boolean.FalseString;
- ///
- /// [TaskAttribute("warnlevel")]
- /// [Int32Validator(0,4)] // limit values to 0-4
- /// // during ExecuteTask you can safely use Convert.ToInt32(_optimize)
- /// string _warnlevel = "0";
- ///
- /// [TaskFileSet("sources")]
- /// FileSet _sources = new FileSet();
- /// </code>
- /// NOTE: Attribute values must be of type of string if you want
- /// to be able to have macros. The field stores the exact value during
- /// InitializeTask. Just before ExecuteTask is called NAnt will expand
- /// all the macros with the current values.
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]
- public class TaskAttributeAttribute : Attribute {
-
- string _name;
- bool _required;
- bool _expandText;
-
- public TaskAttributeAttribute(string name) {
- Name = name;
- Required = false;
- ExpandText = true;
- }
-
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
-
- public bool Required {
- get { return _required; }
- set { _required = value; }
- }
-
- public bool ExpandText {
- get { return _expandText; }
- set { _expandText = value; }
- }
- }
-}
diff --git a/mcs/nant/src/Attributes/TaskFileSetAttribute.cs b/mcs/nant/src/Attributes/TaskFileSetAttribute.cs
deleted file mode 100755
index 607f59fc4c5..00000000000
--- a/mcs/nant/src/Attributes/TaskFileSetAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that field should be treated as a xml file set for the task.</summary>
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]
- public class TaskFileSetAttribute : Attribute {
-
- string _name;
-
- public TaskFileSetAttribute(string name) {
- Name = name;
- }
-
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Attributes/TaskNameAttribute.cs b/mcs/nant/src/Attributes/TaskNameAttribute.cs
deleted file mode 100755
index bc7ffde1d2a..00000000000
--- a/mcs/nant/src/Attributes/TaskNameAttribute.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that class should be treated as a task.</summary>
- /// <remarks>
- /// Attach this attribute to a subclass of Task to have NAnt be able
- /// to reconize it. The name should be short but must not confict
- /// with any other task already in use.
- /// </remarks>
- [AttributeUsage(AttributeTargets.Class, Inherited=false, AllowMultiple=false)]
- public class TaskNameAttribute : Attribute {
-
- string _name;
-
- public TaskNameAttribute(string name) {
- _name = name;
- }
-
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Attributes/ValidatorAttribute.cs b/mcs/nant/src/Attributes/ValidatorAttribute.cs
deleted file mode 100755
index 053089cc497..00000000000
--- a/mcs/nant/src/Attributes/ValidatorAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- public abstract class ValidatorAttribute : Attribute {
- public abstract string Validate(object value);
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/BuildException.cs b/mcs/nant/src/BuildException.cs
deleted file mode 100755
index 7940496d330..00000000000
--- a/mcs/nant/src/BuildException.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
-
- /// <summary>
- /// Thrown whenever an error occurs during the build.
- /// </summary>
- public class BuildException : ApplicationException {
-
- private Location _location = Location.UnknownLocation;
-
- /// <summary>
- /// Constructs a build exception with no descriptive information.
- /// </summary>
- public BuildException() : base() {
- }
-
- /// <summary>
- /// Constructs an exception with a descriptive message.
- /// </summary>
- public BuildException(String message) : base(message) {
- }
-
- /// <summary>
- /// Constructs an exception with a descriptive message and an
- /// instance of the Exception that is the cause of the current Exception.
- /// </summary>
- public BuildException(String message, Exception e) : base(message, e) {
- }
-
- /// <summary>
- /// Constructs an exception with a descriptive message and location
- /// in the build file that caused the exception.
- /// </summary>
- /// <param name="location">Location in the build file where the exception occured.</param>
- public BuildException(String message, Location location) : base(message) {
- _location = location;
- }
-
- /// <summary>
- /// Constructs an exception with the given descriptive message, the
- /// location in the build file and an instance of the Exception that
- /// is the cause of the current Exception.
- /// </summary>
- /// <param name="message">The error message that explains the reason for the exception.</param>
- /// <param name="location">Location in the build file where the exception occured.</param>
- /// <param name="e">An instance of Exception that is the cause of the current Exception.</param>
- public BuildException(String message, Location location, Exception e) : base(message, e) {
- _location = location;
- }
-
- public override string Message {
- get {
- string message = base.Message;
-
- // only include location string if not empty
- string locationString = _location.ToString();
- if (locationString != String.Empty) {
- message = locationString + " " + message;
- }
- return message;
- }
- }
- }
-}
diff --git a/mcs/nant/src/DirectoryScanner.cs b/mcs/nant/src/DirectoryScanner.cs
deleted file mode 100755
index a2baa303d38..00000000000
--- a/mcs/nant/src/DirectoryScanner.cs
+++ /dev/null
@@ -1,226 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-/*
-Examples:
-"**\*.class" matches all .class files/dirs in a directory tree.
-
-"test\a??.java" matches all files/dirs which start with an 'a', then two
-more characters and then ".java", in a directory called test.
-
-"**" matches everything in a directory tree.
-
-"**\test\**\XYZ*" matches all files/dirs that start with "XYZ" and where
-there is a parent directory called test (e.g. "abc\test\def\ghi\XYZ123").
-
-Example of usage:
-
-DirectoryScanner scanner = DirectoryScanner();
-scanner.Includes.Add("**\\*.class");
-scanner.Exlucdes.Add("modules\\*\\**");
-scanner.BaseDirectory = "test";
-scanner.Scan();
-foreach (string filename in GetIncludedFiles()) {
- Console.WriteLine(filename);
-}
-*/
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.IO;
- using System.Text;
- using System.Text.RegularExpressions;
-
- public class DirectoryScanner {
-
- string _baseDirectory = Environment.CurrentDirectory;
-
- // holds the nant patterns
- StringCollection _includes = new StringCollection();
- StringCollection _excludes = new StringCollection();
-
- // holds the nant patterns converted to regular expression patterns
- StringCollection _includePatterns = null;
- StringCollection _excludePatterns = null;
-
- // holds the result from a scan
- StringCollection _fileNames = null;
- StringCollection _directoryNames = null;
-
- public StringCollection Includes {
- get { return _includes; }
- }
-
- public StringCollection Excludes {
- get { return _excludes; }
- }
-
- public string BaseDirectory {
- get { return _baseDirectory; }
- set { _baseDirectory = value; }
- }
-
- public StringCollection FileNames {
- get {
- if (_fileNames == null) {
- Scan();
- }
- return _fileNames;
- }
- }
-
- public StringCollection DirectoryNames {
- get {
- if (_directoryNames == null) {
- Scan();
- }
- return _directoryNames;
- }
- }
-
- public void Scan() {
- _includePatterns = new StringCollection();
- foreach (string pattern in Includes) {
- _includePatterns.Add(ToRegexPattern(pattern));
- }
-
- _excludePatterns = new StringCollection();
- foreach (string pattern in Excludes) {
- _excludePatterns.Add(ToRegexPattern(pattern));
- }
-
- _fileNames = new StringCollection();
- _directoryNames = new StringCollection();
-
- ScanDirectory(Path.GetFullPath(BaseDirectory));
- }
-
- void ScanDirectory(string path) {
- // get info for the current directory
- DirectoryInfo currentDirectoryInfo = new DirectoryInfo(path);
-
- // scan subfolders
- foreach (DirectoryInfo directoryInfo in currentDirectoryInfo.GetDirectories()) {
- ScanDirectory(directoryInfo.FullName);
- }
-
- // scan files
- foreach (FileInfo fileInfo in currentDirectoryInfo.GetFiles()) {
- string filename = Path.Combine(path, fileInfo.Name);
- if (IsPathIncluded(filename)) {
- _fileNames.Add(filename);
- }
- }
-
- // Check current path last so that delete task will correctly
- // delete empty directories. This may *seem* like a special case
- // but it is more like formalizing something in a way that makes
- // writing the delete task easier :)
- if (IsPathIncluded(path)) {
- _directoryNames.Add(path);
- }
- }
-
- bool IsPathIncluded(string path) {
- bool included = false;
-
- // check path against includes
- foreach (string pattern in _includePatterns) {
- Match m = Regex.Match(path, pattern);
- if (m.Success) {
- included = true;
- break;
- }
- }
-
- // check path against excludes
- if (included) {
- foreach (string pattern in _excludePatterns) {
- Match m = Regex.Match(path, pattern);
- if (m.Success) {
- included = false;
- break;
- }
- }
- }
-
- return included;
- }
-
- string ToRegexPattern(string nantPattern) {
-
- StringBuilder pattern = new StringBuilder(nantPattern);
-
- // NAnt patterns can use either / \ as a directory seperator.
- // We must replace both of these characters with Path.DirectorySeperatorChar
- pattern.Replace('/', Path.DirectorySeparatorChar);
- pattern.Replace('\\', Path.DirectorySeparatorChar);
-
- // Patterns MUST be full paths.
- if (!Path.IsPathRooted(pattern.ToString())) {
- pattern = new StringBuilder(Path.Combine(BaseDirectory, pattern.ToString()));
- }
-
- // The '\' character is a special character in regular expressions
- // and must be escaped before doing anything else.
- pattern.Replace(@"\", @"\\");
-
- // Escape the rest of the regular expression special characters.
- // NOTE: Characters other than . $ ^ { [ ( | ) * + ? \ match themselves.
- // TODO: Decide if ] and } are missing from this list, the above
- // list of characters was taking from the .NET SDK docs.
- pattern.Replace(".", @"\.");
- pattern.Replace("$", @"\$");
- pattern.Replace("^", @"\^");
- pattern.Replace("{", @"\{");
- pattern.Replace("[", @"\[");
- pattern.Replace("(", @"\(");
- pattern.Replace(")", @"\)");
- pattern.Replace("+", @"\+");
-
- // Special case directory seperator string under Windows.
- string seperator = Path.DirectorySeparatorChar.ToString();
- if (seperator == @"\") {
- seperator = @"\\";
- }
-
- // Convert NAnt pattern characters to regular expression patterns.
-
- // SPECIAL CASE: to match subdirectory OR current directory. If
- // we don't do this then we can write something like 'src/**/*.cs'
- // to match all the files ending in .cs in the src directory OR
- // subdirectories of src.
- pattern.Replace(seperator + "**", "(" + seperator + ".|)|");
-
- // | is a place holder for * to prevent it from being replaced in next line
- pattern.Replace("**", ".|");
- pattern.Replace("*", "[^" + seperator + "]*");
- pattern.Replace("?", "[^" + seperator + "]?");
- pattern.Replace('|', '*'); // replace place holder string
-
- // Help speed up the search
- pattern.Insert(0, '^'); // start of line
- pattern.Append('$'); // end of line
-
- return pattern.ToString();
- }
- }
-}
diff --git a/mcs/nant/src/FileSet.cs b/mcs/nant/src/FileSet.cs
deleted file mode 100755
index 4e934fc82d2..00000000000
--- a/mcs/nant/src/FileSet.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.IO;
-
- public class FileSet {
-
- /// <summary>
- /// Used to determine if a file has a more recent last write time then the specified write time.
- /// </summary>
- /// <param name="fileNames">A collection of filenames to check last write times against.</param>
- /// <param name="targetLastWriteTime">The datetime to compare against.</param>
- /// <returns><c>True</c> if at least one file in <c>fileNames</c> has a last write time greater than <c>targetLastWriteTime</c>.</returns>
- public static bool MoreRecentLastWriteTime(StringCollection fileNames, DateTime targetLastWriteTime) {
- foreach (string fileName in fileNames) {
- FileInfo fileInfo = new FileInfo(fileName);
- if (!fileInfo.Exists) {
- return true;
- }
- if (fileInfo.LastWriteTime > targetLastWriteTime) {
- return true;
- }
- }
- return false;
- }
-
- // We can't just use the DirectoryScanner's includes/excludes collections
- // because when we do a Scan() we need to first expand any macros.
-
- StringCollection _includes = new StringCollection();
- StringCollection _excludes = new StringCollection();
- DirectoryScanner _scanner = null;
- string _baseDirectory;
- bool _includeAllByDefault;
- Task _task = null;
-
- public FileSet(bool includeAllByDefault) {
- IncludeAllByDefault = includeAllByDefault;
- Excludes.Add("**/CVS/*");
- Excludes.Add("**/.cvsignore");
- }
-
- /// <remarks>
- /// Will be automagically set in Task.AutoInitializeAttributes() if
- /// file set has TaskFileSetAttribute set on it.
- /// </remarks>
- // TODO: change this to IMacroExpander
- public Task Task {
- get { return _task; }
- set { _task = value; }
- }
-
- public string BaseDirectory {
- get { return _baseDirectory; }
- set { _baseDirectory = value; }
- }
-
- /// <summary>Determines if scan should produce everything or nothing
- /// if there are no Includes set. Default false.</summary>
- public bool IncludeAllByDefault {
- get { return _includeAllByDefault; }
- set { _includeAllByDefault = value; }
- }
-
- public StringCollection Includes {
- get { return _includes; }
- }
-
- public StringCollection Excludes {
- get { return _excludes; }
- }
-
- public void Scan() {
- // get project (only for expanding macros)
- Project expander = Task.Project;
-
- _scanner = new DirectoryScanner();
- _scanner.BaseDirectory = expander.GetFullPath(BaseDirectory);;
-
- foreach (string path in Includes) {
- _scanner.Includes.Add(expander.ExpandText(path));
- }
- if (Includes.Count <= 0 && IncludeAllByDefault) {
- _scanner.Includes.Add("**");
- }
-
- foreach (string path in Excludes) {
- _scanner.Excludes.Add(expander.ExpandText(path));
- }
-
- _scanner.Scan();
- }
-
- public StringCollection DirectoryNames {
- get {
- if (_scanner == null) {
- Scan();
- }
- return _scanner.DirectoryNames;
- }
- }
-
- public StringCollection FileNames {
- get {
- if (_scanner == null) {
- Scan();
- }
- return _scanner.FileNames;
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Location.cs b/mcs/nant/src/Location.cs
deleted file mode 100755
index 3a51279d371..00000000000
--- a/mcs/nant/src/Location.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Ian MacLean (ian_maclean@another.com)
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
- using System;
- using System.IO;
-
- /// <summary>
- /// Stores the file name and line number in a file.
- /// </summary>
- public class Location {
- string _fileName;
- int _lineNumber;
- int _columnNumber;
-
- public static readonly Location UnknownLocation = new Location();
-
- /// <summary>
- /// Creates a location consisting of a file name and line number.
- ///</summary>
- public Location(string fileName, int lineNumber, int columnNumber) {
- Uri uri = new Uri(fileName);
- string strfileName = uri.LocalPath; // convert from URI syntax to local path
- Init(strfileName, lineNumber, columnNumber);
- }
-
- /// <summary>
- /// Creates a location consisting of a file name but no line number.
- ///</summary>
- public Location(string fileName) {
- Init(fileName, 0, 0);
- }
-
- /// <summary>
- /// Creates an "unknown" location.
- ///</summary>
- private Location() {
- Init(null, 0, 0);
- }
-
- /// <summary>
- /// Private Init function.
- ///</summary>
- private void Init(string fileName, int lineNumber, int columnNumber) {
- _fileName = fileName;
- _lineNumber = lineNumber;
- _columnNumber = columnNumber;
- }
-
- /// <summary>
- /// Returns the file name, line number and a trailing space. An error
- /// message can be appended easily. For unknown locations, returns
- /// an empty string.
- ///</summary>
- public override string ToString() {
- string message = "";
-
- if (_fileName != null) {
- message += _fileName;
-
- if (_lineNumber != 0) {
- message += ":";
- message += _lineNumber.ToString();
- }
-
- message += ":";
- }
-
- return message;
- }
- }
-}
diff --git a/mcs/nant/src/NAnt.cs b/mcs/nant/src/NAnt.cs
deleted file mode 100755
index 7a192036f98..00000000000
--- a/mcs/nant/src/NAnt.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Diagnostics;
- using System.IO;
- using System.Text.RegularExpressions;
-
- public class NAnt {
- public static int Main(string[] args) {
- int returnCode = 0;
-
- Log.IndentSize = 12;
-
- Project project = new Project();
-
- const string buildfileOption = "-buildfile:";
- const string basedirOption = "-basedir:";
- const string setOption = "-set:";
- const string helpOption = "-h"; // allow -h and -help
- const string verboseOption = "-verbose";
-
- bool showHelp = false;
-
- foreach (string arg in args) {
- if (arg.StartsWith(buildfileOption)) {
- project.BuildFileName = arg.Substring(buildfileOption.Length);
- } else if (arg.StartsWith(basedirOption)) {
- project.BaseDirectory = arg.Substring(basedirOption.Length);
- } else if (arg.StartsWith(basedirOption)) {
- project.BaseDirectory = arg.Substring(basedirOption.Length);
- } else if (arg.StartsWith(setOption)) {
- // TODO: implement user defined properties
- // user defined properties from command line or file should be
- // marked so that they cannot be overwritten by the build file
- // ie, once set they are set for the rest of the build.
- Match match = Regex.Match(arg, @"-set:(\w+)=(\w*)");
- if (match.Success) {
- string name = match.Groups[1].Value;
- string value = match.Groups[2].Value;
- project.Properties.AddReadOnly(name, value);
- }
- } else if (arg.StartsWith(helpOption)) {
- showHelp = true;
- } else if (arg.StartsWith(verboseOption)) {
- project.Verbose = true;
- } else if (arg.Length > 0) {
- // must be a target (or mistake ;)
- project.BuildTargets.Add(arg);
- }
- }
-
- // Get version information directly from assembly. This takes more
- // work but prevents the version numbers from getting out of sync.
- ProcessModule module = Process.GetCurrentProcess().MainModule;
- FileVersionInfo info = FileVersionInfo.GetVersionInfo(module.FileName);
- string programName = Path.GetFileNameWithoutExtension(info.FileName); // in case the user has renamed the program
-
- if (showHelp) {
- const int optionPadding = 23;
-
- Console.WriteLine("NAnt Version {0} Copyright (C) 2001 Gerry Shaw", info.FileMajorPart + "." + info.FileMinorPart + "." + info.FileBuildPart);
- Console.WriteLine("http://nant.sourceforge.net/");
- Console.WriteLine();
- Console.WriteLine("NAnt comes with ABSOLUTELY NO WARRANTY.");
- Console.WriteLine("This is free software, and you are welcome to redistribute it under certain");
- Console.WriteLine("conditions set out by the GNU General Public License. A copy of the license");
- Console.WriteLine("is available in the distribution package and from the NAnt web site.");
- Console.WriteLine();
- Console.WriteLine("usage: {0} [options] [target]", programName);
- Console.WriteLine();
- Console.WriteLine("options:");
- Console.WriteLine(" {0} use given buildfile", (buildfileOption + "<file>").PadRight(optionPadding));
- Console.WriteLine(" {0} set project base directory", (basedirOption + "<dir>").PadRight(optionPadding));
- Console.WriteLine(" {0} use value for given property", (setOption + "<property>=<value>").PadRight(optionPadding));
- Console.WriteLine(" {0} print this message", helpOption.PadRight(optionPadding));
- Console.WriteLine();
- Console.WriteLine("If no buildfile is specified the first file ending in .build will be used.");
- } else {
- if (!project.Run()) {
- Console.WriteLine("Try `{0} -help' for more information.", programName);
- returnCode = 1; // set return code to indicate an error occurred
- }
- }
- Log.Close();
- return returnCode;
- }
- }
-}
diff --git a/mcs/nant/src/NAnt.exe b/mcs/nant/src/NAnt.exe
deleted file mode 100755
index a7a82b71366..00000000000
--- a/mcs/nant/src/NAnt.exe
+++ /dev/null
Binary files differ
diff --git a/mcs/nant/src/Project.cs b/mcs/nant/src/Project.cs
deleted file mode 100755
index 9746dadcfdc..00000000000
--- a/mcs/nant/src/Project.cs
+++ /dev/null
@@ -1,332 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
- using System.Reflection;
- using System.Text.RegularExpressions;
- using System.Xml;
- using System.Xml.XPath;
- using System.Collections;
- using System.Collections.Specialized;
-
- /// <summary>
- /// Central representation of an NAnt project.
- /// </summary>
- public class Project {
-
- public static readonly string BuildFilePattern = "*.build";
-
- /// <summary>
- /// Finds the file name for the build file in the specified directory.
- /// </summary>
- /// <param name="directory">The directory to look for a build file. When in doubt use Environment.CurrentDirectory for directory.</param>
- /// <returns>The path to the build file or <c>null</c> if no build file could be found.</returns>
- public static string FindBuildFileName(string directory) {
- string buildFileName = null;
-
- // find first file ending in .build
- DirectoryInfo directoryInfo = new DirectoryInfo(directory);
- FileInfo[] files = directoryInfo.GetFiles(BuildFilePattern);
- if (files.Length > 0) {
- buildFileName = Path.Combine(directory, files[0].Name);
- }
- return buildFileName;
- }
-
- string _name;
- string _defaultTargetName;
- string _baseDirectory;
- string _buildFileName;
- bool _verbose = false;
-
- StringCollection _buildTargets = new StringCollection();
- TaskCollection _tasks = new TaskCollection();
- TargetCollection _targets = new TargetCollection();
- XPathTextPositionMap _positionMap; // created when Xml document is loaded
- TaskFactory _taskFactory; // created in constructor
- PropertyDictionary _properties = new PropertyDictionary();
-
- public Project() {
- _taskFactory = new TaskFactory(this);
- }
-
- /// <summary>
- /// The name of the project.
- /// </summary>
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
-
- public string BaseDirectory {
- get { return _baseDirectory; }
- set { _baseDirectory = value; }
- }
-
- public string BuildFileName {
- get { return _buildFileName; }
- set { _buildFileName = value; }
- }
-
- /// <summary>
- /// When true tasks should output more output.
- /// </summary>
- public bool Verbose {
- get { return _verbose; }
- set { _verbose = value; }
- }
-
- /// <summary>
- /// The list of targets to built.
- /// </summary>
- /// <remarks>
- /// Targets are built in the order they appear in the collection. If
- /// the collection is empty the default target will be built.
- /// </remarks>
- public StringCollection BuildTargets {
- get { return _buildTargets; }
- }
-
- /// <summary>
- /// The list of tasks to perform before any targets executed.
- /// </summary>
- /// <remarks>
- /// Tasks are executed in the order they appear in the collection.
- /// </remarks>
- public TaskCollection Tasks {
- get { return _tasks; }
- }
-
- public PropertyDictionary Properties {
- get { return _properties; }
- }
-
- public TargetCollection Targets {
- get { return _targets; }
- }
-
- public bool Run() {
- bool buildResult = false;
- try {
- DateTime startTime = DateTime.Now;
-
- if (BaseDirectory == null) {
- BaseDirectory = Environment.CurrentDirectory;
- }
- BaseDirectory = Path.GetFullPath(BaseDirectory);
-
- if (BuildFileName == null || BuildFileName == String.Empty) {
- BuildFileName = FindBuildFileName(BaseDirectory);
- if (BuildFileName == null) {
- throw new BuildException(String.Format("Could not find a '{0}' file in '{1}'", BuildFilePattern, BaseDirectory));
- }
- }
-
- Log.WriteLine("Buildfile: {0}", BuildFileName);
- if (Verbose) {
- Log.WriteLine("Base Directory: {0}", BaseDirectory);
- }
-
- XmlDocument doc = new XmlDocument();
- try {
- doc.Load(BuildFileName);
- // TODO: validate against xsd schema
- } catch (XmlException e) {
- throw new BuildException(String.Format("Could not load '{0}'", BuildFileName), e);
- }
-
- Initialize(doc);
- Properties.Add("nant.buildfile", BuildFileName);
-
- Execute();
-
- Log.WriteLine();
- Log.WriteLine("BUILD SUCCEEDED");
-
- TimeSpan buildTime = DateTime.Now - startTime;
- Log.WriteLine();
- Log.WriteLine("Total time: {0} seconds", (int) buildTime.TotalSeconds);
-
- buildResult = true;
- } catch (BuildException e) {
- Log.WriteLine();
- Log.WriteLine("BUILD FAILED");
- Log.WriteLine(e.Message);
- if (e.InnerException != null) {
- Log.WriteLine(e.InnerException.Message);
- }
- } catch (Exception e) {
- // all other exceptions should have been caught
- Log.WriteLine();
- Log.WriteLine("INTERNAL ERROR");
- Log.WriteLine(e.ToString());
- }
- return buildResult;
- }
-
- public int AddTasks(string assemblyPath) {
-
- Assembly assembly;
- if (assemblyPath == null) {
- assembly = Assembly.GetExecutingAssembly();
- } else {
- assembly = Assembly.LoadFrom(assemblyPath);
- }
-
- int taskCount = 0;
- foreach(Type type in assembly.GetTypes()) {
- if (type.IsSubclassOf(typeof(Task)) && !type.IsAbstract) {
- if (_taskFactory.Builders.Add(new TaskBuilder(type.FullName, assemblyPath))) {
- taskCount++;
- }
- }
- }
- return taskCount;
- }
-
- public void Initialize(XmlDocument doc) {
-
- Name = doc.SelectSingleNode("project/@name").Value;
-
- // make it possible for user to override this value
- if (BaseDirectory == null) {
- BaseDirectory = doc.SelectSingleNode("project/@basedir").Value;
- }
-
- // used only if BuildTargets collection is empty
- _defaultTargetName = doc.SelectSingleNode("project/@default").Value;
-
- // initialize builtin tasks
- AddTasks(null);
-
- // init static built in properties
- Properties.Add("nant.project.name", Name);
- Properties.Add("nant.base.dir", BaseDirectory);
- Properties.Add("nant.default.name", _defaultTargetName);
-
- // add all environment variables
- IDictionary variables = Environment.GetEnvironmentVariables();
- foreach (string name in variables.Keys) {
- string value = (string) variables[name];
- Properties.Add("nant.env." + name, value);
- }
-
- // Load line Xpath to linenumber array
- _positionMap = new XPathTextPositionMap(doc.BaseURI);
-
- // process all the non-target nodes (these are global tasks for the project)
- XmlNodeList taskList = doc.SelectNodes("project/*[name() != 'target']");
- foreach (XmlNode taskNode in taskList) {
-
- // TODO: do somethiing like Project.CreateTask(taskNode) and have the project set the location
- TextPosition textPosition = _positionMap.GetTextPosition(taskNode);
-
- Task task = CreateTask(taskNode);
- if (task != null) {
- Tasks.Add(task);
- }
- }
-
- // execute global tasks now - before anything else
- // this lets us include tasks that do things like add more tasks
- foreach (Task task in Tasks) {
- task.Execute();
- }
-
- // process all the targets
- XmlNodeList targetList = doc.SelectNodes("project/target");
- foreach (XmlNode targetNode in targetList) {
- Target target = new Target(this);
- target.Initialize(targetNode);
- Targets.Add(target);
- }
- }
-
- public void Execute() {
- if (BuildTargets.Count == 0) {
- BuildTargets.Add(_defaultTargetName);
- }
-
- foreach(string targetName in BuildTargets) {
- Execute(targetName);
- }
- }
-
- public void Execute(string targetName) {
- Target target = Targets.Find(targetName);
- if (target == null) {
- throw new BuildException(String.Format("unknown target '{0}'", targetName));
- }
- target.Execute();
- }
-
- public Task CreateTask(XmlNode taskNode) {
- return CreateTask(taskNode, null);
- }
-
- public Task CreateTask(XmlNode taskNode, Target target) {
- Task task = _taskFactory.CreateTask(taskNode, target);
- if (task != null) {
- // save task location in case of error
- TextPosition pos = _positionMap.GetTextPosition(taskNode);
-
- // initialize the task
- task.Initialize(taskNode, new Location(taskNode.BaseURI, pos.Line, pos.Column));
- }
- return task;
- }
-
- public string ExpandText(string input) {
- string output = input;
- if (input != null) {
- const string pattern = @"\$\{([^\}]*)\}";
- foreach (Match m in Regex.Matches(input, pattern)) {
- if (m.Length > 0) {
-
- string token = m.ToString();
- string propertyName = m.Groups[1].Captures[0].Value;
- string propertyValue = Properties[propertyName];
-
- if (propertyValue != null) {
- output = output.Replace(token, propertyValue);
- }
- }
- }
- }
- return output;
- }
-
- public string GetFullPath(string path) {
- string baseDir = ExpandText(BaseDirectory);
-
- if (path != null) {
- if (!Path.IsPathRooted(path)) {
- path = Path.Combine(baseDir, path);
- }
- } else {
- path = baseDir;
- }
- return Path.GetFullPath(path);
- }
- }
-}
diff --git a/mcs/nant/src/PropertyDictionary.cs b/mcs/nant/src/PropertyDictionary.cs
deleted file mode 100755
index 072ba46c0d2..00000000000
--- a/mcs/nant/src/PropertyDictionary.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System.Collections;
- using System.Collections.Specialized;
-
- public class PropertyDictionary : DictionaryBase {
-
- /// <summary>
- /// Maintains a list of the property names that are readonly.
- /// </summary>
- StringCollection _readOnlyProperties = new StringCollection();
-
- /// <summary>
- /// Adds a property that cannot be changed.
- /// </summary>
- /// <remarks>
- /// Properties added with this method can never be changed. Note that
- /// they are removed if the <c>Clear</c> method is called.
- /// </remarks>
- /// <param name="name">Name of property</param>
- /// <param name="value">Value of property</param>
- public void AddReadOnly(string name, string value) {
- if (!_readOnlyProperties.Contains(name)) {
- _readOnlyProperties.Add(name);
- Dictionary.Add(name, value);
- }
- }
-
- /// <summary>
- /// Adds a property to the collection.
- /// </summary>
- /// <param name="name">Name of property</param>
- /// <param name="value">Value of property</param>
- public void Add(string name, string value) {
- if (!_readOnlyProperties.Contains(name)) {
- Dictionary.Add(name, value);
- }
- }
-
- public string this[string name] {
- get { return (string) Dictionary[(object) name]; }
- set {
- if (!_readOnlyProperties.Contains(name)) {
- Dictionary[name] = value;
- }
- }
- }
-
- protected override void OnClear() {
- _readOnlyProperties.Clear();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Target.cs b/mcs/nant/src/Target.cs
deleted file mode 100755
index 3e0de022c23..00000000000
--- a/mcs/nant/src/Target.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Xml;
-
- public class Target {
-
- string _name;
- Project _project;
- bool _hasExecuted = false;
- TaskCollection _tasks = new TaskCollection();
- StringCollection _dependencies = new StringCollection();
-
- public Target(Project project) {
- Project = project;
- }
-
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
-
- public Project Project {
- get { return _project; }
- set { _project = value; }
- }
-
- public bool HasExecuted {
- get { return _hasExecuted; }
- }
-
- public TaskCollection Tasks {
- get { return _tasks; }
- }
-
- public StringCollection Dependencies {
- get { return _dependencies; }
- }
-
- public void Initialize(XmlNode targetNode) {
- // get target name
- XmlNode nameNode = targetNode.SelectSingleNode("@name");
- if (nameNode == null) {
- // TODO: add Location to exception
- throw new BuildException("target must have a name attribute");
- }
- Name = nameNode.Value;
-
- // add dependicies
- XmlNode dependsNode = targetNode.SelectSingleNode("@depends");
- if (dependsNode != null) {
- string depends = dependsNode.Value;
- foreach (string str in depends.Split(new char[]{','})) {
- string dependency = str.Trim();
- if (dependency.Length > 0) {
- Dependencies.Add(dependency);
- }
- }
- }
-
- // select all the non-target nodes (these are global tasks for the project)
- XmlNodeList taskList = targetNode.SelectNodes("*");
- foreach (XmlNode taskNode in taskList) {
- Task task = Project.CreateTask(taskNode, this);
- if (task != null) {
- Tasks.Add(task);
- }
- }
- }
-
- public void Execute() {
- if (!HasExecuted) {
- try {
- foreach (string targetName in Dependencies) {
- Target target = Project.Targets.Find(targetName);
- if (target == null) {
- // TODO: add Location to exception
- throw new BuildException(String.Format("unknown dependent target '{0}' of target '{1}'", targetName, Name));
- }
- target.Execute();
- }
-
- Log.WriteLine();
- Log.WriteLine("{0}:", Name);
- foreach (Task task in Tasks) {
- task.Execute();
- }
- } finally {
- _hasExecuted = true;
- }
- }
- }
- }
-}
diff --git a/mcs/nant/src/TargetCollection.cs b/mcs/nant/src/TargetCollection.cs
deleted file mode 100755
index c4f486b1302..00000000000
--- a/mcs/nant/src/TargetCollection.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections;
-
- public class TargetCollection : ArrayList {
-
- public Target Find(string targetName) {
- foreach(Target target in this) {
- if (target.Name == targetName)
- return target;
- }
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Task.cs b/mcs/nant/src/Task.cs
deleted file mode 100755
index 2a4eafaebd1..00000000000
--- a/mcs/nant/src/Task.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
- using System.Xml;
-
- public abstract class Task {
-
- /// <summary>Gets and sets how much spacing log prefix names will be padded.</summary>
- /// <remarks>
- /// Includes characters for a space after the name and the [ ] brackets. Default is 12.
- /// </remarks>
- public static int LogPrefixPadding = Log.IndentSize;
-
- Location _location = Location.UnknownLocation;
- Target _target = null;
- Project _project = null;
-
- /// <summary>
- /// Location in build file where task is defined.
- /// </summary>
- protected Location Location {
- get { return _location; }
- set { _location = value; }
- }
-
- public string Name {
- get {
- string name = null;
- TaskNameAttribute taskName = (TaskNameAttribute) Attribute.GetCustomAttribute(GetType(), typeof(TaskNameAttribute));
- if (taskName != null) {
- name = taskName.Name;
- }
- return name;
- }
- }
-
- public string LogPrefix {
- get {
- string prefix = "[" + Name + "] ";
- return prefix.PadLeft(LogPrefixPadding);
- }
- }
-
- public Target Target {
- get { return _target; }
- set { _target = value; }
- }
-
- public Project Project {
- get { return _project; }
- set { _project = value; }
- }
-
- protected void AutoInitializeAttributes(XmlNode taskNode) {
-
- // TODO: BooleanValidatorAttribute and Int32ValidatorAttribute implementation in Task
-
- // Go down the inheritance tree to find the private fields in the object.
- // We are looking for task attributes to initialize.
- Type currentType = GetType();
- while (currentType != typeof(object)) {
- FieldInfo[] fieldInfoArray = currentType.GetFields(BindingFlags.NonPublic|BindingFlags.Instance);
- foreach (FieldInfo fieldInfo in fieldInfoArray) {
-
- // process TaskAttribute attributes
- TaskAttributeAttribute taskAttribute = (TaskAttributeAttribute) Attribute.GetCustomAttribute(fieldInfo, typeof(TaskAttributeAttribute));
- if (taskAttribute != null) {
-
- // get value from xml file
- XmlNode node = taskNode.SelectSingleNode("@" + taskAttribute.Name);
-
- // check if its required
- if (node == null && taskAttribute.Required) {
- // TODO: add Location to exception
- throw new BuildException(String.Format("{0} is a required attribute.", taskAttribute.Name), Location);
- }
-
- if (node != null) {
- fieldInfo.SetValue(this, Convert.ChangeType(node.Value, fieldInfo.FieldType));
- }
- }
-
- // process TaskFileSet attributes
- TaskFileSetAttribute fileSetAttribute = (TaskFileSetAttribute) Attribute.GetCustomAttribute(fieldInfo, typeof(TaskFileSetAttribute));
- if (fileSetAttribute != null) {
- // have file set initialize itself
- FileSet fileSet = (FileSet) fieldInfo.GetValue(this);
-
- // set task fileset belongs to
- fileSet.Task = this;
-
- // load values from build file
- XmlNode fileSetNode = taskNode.SelectSingleNode(fileSetAttribute.Name);
- if (fileSetNode != null) {
-
- XmlNode baseDirectoryNode = fileSetNode.SelectSingleNode("@basedir");
- if (baseDirectoryNode != null) {
- fileSet.BaseDirectory = baseDirectoryNode.Value;
- }
-
- foreach (XmlNode node in fileSetNode.SelectNodes("includes")) {
- string pathname = node.SelectSingleNode("@name").Value;
- fileSet.Includes.Add(pathname);
- }
-
- foreach (XmlNode node in fileSetNode.SelectNodes("excludes")) {
- fileSet.Excludes.Add(node.SelectSingleNode("@name").Value);
- }
- }
- }
- }
- currentType = currentType.BaseType;
- }
- }
-
- protected void AutoExpandAttributes() {
-
- // Go down the inheritance tree to find the private fields in the object.
- // We are looking for task attributes to initialize.
- Type currentType = GetType();
- while (currentType != typeof(object)) {
- FieldInfo[] fieldInfoArray = currentType.GetFields(BindingFlags.NonPublic|BindingFlags.Instance);
- foreach (FieldInfo fieldInfo in fieldInfoArray) {
-
- // proces string parameters
- TaskAttributeAttribute taskAttribute = (TaskAttributeAttribute) Attribute.GetCustomAttribute(fieldInfo, typeof(TaskAttributeAttribute));
- if (taskAttribute != null) {
- if (taskAttribute.ExpandText) {
- string value = (string) fieldInfo.GetValue(this);
- value = Project.ExpandText(value);
- fieldInfo.SetValue(this, value);
- }
-
- // if a field also has a validator attribute then ensure that value is correct
- ValidatorAttribute[] validators = (ValidatorAttribute[]) Attribute.GetCustomAttributes(fieldInfo, typeof(ValidatorAttribute));
- foreach (ValidatorAttribute validator in validators) {
- string errorMessage = validator.Validate(fieldInfo.GetValue(this));
- if (errorMessage != null) {
- throw new BuildException(String.Format("Error processing '{0}' attribute in <{1}> task: {2}", taskAttribute.Name, Name, errorMessage), Location);
- }
- }
- }
- }
- currentType = currentType.BaseType;
- }
- }
-
- public void Initialize(XmlNode taskNode) {
- Initialize(taskNode, null);
- }
-
- public void Initialize(XmlNode taskNode, Location location) {
- if (location != null) {
- _location = location;
- }
- AutoInitializeAttributes(taskNode);
- InitializeTask(taskNode);
- }
-
- public void Execute() {
- AutoExpandAttributes();
- ExecuteTask();
- }
-
- protected virtual void InitializeTask(XmlNode taskNode) {
- }
-
- protected abstract void ExecuteTask();
- }
-}
diff --git a/mcs/nant/src/TaskBuilder.cs b/mcs/nant/src/TaskBuilder.cs
deleted file mode 100755
index 97b602b4828..00000000000
--- a/mcs/nant/src/TaskBuilder.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- public class TaskBuilder {
-
- string _className;
- string _assemblyFileName;
- string _taskName;
-
- public TaskBuilder(string className)
- : this(className, null) {
- }
-
- public TaskBuilder(string className, string assemblyFileName) {
- _className = className;
- _assemblyFileName = assemblyFileName;
-
- // get task name from attribute
- Assembly assembly = GetAssembly();
- TaskNameAttribute taskNameAttribute = (TaskNameAttribute) Attribute.GetCustomAttribute(assembly.GetType(ClassName), typeof(TaskNameAttribute));
- _taskName = taskNameAttribute.Name;
- }
-
- public string ClassName {
- get { return _className; }
- }
-
- public string AssemblyFileName {
- get { return _assemblyFileName; }
- }
-
- public string TaskName {
- get { return _taskName; }
- }
-
- private Assembly GetAssembly() {
- Assembly assembly;
- if (AssemblyFileName == null) {
- assembly = Assembly.GetExecutingAssembly();
- } else {
- assembly = Assembly.LoadFrom(AssemblyFileName);
- }
- return assembly;
- }
-
- public Task CreateTask(Project project, Target target) {
- Task task;
- try {
- Assembly assembly = GetAssembly();
-
- // create instance (ignore case)
- task = (Task) assembly.CreateInstance(ClassName, true);
-
- // set default values
- task.Project = project;
- task.Target = target;
- } catch (Exception) {
- task = null;
- }
- return task;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/TaskBuilderCollection.cs b/mcs/nant/src/TaskBuilderCollection.cs
deleted file mode 100755
index bb61c3171a3..00000000000
--- a/mcs/nant/src/TaskBuilderCollection.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections;
-
- public class TaskBuilderCollection : ArrayList {
-
- public bool Add(TaskBuilder builder) {
- // prevent adding duplicate builders with the name task name
- bool taskAdded = false;
- if (GetBuilderForTask(builder.TaskName) == null) {
- base.Add(builder);
- taskAdded = true;
- }
- return taskAdded;
- }
-
- public TaskBuilder GetBuilderForTask(string taskName) {
- foreach (TaskBuilder builder in this) {
- if (builder.TaskName == taskName) {
- return builder;
- }
- }
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/TaskCollection.cs b/mcs/nant/src/TaskCollection.cs
deleted file mode 100755
index 94d7afc4202..00000000000
--- a/mcs/nant/src/TaskCollection.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System.Collections;
-
- public class TaskCollection : ArrayList {
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/TaskFactory.cs b/mcs/nant/src/TaskFactory.cs
deleted file mode 100755
index f1e4f7f718a..00000000000
--- a/mcs/nant/src/TaskFactory.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Xml;
-
- internal class TaskFactory {
-
- TaskBuilderCollection _builders = new TaskBuilderCollection();
- Project _project;
-
- public TaskFactory(Project project) {
- Project = project;
- }
-
- public TaskBuilderCollection Builders {
- get { return _builders; }
- }
-
- public Project Project {
- get { return _project; }
- set { _project = value; }
- }
-
- public Task CreateTask(XmlNode taskNode, Target target) {
- string taskName = taskNode.Name;
- Task task = null;
-
- TaskBuilder builder = Builders.GetBuilderForTask(taskName);
- if (builder != null) {
- task = builder.CreateTask(Project, target);
- } else {
- throw new BuildException(String.Format("unknown task <{0}> in target <{1}>", taskName, target.Name));
- }
-
- return task;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/CallTask.cs b/mcs/nant/src/Tasks/CallTask.cs
deleted file mode 100755
index 08e24711746..00000000000
--- a/mcs/nant/src/Tasks/CallTask.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.IO;
- using System.Xml;
-
- [TaskName("call")]
- public class CallTask : Task {
-
- [TaskAttribute("target", Required=true)]
- string _target = null;
-
- // Attribute properties
- public string TargetName { get { return _target; } }
-
- protected override void ExecuteTask() {
- Project.Execute(TargetName);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/CompilerBase.cs b/mcs/nant/src/Tasks/CompilerBase.cs
deleted file mode 100755
index 3c5990a09f2..00000000000
--- a/mcs/nant/src/Tasks/CompilerBase.cs
+++ /dev/null
@@ -1,186 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.IO;
-
- public abstract class CompilerBase : ExternalProgramBase {
-
- string _responseFileName;
-
- // Microsoft common compiler options
- [TaskAttribute("output", Required=true)]
- string _output = null;
-
- [TaskAttribute("target", Required=true)]
- string _target = null;
-
- [TaskAttribute("debug")]
- [BooleanValidator()]
- string _debug = Boolean.FalseString;
-
- [TaskAttribute("define")]
- string _define = null;
-
- [TaskAttribute("win32icon")]
- string _win32icon = null;
-
- [TaskFileSet("references")]
- FileSet _references = new FileSet(false);
-
- [TaskFileSet("resources")]
- FileSet _resources = new FileSet(false);
-
- [TaskFileSet("modules")]
- FileSet _modules = new FileSet(false);
-
- [TaskFileSet("sources")]
- FileSet _sources = new FileSet(true); // include all by default
-
- public string Output { get { return _output; } }
- public string OutputTarget { get { return _target; } }
- public bool Debug { get { return Convert.ToBoolean(_debug); } }
- public string Define { get { return _define; } }
- public string Win32Icon { get { return _win32icon; } }
- public FileSet References { get { return _references; } }
- public FileSet Resources { get { return _resources; } }
- public FileSet Modules { get { return _modules; } }
- public FileSet Sources { get { return _sources; } }
-
- public override string ProgramFileName { get { return Name; } }
- public override string ProgramArguments { get { return "@" + _responseFileName; } }
-
- protected virtual void WriteOptions(TextWriter writer) {
- }
-
- protected string GetOutputPath() {
- return Path.GetFullPath(Path.Combine(BaseDirectory, Project.ExpandText(Output)));
- }
-
- protected virtual bool NeedsCompiling() {
- // return true as soon as we know we need to compile
-
- FileInfo outputFileInfo = new FileInfo(GetOutputPath());
- if (!outputFileInfo.Exists) {
- return true;
- }
-
- if (FileSet.MoreRecentLastWriteTime(Sources.FileNames, outputFileInfo.LastWriteTime)) {
- return true;
- }
- if (FileSet.MoreRecentLastWriteTime(References.FileNames, outputFileInfo.LastWriteTime)) {
- return true;
- }
- if (FileSet.MoreRecentLastWriteTime(Modules.FileNames, outputFileInfo.LastWriteTime)) {
- return true;
- }
-
- // if we made it here then we don't have to recompile
- return false;
- }
-
- protected override void ExecuteTask() {
- if (NeedsCompiling()) {
- // create temp response file to hold compiler options
- _responseFileName = Path.GetTempFileName();
- StreamWriter writer = new StreamWriter(_responseFileName);
-
- try {
- if (References.BaseDirectory == null) {
- References.BaseDirectory = BaseDirectory;
- }
- if (Modules.BaseDirectory == null) {
- Modules.BaseDirectory = BaseDirectory;
- }
- if (Sources.BaseDirectory == null) {
- Sources.BaseDirectory = BaseDirectory;
- }
-
- Log.WriteLine(LogPrefix + "Compiling {0} files to {1}", Sources.FileNames.Count, GetOutputPath());
-
- // specific compiler options
- WriteOptions(writer);
-
- // Microsoft common compiler options
- writer.WriteLine("/nologo");
- writer.WriteLine("/target:{0}", OutputTarget);
- writer.WriteLine("/out:{0}", GetOutputPath());
- if (Debug) {
- writer.WriteLine("/debug");
- writer.WriteLine("/define:DEBUG;TRACE");
- }
- if (Define != null) {
- writer.WriteLine("/define:{0}", Define);
- }
- if (Win32Icon != null) {
- writer.WriteLine("/win32icon:{0}", Win32Icon);
- }
- foreach (string fileName in References.FileNames) {
- writer.WriteLine("/reference:{0}", fileName);
- }
- foreach (string fileName in Modules.FileNames) {
- writer.WriteLine("/addmodule:{0}", fileName);
- }
- foreach (string fileName in Resources.FileNames) {
- writer.WriteLine("/resource:{0}", fileName);
- }
- foreach (string fileName in Sources.FileNames) {
- writer.WriteLine(fileName);
- }
- // Make sure to close the response file otherwise contents
- // will not be written to disc and EXecuteTask() will fail.
- writer.Close();
-
- if (Verbose) {
- // display response file contents
- Log.WriteLine(LogPrefix + "Contents of " + _responseFileName);
- /*
- StreamReader reader = File.OpenText(_responseFileName);
- string line = reader.ReadLine();
- while (line != null) {
- Log.WriteLine(LogPrefix + " " + line);
- line = reader.ReadLine();
- }
- reader.Close();
- */
-
- StreamReader reader = File.OpenText(_responseFileName);
- Log.WriteLine(reader.ReadToEnd());
- reader.Close();
-
- }
-
- // call base class to do the work
- base.ExecuteTask();
-
- } finally {
- // make sure we delete response file even if an exception is thrown
- writer.Close(); // make sure stream is closed or file cannot be deleted
- File.Delete(_responseFileName);
- _responseFileName = null;
- }
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/CopyTask.cs b/mcs/nant/src/Tasks/CopyTask.cs
deleted file mode 100755
index 849eb023f9e..00000000000
--- a/mcs/nant/src/Tasks/CopyTask.cs
+++ /dev/null
@@ -1,196 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
- using System.Xml;
- using System.Text;
- using System.Collections;
- using System.Collections.Specialized;
-
- [TaskName("copy")]
- public class CopyTask : Task {
-
- [TaskAttribute("file")]
- string _sourceFile = null;
-
- [TaskAttribute("tofile")]
- string _toFile = null;
-
- [TaskAttribute("todir")]
- string _toDirectory = null;
-
- [TaskAttribute("filtering")]
- [BooleanValidator()]
- string _filtering = Boolean.FalseString;
-
- [TaskAttribute("flatten")]
- [BooleanValidator()]
- string _flatten = Boolean.FalseString;
-
- [TaskAttribute("includeEmptyDirs")]
- [BooleanValidator()]
- string _includeEmptyDirs = Boolean.FalseString;
-
- [TaskFileSet("fileset")]
- FileSet _fileset = new FileSet(true); // include all by default
-
- [TaskAttribute("overwrite")]
- [BooleanValidator()]
- string _overwrite = Boolean.FalseString;
-
- [TaskAttribute("verbose")]
- [BooleanValidator()]
- string _verbose = Boolean.FalseString;
-
- [TaskAttribute("preserveLastModified")]
- [BooleanValidator()]
- string _preserveLastModified = Boolean.FalseString;
-
- Hashtable _fileCopyMap = new Hashtable();
-
- public string SourceFile { get { return _sourceFile; } }
- public string ToFile { get { return _toFile; } }
- public string ToDirectory { get { return _toDirectory; } }
- public bool Filtering { get { return Convert.ToBoolean(_filtering); } }
- public bool Flatten { get { return Convert.ToBoolean(_flatten); } }
- public bool IncludeEmptyDirs { get { return Convert.ToBoolean(_includeEmptyDirs); } }
- public bool Overwrite { get { return Convert.ToBoolean(_overwrite); } }
- public bool PreserveLastModified{ get { return Convert.ToBoolean(_preserveLastModified); } }
- public FileSet CopyFileSet { get { return _fileset; } }
-
- public bool Verbose {
- get {
- return (Project.Verbose || Convert.ToBoolean(_verbose));
- }
- }
-
- protected Hashtable FileCopyMap {
- get { return _fileCopyMap; }
- }
-
- /// <summary>
- /// Actually does the file (and possibly empty directory) copies.
- /// </summary>
- protected virtual void DoFileOperations() {
- int fileCount = FileCopyMap.Keys.Count;
- if (fileCount > 0) {
- if (ToDirectory != null) {
- Log.WriteLine(LogPrefix + "Copying {0} files to {1}", fileCount, Project.GetFullPath(ToDirectory));
- } else {
- Log.WriteLine(LogPrefix + "Copying {0} files", fileCount);
- }
-
- // loop thru our file list
- foreach (string sourcePath in FileCopyMap.Keys) {
- string dstPath = (string)FileCopyMap[sourcePath];
- if (sourcePath == dstPath) {
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Skipping self-copy of {0}" + sourcePath);
- }
- continue;
- }
-
- try {
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Copying {0} to {1}", sourcePath, dstPath);
- }
-
- // create directory if not present
- string dstDirectory = Path.GetDirectoryName(dstPath);
- if (!Directory.Exists(dstDirectory)) {
- Directory.CreateDirectory(dstDirectory);
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Created directory {0}", dstDirectory);
- }
- }
-
- File.Copy(sourcePath, dstPath, true);
- } catch (IOException ioe) {
- string msg = String.Format("Cannot copy {0} to {1}", sourcePath, dstPath);
- throw new BuildException(msg, Location, ioe);
- }
- }
- }
-
- // TODO: handle empty directories in the fileset, refer to includeEmptyDirs attribute at
- // http://jakarta.apache.org/ant/manual/CoreTasks/copy.html
- }
-
- protected override void ExecuteTask() {
-
- string dstDirectoryPath = Project.GetFullPath(ToDirectory);
- string srcFilePath = Project.GetFullPath(SourceFile);
- FileInfo srcInfo = new FileInfo(srcFilePath);
-
- string dstFilePath;
- if (ToFile == null) {
- dstFilePath = dstDirectoryPath + Path.DirectorySeparatorChar + srcInfo.Name;
- } else {
- dstFilePath = Project.GetFullPath(ToFile);
- }
-
- FileInfo dstInfo = new FileInfo(dstFilePath);
- if (SourceFile != null) {
- if (srcInfo.Exists) {
- // do the outdated check
- bool outdated = (!dstInfo.Exists) || (srcInfo.LastWriteTime > dstInfo.LastWriteTime);
-
- if (Overwrite || outdated) {
- // add to a copy map of absolute verified paths
- FileCopyMap.Add(srcFilePath, dstFilePath);
- }
- } else {
- Log.WriteLine(LogPrefix + "Could not find file {0} to copy.", srcFilePath);
- }
- } else {
- // get the complete path of the base directory of the fileset, ie, c:\work\nant\src
- string srcBasePath = Project.GetFullPath(CopyFileSet.BaseDirectory);
- string dstBasePath = Project.GetFullPath(ToDirectory);
-
- // if source file not specified use fileset
- foreach (string pathname in CopyFileSet.FileNames) {
- // replace the fileset path with the destination path
- // NOTE: big problems could occur if the file set base dir is rooted on a different drive
- string dstPath = pathname.Replace(srcBasePath, dstBasePath);
-
- srcInfo = new FileInfo(pathname);
- dstInfo = new FileInfo(dstPath);
-
- if (srcInfo.Exists) {
- // do the outdated check
- bool outdated = (!dstInfo.Exists) || (srcInfo.LastWriteTime > dstInfo.LastWriteTime);
-
- if (Overwrite || outdated) {
- FileCopyMap.Add(pathname, dstPath);
- }
- } else {
- Log.WriteLine(LogPrefix + "Could not find file {0} to copy.", srcFilePath);
- }
- }
- }
-
- // do all the actual copy operations now...
- DoFileOperations();
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/CscTask.cs b/mcs/nant/src/Tasks/CscTask.cs
deleted file mode 100755
index 6632df83674..00000000000
--- a/mcs/nant/src/Tasks/CscTask.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("csc")]
- public class CscTask : CompilerBase {
-
- // C# specific compiler options
- [TaskAttribute("doc")]
- string _doc = null;
-
- protected override void WriteOptions(TextWriter writer) {
- writer.WriteLine("/fullpaths");
- if (_doc != null) {
- writer.WriteLine("/doc:{0}", _doc);
- }
- }
-
- protected override bool NeedsCompiling() {
- // TODO: add checks for any referenced files OR return false to always compile
- return base.NeedsCompiling();
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/DeleteTask.cs b/mcs/nant/src/Tasks/DeleteTask.cs
deleted file mode 100755
index 4d4abf25149..00000000000
--- a/mcs/nant/src/Tasks/DeleteTask.cs
+++ /dev/null
@@ -1,173 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-
-// TODO: move this into the task documentation (once we figure out how tasks
-// should be documented - xml??
-/*
-
-verbose: Show name of each deleted file ("true"/"false"). Default is "false"
-when omitted.
-
-quiet: If the file does not exist, do not display a diagnostic message or
-modify the exit status to reflect an error (unless Ant has been invoked with
-the -verbose or -debug switches). This means that if a file or directory cannot
-be deleted, then no error is reported. This setting emulates the -f option to
-the Unix "rm" command. ("true"/"false"). Default is "false" meaning things are
-"noisy". Setting this to true, implies setting failonerror to false.
-
-failonerror: This flag (which is only of relevance if 'quiet' is false),
-controls whether an error -such as a failure to delete a file- stops the build
-task, or is merely reported to the screen. The default is "true"
-
-*/
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("delete")]
- public class DeleteTask : Task {
-
- [TaskAttribute("file")]
- string _file = null;
-
- [TaskAttribute("dir")]
- string _dir = null;
-
- [TaskAttribute("verbose")]
- [BooleanValidator()]
- string _verbose = Boolean.FalseString;
-
- [TaskAttribute("failonerror")]
- [BooleanValidator()]
- string _failOnError = Boolean.TrueString;
-
- /// <summary>If true then delete empty directories when using filesets.</summary>
- [TaskAttribute("includeEmptyDirs")]
- [BooleanValidator()]
- string _includeEmptyDirs = Boolean.FalseString;
-
- [TaskFileSet("fileset")]
- FileSet _fileset = new FileSet(false);
-
- public string FileName { get { return _file; } }
- public string DirectoryName { get { return _dir; } }
- public bool FailOnError { get { return Convert.ToBoolean(_failOnError); } }
- public bool IncludeEmptyDirectories { get { return Convert.ToBoolean(_includeEmptyDirs); } }
- public FileSet DeleteFileSet { get { return _fileset; } }
-
- public bool Verbose {
- get {
- return (Project.Verbose || Convert.ToBoolean(_verbose));
- }
- }
-
- protected override void ExecuteTask() {
-
- // limit task to deleting either a file or a directory or a file set
- if (FileName != null && DirectoryName != null) {
- throw new BuildException("Cannot specify 'file' and 'dir' in the same delete task", Location);
- }
-
- // try to delete specified file
- if (FileName != null) {
- string path = null;
- try {
- path = Project.GetFullPath(FileName);
- } catch (Exception e) {
- string msg = String.Format("Could not determine path from {0}", FileName);
- throw new BuildException(msg, Location, e);
- }
- DeleteFile(path);
-
- // try to delete specified directory
- } else if (DirectoryName != null) {
- string path = null;
- try {
- path = Project.GetFullPath(DirectoryName);
- } catch (Exception e) {
- string msg = String.Format("Could not determine path from {0}", DirectoryName);
- throw new BuildException(msg, Location, e);
- }
- DeleteDirectory(path);
-
- // delete files/directories in fileset
- } else {
- // only use the file set if file and dir attributes have NOT been set
- foreach (string path in DeleteFileSet.FileNames) {
- DeleteFile(path);
- }
-
- if (IncludeEmptyDirectories) {
- foreach (string path in DeleteFileSet.DirectoryNames) {
- // only delete EMPTY directories (no files, no directories)
- DirectoryInfo dirInfo = new DirectoryInfo(path);
-
- if ((dirInfo.GetFiles().Length == 0) && (dirInfo.GetDirectories().Length == 0)) {
- DeleteDirectory(path);
- }
- }
- }
- }
- }
-
- void DeleteDirectory(string path) {
- try {
- if (Directory.Exists(path)) {
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Deleting directory {0}", path);
- }
- if (path.Length > 10) {
- Directory.Delete(path, true);
- } else {
- // TODO: remove this once this task is fully tested and NAnt is at 1.0
- Console.WriteLine(LogPrefix + "Path {0} is too close to root to delete this early in development", path);
- }
- } else {
- throw new DirectoryNotFoundException();
- }
- } catch (Exception e) {
- if (FailOnError) {
- string msg = String.Format("Cannot delete directory {0}", path);
- throw new BuildException(msg, Location, e);
- }
- }
- }
-
- void DeleteFile(string path) {
- try {
- if (File.Exists(path)) {
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Deleting file {0}", path);
- }
- File.Delete(path);
- } else {
- throw new FileNotFoundException();
- }
- } catch (Exception e) {
- if (FailOnError) {
- string msg = String.Format("Cannot delete file {0}", path);
- throw new BuildException(msg, Location, e);
- }
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/EchoTask.cs b/mcs/nant/src/Tasks/EchoTask.cs
deleted file mode 100755
index 871a4385b10..00000000000
--- a/mcs/nant/src/Tasks/EchoTask.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
-
- [TaskName("echo")]
- public class EchoTask : Task {
-
- [TaskAttribute("message", Required=true)]
- string _message = null;
-
- protected override void ExecuteTask() {
- Log.WriteLine(LogPrefix + _message);
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/ExecTask.cs b/mcs/nant/src/Tasks/ExecTask.cs
deleted file mode 100755
index 747c8ab5f46..00000000000
--- a/mcs/nant/src/Tasks/ExecTask.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("exec")]
- public class ExecTask : ExternalProgramBase {
-
- [TaskAttribute("program", Required=true)]
- string _program = null;
-
- [TaskAttribute("commandline")]
- string _commandline = null;
-
- [TaskAttribute("basedir")]
- string _baseDirectory = null;
-
- // Stop the buildprocess if the command exits with a returncode other than 0.
- [TaskAttribute("failonerror")]
- [BooleanValidator()]
- string _failonerror = Boolean.TrueString;
-
- // TODO: change this to Int32Parameter to ensure value is a valid Int32 type after text expansion
- [TaskAttribute("timeout")]
- [Int32Validator()]
- string _timeout = Int32.MaxValue.ToString();
-
- public override string ProgramFileName { get { return Project.GetFullPath(_program); } }
- public override string ProgramArguments { get { return _commandline; } }
- public override string BaseDirectory { get { return Project.GetFullPath(_baseDirectory); } }
- public override int TimeOut { get { return Convert.ToInt32(_timeout); } }
- public override bool FailOnError { get { return Convert.ToBoolean(_failonerror); } }
-
- protected override void ExecuteTask() {
- Log.WriteLine(LogPrefix + "{0} {1}", Path.GetFileName(ProgramFileName), GetCommandLine());
- base.ExecuteTask();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/ExternalProgramBase.cs b/mcs/nant/src/Tasks/ExternalProgramBase.cs
deleted file mode 100755
index 0bc938177a2..00000000000
--- a/mcs/nant/src/Tasks/ExternalProgramBase.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.IO;
- using System.Text;
- using System.Xml;
-
- public abstract class ExternalProgramBase : Task {
-
- [TaskAttribute("verbose")]
- [BooleanValidator()]
- string _verbose = Boolean.FalseString;
-
- public abstract string ProgramFileName { get; }
- public abstract string ProgramArguments { get; }
-
- public virtual string BaseDirectory {
- get {
- if (Project != null) {
- return Project.BaseDirectory;
- } else {
- return null;
- }
- }
- }
-
- public virtual int TimeOut {
- get { return Int32.MaxValue; }
- }
-
- public virtual bool FailOnError {
- get { return true; }
- }
-
- public bool Verbose {
- get {
- return (Project.Verbose || Convert.ToBoolean(_verbose));
- }
- }
-
- StringCollection _args = new StringCollection();
-
- protected override void InitializeTask(XmlNode taskNode) {
- // initialize the _args collection
- foreach (XmlNode optionNode in taskNode.SelectNodes("arg")) {
-
- // TODO: decide if we should enforce arg elements not being able
- // to accept a file and value attribute on the same element.
- // Ideally this would be down via schema and since it doesn't
- // really hurt for now I'll leave it in.
-
- XmlNode valueNode = optionNode.SelectSingleNode("@value");
- if (valueNode != null) {
- _args.Add(Project.ExpandText(valueNode.Value));
- }
-
- XmlNode fileNode = optionNode.SelectSingleNode("@file");
- if (fileNode != null) {
- _args.Add(Project.GetFullPath(Project.ExpandText(fileNode.Value)));
- }
- }
- }
-
- public string GetCommandLine() {
- // append any nested <arg> arguments to command line
- StringBuilder arguments = new StringBuilder(ProgramArguments);
- foreach (string arg in _args) {
- arguments = arguments.Append(' ');
- arguments = arguments.Append(arg);
- }
- return arguments.ToString();
- }
-
- protected override void ExecuteTask() {
- try {
- // create process to launch compiler (redirect standard output to temp buffer)
- Process process = new Process();
- process.StartInfo.FileName = ProgramFileName;
- process.StartInfo.Arguments = GetCommandLine();
- process.StartInfo.RedirectStandardOutput = true;
- process.StartInfo.UseShellExecute = false;
- process.StartInfo.WorkingDirectory = BaseDirectory;
- if (Verbose) {
- Log.WriteLine(LogPrefix + "{0}>{1} {2}", process.StartInfo.WorkingDirectory, process.StartInfo.FileName, process.StartInfo.Arguments);
- }
- process.Start();
-
- // display standard output
- StreamReader reader = process.StandardOutput;
- string output = reader.ReadToEnd();
- if (output.Length > 0) {
- int indentLevel = Log.IndentLevel;
- Log.IndentLevel = 0;
- Log.WriteLine(output);
- Log.IndentLevel = indentLevel;
- }
-
- // wait for program to exit
- process.WaitForExit(TimeOut);
-
- if (FailOnError && process.ExitCode != 0) {
- throw new BuildException("Program error, see build log for details.");
- }
- } catch (Exception e) {
- throw new BuildException(e.Message, Location, e);
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/FailTask.cs b/mcs/nant/src/Tasks/FailTask.cs
deleted file mode 100755
index 2e6b7161fb5..00000000000
--- a/mcs/nant/src/Tasks/FailTask.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
-
- [TaskName("fail")]
- public class FailTask : Task {
-
- [TaskAttribute("message")]
- string _message = null;
-
- protected override void ExecuteTask() {
- string message = _message;
- if (message == null) {
- message = "No message";
- }
- throw new BuildException(message);
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/IncludeTask.cs b/mcs/nant/src/Tasks/IncludeTask.cs
deleted file mode 100755
index 637c3dabb5e..00000000000
--- a/mcs/nant/src/Tasks/IncludeTask.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Ian MacLean (ian_maclean@another.com)
-
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Xml;
- using System.Collections;
- using System.Collections.Specialized;
-
- /// <summary>
- /// Summary description for IncludeTask.
- /// </summary>
-
- [TaskName("include")] // TODO make into ant:include
- public class IncludeTask : Task {
-
- /// <summary>hours to to add to the sleep time</summary>
- [TaskAttribute("href", Required=true)]
- string _href = null;
-
- // Attribute properties
- public string Href { get { return _href; } }
-
- XPathTextPositionMap _positionMap; // created when Xml document is loaded
- TaskCollection _tasks = new TaskCollection();
-
- // static members
- static System.Collections.Stack _includesStack = new Stack();
- static bool IsIncluded( string href ) {
- bool result = false;
- IEnumerator stackenum = _includesStack.GetEnumerator();
- while ( stackenum.MoveNext()) {
- if ( href == (string)stackenum.Current ) {
- result = true; break;
- }
- }
- return result;
- }
-
- protected void InitializeIncludedDocument(XmlDocument doc) {
-
- // Load line Xpath to linenumber array
- _positionMap = new XPathTextPositionMap(doc.BaseURI);
-
- // process all the non-target nodes (these are global tasks for the project)
- XmlNodeList taskList = doc.SelectNodes("project/*[name() != 'target']");
- foreach (XmlNode taskNode in taskList) {
-
- // TODO: do somethiing like Project.CreateTask(taskNode) and have the project set the location
- TextPosition textPosition = _positionMap.GetTextPosition(taskNode);
-
- Task task = Project.CreateTask(taskNode);
- if (task != null) {
- // Store a local copy also so we can execute only those
- _tasks.Add(task);
- }
- }
-
- // execute global tasks now - before anything else
- // this lets us include tasks that do things like add more tasks
- // Here is where we should check for recursive dependencies
- //
- foreach (Task task in _tasks ) {
- task.Execute();
- }
-
- // process all the targets
- XmlNodeList targetList = doc.SelectNodes("project/target");
- foreach (XmlNode targetNode in targetList) {
- Target target = new Target(Project);
- target.Initialize(targetNode);
- Project.Targets.Add(target);
- }
- }
-
- /// <summary>
- /// verify parameters
- ///</summary>
- ///<param name="taskNode"> taskNode used to define this task instance </param>
- protected override void InitializeTask(XmlNode taskNode) {
-
- //TODO check where we are in document - if not at top level then bail out on error ...
- // basic recursion check
- if (IsIncluded( Project.GetFullPath(Href) )) {
- throw new BuildException("Recursive includes are not allowed", Location);
- }
- }
-
- protected override void ExecuteTask() {
-
- string fullpath = Project.GetFullPath(Href);
- // push ourselves onto the stack
- _includesStack.Push(fullpath);
- try {
-
- XmlDocument doc = new XmlDocument();
-
- // Handle local file case
- doc.Load(fullpath);
-
- InitializeIncludedDocument(doc);
- }
- // Handling the case where a nested include causes an exception during initialization
- catch ( BuildException ) {
- throw;
- }
- catch ( Exception e) {
- throw new BuildException(e.Message, Location, e);
- }
- finally {
- // Pop off the stack
- _includesStack.Pop();
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/JscTask.cs b/mcs/nant/src/Tasks/JscTask.cs
deleted file mode 100755
index e2944122aa7..00000000000
--- a/mcs/nant/src/Tasks/JscTask.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("jsc")]
- public class JscTask : CompilerBase {
-
- // TODO: add JScript.NET specific compiler options here (see CscTask)
-
- protected override void WriteOptions(TextWriter writer) {
- // TODO: add support for compiler specific options
- }
-
- protected override bool NeedsCompiling() {
- // TODO: add checks for any referenced files OR return false to always compile
- return base.NeedsCompiling();
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/MkDirTask.cs b/mcs/nant/src/Tasks/MkDirTask.cs
deleted file mode 100755
index fca374b3408..00000000000
--- a/mcs/nant/src/Tasks/MkDirTask.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- /// <summary>Creates a directory and any non-existent parent directories when necessary.</summary>
- [TaskName("mkdir")]
- public class MkDirTask : Task {
-
- [TaskAttribute("dir", Required=true)]
- string _dir = null; // the directory to create
-
- protected override void ExecuteTask() {
- try {
- string directory = Project.GetFullPath(_dir);
- if (!Directory.Exists(directory)) {
- Log.WriteLine(LogPrefix + "Creating directory {0}", directory);
- DirectoryInfo result = Directory.CreateDirectory(directory);
- if (result == null) {
- string msg = String.Format("Unknown error creating directory '{0}'", directory);
- throw new BuildException(msg, Location);
- }
- }
- } catch (Exception e) {
- throw new BuildException(e.Message, Location, e);
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/MoveTask.cs b/mcs/nant/src/Tasks/MoveTask.cs
deleted file mode 100755
index 2b63014ef0b..00000000000
--- a/mcs/nant/src/Tasks/MoveTask.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("move")]
- public class MoveTask : CopyTask {
-
- /// <summary>
- /// Actually does the file (and possibly empty directory) copies.
- /// </summary>
- protected override void DoFileOperations() {
- if (FileCopyMap.Count > 0) {
-
- // loop thru our file list
- foreach (string sourcePath in FileCopyMap.Keys) {
- string destinationPath = (string)FileCopyMap[sourcePath];
- if (sourcePath == destinationPath) {
- Log.WriteLine(LogPrefix + "Skipping self-move of {0}" + sourcePath);
- continue;
- }
-
- try {
- // check if directory exists
- if (Directory.Exists(sourcePath)) {
- Log.WriteLine(LogPrefix + "moving directory {0} to {1}", sourcePath, destinationPath);
- Directory.Move(sourcePath, destinationPath);
- }
- else {
-
- DirectoryInfo todir = new DirectoryInfo(destinationPath);
- if ( !todir.Exists ) {
- Directory.CreateDirectory( Path.GetDirectoryName(destinationPath) );
- }
-
- Log.WriteLine(LogPrefix + "Moving {0} to {1}", sourcePath, destinationPath);
- // IM look into how Ant does this for directories
- File.Move(sourcePath, destinationPath);
- }
-
- } catch (IOException ioe) {
- string msg = String.Format("Failed to move {0} to {1}\n{2}", sourcePath, destinationPath, ioe.Message);
- throw new BuildException(msg, Location);
- }
- }
- }
- }
- }
-}
-
-
diff --git a/mcs/nant/src/Tasks/NantTask.cs b/mcs/nant/src/Tasks/NantTask.cs
deleted file mode 100755
index 1462ae97097..00000000000
--- a/mcs/nant/src/Tasks/NantTask.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.IO;
- using System.Xml;
-
- [TaskName("nant")]
- public class NantTask : Task {
-
- [TaskAttribute("buildfile")]
- string _buildFileName = null;
-
- [TaskAttribute("basedir")]
- string _baseDirectory = null;
-
- // TODO: add support for multiple targets
- [TaskAttribute("target")]
- string _target = null;
-
- protected override void ExecuteTask() {
- string directory = Project.GetFullPath(_baseDirectory);
- string buildFileName = _buildFileName;
- if (buildFileName == null) {
- buildFileName = Project.FindBuildFileName(directory);
- }
-
- try {
- Log.WriteLine(LogPrefix + "{0} {1}", buildFileName, _target);
- Log.Indent();
- Project project = new Project();
- project.BaseDirectory = directory;
- project.BuildFileName = buildFileName;
- if (_target != null) {
- project.BuildTargets.Add(_target);
- }
- if (!project.Run()) {
- throw new BuildException("Nested build failed - refer to build log for exact reason.");
- }
- } finally {
- Log.Unindent();
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/PropertyTask.cs b/mcs/nant/src/Tasks/PropertyTask.cs
deleted file mode 100755
index 90933ca78ac..00000000000
--- a/mcs/nant/src/Tasks/PropertyTask.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
-
- [TaskName("property")]
- public class PropertyTask : Task {
-
- [TaskAttribute("name", Required=true)]
- string _name = null;
-
- [TaskAttribute("value", Required=true)]
- string _value = String.Empty;
-
- protected override void ExecuteTask() {
- Project.Properties[_name] = _value;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/SleepTask.cs b/mcs/nant/src/Tasks/SleepTask.cs
deleted file mode 100755
index d6c69cc90b1..00000000000
--- a/mcs/nant/src/Tasks/SleepTask.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Xml;
- using System.Threading;
-
- /// <summary>
- /// A task for sleeping a short period of time, useful when a build or deployment process
- /// requires an interval between tasks.
- /// </summary>
-
- [TaskName("sleep")]
- public class SleepTask : Task {
-
- /// <summary>hours to to add to the sleep time</summary>
- [TaskAttribute("hours")]
- string _hours = null;
-
- /// <summary>minutes to add to the sleep time</summary>
- [TaskAttribute("minutes")]
- string _minutes = 0.ToString();
-
- /// <summary>seconds to add to the sleep time</summary>
- [TaskAttribute("seconds")]
- string _seconds = 0.ToString();
-
- /// <summary>milliseconds to add to the sleep time</summary>
- [TaskAttribute("milliseconds")]
- string _milliseconds = 0.ToString();
-
- /// <summary>flag controlling whether to break the build on an error</summary>
- [TaskAttribute("failonerror")]
- [BooleanValidator()]
- string _failonerror = Boolean.FalseString;
-
- // Attribute properties
- public int Hours { get { return Convert.ToInt32(_hours); } }
- public int Minutes { get { return Convert.ToInt32(_minutes); } }
- public int Seconds { get { return Convert.ToInt32(_seconds); } }
- public int Milliseconds { get { return Convert.ToInt32(_milliseconds); } }
- public bool FailOnError { get { return Convert.ToBoolean(_failonerror); } }
-
- ///return time to sleep
- private int GetSleepTime() {
- return ((((int) Hours * 60) + Minutes) * 60 + Seconds) * 1000 + Milliseconds;
- }
-
- ///<summary> return time to sleep </summary>
- ///<param name="millis"> </param>
- private void DoSleep(int millis ) {
- Thread.Sleep(millis);
- }
-
- /// <summary>
- /// verify parameters
- ///</summary>
- ///<param name="taskNode"> taskNode used to define this task instance </param>
- protected override void InitializeTask(XmlNode taskNode) {
- if (GetSleepTime() < 0) {
- throw new BuildException("Negative sleep periods are not supported", Location);
- }
- }
-
- protected override void ExecuteTask() {
- int sleepTime = GetSleepTime();
- Log.WriteLine(LogPrefix + "sleeping for {0} milliseconds", sleepTime);
- DoSleep(sleepTime);
- }
- }
-}
-
-
diff --git a/mcs/nant/src/Tasks/StyleTask.cs b/mcs/nant/src/Tasks/StyleTask.cs
deleted file mode 100755
index 05117217d0b..00000000000
--- a/mcs/nant/src/Tasks/StyleTask.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Serge (serge@wildwestsoftware.com)
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
- using System.Xml;
- using System.Xml.Xsl;
- using System.Xml.XPath;
- using System.Text.RegularExpressions;
-
- [TaskName("style")]
- public class StyleTask : Task {
-
- // TODO: consider prefixing private fields with _ to stay consistent (gs)
-
- [TaskAttribute("basedir", Required=false)]
- string baseDir = null;
-
- [TaskAttribute("destdir", Required=false)]
- string destDir = null;
-
- [TaskAttribute("extension", Required=false)]
- string extension = "html";
-
- [TaskAttribute("style", Required=true)]
- string xsltFile = null;
-
- [TaskAttribute("in", Required=true)]
- string srcFile = null;
-
- [TaskAttribute("out", Required=false)]
- string destFile = null;
-
- private static string GetPath(string dir, string file) {
- // TODO: remove platform dependencies by using System.IO.Path (gs)
- string d = (dir == null)
- ? ""
- : Regex.Replace(dir, "/", "\\");
-
- return (d==null || d=="")
- ? (file==null || file=="") ? "" : file
- : d.EndsWith("\\")
- ? d +file : d + "\\" + file;
- }
-
- private XmlReader CreateXmlReader(string dir, string file) {
- string xmlPath = GetPath(dir, file);
- XmlTextReader xmlReader = null;
-
- try {
- xmlReader = new XmlTextReader(new FileStream(xmlPath, FileMode.Open));
- } catch (Exception) {
- xmlReader = null;
- }
-
- return xmlReader;
- }
-
- private XmlWriter CreateXmlWriter(string dir, string file) {
- string xmlPath = GetPath(dir, file);
-
- XmlWriter xmlWriter = null;
-
- string targetDir = Path.GetDirectoryName(Path.GetFullPath(xmlPath));
- if (targetDir != null && targetDir != "" && !Directory.Exists(targetDir)) {
- Directory.CreateDirectory(targetDir);
- }
-
- try {
- // UTF-8 encoding will be used
- xmlWriter = new XmlTextWriter(xmlPath, null);
- } catch (Exception) {
- xmlWriter = null;
- }
-
- return xmlWriter;
- }
-
- protected override void ExecuteTask() {
- string destFile = this.destFile;
-
- if (destFile == null || destFile == "") {
- // TODO: use System.IO.Path (gs)
- string ext = extension[0]=='.'
- ? extension
- : "." + extension;
-
- int extPos = srcFile.LastIndexOf('.');
-
- if (extPos == -1) {
- destFile = srcFile + ext;
- } else {
- destFile = srcFile.Substring(0, extPos) + ext;
- }
- }
-
- string srcPath = GetPath(baseDir, srcFile);
- string destPath = GetPath(destDir, destFile);
- string xsltPath = GetPath(baseDir, xsltFile);
-
- FileInfo srcInfo = new FileInfo(srcPath);
- FileInfo destInfo = new FileInfo(destPath);
- FileInfo xsltInfo = new FileInfo(xsltPath);
-
- if (!srcInfo.Exists) {
- throw new BuildException("Unable to find source xml file.");
- }
- if (!xsltInfo.Exists) {
- throw new BuildException("Unable to find stylesheet file.");
- }
-
- bool destOutdated = !destInfo.Exists
- || srcInfo.LastWriteTime > destInfo.LastWriteTime
- || xsltInfo.LastWriteTime > destInfo.LastWriteTime;
-
- if (destOutdated) {
- XmlReader xmlReader = CreateXmlReader(baseDir, srcFile);
- XmlReader xslReader = CreateXmlReader(baseDir, xsltFile);
- XmlWriter xmlWriter = CreateXmlWriter(destDir, destFile);
-
- Log.WriteLine(LogPrefix + "Transforming into " + Path.GetFullPath(destDir));
-
- // TODO: remove assignments from conditional statement (gs)
- if (xmlReader != null && xslReader != null && xmlWriter != null) {
- XslTransform xslt = new XslTransform();
- XPathDocument xml = new XPathDocument(xmlReader);
-
- Log.WriteLine(LogPrefix + "Loading stylesheet " + Path.GetFullPath(xsltPath));
- try {
- xslt.Load(xslReader);
- } catch (XsltCompileException xce) {
- throw new BuildException(xce.Message, xce);
- } catch (Exception e) {
- throw new BuildException(e.Message, e);
- }
-
- Log.WriteLine(LogPrefix + "Processing " + Path.GetFullPath(srcPath) + " to " + Path.GetFullPath(destPath));
- try {
- xslt.Transform(xml, null, xmlWriter);
- } catch (Exception e) {
- throw new BuildException(e.Message, e);
- }
- } else {
- // not sure how to deal with this...
- // TODO: remove this statement or do something useful (gs)
- // Can this condition occur? I would have thought
- // that an exception would be thrown. (gs)
- }
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/TStampTask.cs b/mcs/nant/src/Tasks/TStampTask.cs
deleted file mode 100755
index 1806a3040c4..00000000000
--- a/mcs/nant/src/Tasks/TStampTask.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- /// <remarks>
- /// Sets the following properties:
- /// <ul>
- /// <li>nant.dateStamp to yyyyMMdd</li>
- /// <li>nant.timeStamp to HHmm</li>
- /// <li>nant.today using default DataTime.ToString() method</li>
- /// </ul>
- /// </remarks>
- [TaskName("tstamp")]
- public class TStampTask : Task {
- protected override void ExecuteTask() {
- DateTime now = DateTime.Now;
- Log.WriteLine(LogPrefix + now.ToString());
- Project.Properties["nant.dstamp"] = now.ToString("yyyyMMdd");
- Project.Properties["nant.tstamp"] = now.ToString("HHmm");
- Project.Properties["nant.today"] = now.ToString();
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/TaskDefTask.cs b/mcs/nant/src/Tasks/TaskDefTask.cs
deleted file mode 100755
index 4c7eca7be4f..00000000000
--- a/mcs/nant/src/Tasks/TaskDefTask.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("taskdef")]
- public class TaskDefTask : Task {
-
- [TaskAttribute("assembly", Required=true)]
- string _assemblyFileName = null;
-
- protected override void ExecuteTask() {
- string assemblyFileName = Project.GetFullPath(_assemblyFileName);
- try {
- int taskCount = Project.AddTasks(assemblyFileName);
- Log.WriteLine(LogPrefix + "Added {0} tasks from {1}", taskCount, assemblyFileName);
- } catch (Exception e) {
- Log.WriteLine(LogPrefix + "Adding tasks from {0}", assemblyFileName);
- throw new BuildException(e.Message, Location, e);
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/VbcTask.cs b/mcs/nant/src/Tasks/VbcTask.cs
deleted file mode 100755
index 4f93787eed8..00000000000
--- a/mcs/nant/src/Tasks/VbcTask.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("vbc")]
- public class VbcTask : CompilerBase {
-
- // TODO: add JScript.NET specific compiler options here (see CscTask)
-
- protected override void WriteOptions(TextWriter writer) {
- // TODO: add support for compiler specific options
- }
-
- protected override bool NeedsCompiling() {
- // TODO: add checks for any referenced files OR return false to always compile
- return base.NeedsCompiling();
- }
- }
-}
diff --git a/mcs/nant/src/Util/Log.cs b/mcs/nant/src/Util/Log.cs
deleted file mode 100755
index b875663069d..00000000000
--- a/mcs/nant/src/Util/Log.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections;
- using System.IO;
- using System.Text;
-
- public class TextWriterCollection : ArrayList {
- }
-
- public class Log {
-
- static bool _autoFlush = false;
- static int _indentLevel = 0;
- static int _indentSize = 4;
-
- static TextWriterCollection _listeners;
-
- protected Log() {
- }
-
- ~Log() {
- // make sure we release any open file handles
- Close();
- }
-
- public static bool AutoFlush {
- get { return _autoFlush; }
- set { _autoFlush = value; }
- }
-
- public static int IndentLevel {
- get { return _indentLevel; }
- set { _indentLevel = value; }
- }
-
- public static int IndentSize {
- get { return _indentSize; }
- set { _indentSize = value; }
- }
-
- public static TextWriterCollection Listeners {
- get {
- if (_listeners == null) {
- _listeners = new TextWriterCollection();
- _listeners.Add(Console.Out);
- }
- return _listeners;
- }
- }
-
- public static void Close() {
- foreach (TextWriter writer in Listeners) {
- // never close the Console.Out writer
- if (writer != Console.Out) {
- writer.Close();
- }
- }
- }
-
- public static void Flush() {
- foreach (TextWriter writer in Listeners) {
- writer.Flush();
- }
- }
-
- public static void Indent() {
- IndentLevel++;
- }
-
- public static void Unindent() {
- if (IndentLevel <= 0) {
- throw new InvalidOperationException("IndentLevel must be greater than zero before calling Unindent()");
- }
- IndentLevel--;
- }
-
- /// <summary>
- /// Flag to indicate next string will start on a new line so that it can be indented.
- /// </summary>
- private static bool _newline = true;
-
- private static void PreprocessValue(ref string value) {
- // if we are starting a new line then first indent the string
- if (_newline) {
- if (IndentLevel > 0) {
- StringBuilder sb = new StringBuilder(value);
- sb.Insert(0, " ", IndentLevel * IndentSize);
- value = sb.ToString();
- }
- _newline = false;
- }
- }
-
- public static void Write(string value) {
- PreprocessValue(ref value);
- foreach (TextWriter writer in Listeners) {
- writer.Write(value);
- }
-
- if (AutoFlush) {
- foreach (TextWriter writer in Listeners) {
- writer.Flush();
- }
- }
- }
-
- public static void WriteLine() {
- WriteLine(String.Empty);
- }
-
- public static void WriteLine(string value) {
- PreprocessValue(ref value);
- foreach (TextWriter writer in Listeners) {
- writer.WriteLine(value);
- }
-
- if (AutoFlush) {
- foreach (TextWriter writer in Listeners) {
- writer.Flush();
- }
- }
-
- // make sure we indent the next line
- _newline = true;
- }
-
- public static void Write(string format, params object[] arg) {
- Write(String.Format(format, arg));
- }
-
- public static void WriteLine(string format, params object[] arg) {
- WriteLine(String.Format(format, arg));
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Util/XmlNodeTextPositionMap.cs b/mcs/nant/src/Util/XmlNodeTextPositionMap.cs
deleted file mode 100755
index fd10caafd4f..00000000000
--- a/mcs/nant/src/Util/XmlNodeTextPositionMap.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
- using System.Text.RegularExpressions;
- using System.Xml;
- using System.Xml.XPath;
- using System.Collections;
-
- public struct TextPosition {
- public static readonly TextPosition InvalidPosition = new TextPosition(-1,-1);
-
- public TextPosition(int line, int column) {
- Line = line;
- Column = column;
- }
-
- public int Line;
- public int Column;
- }
-
- /// <summary>
- /// Maps XML nodes to the text positions from their original source.
- /// </summary>
- public class XPathTextPositionMap {
-
- Hashtable _map = new Hashtable();
-
- public XPathTextPositionMap(string url) {
- string parentXPath = "/"; // default to root
- string previousXPath = "";
- int previousDepth = 0;
-
- // Load text reader
- XmlTextReader reader = new XmlTextReader(url);
- ArrayList indexAtDepth = new ArrayList();
-
- // Explicitly load document XPath
- _map.Add((object) "/", (object) new TextPosition(1, 1));
-
- // loop thru all nodes in the document
- while (reader.Read()) {
- // reader to Node ...
- if ( (reader.NodeType.ToString() != "Whitespace") // Ignore those we aren't interested in
- && (reader.NodeType.ToString() != "EndElement")
- && (reader.NodeType.ToString() != "ProcessingInstruction")
- && (reader.NodeType.ToString() != "XmlDeclaration")
- ) {
- int level = reader.Depth;
- string currentXPath = "";
-
- // If we arr higher than before
- if (reader.Depth < previousDepth) {
- // Clear vars for new depth
- string[] list = parentXPath.Split('/');
- string newXPath = ""; // once appended to / will be root node ...
-
- for (int j = 1; j < level+1; j++) {
- newXPath += "/" + list[j];
- }
-
- // higher than before so trim xpath\
- parentXPath = newXPath; // one up from before
-
- // clear indexes for depth greater than ours
- indexAtDepth.RemoveRange(level+1, indexAtDepth.Count - (level+1));
-
- } else if (reader.Depth > previousDepth) {
- // we are lower
- parentXPath = previousXPath;
- }
-
- // End depth setup
- // Setup up index array
- // add any needed extra items ( usually only 1 )
- // would have uses array but not sure what maximum depth will be beforehand
- for (int index = indexAtDepth.Count; index < level+1; index++) {
- indexAtDepth.Add(0);
- }
- // Set child index
- if ((int) indexAtDepth[level] == 0) {
- // first time thru
- indexAtDepth[level] = 1;
- } else {
- indexAtDepth[level] = (int) indexAtDepth[level] + 1; // lower so append to xpath
- }
-
- // Do actual XPath generation
- if (parentXPath.EndsWith("/")) {
- currentXPath = parentXPath;
- } else {
- currentXPath = parentXPath + "/"; // add seperator
- }
-
- // Set the final XPath
- currentXPath += "child::node()[" + indexAtDepth[level] + "]";
-
- // Add to our hash structures
- _map.Add((object) currentXPath, (object) new TextPosition(reader.LineNumber, reader.LinePosition));
-
- // setup up loop vars for next iteration
- previousXPath = currentXPath;
- previousDepth = reader.Depth;
- }
- }
- }
-
- public TextPosition GetTextPosition(XmlNode node) {
- string xpath = GetXPathFromNode(node);
- return GetTextPosition(xpath);
- }
-
- public TextPosition GetTextPosition(string xpath) {
- TextPosition pos;
- if (_map.ContainsKey(xpath)) {
- pos = (TextPosition) _map[xpath];
- } else {
- pos = TextPosition.InvalidPosition;
- }
- return pos;
- }
-
- private string GetXPathFromNode(XmlNode node) {
- XPathNavigator nav = node.CreateNavigator();
-
- string xpath = "";
- int index = 0;
-
- while (nav.NodeType.ToString() != "Root") {
- // loop thru children until we find ourselves
- XPathNavigator navParent = nav.Clone();
- navParent.MoveToParent();
- int parentIndex = 0;
- navParent.MoveToFirstChild();
- if (navParent.IsSamePosition(nav)) {
- index = parentIndex;
- }
- while (navParent.MoveToNext()) {
- parentIndex++;
- if (navParent.IsSamePosition(nav)) {
- index = parentIndex;
- }
- }
-
- nav.MoveToParent(); // do loop condiditon here
-
- // if we are at doc and index = 0 then there is no xml proc instruction
- if ((nav.NodeType.ToString()) != "Root" || (index == 0)) {
- index = index + 1; // special case at root to avoid processing instruction ..
- }
-
- string thisNode = "child::node()[" + index + "]";
-
- if (xpath == "") {
- xpath = thisNode;
- } else {
- // build xpath string
- xpath = thisNode + "/" + xpath;
- }
- }
-
- // prepend slash to ...
- xpath = "/" + xpath;
-
- return xpath;
- }
- }
-}
diff --git a/mcs/nunit/.cvsignore b/mcs/nunit/.cvsignore
deleted file mode 100644
index 6a7461313bb..00000000000
--- a/mcs/nunit/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.dll
diff --git a/mcs/nunit/NUnitGUI.exe b/mcs/nunit/NUnitGUI.exe
deleted file mode 100755
index c20adf5e45a..00000000000
--- a/mcs/nunit/NUnitGUI.exe
+++ /dev/null
Binary files differ
diff --git a/mcs/nunit/NUnitTests.dll b/mcs/nunit/NUnitTests.dll
deleted file mode 100755
index d040176d997..00000000000
--- a/mcs/nunit/NUnitTests.dll
+++ /dev/null
Binary files differ
diff --git a/mcs/nunit/makefile b/mcs/nunit/makefile
deleted file mode 100644
index 08c53250447..00000000000
--- a/mcs/nunit/makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-all: NUnitConsole.exe
-linux: NUnitConsole.exe
-windows: NUnitConsole.exe
-
-NUnitConsole.exe: NUnitCore.dll
- (cd src/NUnitConsole; csc /nologo /target:exe /out:../../NUnitConsole.exe *.cs /r:../../NUnitCore.dll)
-
-NUnitCore.dll:
- (cd src/NUnitCore; csc /nologo /target:library /out:../../NUnitCore.dll *.cs)
-
-clean:
- rm -f NUnitCore.dll NUnitConsole.exe
diff --git a/mcs/nunit/src/NUnitConsole/NUnitConsole.xml b/mcs/nunit/src/NUnitConsole/NUnitConsole.xml
deleted file mode 100644
index 7aaf89815df..00000000000
--- a/mcs/nunit/src/NUnitConsole/NUnitConsole.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0"?>
-<doc>
- <assembly>
- <name>NUnitConsole</name>
- </assembly>
- <members>
- <member name="T:NUnit.Top">
- <summary>
-
- </summary>
- </member>
- <member name="M:NUnit.Top.Main(System.String[])">
- <summary>
-
- </summary>
- <param name="args"></param>
- </member>
- <member name="T:NUnit.TextUI.TestRunner">
- <summary>A command line based tool to run tests.</summary><remarks>
- <code>
- C:\NUnitConsole.exe /t [/wait] TestCaseClass
- </code>
- TestRunner expects the name of a TestCase class as argument.
- If this class defines a static <c>Suite</c> property it
- will be invoked and the returned test is run. Otherwise all
- the methods starting with "Test" having no arguments are run.
-
- When the wait command line argument is given TestRunner
- waits until the users types RETURN.
-
- TestRunner prints a trace as the tests are executed followed by a
- summary at the end.</remarks>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.#ctor">
- <summary>
- Constructs a TestRunner.
- </summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.#ctor(System.IO.TextWriter)">
- <summary>
- Constructs a TestRunner using the given stream for all the output
- </summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.AddError(NUnit.Framework.ITest,System.Exception)">
- <summary>
-
- </summary>
- <param name="test"></param>
- <param name="t"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.AddFailure(NUnit.Framework.ITest,NUnit.Framework.AssertionFailedError)">
- <summary>
-
- </summary>
- <param name="test"></param>
- <param name="t"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.CreateTestResult">
- <summary>Creates the TestResult to be used for the test run.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.DoRun(NUnit.Framework.ITest,System.Boolean)">
- <summary>
-
- </summary>
- <param name="suite"></param>
- <param name="wait"></param>
- <returns></returns>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.EndTest(NUnit.Framework.ITest)">
- <summary>
-
- </summary>
- <param name="test"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.GetLoader">
- <summary>
-
- </summary>
- <returns></returns>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.Print(NUnit.Framework.TestResult)">
- <summary>
-
- </summary>
- <param name="result"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.PrintErrors(NUnit.Framework.TestResult)">
- <summary>Prints the errors to the standard output.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.PrintFailures(NUnit.Framework.TestResult)">
- <summary>Prints failures to the standard output.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.PrintHeader(NUnit.Framework.TestResult)">
- <summary>Prints the header of the report.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.Run(System.Type)">
- <summary>Runs a Suite extracted from a TestCase subclass.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.Run(NUnit.Framework.ITest)">
- <summary>
-
- </summary>
- <param name="suite"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.RunAndWait(NUnit.Framework.ITest)">
- <summary>Runs a single test and waits until the user
- types RETURN.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.RunFailed(System.String)">
- <summary>
-
- </summary>
- <param name="message"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.Start(System.String[])">
- <summary>Starts a test run. Analyzes the command line arguments
- and runs the given test suite.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.StartTest(NUnit.Framework.ITest)">
- <summary>
-
- </summary>
- <param name="test"></param>
- </member>
- <member name="P:NUnit.TextUI.TestRunner.Writer">
- <summary>
-
- </summary>
- </member>
- <member name="M:System.Collections.Hashtable.Synchronized(System.Collections.Hashtable)">
- <summary>
- Returns a synchronized (thread-safe)
- wrapper for the Hashtable.
- </summary>
- </member>
- <member name="M:System.Collections.Hashtable.GetHash(System.Object)">
- <summary>Returns the hash code for the specified key.</summary>
- </member>
- <member name="M:System.Collections.Hashtable.KeyEquals(System.Object,System.Object)">
- <summary>
- Compares a specific Object with a specific key
- in the Hashtable.
- </summary>
- </member>
- </members>
-</doc>
diff --git a/mcs/nunit/src/NUnitCore/IFailureDetailView.cs b/mcs/nunit/src/NUnitCore/IFailureDetailView.cs
index 55553b505ad..424c5a096b7 100644
--- a/mcs/nunit/src/NUnitCore/IFailureDetailView.cs
+++ b/mcs/nunit/src/NUnitCore/IFailureDetailView.cs
@@ -1,6 +1,7 @@
namespace NUnit.Runner {
using System;
+ using System.Windows.Forms;
using NUnit.Framework;
@@ -14,6 +15,11 @@ namespace NUnit.Runner {
void Clear();
/// <summary>
+ /// Returns the component used to present the TraceView
+ /// </summary>
+ Control GetComponent();
+
+ /// <summary>
/// Shows details of a TestFailure
/// </summary>
void ShowFailure(TestFailure failure);
diff --git a/mcs/nunit/src/NUnitCore/SimpleTestCollector.cs b/mcs/nunit/src/NUnitCore/SimpleTestCollector.cs
deleted file mode 100644
index e1f73ea959a..00000000000
--- a/mcs/nunit/src/NUnitCore/SimpleTestCollector.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-namespace NUnit.Runner {
-
- using System;
-
- /// <summary>
- /// An implementation of a TestCollector that considers
- /// a class to be a test class when it contains the
- /// pattern "Test" in its name
- /// <see cref="ITestCollector"/>
- /// </summary>
- public class SimpleTestCollector: ClassPathTestCollector {
- /// <summary>
- ///
- /// </summary>
- public SimpleTestCollector() {
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="classFileName"></param>
- /// <returns></returns>
- protected override bool IsTestClass(string classFileName) {
- return
- (classFileName.EndsWith(".dll") || classFileName.EndsWith(".exe")) &&
- classFileName.IndexOf("Test") > 0;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/tests/ChangeLog b/mcs/tests/ChangeLog
deleted file mode 100755
index 304a062f384..00000000000
--- a/mcs/tests/ChangeLog
+++ /dev/null
@@ -1,296 +0,0 @@
-2002-02-20 Miguel de Icaza <miguel@ximian.com>
-
- * unsafe-1.cs: Extend test.
-
-2002-01-18 Miguel de Icaza <miguel@ximian.com>
-
- * test-7.cs: Fix test (i.i wsa invalid)
-
-2002-01-18 Nick Drochak <ndrochak@gol.com>
-
- * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
-
-2002-01-13 Ravi Pratap <ravi@ximian.com>
-
- * test-58.cs : Since it was a duplicate, replace with unsafe
- code testing.
-
-2002-01-08 Miguel de Icaza <miguel@ximian.com>
-
- * test-34.cs: Improve this test to check ref/ref cases.
-
-2002-01-02 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Augment to exercise support for array initialization
- for various other types.
-
-2001-12-30 Miguel de Icaza <miguel@ximian.com>
-
- * test-67.cs: Improve this test.
-
-2001-12-29 Ravi Pratap <ravi@ximian.com>
-
- * test-69.cs : Add. This tests support for methods which are
- internal calls.
-
-2001-12-28 Ravi Pratap <ravi@ximian.com>
-
- * test-34.cs : Update to exercise the new overload resolution
- code.
-
-2001-12-26 Ravi Pratap <ravi@ximian.com>
-
- * test-67.cs : Add. These are tests for explicit layout
- of structs and classes.
-
- * makefile : Update accordingly.
-
-2001-12-25 Ravi Pratap <ravi@ximian.com>
-
- * test-57.cs : Update to exercise more of the code base for
- events.
-
-2001-12-24 Ravi Pratap <ravi@ximian.com>
-
- * test-19.cs : Augment to exercise tests on delegates
- defined in mscorlib.
-
- * test-57.cs : Update to exercise the -= operator
- as well.
-
-2001-12-23 Ravi Pratap <ravi@ximian.com>
-
- * test-57.cs : Update.
-
- * makefile : Update to include the above as it passes nicely.
-
-2001-12-21 Ravi Pratap <ravi@ximian.com>
-
- * test-19.cs : Augment to exercise code which fixed the bug
- where we were not generating a This for the delegate's
- instance expression - for the non-static methods ie.
-
-2001-12-15 Miguel de Icaza <miguel@ximian.com>
-
- * test-45.cs: Make test also use variables as arguments to new;
- We used to have a bug in the compiler that did not resolve some of
- the arguments.
-
-2001-12-15 Ravi Pratap <ravi@ximian.com>
-
- * makefile : Include test-52.cs in the suite, it works fine!
-
- (NO_PASS): It's test-51 which doesn't seem to pass.
-
- * test-50.cs : Augment some more to set named arguments on
- the DllImport attribute.
-
- * test-57.cs : Add. This tests support for Events and does not
- pass yet.
-
-2001-12-14 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Update for float and double initialization.
-
-2001-12-13 Miguel de Icaza <miguel@ximian.com>
-
- * makefile (test-30): Another test moved to the `pass' section.
- This is explicit interface implementation.
-
- (test-54): returning from catch exceptions has been working for
- some time now.
-
-2001-12-09 Radek Doulik <rodo@ximian.com>
-
- * makefile (TEST_SOURCES): added test-55 for using alias directive
-
-2001-12-06 Dietmar Maurer <dietmar@ximian.com>
-
- * makefile: added new target test-jit
-
-2001-12-04 Ravi Pratap <ravi@ximian.com>
-
- * makefile : Update to include test 50 as it now passes.
-
-2001-12-04 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Update for string initialization tests.
-
-2001-12-03 Miguel de Icaza <miguel@ximian.com>
-
- * test-49.cs: Updated to test `goto default'
-
- * test-43.cs: Test break and continue here.
-
- * gen-cast-test.cs: Improved cast test generator.
-
-2001-12-03 Ravi Pratap <ravi@ximian.com>
-
- * test-50.cs : Add. This does not pass yet.
-
-2001-12-02 Ravi Pratap <ravi@ximian.com>
-
- * test-40.cs : Update to now test recursive definitions with
- constants hooked up.
-
-2001-12-01 Ravi Pratap <ravi@ximian.com>
-
- * test-40.cs : Update to do recursive enumeration definition.
-
-2001-11-28 Ravi Pratap <ravi@ximian.com>
-
- * test-48.cs : Add for constant emission tests.
-
- * makefile : Update for the above as it passes nicely :-)
-
-2001-11-22 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Augment some more to test shorthand declaration
- of variables/fields that are array types.
-
-2001-11-20 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Add for array initialization testing.
-
-2001-11-16 Miguel de Icaza <miguel@ximian.com>
-
- * test-34.cs: Improve this test to check if we are actually
- walking over the arguments in foreach.
-
-2001-11-15 Ravi Pratap <ravi@ximian.com>
-
- * makefile : Update to include test-33 again. All tests
- pass again !
-
-2001-11-13 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Re-write to make the tests more robust.
-
-2001-11-12 Ravi Pratap <ravi@ximian.com>
-
- * test-39.cs : Update to test named arguments too.
-
-2001-11-11 Ravi Pratap <ravi@ximian.com>
-
- * test-40.cs : Update to be a little more useful.
-
-2001-11-08 Ravi Pratap <ravi@ximian.com>
-
- * test-39.cs : Add
-
- * test-40.cs : Add
-
- * makefile : Modify to include the above as they pass all tests.
-
-2001-10-31 Ravi Pratap <ravi@ximian.com>
-
- * test-34.cs : Add
-
-2001-10-28 Ravi Pratap <ravi@ximian.com>
-
- * test-32.cs : Added to test array definition and creation.
-
- * makefile : Updated accordingly.
-
-2001-10-22 Ravi Pratap <ravi@ximian.com>
-
- * makefile : New target 'verify' which uses the verifier to check
- that executables produced by us are identical to the MSC produced ones.
-
- * test-7.cs : Update to exercise more overloadable operators.
-
-2001-10-21 Ravi Pratap <ravi@ximian.com>
-
- * test-27.cs : Add to do various implicit and explicit
- reference conversions.
-
- * makefile : Update accordingly.
-
-2001-10-18 Ravi Pratap <ravi@ximian.com>
-
- * test-26.cs : Update to test delegate creation from another
- delegate.
-
-2001-10-17 Ravi Pratap <ravi@ximian.com>
-
- * test-26.cs : Added to demonstrate delegate support.
-
-2001-10-16 Miguel de Icaza <miguel@ximian.com>
-
- * test-25.cs: Added new test to excercise break/continue on
- various loop constructs.
-
- * test-24.cs: Test property use in expression and statement
- contexts.
-
-2001-10-14 Miguel de Icaza <miguel@ximian.com>
-
- * test-23.cs: Added new test for properties.
-
-2001-10-12 Ravi Pratap <ravi@ximian.com>
-
- * test-21.cs : Update to actually do some checking and return
- an appropriate value.
-
-2001-10-11 Ravi Pratap <ravi@ximian.com>
-
- * test-21.cs : Add. This is a test for testing our support
- for nested types
-
-2001-10-05 Ravi Pratap <ravi@ximian.com>
-
- * test-16.cs : Update to exercise the code which selects the best
- conversion operator based on "most encompassing/encompassed type"
-
- * test-7.cs : Update here too.
-
-2001-10-05 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Update to do explicit conversion tests.
-
- * makefile : small fix.
-
-2001-10-03 Ravi Pratap <ravi@ximian.com>
-
- * test-16.cs : Update to make the test more correct.
-
-2001-10-03 Ravi Pratap <ravi@ximian.com>
-
- * test-16.cs : Add.
-
- * makefile : update accordingly.
-
-2001-10-02 Miguel de Icaza <miguel@ximian.com>
-
- * makefile (test-compiler): Add rm *.exe before launching tests.
-
-2001-10-02 Ravi Pratap <ravi@ximian.com>
-
- * test-13.cs : Added.
-
- * makefile : update accordingly.
-
-2001-09-27 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Revamp and add more operator tests. Still in progress.
-
- * test-9,10.cs : Added by Miguel earlier.
-
-2001-09-26 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Update to return an exit code
-
- * test-8.cs : Added by Miguel.
-
-2001-09-25 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Update to include implicit conversion tests.
-
-2001-09-21 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Add.
-
-2001-09-21 Miguel de Icaza <miguel@ximian.com>
-
- * makefile (test-compiler): Abort tests on failure.
-
diff --git a/mcs/tests/c1.cs b/mcs/tests/c1.cs
deleted file mode 100755
index 8b81c046864..00000000000
--- a/mcs/tests/c1.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0146.cs: circular class definition
-// Line: 6
-class A : B {
-}
-
-class B : A {
-}
diff --git a/mcs/tests/c2.cs b/mcs/tests/c2.cs
deleted file mode 100755
index eeeb6f19e74..00000000000
--- a/mcs/tests/c2.cs
+++ /dev/null
@@ -1,2 +0,0 @@
-class X {
-}
diff --git a/mcs/tests/casts.cs b/mcs/tests/casts.cs
deleted file mode 100755
index 8934e4eee7e..00000000000
--- a/mcs/tests/casts.cs
+++ /dev/null
@@ -1,566 +0,0 @@
-using System;
-class Test {
-
- static void receive_int (int a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_uint (uint a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_short (short a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_ushort (ushort a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_long (long a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_ulong (ulong a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_sbyte (sbyte a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_byte (byte a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_char (char a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void probe_int()
- {
- int zero = (int) 0;
- int min = (int) int.MinValue;
- int max = (int) int.MaxValue;
-
- Console.WriteLine ("Testing: int");
-
- Console.WriteLine (" arg: int (int)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (int)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (int)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (int)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (int)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (int)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (int)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (int)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (int)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_uint()
- {
- uint zero = (uint) 0;
- uint min = (uint) uint.MinValue;
- uint max = (uint) uint.MaxValue;
-
- Console.WriteLine ("Testing: uint");
-
- Console.WriteLine (" arg: int (uint)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (uint)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (uint)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (uint)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (uint)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (uint)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (uint)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (uint)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (uint)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_short()
- {
- short zero = (short) 0;
- short min = (short) short.MinValue;
- short max = (short) short.MaxValue;
-
- Console.WriteLine ("Testing: short");
-
- Console.WriteLine (" arg: int (short)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (short)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (short)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (short)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (short)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (short)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (short)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (short)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (short)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_ushort()
- {
- ushort zero = (ushort) 0;
- ushort min = (ushort) ushort.MinValue;
- ushort max = (ushort) ushort.MaxValue;
-
- Console.WriteLine ("Testing: ushort");
-
- Console.WriteLine (" arg: int (ushort)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (ushort)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (ushort)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (ushort)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (ushort)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (ushort)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (ushort)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (ushort)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (ushort)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_long()
- {
- long zero = (long) 0;
- long min = (long) long.MinValue;
- long max = (long) long.MaxValue;
-
- Console.WriteLine ("Testing: long");
-
- Console.WriteLine (" arg: int (long)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (long)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (long)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (long)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (long)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (long)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (long)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (long)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (long)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_ulong()
- {
- ulong zero = (ulong) 0;
- ulong min = (ulong) ulong.MinValue;
- ulong max = (ulong) ulong.MaxValue;
-
- Console.WriteLine ("Testing: ulong");
-
- Console.WriteLine (" arg: int (ulong)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (ulong)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (ulong)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (ulong)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (ulong)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (ulong)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (ulong)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (ulong)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (ulong)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_sbyte()
- {
- sbyte zero = (sbyte) 0;
- sbyte min = (sbyte) sbyte.MinValue;
- sbyte max = (sbyte) sbyte.MaxValue;
-
- Console.WriteLine ("Testing: sbyte");
-
- Console.WriteLine (" arg: int (sbyte)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (sbyte)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (sbyte)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (sbyte)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (sbyte)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (sbyte)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (sbyte)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (sbyte)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (sbyte)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_byte()
- {
- byte zero = (byte) 0;
- byte min = (byte) byte.MinValue;
- byte max = (byte) byte.MaxValue;
-
- Console.WriteLine ("Testing: byte");
-
- Console.WriteLine (" arg: int (byte)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (byte)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (byte)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (byte)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (byte)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (byte)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (byte)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (byte)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (byte)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_char()
- {
- char zero = (char) 0;
- char min = (char) char.MinValue;
- char max = (char) char.MaxValue;
-
- Console.WriteLine ("Testing: char");
-
- Console.WriteLine (" arg: int (char)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (char)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (char)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (char)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (char)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (char)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (char)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (char)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (char)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void Main ()
- {
- probe_int ();
- probe_uint ();
- probe_short ();
- probe_ushort ();
- probe_long ();
- probe_ulong ();
- probe_sbyte ();
- probe_byte ();
- probe_char ();
- }
-}
-
diff --git a/mcs/tests/co1.cs b/mcs/tests/co1.cs
deleted file mode 100755
index da1bdaab246..00000000000
--- a/mcs/tests/co1.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-class X {
- const int x = 1;
- const string s = "Hello";
-}
diff --git a/mcs/tests/cs1.cs b/mcs/tests/cs1.cs
deleted file mode 100755
index bfb3c74b3c8..00000000000
--- a/mcs/tests/cs1.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-class X {
-}
-
-struct Y {
-}
diff --git a/mcs/tests/csc-casts.out b/mcs/tests/csc-casts.out
deleted file mode 100755
index 70ce7135da8..00000000000
--- a/mcs/tests/csc-casts.out
+++ /dev/null
Binary files differ
diff --git a/mcs/tests/gen-cast-test.cs b/mcs/tests/gen-cast-test.cs
deleted file mode 100755
index d1f9531d2f1..00000000000
--- a/mcs/tests/gen-cast-test.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-using System;
-
-class Stress {
-
- static string mode = "unchecked";
-
- static string [] types = {
- "int", "uint",
- "short", "ushort",
- "long", "ulong",
- "sbyte", "byte", "char"
- };
-
-
- static void w (string s)
- {
- Console.Write (s);
- }
-
- static void wl (string s)
- {
- Console.WriteLine (s);
- }
-
- static void generate_receptors ()
- {
- foreach (string t in types){
- w ("\tstatic void receive_" + t + " (" + t + " a)\n\t{\n");
- w ("\t\tConsole.Write (\" \");\n");
- w ("\t\tConsole.WriteLine (a);\n");
- w ("\t}\n\n");
- }
-
- }
-
- static void var (string type, string name, string init)
- {
- w ("\t\t" + type + " " + name + " = (" + type + ") " + init + ";\n");
- }
-
- static void call (string type, string name)
- {
- w ("\t\treceive_" + type + " (" + mode + "((" + type + ") " + name + "));\n");
- }
-
- static void generate_emision ()
- {
- foreach (string type in types){
- w ("\tstatic void probe_" + type + "()\n\t{\n");
- var (type, "zero", "0");
- var (type, "min", type + ".MinValue");
- var (type, "max", type + ".MaxValue");
- wl ("");
-
- wl ("\t\tConsole.WriteLine (\"Testing: " + type + "\");\n");
- foreach (string t in types){
- wl ("\t\tConsole.WriteLine (\" arg: " + t + " (" + type + ")\");\n");
- call (t, "zero");
- call (t, "min");
- call (t, "max");
- }
-
- w ("\t}\n\n");
- }
- }
-
- static void generate_main ()
- {
- wl ("\tstatic void Main ()\n\t{");
-
- foreach (string t in types){
- w ("\t\tprobe_" + t + " ();\n");
- }
- wl ("\t}");
- }
-
- static void Main (string [] args)
- {
- foreach (string arg in args){
- if (arg == "-h" || arg == "--help"){
- Console.WriteLine ("-h, --help Shows help");
- Console.WriteLine ("-c, --checked Generate checked contexts");
- return;
- }
- if (arg == "--checked" || arg == "-c"){
- mode = "checked";
- continue;
- }
- }
- wl ("using System;\nclass Test {\n");
-
- generate_receptors ();
- generate_emision ();
-
- generate_main ();
-
- wl ("}\n");
- }
-}
diff --git a/mcs/tests/gen-check.cs b/mcs/tests/gen-check.cs
deleted file mode 100755
index 9077b141a74..00000000000
--- a/mcs/tests/gen-check.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System;
-
-class Stress {
-
- static string [] types = {
- "int", "uint",
- "short", "ushort",
- "long", "ulong",
- "sbyte", "byte", "char"
- };
-
-
- static void w (string s)
- {
- Console.Write (s);
- }
-
- static void wl (string s)
- {
- Console.WriteLine (s);
- }
-
- static void generate_receptors ()
- {
- foreach (string t in types){
- w ("\tstatic void receive_" + t + " (" + t + " a)\n\t{\n");
- w ("\t\tConsole.Write (\" \");\n");
- w ("\t\tConsole.WriteLine (a);\n");
- w ("\t}\n\n");
- }
-
- }
-
- static void call (string type, string name)
- {
- w ("\t\treceive_" + type + " (checked ((" + type + ") var ));\n");
- }
-
- static void generate_emision ()
- {
- foreach (string type in types){
- w ("\tstatic void probe_" + type + "()\n\t{\n");
- if (type == "char")
- w ("\t\t" + type + " var = (char) 0;");
- else
- w ("\t\t" + type + " var = 0;");
-
- wl ("");
-
- foreach (string t in types)
- call (t, "var");
-
- w ("\t}\n\n");
- }
- }
-
- static void generate_main ()
- {
- wl ("\tstatic void Main ()\n\t{");
-
- foreach (string t in types){
- w ("\t\tprobe_" + t + " ();\n");
- }
- wl ("\t}");
- }
-
- static void Main (string [] args)
- {
- wl ("using System;\nclass Test {\n");
-
- generate_receptors ();
- generate_emision ();
-
- generate_main ();
-
- wl ("}\n");
- }
-}
diff --git a/mcs/tests/i-recursive.cs b/mcs/tests/i-recursive.cs
deleted file mode 100644
index 9c22e5876cc..00000000000
--- a/mcs/tests/i-recursive.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-interface A : B {
-}
-
-interface B : A {
-}
diff --git a/mcs/tests/i-three.cs b/mcs/tests/i-three.cs
deleted file mode 100755
index 7c473f21657..00000000000
--- a/mcs/tests/i-three.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-interface A {
-}
-
-interface B : A{
-}
-
-interface C : A {
-}
-
-interface D : C {
-}
diff --git a/mcs/tests/i-undefined.cs b/mcs/tests/i-undefined.cs
deleted file mode 100644
index 496795cd6db..00000000000
--- a/mcs/tests/i-undefined.cs
+++ /dev/null
@@ -1,2 +0,0 @@
-interface A : B {
-}
diff --git a/mcs/tests/i1.cs b/mcs/tests/i1.cs
deleted file mode 100755
index 00141820820..00000000000
--- a/mcs/tests/i1.cs
+++ /dev/null
@@ -1,2 +0,0 @@
-interface A {
-}
diff --git a/mcs/tests/i2.cs b/mcs/tests/i2.cs
deleted file mode 100755
index 9c22e5876cc..00000000000
--- a/mcs/tests/i2.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-interface A : B {
-}
-
-interface B : A {
-}
diff --git a/mcs/tests/i3.cs b/mcs/tests/i3.cs
deleted file mode 100755
index dff6c54db9d..00000000000
--- a/mcs/tests/i3.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-class X {
-}
-
-interface A : X {
-}
diff --git a/mcs/tests/i4.cs b/mcs/tests/i4.cs
deleted file mode 100755
index f89988f2cb3..00000000000
--- a/mcs/tests/i4.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0509.cs: base class is sealed
-// Line: 7
-struct V {
- int v;
-}
-
-class X : V {
-}
diff --git a/mcs/tests/i5.cs b/mcs/tests/i5.cs
deleted file mode 100755
index e312377061b..00000000000
--- a/mcs/tests/i5.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-class A1 {
-}
-
-class A2 {
-}
-
-class B : A1, A2 {
-}
diff --git a/mcs/tests/i6.cs b/mcs/tests/i6.cs
deleted file mode 100755
index fa20da0ada8..00000000000
--- a/mcs/tests/i6.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs0246.cs: can not find type `B'
-// Line: 4
-class X : D {
-}
diff --git a/mcs/tests/interfaces.cs b/mcs/tests/interfaces.cs
deleted file mode 100755
index 6fcd9ec3061..00000000000
--- a/mcs/tests/interfaces.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-interface X {
-
- // Methods
- new int IntegerMethod (int a, int b);
- new int IntegerMethod (int a, string c);
- new int StringMethod ();
- int A (string b);
-
- // Properties
- new string TheString { get; set; }
- int TheInt { get; }
- int TheInt2 { set; }
- int TheInt3 { set; get; }
-
- // Events
- new event int MyEvent;
- event string MyEvent2;
-
- // Indexers
-}
-
-
diff --git a/mcs/tests/ix1.cs b/mcs/tests/ix1.cs
deleted file mode 100755
index 984391d2fda..00000000000
--- a/mcs/tests/ix1.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-interface INTERFACE {
- string PROPERTY { get; set; }
-}
diff --git a/mcs/tests/ix2.cs b/mcs/tests/ix2.cs
deleted file mode 100755
index c36b52ea2ac..00000000000
--- a/mcs/tests/ix2.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-interface Blah {
- string this [ int INDEX ] { get; set; }
- string Item (int index);
-}
-
-public class Foo {
-
- public static void Main ()
- {
- Console.WriteLine ("foo");
- }
-}
-
diff --git a/mcs/tests/makefile b/mcs/tests/makefile
deleted file mode 100755
index 6b99444a669..00000000000
--- a/mcs/tests/makefile
+++ /dev/null
@@ -1,99 +0,0 @@
-CSC=csc.exe
-
-MCS=../mcs/mcs.exe
-VERIFY=../tools/verifier.exe
-
-TEST_SOURCES = \
- test-1 test-2 test-3 test-4 test-5 test-6 test-7 test-8 test-9 test-10 \
- test-11 test-12 test-13 test-14 test-15 test-16 test-17 test-18 test-19 test-20 \
- test-21 test-22 test-23 test-24 test-25 test-26 test-27 test-28 test-30 \
- test-31 test-32 test-33 test-34 test-35 test-36 test-37 test-39 test-40 \
- test-41 test-42 test-43 test-44 test-45 test-46 test-47 test-48 test-49 test-50 \
- test-51 test-52 test-53 test-54 test-55 test-56 test-57 test-59 \
- test-61 test-62 test-63 test-64 test-65 test-66 test-67 test-68 test-69 test-70 \
- test-71 test-72 test-73 test-74 test-75 test-77 test-78 test-79
-
-UNSAFE_SOURCES = \
- unsafe-1 unsafe-2
-
-TEST_NOPASS = \
- test-29 test-38 test-76
-
-all: test-compiler test-unsafe
-
-test-compiler:
- -rm *.exe
- for i in $(TEST_SOURCES); do \
- if $(MCS) $$i.cs > /dev/null; then \
- if ./$$i.exe; then \
- echo $$i: ok; \
- else \
- echo test $$i failed; exit; \
- fi; \
- else \
- echo compiler failed on $$i; exit; \
- fi \
- done
-
-test-unsafe:
- for i in $(UNSAFE_SOURCES); do \
- if $(MCS) --unsafe $$i.cs > /dev/null; then \
- if ./$$i.exe; then \
- echo $$i: ok; \
- else \
- echo test $$i failed; exit; \
- fi; \
- else \
- echo compiler failed on $$i; exit; \
- fi \
- done
-
-test-jit:
- for i in $(TEST_SOURCES:.cs=.exe); do \
- if mono ./$$i.exe; then \
- echo $$i: ok; \
- else \
- echo test $$i failed; exit; \
- fi \
- done
-
-
-
-verify:
- for i in $(TEST_SOURCES); do \
- if $(MCS) -o mcs-gen-code.exe $$i.cs > /dev/null; then \
- if $(CSC) /out:csc-gen-code.exe $$i.cs > /dev/null; then \
- if $(VERIFY) mcs-gen-code.exe csc-gen-code.exe > /dev/null; then \
- echo $$i: identical assemblies; \
- else \
- echo $$i: unidentical assemblies; exit; \
- fi; \
- fi \
- fi \
- done
-
-
-casts.cs: gen-cast-test.cs
- $(CSC) /out:csc-cast.exe gen-cast-test.cs
- ./csc-cast > casts.cs
-
-casts-csc.exe: casts.cs
- $(CSC) /out:casts-csc.exe casts.cs
-
-casts.exe: casts.cs
- $(MCS) casts.cs
-
-csc-casts.out: casts-csc.exe
- ./casts-csc.exe > csc-casts.out
-
-msc-casts.out: casts.exe
- ./casts.exe > msc-casts.out
-
-test-casts: csc-casts.out msc-casts.out
- cmp csc-casts.out msc-casts.out
-
-clean:
- rm *.exe
- rm *.out
- rm casts.cs
-
diff --git a/mcs/tests/n1.cs b/mcs/tests/n1.cs
deleted file mode 100755
index b47fd24b2ca..00000000000
--- a/mcs/tests/n1.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace A {
- class X {
- void Y () {}
- }
-}
-
-namespace A {
- class XX : X {
- void YY () {}
- }
-}
diff --git a/mcs/tests/n2.cs b/mcs/tests/n2.cs
deleted file mode 100755
index 34c210e1fe7..00000000000
--- a/mcs/tests/n2.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-using System.Collections;
-
-class X : Queue {
-}
diff --git a/mcs/tests/s1.cs b/mcs/tests/s1.cs
deleted file mode 100755
index 6c1191a86a0..00000000000
--- a/mcs/tests/s1.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-struct A {
- int x;
-}
-
-struct B : A {
- int y;
-}
diff --git a/mcs/tests/test-1.cs b/mcs/tests/test-1.cs
deleted file mode 100755
index adb1dd88a92..00000000000
--- a/mcs/tests/test-1.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-class X {
- static int Main (string [] args)
- {
- Console.WriteLine ("Hello, World!");
- return 0;
- }
-}
diff --git a/mcs/tests/test-10.cs b/mcs/tests/test-10.cs
deleted file mode 100644
index 20e1cc6ee81..00000000000
--- a/mcs/tests/test-10.cs
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Test explicit numeric conversions.
- */
-
-using System;
-
-class X {
-
- void asbyte (byte a, ushort b, uint c, ulong d, char e)
- {
- }
-
- void bsbyte ()
- {
- sbyte s = 0;
-
- asbyte ((byte) s, (ushort) s, (uint) s, (ulong) s, (char) s);
- asbyte (checked ((byte) s), checked ((ushort) s), checked ((uint) s), checked ((ulong) s), checked ((char) s));
- }
-
- void abyte (sbyte a, char b)
- {
- }
-
- void bbyte ()
- {
- byte b = 0;
-
- abyte ((sbyte) b, (char) b);
- abyte (checked ((sbyte) b), checked ((char) b));
- }
-
- void ashort (sbyte a, byte b, ushort c, uint d, ulong e, char f)
- {
- }
-
- void bshort ()
- {
- short a = 1;
-
- ashort ((sbyte) a, (byte) a, (ushort) a, (uint) a, (ulong) a, (char) a);
- ashort (checked ((sbyte) a), checked ((byte) a), checked ((ushort) a), checked ((uint) a), checked ((ulong) a), checked ((char) a));
- }
-
- void aushort (sbyte a, byte b, short c, char d)
- {
- }
-
- void bushort ()
- {
- ushort a = 1;
- aushort ((sbyte) a, (byte) a, (short) a, (char) a);
- aushort (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((char) a));
- }
-
- void aint (sbyte a, byte b, short c, ushort d, uint e, ulong f, char g)
- {
- }
-
- void bint ()
- {
- int a = 1;
-
- aint ((sbyte) a, (byte) a, (short) a, (ushort) a, (uint) a, (ulong) a, (char) a);
- aint (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((uint) a), checked ((ulong) a), checked ((char) a));
- }
-
- void auint (sbyte a, byte b, short c, ushort d, int e, char f)
- {
- }
-
- void buint ()
- {
- uint a = 1;
-
- auint ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (char) a);
- auint (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((char) a));
- }
-
- void along (sbyte a, byte b, short c, ushort d, int e, uint f, ulong g, char h)
- {
- }
-
- void blong ()
- {
- long a = 1;
-
- along ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (uint) a, (ulong) a, (char) a);
- along (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((uint) a), checked ((ulong) a), checked ((char) a));
- }
-
- void aulong (sbyte a, byte b, short c, ushort d, int e, uint f, long g, char h)
- {
- }
-
- void bulong ()
- {
- ulong a = 1;
-
- aulong ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (uint) a, (long) a, (char) a);
- aulong (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((uint) a), checked ((long) a), checked ((char) a));
- }
-
- void achar (sbyte a, byte b, short c)
- {
-
- }
-
- void bchar ()
- {
- char a = (char) 1;
-
- achar ((sbyte) a, (byte) a, (short) a);
- achar (checked ((sbyte) a), checked ((byte) a), checked ((short) a));
- }
-
- void afloat (sbyte a, byte b, short c, ushort d, int e, uint f, long ll, ulong g, char h, decimal dd)
- {
- }
-
- void bfloat ()
- {
- float a = 1;
-
- afloat ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (uint) a, (long) a,
- (ulong) a, (char) a, (decimal) a);
- afloat (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((uint) a), checked ((long) a),
-checked ( (ulong) a), checked ((char) a), checked ((decimal) a));
- }
-
- void adouble (sbyte a, byte b, short c, ushort d, int e, uint f, long ll, ulong g, char h,
- float ff, decimal dd)
- {
- }
-
- void bdouble ()
- {
- double a = 1;
-
- adouble ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (uint) a, (long) a,
- (ulong) a, (char) a, (float) a, (decimal) a);
- adouble (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((uint) a), checked ((long) a),
-checked ( (ulong) a), checked ((char) a), checked ((float) a), (decimal) a);
- }
-
- static void Main ()
- {
-
- }
-}
diff --git a/mcs/tests/test-11.cs b/mcs/tests/test-11.cs
deleted file mode 100644
index c122201d472..00000000000
--- a/mcs/tests/test-11.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.IO;
-
-public class Test {
-
- public static int boxtest ()
- {
- int i = 123;
- object o = i;
-// int j = (int) o;
-
-// if (i != j)
-// return 1;
-
- return 0;
- }
-
- public static int Main () {
- if (boxtest () != 0)
- return 1;
-
-
- return 0;
- }
-}
-
-
diff --git a/mcs/tests/test-12.cs b/mcs/tests/test-12.cs
deleted file mode 100644
index b788eb89dd1..00000000000
--- a/mcs/tests/test-12.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Tests the ?: operator and the string concatenation
- */
-
-using System;
-class X {
- static int Main (string [] args)
- {
- string a = "hello";
- string b = "1";
- string c = a + b;
- string d = a + 1;
- string y;
-
- if (c != d)
- return 1;
- if (d != (a + b))
- return 2;
- if (d != x (a, b))
- return 3;
- if (d != x (a, 1))
- return 4;
-
- y = c == d ? "equal" : "not-equal";
- if (y != "equal")
- return 5;
- y = b == a ? "oops" : "nice";
- if (y != "nice")
- return 6;
-
- Console.WriteLine (c);
- return 0;
- }
-
- static string s (string a, int o)
- {
- return a + o;
- }
- static string x (string s, object o)
- {
- return s + o;
- }
-
-}
diff --git a/mcs/tests/test-13.cs b/mcs/tests/test-13.cs
deleted file mode 100644
index f921ae55728..00000000000
--- a/mcs/tests/test-13.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-
-class Foo {
-
- public bool MyMethod ()
- {
- Console.WriteLine ("Base class method !");
- return true;
- }
-}
-
-class Blah : Foo {
-
- public static int Main ()
- {
- Blah k = new Blah ();
-
- Foo i = k;
-
- if (i.MyMethod ())
- return 0;
- else
- return 1;
-
-
- }
-
-}
-
-
-
diff --git a/mcs/tests/test-14.cs b/mcs/tests/test-14.cs
deleted file mode 100644
index dac824b6028..00000000000
--- a/mcs/tests/test-14.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-
-namespace Obj {
- interface Bah {
- int H ();
- }
- class A : Bah {
- public int F () {return 1;}
- public virtual int G () {return 2;}
- public int H () {return 10;}
- }
- class B : A {
- public new int F () {return 3;}
- public override int G () {return 4;}
- public new int H () {return 11;}
- }
- class Test {
- static public int Main () {
- int result = 0;
- B b = new B ();
- A a = b;
- if (a.F () != 1)
- result |= 1 << 0;
- if (b.F () != 3)
- result |= 1 << 1;
- if (b.G () != 4)
- result |= 1 << 2;
- if (a.G () != 4){
- Console.WriteLine ("oops: " + a.G ());
- result |= 1 << 3;
- }
- if (a.H () != 10)
- result |= 1 << 4;
- if (b.H () != 11)
- result |= 1 << 5;
- if (((A)b).H () != 10)
- result |= 1 << 6;
- if (((B)a).H () != 11)
- result |= 1 << 7;
- return result;
- }
- };
-};
diff --git a/mcs/tests/test-15.cs b/mcs/tests/test-15.cs
deleted file mode 100755
index c199bc13bcb..00000000000
--- a/mcs/tests/test-15.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-
-interface Iface {
- void A ();
-}
-
-class Implementor : Iface {
- public void A () {}
-}
-
-class Run {
-
- static int Main ()
- {
- Iface iface;
- Implementor i = new Implementor ();
-
- iface = i;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-16.cs b/mcs/tests/test-16.cs
deleted file mode 100644
index 0b45b1fc5cf..00000000000
--- a/mcs/tests/test-16.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-
-namespace Mine {
-
- public class Blah {
-
- public static int operator + (Blah i, Blah j)
- {
- Console.WriteLine ("Base class binary + operator");
- return 2;
- }
-
- public static implicit operator int (Blah i)
- {
- Console.WriteLine ("Blah->int");
- return 3;
- }
-
- public static implicit operator byte (Blah i)
- {
- Console.WriteLine ("Blah->byte");
- return 0;
- }
-
- public static implicit operator short (Blah i)
- {
- Console.WriteLine ("Blah->short");
- return 1;
- }
-
- }
-
- public class Foo : Blah {
-
- public static int Main ()
- {
- int number = new Foo () + new Foo () ;
- Console.WriteLine (number);
-
- Foo tmp = new Foo ();
-
- int k = tmp;
-
- float f = tmp;
-
- // The following will not work till we fix our UserCast::Emit
- // to convert the return value on the stack.
- if (f == 3)
- Console.WriteLine ("Best implicit conversion selected correctly.");
-
- Console.WriteLine ("F is {0}", f);
-
- if (number == 2 && k == 3)
- return 0;
- else
- return 1;
- }
- }
-}
diff --git a/mcs/tests/test-17.cs b/mcs/tests/test-17.cs
deleted file mode 100755
index c6e2a95745c..00000000000
--- a/mcs/tests/test-17.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// This test excercises user defined conversions and an implicit
-// conversion to a type afterwards.
-//
-//
-using System;
-
-class Blah {
-
- public static int Main ()
- {
- Blah k = new Blah ();
-
- float f = k;
-
- if (f == 2){
- Console.WriteLine ("Best implicit operator selected correctly");
- return 0;
- }
- return 1;
-
- }
-
- public static implicit operator byte (Blah i)
- {
- Console.WriteLine ("Blah->byte");
- return 0;
- }
-
-
- public static implicit operator short (Blah i)
- {
- Console.WriteLine ("Blah->short");
- return 1;
- }
-
- public static implicit operator int (Blah i)
- {
- Console.WriteLine ("Blah->int");
- return 2;
- }
-
-
-}
-
diff --git a/mcs/tests/test-18.cs b/mcs/tests/test-18.cs
deleted file mode 100644
index efa05510a15..00000000000
--- a/mcs/tests/test-18.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-
-class X {
- static int i;
- static int j;
-
- static void m ()
- {
- i = 0;
- j = 0;
-
- try {
- throw new ArgumentException ("Blah");
- } catch (ArgumentException){
- i = 1;
- } catch (Exception){
- i = 2;
- } finally {
- j = 1;
- }
- }
-
- static int Main ()
- {
- m ();
- if (i != 1)
- return 1;
- if (j != 1)
- return 2;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-19.cs b/mcs/tests/test-19.cs
deleted file mode 100755
index 4a49c8fb6fd..00000000000
--- a/mcs/tests/test-19.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-using System;
-using System.Threading;
-using System.Reflection;
-
-class I {
-
- public delegate string GetTextFn (string a);
-
- static public GetTextFn GetText;
-
- static string fn (string s)
- {
- return "(" + s + ")";
- }
-
- static I ()
- {
- GetText = new GetTextFn (fn);
- }
-}
-
-class X {
-
- public delegate int Foo (int i, int j);
-
- private void Thread_func () {
- Console.WriteLine ("Inside the thread !");
- }
-
- public int Func (int i, int j)
- {
- return i+j;
- }
-
- public void Bar ()
- {
- Foo my_func = new Foo (Func);
-
- int result = my_func (2, 4);
-
- Console.WriteLine ("Answer is : " + result);
- }
-
- static bool MyFilter (MemberInfo mi, object criteria)
- {
- Console.WriteLine ("You passed in : " + criteria);
- return true;
- }
-
- public static int Main ()
- {
- I.GetTextFn _ = I.GetText;
-
- Console.WriteLine ("Value: " + I.GetText);
- X x = new X ();
-
- Thread thr = new Thread (new ThreadStart (x.Thread_func));
-
- thr.Start ();
- Console.WriteLine ("Inside main ");
- thr.Join ();
-
- Console.WriteLine (_("Hello"));
-
- x.Bar ();
-
- MemberFilter filter = new MemberFilter (MyFilter);
-
- Type t = x.GetType ();
-
- MemberInfo [] mi = t.FindMembers (MemberTypes.Method, BindingFlags.Static | BindingFlags.NonPublic,
- Type.FilterName, "MyFilter");
-
- Console.WriteLine ("FindMembers called, mi = " + mi);
- Console.WriteLine (" Count: " + mi.Length);
- if (!filter (mi [0], "MyFilter"))
- return 1;
-
- Console.WriteLine ("Test passes");
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-2.cs b/mcs/tests/test-2.cs
deleted file mode 100755
index 0a18d50767b..00000000000
--- a/mcs/tests/test-2.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-class X {
- static int Main (string [] args)
- {
- System.Console.WriteLine ("Hello, World");
- return 0;
- }
-}
diff --git a/mcs/tests/test-20.cs b/mcs/tests/test-20.cs
deleted file mode 100755
index 006bd45075e..00000000000
--- a/mcs/tests/test-20.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// This generates a warning
-//
-using System;
-
-class A {
- public int a;
-
- public void X ()
- {
- a = 1;
- }
-}
-
-class B : A {
- void X ()
- {
- a = 2;
- }
-
- public void TestB ()
- {
- X ();
- }
-}
-
-class Ax {
- public int a;
-
- public virtual void A ()
- {
- a = 1;
- }
-
- public virtual void B ()
- {
- a = 3;
- }
-}
-
-class Bx : Ax {
- public override void A ()
- {
- a = 2;
- }
- public new void B ()
- {
- a = 4;
- }
-}
-class Test {
- static int Main ()
- {
- B b = new B ();
-
- b.TestB ();
- if (b.a != 2)
- return 1;
-
- Bx bx = new Bx ();
- bx.A ();
- if (b.a != 2)
- return 2;
- bx.B ();
- Console.WriteLine ("a="+bx.a);
- if (bx.a != 4)
- return 3;
- return 0;
- }
-}
diff --git a/mcs/tests/test-21.cs b/mcs/tests/test-21.cs
deleted file mode 100644
index cd125497bbb..00000000000
--- a/mcs/tests/test-21.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-
-public class Blah {
-
- public class Foo {
-
- public Foo ()
- {
- Console.WriteLine ("Inside the Foo constructor now");
- }
-
- public int Bar (int i, int j)
- {
- Console.WriteLine ("The Bar method");
- return i+j;
- }
-
-
- }
-
- public static int Main ()
- {
- Foo f = new Foo ();
-
- int j = f.Bar (2, 3);
- Console.WriteLine ("Blah.Foo.Bar returned " + j);
-
- if (j == 5)
- return 0;
- else
- return 1;
-
- }
-
-}
diff --git a/mcs/tests/test-22.cs b/mcs/tests/test-22.cs
deleted file mode 100644
index 2e662494ddd..00000000000
--- a/mcs/tests/test-22.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// This test excercises invocations of methods in structures.
-//
-// Unlike classes, we can not just leave the result of a computed
-// structure in the IL stack as a result. The reason is that the
-// result is the whole structure, not a pointer to it.
-//
-// This program excercises invocations to methods on structures
-//
-
-struct T {
- public int a, b;
-}
-
-struct S {
- T t;
-
- public T GetT ()
- {
- return t;
- }
-
- public void Init ()
- {
- t.a = 1;
- t.b = 2;
- }
-}
-
-class M {
- static int Main ()
- {
- S s = new S ();
-
- s.Init ();
-
- if (s.GetT ().a != 1)
- return 1;
-
- if (s.GetT ().b != 2)
- return 2;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-23.cs b/mcs/tests/test-23.cs
deleted file mode 100644
index 0723c667d95..00000000000
--- a/mcs/tests/test-23.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// Tests properties
-//
-using System;
-
-class X {
- static int v;
-
- static X ()
- {
- v = 10;
- }
-
- public static int Value {
- get {
- return v;
- }
-
- set {
- v = value;
- }
- }
-
- static int Main ()
- {
- if (Value != 10)
- return 1;
-
- Value = 4;
-
- if (Value != 4)
- return 2;
-
- Y y = new Y ("hello");
-
- if (y.Value != "hello")
- return 3;
-
- y.Value = "goodbye";
- if (y.Value != "goodbye")
- return 4;
-
- Z z = new Z ();
-
- if (Z.IVal != 4)
- return 5;
- Z.IVal = 10;
- if (Z.IVal != 10)
- return 6;
-
- z.XVal = 23;
- if (z.XVal != 23)
- return 7;
-
- return 0;
- }
-}
-
-class Y {
- string init;
-
- public Y (string s)
- {
- init = s;
- }
-
- public string Value {
- get {
- return init;
- }
-
- set {
- init = value;
- }
- }
-}
-
-struct Z {
- static int val;
- int xval;
-
- static Z ()
- {
- val = 4;
- }
-
- static public int IVal {
- get {
- return val;
- }
-
- set {
- val= value;
- }
- }
-
- public int XVal {
- get {
- return xval;
- }
-
- set {
- xval = value;
- }
- }
-}
diff --git a/mcs/tests/test-24.cs b/mcs/tests/test-24.cs
deleted file mode 100644
index e69a844c93d..00000000000
--- a/mcs/tests/test-24.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// Properties intermixed in assignments
-//
-
-using System;
-
-class X {
-
- static string v;
-
- static string S {
- get {
- return v;
- }
- set {
- v = value;
- }
- }
-
- static string x, b;
-
- static int Main ()
- {
-
- x = S = b = "hlo";
- if (x != "hlo")
- return 1;
- if (S != "hlo")
- return 2;
- if (b != "hlo")
- return 3;
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-25.cs b/mcs/tests/test-25.cs
deleted file mode 100644
index a01a8daa4f1..00000000000
--- a/mcs/tests/test-25.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Test the various iteration constructs, breaks and continues
-//
-// FIXME: Add foreach and more tests.
-//
-using System;
-
-class X {
-
- static int Main ()
- {
- int i, j, t, k;
-
- for (i = 0; i < 10; i++){
- if (i == 5)
- break;
- }
-
- if (i != 5)
- return 1;
-
- t = 0;
- k = 0;
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++){
- if (j > 3)
- break;
- t++;
-
- if (j >= 1)
- continue;
-
- k++;
- }
- }
-
- if (t != 40)
- return 2;
- if (k != 10)
- return 3;
-
-
- t = 0;
- do {
- if (k == 5)
- continue;
- t++;
- } while (--k > 0);
-
- if (t != 9)
- return 4;
-
- t = 0;
- do {
- t++;
- if (t == 5)
- break;
- } while (k++ < 10);
-
- if (t != 5)
- return 5;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-26.cs b/mcs/tests/test-26.cs
deleted file mode 100644
index 8914ae61a81..00000000000
--- a/mcs/tests/test-26.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-
-public class Blah {
-
- public delegate int MyDelegate (int i, int j);
-
- public int Foo (int i, int j)
- {
- return i+j;
- }
-
- public static int Main ()
- {
- Blah f = new Blah ();
-
- MyDelegate del = new MyDelegate (f.Foo);
-
- MyDelegate another = new MyDelegate (del);
-
- int number = del (2, 3);
-
- int i = another (4, 6);
-
- Console.WriteLine ("Delegate invocation of one returned : " + number);
-
- Console.WriteLine ("Delegate invocation of the other returned : " + i);
-
- if (number == 5 && i == 10)
- return 0;
- else
- return 1;
-
- }
-
-}
diff --git a/mcs/tests/test-27.cs b/mcs/tests/test-27.cs
deleted file mode 100644
index f1bd59b102a..00000000000
--- a/mcs/tests/test-27.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-using System;
-
-public interface Hello {
-
- bool MyMethod (int i);
-}
-
-public interface Another : Hello {
-
- int AnotherMethod (int i);
-}
-
-public class Foo : Hello, Another {
-
- public bool MyMethod (int i)
- {
- if (i == 22)
- return true;
- else
- return false;
- }
-
- public int AnotherMethod (int i)
- {
- return i * 10;
- }
-
-}
-
-public interface ITest {
-
- bool TestMethod (int i, float j);
-}
-
-public class Blah : Foo {
-
- public delegate void MyDelegate (int i, int j);
-
- void Bar (int i, int j)
- {
- Console.WriteLine (i+j);
- }
-
- public static int Main ()
- {
- Blah k = new Blah ();
-
- Foo f = k;
-
- object o = k;
-
- if (f is Foo)
- Console.WriteLine ("I am a Foo!");
-
- Hello ihello = f;
-
- Another ianother = f;
-
- ihello = ianother;
-
- bool b = f.MyMethod (22);
-
- MyDelegate del = new MyDelegate (k.Bar);
-
- del (2, 3);
-
- Delegate tmp = del;
-
- // Explicit reference conversions
-
- MyDelegate adel = (MyDelegate) tmp;
-
- adel (4, 7);
-
- Blah l = (Blah) o;
-
- l.Bar (20, 30);
-
- l = (Blah) f;
-
- l.Bar (2, 5);
-
- f = (Foo) ihello;
-
- // The following cause exceptions even though they are supposed to work
- // according to the spec
-
- // This one sounds ridiculous !
- // ITest t = (ITest) l;
-
- // ITest u = (ITest) ihello;
-
- return 0;
-
- }
-}
-
diff --git a/mcs/tests/test-28.cs b/mcs/tests/test-28.cs
deleted file mode 100644
index def07a59b47..00000000000
--- a/mcs/tests/test-28.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-class X {
- int v1, v2;
-
- int this [int a] {
- get {
- if (a == 0)
- return v1;
- else
- return v2;
- }
-
- set {
- if (a == 0)
- v1 = value;
- else
- v2 = value;
- }
- }
-
- static int Main ()
- {
- X x = new X ();
- int b;
-
- x [0] = 1;
- if (x.v1 != 1)
- return 1;
-
- if (x [0] != 1)
- return 2;
-
- return 0;
-
- }
-}
diff --git a/mcs/tests/test-29.cs b/mcs/tests/test-29.cs
deleted file mode 100644
index 6183126d277..00000000000
--- a/mcs/tests/test-29.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// Versioning, should choose Derived.Add (1)
-//
-using System;
-
-class Base {
- public int val;
-
- public void Add (int x)
- {
- Console.WriteLine ("Incorrect method called");
-
- val = 1;
- }
-}
-
-class Derived : Base {
- public void Add (double x)
- {
- Console.WriteLine ("Calling the derived class with double! Excellent!");
- val = 2;
- }
-}
-
-class Demo {
-
- static int Main ()
- {
- Derived d = new Derived ();
-
- d.Add (1);
- if (d.val == 1)
- return 1;
-
- if (d.val == 2)
- return 0;
- return 2;
-
- }
-}
diff --git a/mcs/tests/test-3.cs b/mcs/tests/test-3.cs
deleted file mode 100755
index 5e7d4e1fab2..00000000000
--- a/mcs/tests/test-3.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-
-public class TestIntOps {
-
- public static sbyte sbyte_add (sbyte a, sbyte b) {
- return (sbyte)(a+b);
- }
-
- public static short short_add (short a, short b) {
- return (short)(a+b);
- }
-
- public static double double_add (double a, double b) {
- return a+b;
- }
-
- public static int int_add (int a, int b) {
- return a+b;
- }
-
- public static int int_sub (int a, int b) {
- return a-b;
- }
-
- public static int int_mul (int a, int b) {
- return a*b;
- }
-
- public static int Main() {
- int num = 1;
-
- if (int_add (1, 1) != 2) return num;
- num++;
-
- if (int_add (31, -1) != 30) return num;
- num++;
-
- if (int_sub (31, -1) != 32) return num;
- num++;
-
- if (int_mul (12, 12) != 144) return num;
- num++;
-
- if (sbyte_add (1, 1) != 2) return num;
- num++;
-
- if (sbyte_add (31, -1) != 30) return num;
- num++;
-
- if (short_add (1, 1) != 2) return num;
- num++;
-
- if (short_add (31, -1) != 30) return num;
- num++;
-
- if (double_add (1.5, 1.5) != 3) return num;
- num++;
-
- // add more meaningful tests
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-30.cs b/mcs/tests/test-30.cs
deleted file mode 100644
index 56c8308c02b..00000000000
--- a/mcs/tests/test-30.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// Tests whether we implement the correct methods from interfaces
-//
-
-using System;
-
-interface IA {
- void Draw ();
-}
-
-interface IB {
- void Draw ();
-}
-
-class X : IA, IB {
- public bool ia_called;
- public bool ib_called;
-
- void IA.Draw ()
- {
- ia_called = true;
- }
-
- void IB.Draw ()
- {
- ib_called = true;
- }
-}
-
-class test {
-
- static int Main ()
- {
- X x = new X ();
-
- ((IA) x).Draw ();
- Console.WriteLine ("IA: " + x.ia_called);
- Console.WriteLine ("IB: " + x.ib_called);
-
- if (x.ib_called)
- return 1;
- if (!x.ia_called)
- return 2;
-
- X y = new X ();
- ((IB) y).Draw ();
- Console.WriteLine ("IA: " + x.ia_called);
- Console.WriteLine ("IB: " + x.ib_called);
-
- if (!y.ib_called)
- return 3;
- if (y.ia_called)
- return 4;
-
- Console.WriteLine ("All tests pass");
- return 0;
- }
-}
-
-
diff --git a/mcs/tests/test-31.cs b/mcs/tests/test-31.cs
deleted file mode 100644
index c7c31fed25e..00000000000
--- a/mcs/tests/test-31.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Versioning test: make sure that we output a warning, but still call the derived
-// method
-//
-using System;
-
-class Base {
- public int which;
-
- public virtual void A ()
- {
- which = 1;
- }
-}
-
-class Derived :Base {
- public virtual void A ()
- {
- which = 2;
- }
-}
-
-class Test {
- static int Main ()
- {
- Derived d = new Derived ();
-
- //
- // This should call Derived.A and output a warning.
- //
- d.A ();
-
-
- if (d.which == 1)
- return 1;
-
- Console.WriteLine ("Test passes");
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-32.cs b/mcs/tests/test-32.cs
deleted file mode 100644
index 94399b230e2..00000000000
--- a/mcs/tests/test-32.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-
-public class Blah {
-
- public static int Main ()
- {
- int [][] i = new int [2][];
-
- int [,][] j = new int [3,6][];
-
- Blah [] k = new Blah [2];
-
- Blah [,][] l = new Blah [3,4][];
-
- Uri [] uri = new Uri [4];
-
- Console.WriteLine ("All arrays successfully created");
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-33.cs b/mcs/tests/test-33.cs
deleted file mode 100644
index 3e908b2ef35..00000000000
--- a/mcs/tests/test-33.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System;
-
-namespace FirstOuter
-{
- namespace FirstInner
- {
- public class First
- {
- public string MyIdentity {
- get {
- return this.GetType().FullName;
- }
- }
- }
- }
-
- public class Second : FirstInner.First {}
-
- namespace SecondInner
- {
- public class Third : FirstOuter.FirstInner.First {}
- }
-
- namespace FirstInner // purposefully again
- {
- public class Fourth : First {} // must understand First in the nom qualified form
- }
-}
-
-public class Fifth : FirstOuter.FirstInner.First {}
-
-class Application
-{
- static int Main(string[] args)
- {
- FirstOuter.FirstInner.First V1 = new FirstOuter.FirstInner.First();
- FirstOuter.Second V2 = new FirstOuter.Second();
- FirstOuter.SecondInner.Third V3 = new FirstOuter.SecondInner.Third();
- FirstOuter.FirstInner.Fourth V4 = new FirstOuter.FirstInner.Fourth();
- Fifth V5 = new Fifth();
-
- Console.WriteLine("V1 is " + V1.MyIdentity);
- Console.WriteLine("V2 is " + V2.MyIdentity);
- Console.WriteLine("V3 is " + V3.MyIdentity);
- Console.WriteLine("V4 is " + V4.MyIdentity);
- Console.WriteLine("V5 is " + V5.MyIdentity);
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-34.cs b/mcs/tests/test-34.cs
deleted file mode 100644
index 2b797fe2fc6..00000000000
--- a/mcs/tests/test-34.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// This test tests both how arguments are selected in the presence
-// of ref/out modifiers and the params arguments.
-//
-using System;
-
-public class Blah {
- static int got;
-
- public static void Foo (ref int i, ref int j)
- {
- got = 1;
- }
-
- public static int Bar (int j, params int [] args)
- {
- got = 2;
- int total = 0;
-
- foreach (int i in args){
- Console.WriteLine ("My argument: " + i);
- total += i;
- }
-
- return total;
- }
-
- public static void Foo (int i, int j)
- {
- got = 3;
- }
-
- static void In (ref int a)
- {
- a++;
- }
-
- static void Out (ref int a)
- {
- In (ref a);
- }
-
- public static int Main ()
- {
- int i = 1;
- int j = 2;
-
- int [] arr = new int [2] { 0, 1 };
-
- Foo (i, j);
- if (got != 3)
- return 1;
-
- Foo (ref i, ref j);
- if (got != 1)
- return 2;
-
- if (Bar (i, j, 5, 4, 3, 3, 2) != 19)
- return 4;
-
- //if (Bar (1, arr) != 1)
- // return 5;
-
- if (got != 2)
- return 3;
-
- int k = 10;
-
- Out (ref k);
- if (k != 11)
- return 10;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-35.cs b/mcs/tests/test-35.cs
deleted file mode 100755
index d9bc1d8338e..00000000000
--- a/mcs/tests/test-35.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// This test checks the !x optimization for if/while/for/do
-//
-class X {
-
- static bool t = true;
- static bool f = false;
- static int j = 0;
-
- static void a ()
- {
- if (!t)
- j = 1;
- }
-
- static void w (int x)
- {
- System.Console.WriteLine (" " + x);
- }
-
- static int Main ()
- {
- int ok = 0, error = 0;
-
- if (!f)
- ok = 1;
- else
- error++;
-
- w (1);
- if (f)
- error++;
- else
- ok |= 2;
-
- w(2);
- if (t)
- ok |= 4;
- else
- error++;
-
- if (!t)
- error++;
- else
- ok |= 8;
-
- if (!(t && f == false))
- error++;
- else
- ok |= 16;
-
- int i = 0;
- w(3);
- do {
- i++;
- } while (!(i > 5));
- if (i != 6)
- error ++;
- else
- ok |= 32;
-
- w(100);
- System.Console.WriteLine ("Value: " + t);
- do {
- i++;
- } while (!t);
-
- System.Console.WriteLine ("Ok=" + ok + " Errors=" + error);
- return ((ok == 63) && (error == 0)) ? 0 : 1;
- }
-}
diff --git a/mcs/tests/test-36.cs b/mcs/tests/test-36.cs
deleted file mode 100755
index 11f52732edc..00000000000
--- a/mcs/tests/test-36.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// This program excercises invoking foreach on structures
-// that implement GetEnumerator
-//
-
-using System;
-using System.Collections;
-struct X {
- int [] a;
-
- public IEnumerator GetEnumerator ()
- {
- a = new int [3] { 1, 2, 3};
- return a.GetEnumerator ();
- }
- }
-
-class Y {
- static X x;
-
- static int Main ()
- {
- int total = 0;
- x = new X ();
-
- foreach (object a in x){
- total += (int) a;
- }
-
- if (total != 6)
- return 1;
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-37.cs b/mcs/tests/test-37.cs
deleted file mode 100755
index 91f54f4d9a0..00000000000
--- a/mcs/tests/test-37.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// This test excercises array access on single dimension, multi-dimension
-// and jagged arrays.
-//
-using System;
-
-class X {
- static void m (int [] a)
- {
- a [0] = 0xdead;
- }
-
- static int test_int_single_dim ()
- {
- int [] a = new int [10];
- int i;
-
- for (i = 0; i < 10; i++)
- a [i] = i;
-
- m (a);
-
- if (a [0] != 0xdead)
- return 1;
-
- a [0] = 0;
- for (i = 9; i >= 0; i--){
- if (a [i] != i)
- return 2;
- }
- return 0;
- }
-
- static int simple_test_double_dim ()
- {
- int [,] b = new int [10, 10];
-
- b [0, 0] = 1;
- b [4, 4] = 1;
-
- if (b [0, 0] != b [4, 4])
- return 20;
- if (b [1, 1] != b [5, 5])
- return 21;
-
- return 0;
- }
-
-// static void dd (int [,] b)
-// {
-// int i, j;
-//
-// for (i = 0; i < 10; i++)
-// for (j = 0; j < 10; j++)
-// b [i, j] = b [i, j] + 1;
-// }
-//
-// static int test_int_double_dim ()
-// {
-// int [,] b = new int [10,10];
-// int i, j;
-//
-// for (i = 0; i < 10; i++)
-// for (j = 0; j < 10; j++)
-// b [i,j] = i * 10 + j;
-//
-// dd (b);
-//
-// for (i = 0; i < 10; i++)
-// for (j = 0; j < 10; j++)
-// if (b [i,j] != i *10 + j + 1){
-// Console.WriteLine ("Expecting " + (i * 10 + j + 1) + "got: " + b [i,j]);
-// return 10;
-// }
-//
-// return 0;
-// }
-
-// static int test_jagged ()
-// {
-// int [][] a = new int [10][];
-// int i;
-//
-// for (i = 0; i < 10; i++){
-// if (a [i] != null)
-// return 20;
-//
-// a [i] = new int [10];
-//
-// for (int j = 0; j < 10; j++){
-// int q;
-// a [i][j] = j * 10;
-// q = a [i][j] = j * 10;
-//
-// a [i][j]++;
-//
-// if (a [i][j] != q + 1)
-// return 21;
-// }
-// }
-//
-// return 0;
-// }
-
- static int Main ()
- {
- int v;
-
- Console.WriteLine ("hello");
- return 0;
-
- v = test_int_single_dim ();
-
- if (v != 0)
- return v;
-
- // v = test_int_double_dim ();
- // if (v != 0)
- // return v;
- //
- // v = test_jagged ();
-
- v = simple_test_double_dim ();
- if (v != 0)
- return v;
-
- int [] a = new int [10];
- int i;
- for (i = 0; i < 10; i++){
- a [i] = i;
- // a [i]++;
- // Console.WriteLine ("Should be: " + (i + 1) + " it is = " + a [i]);
- }
- return 0;
- }
-}
diff --git a/mcs/tests/test-38.cs b/mcs/tests/test-38.cs
deleted file mode 100755
index 69dbbc3f936..00000000000
--- a/mcs/tests/test-38.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-class X {
- int v1, v2;
-
- int this [int a] {
- get {
- if (a == 0)
- return v1;
- else
- return v2;
- }
-
- set {
- if (a == 0)
- v1 = value;
- else
- v2 = value;
- }
- }
-
- static int Main ()
- {
- X x = new X ();
- int b;
-
- x [0] = x [1] = 1;
- x [0] = 1;
- if (x.v1 != 1)
- return 1;
-
- if (x [0] != 1)
- return 2;
-
- return 0;
-
- }
-}
diff --git a/mcs/tests/test-39.cs b/mcs/tests/test-39.cs
deleted file mode 100644
index c4bddab5264..00000000000
--- a/mcs/tests/test-39.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-[AttributeUsage (AttributeTargets.Class, AllowMultiple = true)]
- public class SimpleAttribute : Attribute {
-
- string name = null;
-
- public string MyNamedArg;
-
- private string secret;
-
- public SimpleAttribute (string name)
- {
- this.name = name;
- }
-
- public string AnotherArg {
- get {
- return secret;
- }
- set {
- secret = value;
- }
- }
-
- }
-
-[Simple ("Dummy", MyNamedArg = "Dude!")]
-[Simple ("Daya", MyNamedArg = "Raj", AnotherArg = "Foo")]
- public class Blah {
-
- public static int Main ()
- {
- Console.WriteLine ("A dummy app which tests attribute emission");
- return 0;
- }
- }
-
-
diff --git a/mcs/tests/test-4.cs b/mcs/tests/test-4.cs
deleted file mode 100755
index 3023f6e9d1b..00000000000
--- a/mcs/tests/test-4.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-class X {
- bool sbyte_selected;
- bool int_selected;
-
- void test (sbyte s)
- {
- sbyte_selected = true;
- }
-
- void test (int i)
- {
- int_selected = true;
- }
-
- static int Main ()
- {
- X x = new X ();
-
- x.test (1);
- if (x.sbyte_selected){
- Console.WriteLine ("FAILED: Sbyte selected on constant int argument");
- return 1;
- } else {
- Console.WriteLine ("OK: int selected for constant int");
- }
-
- X y = new X ();
- sbyte s = 10;
-
- y.test (s);
- if (y.sbyte_selected){
- Console.WriteLine ("OK: sbyte selected for sbyte argument");
- } else {
- Console.WriteLine ("FAILED: sbyte not selected for sbyte argument");
- return 1;
- }
- return 0;
- }
-}
diff --git a/mcs/tests/test-40.cs b/mcs/tests/test-40.cs
deleted file mode 100644
index d640c5a4970..00000000000
--- a/mcs/tests/test-40.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using System;
-
-public class Blah {
-
- enum Bar {
- a = MyEnum.Foo,
- b = A.c,
- c = MyEnum.Bar,
- d = myconstant
- }
-
- public enum MyEnum : byte {
- Foo = 254,
- Bar = B.y
- }
-
- enum A {
- a, b, c
- }
-
- enum B {
- x, y, z
- }
-
- enum AA : byte { a, b }
- enum BB : ulong { x, y }
-
- const int myconstant = 30;
-
- public static int Main ()
- {
- byte b = (byte) MyEnum.Foo;
-
- Console.WriteLine ("Foo has a value of " + b);
-
- if (b != 254)
- return 1;
-
- int i = (int) A.a;
- int j = (int) B.x;
- int k = (int) A.c;
- int l = (int) AA.b + 1;
-
- if (i != j)
- return 1;
-
- if (k != l)
- return 1;
-
- A var = A.b;
-
- i = (int) Bar.a;
-
- if (i != 254)
- return 1;
-
- i = (int) Bar.b;
-
- if (i != 2)
- return 1;
-
- j = (int) Bar.c;
-
- if (j != 1)
- return 1;
-
- j = (int) Bar.d;
-
- if (j != 30)
- return 1;
-
- Console.WriteLine ("Enum emission test okay");
- return 0;
- }
-}
diff --git a/mcs/tests/test-41.cs b/mcs/tests/test-41.cs
deleted file mode 100644
index cdf1fd45f89..00000000000
--- a/mcs/tests/test-41.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// This tests the ref access to parameters
-//
-using System;
-
-class X {
-
- static void A (ref int a, ref uint b, ref sbyte c, ref byte d, ref long e, ref ulong f,
- ref short g, ref ushort h, ref char i, ref X x, ref float j, ref double k)
- {
- if (a == 1)
- a = 2;
-
- if (b == 1)
- b = 2;
-
- if (c == 1)
- c = 2;
-
- if (d == 1)
- d = 2;
-
- if (e == 1)
- e = 2;
-
- if (f == 1)
- f = 2;
-
- if (g == 1)
- g = 2;
-
- if (h == 1)
- h = 2;
-
- if (i == 'a')
- i = 'b';
-
- if (x == null)
- x = new X ();
-
- if (j == 1.0)
- j = 2.0F;
- if (k == 1.0)
- k = 2.0;
- }
-
- static int Main ()
- {
- int a = 1;
- uint b = 1;
- sbyte c = 1;
- byte d = 1;
- long e = 1;
- ulong f = 1;
- short g = 1;
- ushort h = 1;
- char i = 'a';
- float j = 1.0F;
- double k = 1.0;
- X x = null;
-
- A (ref a, ref b, ref c, ref d, ref e, ref f, ref g, ref h, ref i, ref x, ref j, ref k);
-
- if (a != 2)
- return 1;
- if (b != 2)
- return 2;
- if (c != 2)
- return 3;
- if (d != 2)
- return 4;
- if (e != 2)
- return 5;
- if (f != 2)
- return 6;
- if (g != 2)
- return 7;
- if (h != 2)
- return 8;
- if (i != 'b')
- return 9;
- if (j != 2.0)
- return 10;
- if (k != 2.0)
- return 11;
- if (x == null)
- return 12;
-
- Console.WriteLine ("Test passed");
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-42.cs b/mcs/tests/test-42.cs
deleted file mode 100755
index 684324b8f93..00000000000
--- a/mcs/tests/test-42.cs
+++ /dev/null
@@ -1,184 +0,0 @@
-//
-// This test exercises the various ways in which mutator operators can be
-// used in C# and the various different scenarios that the compiler would
-// have to deal with
-//
-// variables, linear arrays, multi-dimensional arrays, jagged arrays,
-// properties, indexers and overloaded ++ and --
-//
-
-class X {
-
- public int v, p;
- public int idx;
-
- public int this [int n] {
- get {
- idx = n;
- return v;
- }
- set {
- idx = n;
- v = value;
- }
- }
-
- public int P {
- get {
- return p;
- }
-
- set {
- p = value;
- }
- }
-
-}
-
-class Z {
- int v;
-
- public Z P {
- get {
- return null;
- }
-
- set {
- }
- }
-
- static public Z operator ++ (Z v)
- {
- v.v++;
- return v;
- }
-}
-
-class Y {
-
- static int p_pre_increment (X x)
- {
- return ++x.P;
- }
-
- static int p_post_increment (X x)
- {
- return x.P++;
- }
-
- static int i_pre_increment (X x)
- {
- return ++x [100];
- }
-
- static int i_post_increment (X x)
- {
- return x [14]++;
- }
-
- static Z overload_increment (Z z)
- {
- return z++;
- }
-
- static Z overload_pre_increment (Z z)
- {
- return ++z;
- }
-
- static Z ugly (Z z)
- {
- return z.P++;
- }
-
- //
- // Tests the ++ and -- operators on integers
- //
- static int simple (int i)
- {
- if (++i != 11)
- return 1;
- if (--i != 10)
- return 2;
- if (i++ != 10)
- return 3;
- if (i-- != 11)
- return 4;
- return 0;
- }
-
- static int arrays ()
- {
- int [] a = new int [10];
- int i, j;
-
- for (i = 0; i < 10; i++)
- a [i]++;
-
- for (i = 0; i < 10; i++)
- if (a [i] != 1)
- return 100;
-
- int [,] b = new int [10,10];
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++){
- b [i,j] = i * 10 + j;
- if (i < 5)
- b [i,j]++;
- else
- ++b [i,j];
- }
- }
-
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++){
- if (b [i,j] != i * 10 + (j + 1))
- return 101;
- }
- }
-
- return 0;
- }
-
- static int Main ()
- {
- X x = new X ();
- int c;
-
- if ((c = simple (10)) != 0)
- return c;
-
- if (i_pre_increment (x) != 1)
- return 5;
-
- if (x.idx != 100)
- return 6;
-
- if (i_post_increment (x) != 1)
- return 7;
-
- if (x.idx != 14)
- return 8;
-
- if (p_pre_increment (x) != 1)
- return 9;
-
- if (x.p != 1)
- return 10;
-
- if (p_post_increment (x) != 1)
- return 10;
-
- if (x.p != 2)
- return 11;
-
- Z z = new Z();
-
- overload_increment (z);
-
- arrays ();
-
- return 0;
- }
-
-}
diff --git a/mcs/tests/test-43.cs b/mcs/tests/test-43.cs
deleted file mode 100755
index 7d8deffe812..00000000000
--- a/mcs/tests/test-43.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// This test is used for testing the foreach array support
-//
-using System;
-
-class X {
-
- static int test_single (int [] a)
- {
- int total = 0;
-
- foreach (int i in a)
- total += i;
-
- return total;
- }
-
- static int test_continue (int [] a)
- {
- int total = 0;
- int j = 0;
-
- foreach (int i in a){
- j++;
- if (j == 5)
- continue;
- total += i;
- }
-
- return total;
- }
-
- static int test_break (int [] a)
- {
- int total = 0;
- int j = 0;
-
- foreach (int i in a){
- j++;
- if (j == 5)
- break;
- total += i;
- }
-
- return total;
- }
-
- static int Main ()
- {
- int [] a = new int [10];
- int [] b = new int [2];
-
- for (int i = 0; i < 10; i++)
- a [i] = 10 + i;
-
- for (int j = 0; j < 2; j++)
- b [j] = 50 + j;
-
- if (test_single (a) != 145)
- return 1;
-
- if (test_single (b) != 101)
- return 2;
-
- if (test_continue (a) != 131){
- Console.WriteLine ("Expecting: 131, got " + test_continue (a));
- return 3;
- }
-
- if (test_break (a) != 46){
- Console.WriteLine ("Expecting: 46, got " + test_break (a));
- return 4;
- }
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-44.cs b/mcs/tests/test-44.cs
deleted file mode 100755
index c1b896a5814..00000000000
--- a/mcs/tests/test-44.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// This test shows that the current way in which we handle blocks
-// and statements is broken. The b [q,w] code is only executed 10
-// times instead of a 100
-//
-using System;
-
-class X {
-
- static int dob (int [,]b)
- {
- int total = 0;
-
- foreach (int i in b)
- total += i;
-
- return total;
- }
-
- //
- // This tests typecasting from an object to an array of ints
- // and then doing foreach
- //
- static int count (object o)
- {
- int total = 0;
-
- foreach (int i in (int []) o)
- total += i;
-
- return total;
- }
-
- static int Main ()
- {
- int [,] b = new int [10,10];
-
- for (int q = 0; q < 10; q++)
- for (int w = 0; w < 10; w++)
- b [q,w] = q * 10 + w;
-
- if (dob (b) != 4950)
- return 1;
-
- int [] a = new int [10];
- for (int i = 0; i < 10; i++)
- a [i] = 2;
-
- if (count (a) != 20)
- return 2;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-45.cs b/mcs/tests/test-45.cs
deleted file mode 100644
index 9d50a9c9420..00000000000
--- a/mcs/tests/test-45.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-using System;
-
-public class Blah {
-
- private static int[] array = {0, 1, 2, 3};
-
- private static int [,] bar = { {0,1}, {4,5}, {10,20} };
-
- static string [] names = {
- "Miguel", "Paolo", "Dietmar", "Dick", "Ravi"
- };
-
- public static int Main ()
- {
- int [] i = new int [4] { 0, 1, 2, 3 };
-
- short [,] j = new short [4,2] { {0,1}, {2,3}, {4,5}, {6,7} };
-
- ushort [] a = { 4, 5, 6, 7 };
-
- long [,,] m = new long [2,3,2] {{{0,1}, {2,3}, {4,5}}, {{6,7}, {8,9}, {10,11}}};
-
- int foo = 1;
- int [] k = new int [] { foo, foo+1, foo+4 };
-
- int [,] boo = new int [,] {{foo, foo+10}, {foo+3, foo+10}};
-
- float [] f_array = new float [] { 1.23F, 4.5F, 6.24F };
-
- double [] double_arr = new double [] { 34.4567, 90.1226, 54.9823 };
-
- char [] c_arr = { 'A', 'B', 'C', 'M', 'R' };
-
- byte [] b_arr = { 0, 3, 8, 10, 21 };
-
- sbyte [] s_arr = { 10, 15, 30, 123 };
-
- if (a [2] != 6)
- return 1;
-
- if (s_arr [3] != 123)
- return 2;
-
- if (i [2] != 2)
- return 1;
-
- if (j [1,1] != 3)
- return 1;
-
- for (int t = 0; t < 4; ++t) {
- if (array [t] != t)
- return 1;
-
- if (a [t] != (t + 4))
- return 1;
- }
-
- if (bar [2,1] != 20)
- return 1;
-
- if (k [2] != 5)
- return 1;
-
- if (m [1,1,1] != 9)
- return 1;
-
- if (boo [0,1] != 11)
- return 1;
-
- if (f_array [0] != 1.23F)
- return 1;
-
- if (double_arr [1] != 90.1226)
- return 1;
-
- foreach (string s in names)
- Console.WriteLine ("Hello, " + s);
-
- if (names [0] != "Miguel")
- return 1;
-
- if (c_arr [4] != 'R')
- return 2;
-
- int count = 10;
-
- int [] x = new int [count];
-
- for (int idx = 0; idx < count; idx++)
- x [idx] = idx + 1;
-
- for (int idx = count; idx > 0; ){
- idx--;
- if (x [idx] != idx + 1)
- return 12;
- }
- Console.WriteLine ("Array initialization test okay.");
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-46.cs b/mcs/tests/test-46.cs
deleted file mode 100755
index 6a4aa000a0b..00000000000
--- a/mcs/tests/test-46.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// This test probes the various explicit unboxing casts
-//
-using System;
-
-class X {
- static int cast_int (object o) { return (int) o; }
- static uint cast_uint (object o) { return (uint) o; }
- static short cast_short (object o) { return (short) o; }
- static char cast_char (object o) { return (char) o; }
- static ushort cast_ushort (object o) { return (ushort) o; }
- static byte cast_byte (object o) { return (byte) o; }
- static sbyte cast_sbyte (object o) { return (sbyte) o; }
- static long cast_long (object o) { return (long) o; }
- static ulong cast_ulong (object o) { return (ulong) o; }
- static float cast_float (object o) { return (float) o; }
- static double cast_double (object o) { return (double) o; }
- static bool cast_bool (object o) { return (bool) o; }
-
- static int Main ()
- {
- if (cast_int ((object) -1) != -1)
- return 1;
- if (cast_int ((object) 1) != 1)
- return 2;
- if (cast_int ((object) Int32.MaxValue) != Int32.MaxValue)
- return 1;
- if (cast_int ((object) Int32.MinValue) != Int32.MinValue)
- return 2;
- if (cast_int ((object) 0) != 0)
- return 3;
-
- if (cast_uint ((object) (uint)0) != 0)
- return 4;
- if (cast_uint ((object) (uint) 1) != 1)
- return 5;
- if (cast_uint ((object) (uint) UInt32.MaxValue) != UInt32.MaxValue)
- return 6;
- if (cast_uint ((object) (uint) UInt32.MinValue) != UInt32.MinValue)
- return 7;
-
- if (cast_ushort ((object) (ushort) 1) != 1)
- return 8;
- if (cast_ushort ((object) (ushort) UInt16.MaxValue) != UInt16.MaxValue)
- return 9;
- if (cast_ushort ((object) (ushort) UInt16.MinValue) != UInt16.MinValue)
- return 10;
- if (cast_ushort ((object) (ushort) 0) != 0)
- return 11;
-
- if (cast_short ((object) (short)-1) != -1)
- return 12;
- if (cast_short ((object) (short) 1) != 1)
- return 13;
- if (cast_short ((object) (short) Int16.MaxValue) != Int16.MaxValue)
- return 14;
- if (cast_short ((object) (short) Int16.MinValue) != Int16.MinValue)
- return 15;
- if (cast_short ((object) (short) 0) != 0)
- return 16;
-
- if (cast_byte ((object) (byte)1) != 1)
- return 17;
- if (cast_byte ((object) (byte) Byte.MaxValue) != Byte.MaxValue)
- return 18;
- if (cast_byte ((object) (byte) Byte.MinValue) != Byte.MinValue)
- return 19;
- if (cast_byte ((object) (byte) 0) != 0)
- return 20;
-
- if (cast_sbyte ((object) (sbyte) -1) != -1)
- return 21;
- if (cast_sbyte ((object) (sbyte) 1) != 1)
- return 22;
- if (cast_sbyte ((object) (sbyte) SByte.MaxValue) != SByte.MaxValue)
- return 23;
- if (cast_sbyte ((object) (sbyte)SByte.MinValue) != SByte.MinValue)
- return 24;
- if (cast_sbyte ((object) (sbyte) 0) != 0)
- return 25;
-
-
- if (cast_long ((object) (long) -1) != -1)
- return 26;
- if (cast_long ((object) (long) 1) != 1)
- return 27;
- if (cast_long ((object) (long) Int64.MaxValue) != Int64.MaxValue)
- return 28;
- if (cast_long ((object) (long) Int64.MinValue) != Int64.MinValue)
- return 29;
- if (cast_long ((object) (long) 0) != 0)
- return 30;
-
- if (cast_ulong ((object) (ulong) 0) != 0)
- return 31;
- if (cast_ulong ((object) (ulong) 1) != 1)
- return 32;
- if (cast_ulong ((object) (ulong) UInt64.MaxValue) != UInt64.MaxValue)
- return 33;
- if (cast_ulong ((object) (ulong) UInt64.MinValue) != UInt64.MinValue)
- return 34;
-
- if (cast_double ((object) (double) -1) != -1)
- return 35;
- if (cast_double ((object) (double) 1) != 1)
- return 36;
- if (cast_double ((object) (double) Double.MaxValue) != Double.MaxValue)
- return 37;
- if (cast_double ((object) (double) Double.MinValue) != Double.MinValue)
- return 38;
- if (cast_double ((object) (double) 0) != 0)
- return 39;
-
- if (cast_float ((object) (float) -1) != -1)
- return 40;
- if (cast_float ((object) (float) 1) != 1)
- return 41;
- if (cast_float ((object) (float)Single.MaxValue) != Single.MaxValue)
- return 42;
- if (cast_float ((object) (float) Single.MinValue) != Single.MinValue)
- return 43;
- if (cast_float ((object) (float) 0) != 0)
- return 44;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-47.cs b/mcs/tests/test-47.cs
deleted file mode 100755
index c269d0b6c71..00000000000
--- a/mcs/tests/test-47.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// Short-circuit evaluation tests
-//
-using System;
-
-class X {
-
- static int t_count = 0;
- static int f_count = 0;
-
- static bool f ()
- {
- Console.WriteLine ("f");
- f_count++;
- return false;
- }
-
- static bool t ()
- {
- Console.WriteLine ("t");
- t_count++;
- return true;
- }
-
- static int Main ()
- {
- if (t () && t ()){
- f_count--;
- }
-
- if (t_count != 2)
- return 1;
-
- if (f_count != -1)
- return 3;
-
- f_count = 0;
-
- if (t () && f ())
- if (t_count != 3 && f_count == 1)
- return 2;
-
- if (f () && f ())
- return 3;
-
- if (f_count != 2)
- return 4;
-
- if (f () && t ())
- return 5;
-
- if (f_count != 3)
- return 6;
-
- if (t_count != 3)
- return 7;
-
- //
- // reset
- //
- Console.WriteLine ("or");
-
- t_count = f_count = 0;
-
- if (t () || t ()){
- if (t_count != 1)
- return 8;
- } else
- return 9;
-
- if (t () || f ()){
- if (f_count != 0)
- return 10;
- if (t_count != 2)
- return 16;
- } else
- return 11;
-
- if (f () || f ()){
- return 12;
- } else
- if (f_count != 2)
- return 13;
-
- if (f () || t ()){
- if (f_count != 3)
- return 15;
- if (t_count != 3)
- return 17;
- } else
- return 14;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-48.cs b/mcs/tests/test-48.cs
deleted file mode 100644
index 21b6857ba6c..00000000000
--- a/mcs/tests/test-48.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-
-public class Blah {
-
- public const int i = 5;
-
- public static int Main ()
- {
- const int foo = 10;
-
- int j = Blah.i;
-
- if (j != 5)
- return 1;
-
- if (foo != 10)
- return 1;
-
- for (int i = 0; i < 5; ++i){
- const int bar = 15;
-
- Console.WriteLine (bar);
- Console.WriteLine (foo);
- }
-
- Console.WriteLine ("Constant emission test okay");
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-49.cs b/mcs/tests/test-49.cs
deleted file mode 100755
index 1a479853145..00000000000
--- a/mcs/tests/test-49.cs
+++ /dev/null
@@ -1,467 +0,0 @@
-//
-// This tests excercises a number of switch things:
-//
-// Code to test for multiple-labels is different that
-// code for a single label.
-//
-// Code for switching on strings is different from the integer
-// code.
-//
-// nulls (for strings) need to be handled specially since ceq will
-// throw an exception if there.
-//
-// null as a case statement needs to be caught specially
-//
-using System;
-
-class X {
- enum A {
- a = 23333,
- }
-
- static int s (byte b)
- {
- switch (b){
- case 0: return 255-0;
- case 1: return 255-1;
- case 2: return 255-2;
- case 3: return 255-3;
- case 4: return 255-4;
- case 5: return 255-5;
- case 6: return 255-6;
- case 7: return 255-7;
- case 8: return 255-8;
- case 9: return 255-9;
- case 10: return 255-10;
- case 11: return 255-11;
- case 12: return 255-12;
- case 13: return 255-13;
- case 14: return 255-14;
- case 15: return 255-15;
- case 16: return 255-16;
- case 17: return 255-17;
- case 18: return 255-18;
- case 19: return 255-19;
- case 20: return 255-20;
- case 21: return 255-21;
- case 22: return 255-22;
- case 23: return 255-23;
- case 24: return 255-24;
- case 25: return 255-25;
- case 26: return 255-26;
- case 27: return 255-27;
- case 28: return 255-28;
- case 29: return 255-29;
- case 30: return 255-30;
- case 31: return 255-31;
- case 32: return 255-32;
- case 33: return 255-33;
- case 34: return 255-34;
- case 35: return 255-35;
- case 36: return 255-36;
- case 37: return 255-37;
- case 38: return 255-38;
- case 39: return 255-39;
- case 40: return 255-40;
- case 41: return 255-41;
- case 42: return 255-42;
- case 43: return 255-43;
- case 44: return 255-44;
- case 45: return 255-45;
- case 46: return 255-46;
- case 47: return 255-47;
- case 48: return 255-48;
- case 49: return 255-49;
- case 50: return 255-50;
- case 51: return 255-51;
- case 52: return 255-52;
- case 53: return 255-53;
- case 54: return 255-54;
- case 55: return 255-55;
- case 56: return 255-56;
- case 57: return 255-57;
- case 58: return 255-58;
- case 59: return 255-59;
- case 60: return 255-60;
- case 61: return 255-61;
- case 62: return 255-62;
- case 63: return 255-63;
- case 64: return 255-64;
- case 65: return 255-65;
- case 66: return 255-66;
- case 67: return 255-67;
- case 68: return 255-68;
- case 69: return 255-69;
- case 70: return 255-70;
- case 71: return 255-71;
- case 72: return 255-72;
- case 73: return 255-73;
- case 74: return 255-74;
- case 75: return 255-75;
- case 76: return 255-76;
- case 77: return 255-77;
- case 78: return 255-78;
- case 79: return 255-79;
- case 80: return 255-80;
- case 81: return 255-81;
- case 82: return 255-82;
- case 83: return 255-83;
- case 84: return 255-84;
- case 85: return 255-85;
- case 86: return 255-86;
- case 87: return 255-87;
- case 88: return 255-88;
- case 89: return 255-89;
- case 90: return 255-90;
- case 91: return 255-91;
- case 92: return 255-92;
- case 93: return 255-93;
- case 94: return 255-94;
- case 95: return 255-95;
- case 96: return 255-96;
- case 97: return 255-97;
- case 98: return 255-98;
- case 99: return 255-99;
- case 100: return 255-100;
- case 101: return 255-101;
- case 102: return 255-102;
- case 103: return 255-103;
- case 104: return 255-104;
- case 105: return 255-105;
- case 106: return 255-106;
- case 107: return 255-107;
- case 108: return 255-108;
- case 109: return 255-109;
- case 110: return 255-110;
- case 111: return 255-111;
- case 112: return 255-112;
- case 113: return 255-113;
- case 114: return 255-114;
- case 115: return 255-115;
- case 116: return 255-116;
- case 117: return 255-117;
- case 118: return 255-118;
- case 119: return 255-119;
- case 120: return 255-120;
- case 121: return 255-121;
- case 122: return 255-122;
- case 123: return 255-123;
- case 124: return 255-124;
- case 125: return 255-125;
- case 126: return 255-126;
- case 127: return 255-127;
- case 128: return 255-128;
- case 129: return 255-129;
- case 130: return 255-130;
- case 131: return 255-131;
- case 132: return 255-132;
- case 133: return 255-133;
- case 134: return 255-134;
- case 135: return 255-135;
- case 136: return 255-136;
- case 137: return 255-137;
- case 138: return 255-138;
- case 139: return 255-139;
- case 140: return 255-140;
- case 141: return 255-141;
- case 142: return 255-142;
- case 143: return 255-143;
- case 144: return 255-144;
- case 145: return 255-145;
- case 146: return 255-146;
- case 147: return 255-147;
- case 148: return 255-148;
- case 149: return 255-149;
- case 150: return 255-150;
- case 151: return 255-151;
- case 152: return 255-152;
- case 153: return 255-153;
- case 154: return 255-154;
- case 155: return 255-155;
- case 156: return 255-156;
- case 157: return 255-157;
- case 158: return 255-158;
- case 159: return 255-159;
- case 160: return 255-160;
- case 161: return 255-161;
- case 162: return 255-162;
- case 163: return 255-163;
- case 164: return 255-164;
- case 165: return 255-165;
- case 166: return 255-166;
- case 167: return 255-167;
- case 168: return 255-168;
- case 169: return 255-169;
- case 170: return 255-170;
- case 171: return 255-171;
- case 172: return 255-172;
- case 173: return 255-173;
- case 174: return 255-174;
- case 175: return 255-175;
- case 176: return 255-176;
- case 177: return 255-177;
- case 178: return 255-178;
- case 179: return 255-179;
- case 180: return 255-180;
- case 181: return 255-181;
- case 182: return 255-182;
- case 183: return 255-183;
- case 184: return 255-184;
- case 185: return 255-185;
- case 186: return 255-186;
- case 187: return 255-187;
- case 188: return 255-188;
- case 189: return 255-189;
- case 190: return 255-190;
- case 191: return 255-191;
- case 192: return 255-192;
- case 193: return 255-193;
- case 194: return 255-194;
- case 195: return 255-195;
- case 196: return 255-196;
- case 197: return 255-197;
- case 198: return 255-198;
- case 199: return 255-199;
- case 200: return 255-200;
- case 201: return 255-201;
- case 202: return 255-202;
- case 203: return 255-203;
- case 204: return 255-204;
- case 205: return 255-205;
- case 206: return 255-206;
- case 207: return 255-207;
- case 208: return 255-208;
- case 209: return 255-209;
- case 210: return 255-210;
- case 211: return 255-211;
- case 212: return 255-212;
- case 213: return 255-213;
- case 214: return 255-214;
- case 215: return 255-215;
- case 216: return 255-216;
- case 217: return 255-217;
- case 218: return 255-218;
- case 219: return 255-219;
- case 220: return 255-220;
- case 221: return 255-221;
- case 222: return 255-222;
- case 223: return 255-223;
- case 224: return 255-224;
- case 225: return 255-225;
- case 226: return 255-226;
- case 227: return 255-227;
- case 228: return 255-228;
- case 229: return 255-229;
- case 230: return 255-230;
- case 231: return 255-231;
- case 232: return 255-232;
- case 233: return 255-233;
- case 234: return 255-234;
- case 235: return 255-235;
- case 236: return 255-236;
- case 237: return 255-237;
- case 238: return 255-238;
- case 239: return 255-239;
- case 240: return 255-240;
- case 241: return 255-241;
- case 242: return 255-242;
- case 243: return 255-243;
- case 244: return 255-244;
- case 245: return 255-245;
- case 246: return 255-246;
- case 247: return 255-247;
- case 248: return 255-248;
- case 249: return 255-249;
- case 250: return 255-250;
- case 251: return 255-251;
- case 252: return 255-252;
- case 253: return 255-253;
- case 254: return 255-254;
- case 255: return 255-255;
- }
-
- return -1;
- }
-
- static int test (int v)
- {
- Console.WriteLine ("value: " + v);
- switch (v){
- case 1:
- case 2:
- return 1;
-
- case 3:
- return 3;
-
- case 4:
- return 5;
-
- default:
- Console.WriteLine ("default");
- return 6;
- }
-
- return 7;
- }
-
- static int tests (string s)
- {
- switch (s){
- case "one":
- case "two":
- return 1;
- case "three":
- return 3;
- case "four":
- return 5;
- case null:
- return 9;
- default:
- return 6;
- }
-
- return 1;
- }
-
- static int testn (string s)
- {
- switch (s){
- case "one":
- return 1;
-
- default:
- return 0;
- }
- return -1;
- }
-
- static int testm (string s)
- {
- switch (s){
- case "one":
- return 1;
- }
- return 100;
- }
-
- static int testo (string s)
- {
- switch (s){
- case "one":
- return 1;
- case null:
- return 100;
- }
- return 2;
- }
-
- static int testp (string s)
- {
- switch (s){
- case "one":
- case null:
- case "two":
- return 1;
- case "three":
- return 3;
- }
- return 4;
- }
-
- static int test_def (string s)
- {
- switch (s){
- case "one":
- goto default;
- case "two":
- return 1;
- case "three":
- return 2;
- default:
- return 3;
- }
- return 4;
- }
-
- static int Main ()
- {
- byte b;
-
- for (b = 0; b < 255; b++){
- if (s (b) != 255 - b){
- Console.WriteLine ("Failed with: " + b + " [" + s (b) + "]");
- return 1;
- }
- }
-
- Console.WriteLine ("Batch 2");
- if (test (1) != 1)
- return 1;
- if (test (2) != 1)
- return 2;
- if (test (3) != 3)
- return 3;
- if (test (4) != 5)
- return 4;
- if (test (100) != 6)
- return 5;
-
- if (tests ("one") != 1)
- return 6;
- if (tests ("two") != 1)
- return 7;
- if (tests ("three") != 3)
- return 8;
- if (tests ("four") != 5)
- return 9;
- if (tests (null) != 9)
- return 10;
- if (tests ("blah") != 6)
- return 11;
-
- if (testn ("one") != 1)
- return 12;
- if (testn ("hello") != 0)
- return 13;
- if (testn (null) != 0)
- return 14;
-
- if (testm ("one") != 1)
- return 15;
- if (testm ("two") != 100)
- return 16;
- if (testm (null) != 100)
- return 17;
-
- if (testo ("one") != 1)
- return 18;
- if (testo ("two") != 2)
- return 19;
- if (testo (null) != 100)
- return 20;
-
- if (testp ("one") != 1)
- return 21;
- if (testp (null) != 1)
- return 22;
- if (testp ("two") != 1)
- return 23;
- if (testp ("three") != 3)
- return 24;
- if (testp ("blah") != 4)
- return 25;
-
- if (test_def ("one") != 3)
- return 26;
- if (test_def ("two") != 1)
- return 27;
- if (test_def ("three") != 2)
- return 28;
- if (test_def (null) != 3)
- return 29;
-
- Console.WriteLine ("All tests pass");
- return 0;
- }
-}
diff --git a/mcs/tests/test-5.cs b/mcs/tests/test-5.cs
deleted file mode 100755
index 7b3bdbc7924..00000000000
--- a/mcs/tests/test-5.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-
-class X {
-
- static int Main ()
- {
- Console.WriteLine ("From 0 to 9");
-
- for (int i = 0; i < 10; i++)
- Console.WriteLine (i);
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-50.cs b/mcs/tests/test-50.cs
deleted file mode 100644
index 84636e887ff..00000000000
--- a/mcs/tests/test-50.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-
-public class Blah {
-
- [DllImport ("user32", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)]
- public static extern int MessageBox (int hWnd, string pText, string pCaption, int uType);
-
- public static int Main ()
- {
- MessageBox (0, "Hello from Mono !", "PInvoke Test", 0);
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-51.cs b/mcs/tests/test-51.cs
deleted file mode 100755
index 3a6257747b6..00000000000
--- a/mcs/tests/test-51.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// This test is used to test the `base' implementation
-//
-using System;
-
-class Base {
- public int b_int_field;
- public string b_string_field;
-
- public const int b_const_three = 3;
-
- public int b_int_property {
- get {
- return b_int_field;
- }
-
- set {
- b_int_field = value;
- }
- }
-
- public string b_get_id ()
- {
- return "Base";
- }
-
- public Base ()
- {
- b_int_field = 1;
- b_string_field = "base";
- }
-}
-
-class Derived : Base {
- new int b_int_field;
- new string b_string_field;
- new const int b_const_three = 4;
-
- new int b_int_property {
- get {
- return b_int_field;
- }
-
-
- set {
- b_int_field = value;
- }
-
- }
-
- public Derived ()
- {
- b_int_field = 10;
- b_string_field = "derived";
- }
-
- public int Test ()
- {
- if (b_int_field != 10)
- return 1;
- if (base.b_int_field != 1)
- return 2;
- if (base.b_string_field != "base")
- return 3;
- if (b_string_field != "derived")
- return 4;
- base.b_int_property = 4;
- if (b_int_property != 10)
- return 5;
- if (b_int_property != 10)
- return 6;
- if (base.b_int_property != 4)
- return 7;
- if (b_const_three != 4)
- return 8;
- if (Base.b_const_three != 3)
- return 9;
- System.Console.WriteLine ("All tests pass");
- return 0;
- }
-}
-
-class boot {
- static int Main ()
- {
- Derived d = new Derived ();
- return d.Test ();
- }
-}
diff --git a/mcs/tests/test-52.cs b/mcs/tests/test-52.cs
deleted file mode 100755
index 47bf0afc3e5..00000000000
--- a/mcs/tests/test-52.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-class X {
-
- static string [] a = {
- "one", "two", "three"
- };
-
- static int Main ()
- {
- foreach (string s in a){
- Console.WriteLine (s);
- }
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-53.cs b/mcs/tests/test-53.cs
deleted file mode 100755
index 34cdd0c2f94..00000000000
--- a/mcs/tests/test-53.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// Tests the using statement implementation
-//
-using System;
-using System.IO;
-
-class MyDispose : IDisposable {
- public bool disposed;
-
- public void Dispose ()
- {
- disposed = true;
- }
-}
-
-//
-// This class does not implement IDiposable, but has an implicit conversion
-// defined
-//
-class NoIDispose {
- static public MyDispose x;
-
- public NoIDispose ()
- {
- }
-
- static NoIDispose ()
- {
- x = new MyDispose ();
- }
-
- public static implicit operator MyDispose (NoIDispose a)
- {
- return x;
- }
-}
-
-class Y {
- static void B ()
- {
- using (NoIDispose a = new NoIDispose ()){
- }
- }
-
-}
-
-class X {
- static int Main ()
- {
- MyDispose copy_a, copy_b, copy_c;
-
- //
- // Test whether the two `a' and `b' get disposed
- //
- using (MyDispose a = new MyDispose (), b = new MyDispose ()){
- copy_a = a;
- copy_b = b;
- }
-
- if (!copy_a.disposed)
- return 1;
- if (!copy_b.disposed)
- return 2;
-
- Console.WriteLine ("Nested using clause disposed");
-
- //
- // See if the variable `b' is disposed if there is
- // an error thrown inside the using block.
- //
- copy_c = null;
- try {
- using (MyDispose c = new MyDispose ()){
- copy_c = c;
- throw new Exception ();
- }
- } catch {}
-
- if (!copy_c.disposed)
- return 3;
- else
- Console.WriteLine ("Disposal on finally block works");
-
- //
- // This should test if `a' is non-null before calling dispose
- // implicitly
- //
- using (MyDispose d = null){
- }
-
- Console.WriteLine ("Null test passed");
-
- //
- // This tests that a variable is permitted here if there is
- // an implicit conversion to a type that implement IDisposable
- //
- using (NoIDispose a = new NoIDispose ()){
- }
-
- //
- // See if we dispose the object that can be implicitly converted
- // to IDisposable
- if (NoIDispose.x.disposed != true)
- return 4;
- else
- Console.WriteLine ("Implicit conversion from type to IDisposable pass");
-
- MyDispose bb = new MyDispose ();
- using (bb){
-
- }
- if (bb.disposed == false)
- return 6;
-
- Console.WriteLine ("All tests pass");
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-54.cs b/mcs/tests/test-54.cs
deleted file mode 100755
index 0eb5b692204..00000000000
--- a/mcs/tests/test-54.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// This test does not pass peverify because we dont return properly
-// from catch blocks
-//
-using System;
-
-class X {
-
- bool v ()
- {
- try {
- throw new Exception ();
- } catch {
- return false;
- }
- return true;
- }
-
- static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-55.cs b/mcs/tests/test-55.cs
deleted file mode 100755
index 6058ee2a1ba..00000000000
--- a/mcs/tests/test-55.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using c = System.Console;
-using s = System;
-
-namespace A {
- namespace B {
- class C {
- public static void Hola () {
- c.WriteLine ("Hola!");
- }
- }
- }
-}
-
-namespace X {
- namespace Y {
- namespace Z {
- class W {
- public static void Ahoj () {
- s.Console.WriteLine ("Ahoj!");
- }
- }
- }
- }
-}
-
-class App {
- public static int Main () {
- A.B.C.Hola ();
- X.Y.Z.W.Ahoj ();
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-56.cs b/mcs/tests/test-56.cs
deleted file mode 100755
index 286cb10dacd..00000000000
--- a/mcs/tests/test-56.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// Stress test properties and the various modes of
-// declarations (virtual, overrides, abstract, new)
-//
-using System;
-
-interface I {
- int P {
- get; set;
- }
-}
-
-abstract class A : I {
- public int p;
- public int q;
-
- public int P {
- get { return p; }
- set { p = value; }
- }
-
- public abstract int Q { get; set; }
-
- public int r;
- public virtual int R { get { return r; } set { r = value; } }
-}
-
-class B : A {
- public int bp;
-
- public new int P
- {
- get { return bp; }
- set { bp = value; }
- }
-
- public override int Q {
- get { return q; }
- set { q = value; }
- }
-}
-
-class C : A {
- public override int Q {
- get { return q; }
- set { q = value; }
- }
-
- public int rr;
- public override int R { get { return rr; } set { rr = value; } }
-}
-
-class M {
-
- static int Main ()
- {
- B b = new B ();
-
- b.P = 1;
- b.R = 10;
- b.Q = 20;
-
- if (b.P != 1)
- return 1;
- if (b.bp != 1)
- return 2;
-
- if (b.R != 10)
- return 3;
- if (b.r != 10)
- return 4;
-
- if (b.Q != 20)
- return 5;
- if (b.q != 20)
- return 6;
-
- C c = new C ();
-
- c.R = 10;
- c.Q = 20;
- c.P = 30;
- if (c.R != 10)
- return 7;
- if (c.rr != 10)
- return 8;
- if (c.P != 30)
- return 9;
- if (c.p != 30)
- return 10;
-
- Console.WriteLine ("Test passes");
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-57.cs b/mcs/tests/test-57.cs
deleted file mode 100644
index 2d23bdedb13..00000000000
--- a/mcs/tests/test-57.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using System;
-
-public delegate void EventHandler (int i, int j);
-
-public class Button {
-
- private EventHandler click;
-
- public event EventHandler Click {
- add { click += value; }
- remove { click -= value; }
- }
-
- public void OnClick (int i, int j)
- {
- if (click == null) {
- Console.WriteLine ("Nothing to click!");
- return;
- }
-
- click (i, j);
- }
-
- public void Reset ()
- {
- click = null;
- }
-}
-
-public class Blah {
-
- Button Button1 = new Button ();
-
- public void Connect ()
- {
- Button1.Click += new EventHandler (Button1_Click);
- Button1.Click += new EventHandler (Foo_Click);
- }
-
- public void Button1_Click (int i, int j)
- {
- Console.WriteLine ("Button1 was clicked !");
- Console.WriteLine ("Answer : " + (i+j));
- }
-
- public void Foo_Click (int i, int j)
- {
- Console.WriteLine ("Foo was clicked !");
- Console.WriteLine ("Answer : " + (i+j));
- }
-
- public void Disconnect ()
- {
- Console.WriteLine ("Disconnecting Button1's handler ...");
- Button1.Click -= new EventHandler (Button1_Click);
- }
-
- public static int Main ()
- {
- Blah b = new Blah ();
-
- b.Connect ();
-
- b.Button1.OnClick (2, 3);
-
- b.Disconnect ();
-
- Console.WriteLine ("Now calling OnClick again");
- b.Button1.OnClick (3, 7);
-
- Console.WriteLine ("Events test passes");
- return 0;
- }
-
-}
diff --git a/mcs/tests/test-58.cs b/mcs/tests/test-58.cs
deleted file mode 100755
index d7230ee45df..00000000000
--- a/mcs/tests/test-58.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.Reflection;
-
-public class Blah {
-
- public static int Main ()
- {
- unsafe {
- int* i;
- int foo = 10;
-
- void* bar;
-
- i = &foo;
-
- bar = i;
-
- Console.WriteLine ("Address : {0}", (int) i);
- }
-
- return 0;
- }
-}
-
-
diff --git a/mcs/tests/test-59.cs b/mcs/tests/test-59.cs
deleted file mode 100755
index f857ed84d12..00000000000
--- a/mcs/tests/test-59.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// Tests the varios type conversions.
-//
-using System;
-
-class X {
-
- static int test_explicit ()
- {
- object x_int = 1;
- object x_uint_1 = 1u;
- object x_uint_2 = 1U;
- object x_long_1 = 1l;
- object x_long_2 = 1L;
- object x_ulong_1 = 1ul;
- object x_ulong_2 = 1UL;
- object x_ulong_3 = 1lu;
- object x_ulong_4 = 1Lu;
- object x_ulong_5 = 1LU;
-
- if (!(x_int is int))
- return 1;
-
- if (!(x_uint_1 is uint))
- return 2;
-
- if (!(x_uint_2 is uint))
- return 3;
-
- if (!(x_long_1 is long))
- return 5;
-
- if (!(x_long_2 is long))
- return 6;
-
- if (!(x_ulong_1 is ulong))
- return 7;
-
- if (!(x_ulong_2 is ulong))
- return 8;
-
- if (!(x_ulong_3 is ulong))
- return 9;
-
- if (!(x_ulong_4 is ulong))
- return 10;
-
- if (!(x_ulong_5 is ulong))
- return 11;
-
- return 0;
-
- }
-
- static int test_implicit ()
- {
- object i_int = 1;
- object i_uint = 0x80000000;
- object i_long = 0x100000000;
- object i_ulong = 0x8000000000000000;
-
- if (!(i_int is int))
- return 1;
- if (!(i_uint is uint))
- return 2;
- if (!(i_long is long))
- return 3;
- if (!(i_ulong is ulong))
- return 4;
-
- return 0;
- }
-
- static int Main ()
- {
- int v;
- v = test_explicit ();
-
- if (v != 0)
- return v;
-
- v = test_implicit ();
- if (v != 0)
- return 20 + v;
-
- Console.WriteLine ("Tests pass");
- return 0;
- }
-}
diff --git a/mcs/tests/test-6.cs b/mcs/tests/test-6.cs
deleted file mode 100755
index b95d891b7c4..00000000000
--- a/mcs/tests/test-6.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-class X {
-
- static int Main ()
- {
- Console.WriteLine ("From 0 to 9");
- int i;
-
- for (i = 0; i < 10; i++)
- Console.WriteLine (i);
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-60.cs b/mcs/tests/test-60.cs
deleted file mode 100755
index d79e01025da..00000000000
--- a/mcs/tests/test-60.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Really lame test, but it should be fine for now
-//
-#if YY
-#if X
-#elif Y
-#else
-#endif
-#else
-class X {
- static int Main ()
- {
- return 0;
- }
-}
-#endif
diff --git a/mcs/tests/test-61.cs b/mcs/tests/test-61.cs
deleted file mode 100755
index 9d8c8532b0f..00000000000
--- a/mcs/tests/test-61.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// This tests checks that we allow the `get' and `set' keywords inside
-// the get and set blocks. It does the same for Events special remove
-// and add keywords.
-//
-class X {
- int Property {
- get {
- int get;
- get = 1;
- return get;
- }
- set {
- int set;
- set = value;
- }
- }
-
- int P2 {
- get { return 0; }
- }
-
- int P3 {
- set { }
- }
-
- public delegate void MyEvent ();
-
- public event MyEvent XX {
- add { int add = 1; }
- remove { int remove = 1; }
- }
-
- static int Main ()
- {
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-62.cs b/mcs/tests/test-62.cs
deleted file mode 100755
index 550956009e0..00000000000
--- a/mcs/tests/test-62.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// This test just makes sure that we can typecast to
-// array types, as this was introduced later into the
-// grammar.
-//
-
-class X {
-
- X [] GetX ()
- {
- return (X []) null;
- }
-
- int [] getInt ()
- {
- return (int []) null;
- }
-
- int [,,] getMoreInt ()
- {
- return (int [,,]) null;
- }
-
- static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-63.cs b/mcs/tests/test-63.cs
deleted file mode 100755
index 268c607f783..00000000000
--- a/mcs/tests/test-63.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// Tests rethrowing an exception
-//
-using System;
-
-class X {
- static int Main ()
- {
- bool one = false, two = false;
-
- try {
- try {
- throw new Exception ();
- } catch (Exception e) {
- one = true;
- Console.WriteLine ("Caught");
- throw;
- }
- } catch {
- two = true;
- Console.WriteLine ("Again");
- }
-
- if (one && two){
- Console.WriteLine ("Ok");
- return 0;
- } else
- Console.WriteLine ("Failed");
- return 1;
- }
-}
diff --git a/mcs/tests/test-64.cs b/mcs/tests/test-64.cs
deleted file mode 100755
index 43c31d7559e..00000000000
--- a/mcs/tests/test-64.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// This just test that we can compile this code.
-//
-// The challenge here is that LookupType needs to first look
-// in classes defined in its class or parent classes before resorting
-// to lookups in the namespace.
-//
-
-class Operator {
-}
-
-class Blah {
-
- public enum Operator { A, B };
-
- public Blah (Operator x)
- {
- }
-}
-
-class T {
- static int Main ()
- {
- Blah b = new Blah (Blah.Operator.A);
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-65.cs b/mcs/tests/test-65.cs
deleted file mode 100755
index b117ae309a4..00000000000
--- a/mcs/tests/test-65.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// This exercises the various ways in which the new operator works
-// with value types.
-//
-
-using System;
-
-struct S {
- int v;
-}
-
-class X {
- static bool receive, create, create_and_box;
-
- static void receiver (S x)
- {
- receive = true;
- }
-
- static object BoxS ()
- {
- create_and_box = true;
- return new S ();
- }
-
- static S Plain ()
- {
- create = true;
- return new S ();
- }
-
- static int Main ()
- {
- object a = new S ();
- receiver (new S ());
- S s = Plain ();
- object o = BoxS ();
-
- if (a == null)
- return 1;
- if (receive == false)
- return 2;
- if (create == false)
- return 3;
- if (create_and_box == false)
- return 4;
-
- Console.WriteLine ("Test pass");
- return 0;
- }
-}
diff --git a/mcs/tests/test-66.cs b/mcs/tests/test-66.cs
deleted file mode 100755
index 7691f6e7334..00000000000
--- a/mcs/tests/test-66.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// This tests checks out field access to arrays
-//
-using System;
-
-struct A {
- public int a;
-}
-
-class Y {
- public object a;
-}
-
-class X {
- static A [] a_single = new A [10];
- static A [,] a_double = new A [10,10];
- static Y [] o_single = new Y [10];
- static Y [,] o_double = new Y [10,10];
-
- static void FillOne ()
- {
- a_single [0].a = 1;
- }
-
- static void FillSingle ()
- {
- int i;
-
- for (i = 0; i < 10; i++){
- a_single [i].a = i + 1;
- }
- }
-
- static void FillDouble ()
- {
- int i, j;
-
- for (i = 0; i < 10; i++)
- for (j = 0; j < 10; j++)
- a_double [i,j].a = i * j;
- }
-
- static void FillObject ()
- {
- int i;
-
- for (i = 0; i < 10; i++){
- o_single [i] = new Y ();
- o_single [i].a = (i + 1);
- }
- }
-
- static void FillDoubleObject ()
- {
- int i, j;
-
- for (i = 0; i < 10; i++)
- for (j = 0; j < 10; j++){
- o_double [i,j] = new Y ();
- o_double [i,j].a = i * j;
- }
- }
-
- static int TestSingle ()
- {
- int i;
-
- for (i = 0; i < 10; i++){
- if (a_single [i].a != i + 1)
- return 1;
- }
- return 0;
- }
-
- static int TestDouble ()
- {
- int i, j;
-
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++)
- if (a_double [i,j].a != (i *j))
- return 2;
- }
-
- return 0;
- }
-
- static int TestObjectSingle ()
- {
- int i;
-
- for (i = 0; i < 10; i++){
- if ((int)(o_single [i].a) != i + 1)
- return 1;
- }
- return 0;
- }
-
- static int TestObjectDouble ()
- {
- int i, j;
-
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++)
- if (((int)o_double [i,j].a) != (i *j))
- return 2;
- }
-
- return 0;
- }
-
- static int Main ()
- {
- FillSingle ();
- FillDouble ();
- FillObject ();
- FillDoubleObject ();
-
- if (TestSingle () != 0)
- return 1;
-
- if (TestDouble () != 0)
- return 2;
-
- if (TestObjectSingle () != 0)
- return 3;
-
- if (TestObjectDouble () != 0)
- return 4;
-
- Console.WriteLine ("test passes");
- return 0;
- }
-}
diff --git a/mcs/tests/test-67.cs b/mcs/tests/test-67.cs
deleted file mode 100644
index 7eb792ae690..00000000000
--- a/mcs/tests/test-67.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-
-[StructLayout (LayoutKind.Sequential)]
-public class MySystemTime {
- public ushort Year;
- public ushort Month;
- public ushort DayOfWeek;
- public ushort Day;
- public ushort Hour;
- public ushort Minute;
- public ushort Second;
- public ushort Milliseconds;
-}
-
-[StructLayout (LayoutKind.Sequential)]
-public struct Point {
- public int x;
- public int y;
-}
-
-[StructLayout (LayoutKind.Explicit)]
-public struct Rect {
- [FieldOffset (0)] public int left;
- [FieldOffset (4)] public int top;
- [FieldOffset (8)] public int right;
- [FieldOffset (12)] public int bottom;
-}
-
-[StructLayout (LayoutKind.Explicit)]
-struct A {
- [FieldOffset (0)]
- public int a;
- [FieldOffset (0)]
- public byte b1;
- [FieldOffset (1)]
- public byte b2;
- [FieldOffset (2)]
- public byte b3;
- [FieldOffset (3)]
- public byte b4;
-}
-
-public class Blah {
-
- [DllImport ("Kernel32.dll")]
- public static extern void GetSystemTime (MySystemTime st);
-
- [DllImport ("User32.dll")]
- public static extern bool PtInRect (ref Rect r, Point p);
-
- public static int Main () {
-
- MySystemTime st = new MySystemTime ();
-
- GetSystemTime (st);
-
- Console.WriteLine ("Today's date is : {0:0000}-{1:00}-{2:00}", st.Year, st.Month, st.Day);
- Console.WriteLine ("The time now is : {0:00}:{1:00}:{2:00}", st.Hour, st.Minute, st.Second);
-
- Rect r = new Rect ();
-
- r.left = 10;
- r.top = 12;
- r.right = 30;
- r.bottom = 30;
-
- Point p = new Point ();
-
- p.x = 15;
- p.y = 20;
-
- if (!PtInRect (ref r, p))
- return 1;
-
- A a = new A ();
-
- a.a = 0x12345678;
-
- if (a.b1 != 0x78)
- return 2;
- if (a.b2 != 0x56)
- return 3;
- if (a.b3 != 0x34)
- return 4;
- if (a.b4 != 0x12)
- return 5;
-
- Console.WriteLine ("Point lies inside rect");
- Console.WriteLine ("Test passes");
- return 0;
- }
-}
diff --git a/mcs/tests/test-68.cs b/mcs/tests/test-68.cs
deleted file mode 100755
index 8dd44f48fb7..00000000000
--- a/mcs/tests/test-68.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// Tests invocation of reference type functions with value type arguments
-//
-
-enum A {
- Hello
-}
-
-class X {
-
- static int Main ()
- {
- if ("Hello" != A.Hello.ToString ())
- return 1;
-
- if (5.ToString () != "5")
- return 2;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-69.cs b/mcs/tests/test-69.cs
deleted file mode 100644
index be58166c258..00000000000
--- a/mcs/tests/test-69.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-
-public class Blah {
-
- [MethodImpl (MethodImplOptions.InternalCall)]
- private extern void Start_internal(IntPtr handle);
-
- public static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-7.cs b/mcs/tests/test-7.cs
deleted file mode 100644
index d3a9a9f34b1..00000000000
--- a/mcs/tests/test-7.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-using System;
-
-namespace Mine {
-
- public class Blah {
-
- public int i;
-
- public static int Main ()
- {
- Blah k, l;
-
- k = new Blah (2) + new Blah (3);
- if (k.i != 5)
- return 1;
-
- k = ~ new Blah (5);
- if (k.i != -6)
- return 1;
-
-
- k = + new Blah (4);
- if (k.i != 4)
- return 1;
-
- k = - new Blah (21);
- if (k.i != -21)
- return 1;
-
- k = new Blah (22) - new Blah (21);
- if (k.i != 1)
- return 1;
-
- if (!k)
- Console.WriteLine ("! returned true");
-
- int number = k;
- if (number != 1)
- return 1;
-
- k++;
- ++k;
-
- if (k)
- Console.WriteLine ("k is definitely true");
-
- k = new Blah (30);
-
- double f = (double) k;
-
- if (f != 30.0)
- return 1;
-
- int i = new Blah (5) * new Blah (10);
-
- if (i != 50)
- return 1;
-
- k = new Blah (50);
- l = new Blah (10);
-
- i = k / l;
-
- if (i != 5)
- return 1;
-
- i = k % l;
-
- if (i != 0)
- return 1;
-
- return 0;
- }
-
- public Blah (int v)
- {
- i = v;
- }
-
- public static Blah operator + (Blah i, Blah j)
- {
- Blah b = new Blah (i.i + j.i);
- Console.WriteLine ("Overload binary + operator");
- return b;
- }
-
- public static Blah operator + (Blah i)
- {
- Console.WriteLine ("Overload unary + operator");
- return new Blah (i.i);
- }
-
- public static Blah operator - (Blah i)
- {
- Console.WriteLine ("Overloaded unary - operator");
- return new Blah (- i.i);
- }
-
- public static Blah operator - (Blah i, Blah j)
- {
- Blah b = new Blah (i.i - j.i);
- Console.WriteLine ("Overloaded binary - operator");
- return b;
- }
-
- public static int operator * (Blah i, Blah j)
- {
- Console.WriteLine ("Overloaded binary * operator");
- return i.i * j.i;
- }
-
- public static int operator / (Blah i, Blah j)
- {
- Console.WriteLine ("Overloaded binary / operator");
- return i.i / j.i;
- }
-
- public static int operator % (Blah i, Blah j)
- {
- Console.WriteLine ("Overloaded binary % operator");
- return i.i % j.i;
- }
-
- public static Blah operator ~ (Blah i)
- {
- Console.WriteLine ("Overloaded ~ operator");
- return new Blah (~i.i);
- }
-
- public static bool operator ! (Blah i)
- {
- Console.WriteLine ("Overloaded ! operator");
- return (i.i == 1);
- }
-
- public static Blah operator ++ (Blah i)
- {
- Blah b = new Blah (i.i + 1);
- Console.WriteLine ("Incrementing i");
- return b;
- }
-
- public static Blah operator -- (Blah i)
- {
- Blah b = new Blah (i.i - 1);
- Console.WriteLine ("Decrementing i");
- return b;
- }
-
- public static bool operator true (Blah i)
- {
- Console.WriteLine ("Overloaded true operator");
- return (i.i == 3);
- }
-
- public static bool operator false (Blah i)
- {
- Console.WriteLine ("Overloaded false operator");
- return (i.i != 1);
- }
-
- public static implicit operator int (Blah i)
- {
- Console.WriteLine ("Converting implicitly from Blah->int");
- return i.i;
- }
-
- public static explicit operator double (Blah i)
- {
- Console.WriteLine ("Converting explicitly from Blah->double");
- return (double) i.i;
- }
-
- }
-
-}
diff --git a/mcs/tests/test-70.cs b/mcs/tests/test-70.cs
deleted file mode 100755
index 6fe8da995e8..00000000000
--- a/mcs/tests/test-70.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Tests the right settings for overrides
-//
-
-class X {
-
- public virtual int A {
- get {
- return 1;
- }
- }
-
- public virtual int B ()
- {
- return 1;
- }
-}
-
-class Y : X {
- public override int A {
- get {
- return base.A + 2;
- }
- }
-
- public override int B ()
- {
- return base.B () + 1;
- }
-}
-
-class Z {
- static int Main ()
- {
- Y y = new Y ();
- X x = new X ();
-
- if (y.B () != 2)
- return 1;
- if (y.A != 3)
- return 2;
- if (x.A != 1)
- return 3;
- if (x.B () != 1)
- return 4;
- return 0;
- }
-}
diff --git a/mcs/tests/test-71.cs b/mcs/tests/test-71.cs
deleted file mode 100755
index e7bd956c5f6..00000000000
--- a/mcs/tests/test-71.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// struct with a constructor
-//
-using System;
-
-class X {
-
- static void Main ()
- {
- MethodSignature ms = new MethodSignature ("hello", null, null);
-
- Console.WriteLine ("About to look for: " + ms.Name);
- }
-}
-
- struct MethodSignature {
- public string Name;
- public Type RetType;
- public Type [] Parameters;
-
- public MethodSignature (string name, Type ret_type, Type [] parameters)
- {
- Name = name;
- RetType = ret_type;
- Parameters = parameters;
- }
- }
-
diff --git a/mcs/tests/test-72.cs b/mcs/tests/test-72.cs
deleted file mode 100755
index 06d1cee18f9..00000000000
--- a/mcs/tests/test-72.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Compile test for referencing types on nested types
-//
-
-using System;
-
-public class outer {
- public class inner {
- public void meth(Object o) {
- inner inst = (inner)o;
- }
- }
-
- static int Main ()
- {
- // We only test that this compiles.
-
- return 0;
- }
- }
-
diff --git a/mcs/tests/test-73.cs b/mcs/tests/test-73.cs
deleted file mode 100755
index 2acf9806895..00000000000
--- a/mcs/tests/test-73.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// This test is used to test that we do not use the .override
-// command on abstract method implementations.
-//
-
-public abstract class Abstract {
- public abstract int A ();
-}
-
-public class Concrete : Abstract {
- public override int A () {
- return 1;
- }
-}
-
-class Test {
-
- static int Main ()
- {
- Concrete c = new Concrete ();
-
- if (c.A () != 1)
- return 1;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-74.cs b/mcs/tests/test-74.cs
deleted file mode 100755
index ede9e38b577..00000000000
--- a/mcs/tests/test-74.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// This test excercises #pre-processor directives in non-1 column
-// as well as the literal strings
-//
-class X {
- #if Blah
- #else
- static int Main ()
- {
- #endif
- string s = @"Hola\";
- string d = "Hola\\";
- string e = @"Co""a";
- string f = "Co\"a";
-
- if (s != d)
- return 1;
- if (e != f)
- return 2;
- return 0;
- }
-}
diff --git a/mcs/tests/test-75.cs b/mcs/tests/test-75.cs
deleted file mode 100755
index a16816cbbf0..00000000000
--- a/mcs/tests/test-75.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// This test probes using an operator overloaded in a parents' parent
-//
-
-class X {
- public static bool called = false;
-
- static public X operator + (X a, X b)
- {
- called = true;
- return null;
- }
-}
-
-class Y : X {
-}
-
-class Z : Y {
-}
-
-class driver {
-
- static int Main ()
- {
- Z a = new Z ();
- Z b = new Z ();
- X c = a + b;
-
- if (X.called)
- return 0;
-
- return 1;
- }
-
-}
-
diff --git a/mcs/tests/test-76.cs b/mcs/tests/test-76.cs
deleted file mode 100755
index 91377cee80a..00000000000
--- a/mcs/tests/test-76.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// This test is used to verify that we handle functions that have
-// only an array parameter
-//
-
-using System;
-using System.Text;
-
-class foo {
-
- static string strcat (params string [] values)
- {
- StringBuilder s = new StringBuilder ();
-
- foreach (string val in values) {
- s.Append (val);
- }
-
- return s.ToString ();
- }
-
- public static int Main ()
- {
- if (strcat ("Hello", "World") != "HelloWorld")
- return 1;
-
- if (strcat () != "")
- return 2;
-
- if (strcat ("a", "b", "c", "d", "e") != "abcde")
- return 3;
-
- return 0;
- }
-};
diff --git a/mcs/tests/test-77.cs b/mcs/tests/test-77.cs
deleted file mode 100755
index aca2001a39e..00000000000
--- a/mcs/tests/test-77.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// Tests the various string implicit conversions
-//
-
-class XX {
-
- enum X {
- A = 1
- }
-
- static int Main ()
- {
- int one = 1;
- int two = 2;
-
- if (("a" + "b") != "ab")
- return 1;
-
- if (("one" + one) != "one1")
- return 2;
-
- if ((one + "one") != "1one")
- return 3;
-
- if ((one + "two" + two) != "1two2")
- return 4;
-
- if ((X.A + "a") != "Aa")
- return 5;
-
- if (((int)X.A) + "a" != "1a")
- return 6;
-
- System.Console.WriteLine ("test ok");
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-78.cs b/mcs/tests/test-78.cs
deleted file mode 100755
index 3787fe6b9e2..00000000000
--- a/mcs/tests/test-78.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// This test exhibits an old bug where we did not
-// go into the underlying type for an enumeration, and
-// hence implicit and explicit casts were not working when
-// they were going from a type to an enum
-//
-
-namespace N1
-{
- public enum A
- {
- A_1, A_2, A_3
- }
-
- public class B
- {
- static bool ShortCasting ()
- {
- short i = 0;
- N1.A a = N1.A.A_1;
-
- i = (short) a; //<- crash
- a = (N1.A)i;//<- used to fail, can't convert
-
- if (a != N1.A.A_1)
- return false;
- return true;
- }
-
- static bool IntCasting ()
- {
- int i = 0;
- N1.A a = N1.A.A_1;
-
- i = (int) a;//<- works fine
- a = (N1.A)i;//<- used to fail, can't convert
-
- if (a != N1.A.A_1)
- return false;
- return true;
- }
-
- static int Main ()
- {
- if (!IntCasting ())
- return 1;
- if (!ShortCasting ())
- return 2;
- return 0;
- }
-
- }
-}
-
-
-
-
-
-
diff --git a/mcs/tests/test-79.cs b/mcs/tests/test-79.cs
deleted file mode 100755
index 8a4012db8ad..00000000000
--- a/mcs/tests/test-79.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// This test excercises the compiler being able to compute
-// correctly the return type in the presence of null (as null
-// will be implicitly convertible to anything
-//
-class X {
-
- static int Main ()
- {
- object o = null;
-
- string s = o == null ? "string" : null;
- string d = o == null ? null : "string";
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-8.cs b/mcs/tests/test-8.cs
deleted file mode 100644
index 5de9804f341..00000000000
--- a/mcs/tests/test-8.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-class X {
- static public int Main (string [] args)
- {
- int a, b, c, d;
-
- a = b = 10;
- c = d = 14;
-
- if ((a + b) != 20)
- return 1;
- if ((a + d) != 24)
- return 2;
- if ((c + d) != 28)
- return 3;
- if ((b + c) != 24)
- return 4;
-
- if (a++ != 10)
- return 5;
- if (++a != 12)
- return 6;
- if (b-- != 10)
- return 7;
- if (--b != 8)
- return 8;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-9.cs b/mcs/tests/test-9.cs
deleted file mode 100755
index 4fd35e3714b..00000000000
--- a/mcs/tests/test-9.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-class X {
- static public int Main (string [] args)
- {
- decimal a, b, c, d;
-
- a = 0;
- b = 1;
- c = d = 3;
-
- if (b + b + b != c)
- return 1;
-
- if (a != (b - 1))
- return 2;
-
- if (c != d)
- return 3;
-
- if (!(c == d))
- return 4;
-
- return 0;
- }
-}
diff --git a/mcs/tests/try.cs b/mcs/tests/try.cs
deleted file mode 100755
index 5bc1d408d0c..00000000000
--- a/mcs/tests/try.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-class t {
-
- void a ()
- {
- int b;
-
- try {
- b = 1;
- } catch {
- b = 2;
- }
- }
-
- void b ()
- {
- int a;
-
- try {
- a = 1;
- } catch (Exception) {
- a = 2;
- }
- }
-
- void c ()
- {
- int a;
-
- try {
- a = 2;
- } catch (Exception e) {
- a = 0x3;
- } catch {
- a = 0x1;
- }
- }
-
- void d ()
- {
- int a;
-
- try {
- a = 2;
- } catch (Exception e) {
- a = 0x3;
- } catch {
- a = 0x1;
- } finally {
- a = 111;
- }
- }
-}
-
diff --git a/mcs/tests/unsafe-1.cs b/mcs/tests/unsafe-1.cs
deleted file mode 100755
index b49bc0fe277..00000000000
--- a/mcs/tests/unsafe-1.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// Tests unsafe operators. address-of, dereference, member access
-//
-using System;
-
-unsafe struct Y {
- public int a;
- public int s;
-}
-
-unsafe class X {
- static int TestDereference ()
- {
- Y y;
- Y *z;
- Y a;
-
- z = &y;
- y.a = 1;
- y.s = 2;
-
- a.a = z->a;
- a.s = z->s;
-
- if (a.a != y.a)
- return 1;
- if (a.s != y.s)
- return 2;
-
- return 0;
- }
-
- static int TestPtrAdd ()
- {
- int [] a = new int [10];
- int i;
-
- for (i = 0; i < 10; i++)
- a [i] = i;
-
- i = 0;
- fixed (int *b = &a [0]){
- int *p = b;
-
- for (i = 0; i < 10; i++){
- if (*p != a [i])
- return 10+i;
- p++;
- }
- }
- return 0;
- }
-
- static int i = 1;
- static char c = 'a';
- static long l = 123;
- static double d = 1.2;
- static float f = 1.3F;
- static short s = 4;
-
- static int TestPtrAssign ()
- {
-
- fixed (int *ii = &i){
- *ii = 10;
- }
-
- fixed (char *cc = &c){
- *cc = 'b';
- }
-
- fixed (long *ll = &l){
- *ll = 100;
- }
-
- fixed (double *dd = &d){
- *dd = 3.0;
- }
-
- fixed (float *ff = &f){
- *ff = 1.2F;
- }
-
- fixed (short *ss = &s){
- *ss = 102;
- }
-
- if (i != 10)
- return 100;
- if (c != 'b')
- return 101;
- if (l != 100)
- return 102;
- if (d != 3.0)
- return 103;
- if (f != 1.2F)
- return 104;
- if (s != 102)
- return 105;
- return 0;
- }
-
- static int TestPtrArithmetic ()
- {
- char [] array = new char [10];
- char *pb;
-
- array [5] = 'j';
- fixed (char *pa = array){
- pb = pa + 1;
-
-
- //
- // This one tests pointer element access
- //
- if (pa [5] != 'j')
- return 199;
-
- Console.WriteLine ("V: " + (pb - pa));
- if ((pb - pa) != 1)
- return 200;
-
- pb++;
-
- if (pb == pa)
- return 201;
- if (pb < pa)
- return 202;
- if (pa > pb)
- return 203;
- if (pa >= pb)
- return 204;
- if (pb <= pa)
- return 205;
- pb = pb - 2;
- if (pb != pa){
- Console.WriteLine ("VV: " + (pb - pa));
- return 206;
- }
- }
-
- return 0;
- }
-
- static int Main ()
- {
- int v;
-
- if ((v = TestDereference ()) != 0)
- return v;
-
- if ((v = TestPtrAdd ()) != 0)
- return v;
-
- if ((v = TestPtrAssign ()) != 0)
- return v;
-
- if ((v = TestPtrArithmetic ()) != 0)
- return v;
- Console.WriteLine ("Ok");
- return 0;
- }
-}
diff --git a/mcs/tests/unsafe-2.cs b/mcs/tests/unsafe-2.cs
deleted file mode 100755
index adedee29633..00000000000
--- a/mcs/tests/unsafe-2.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// This test excercises stackalloc, some pointer arithmetic,
-// and dereferences
-//
-using System;
-unsafe class X {
- static int Main ()
- {
- char *ptr = stackalloc char [10];
- int i;
-
- for (i = 0; i < 10; i++)
- ptr [i] = (char) (i + 10);
-
- for (i = 0; i < 10; i++){
- if (*ptr != (char) (i + 10))
- return 200 + i;
- ptr++;
- }
- Console.WriteLine ("Ok");
- return 0;
- }
-}
-
-
diff --git a/mcs/tools/.cvsignore b/mcs/tools/.cvsignore
deleted file mode 100644
index 7d47302f00a..00000000000
--- a/mcs/tools/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.pdb
-*.exe
-*.dll
-cormissing.xml
diff --git a/mcs/tools/ChangeLog b/mcs/tools/ChangeLog
deleted file mode 100644
index f76f8fb896d..00000000000
--- a/mcs/tools/ChangeLog
+++ /dev/null
@@ -1,102 +0,0 @@
-2002-02-22 Nick Drochak <ndrochak@gol.com>
-
- * makefile: move corcompare to it's own directory to hold multiple
- class files. still makes old corcompare for now. will remove that
- soon.
-
-2002-02-18 Duncan Mak <duncan@ximian.com>
-
- * serialize.cs: When appropriate, changed Type.GetType calls to
- the faster typeof operator.
-
-2002-02-19 Nick Drochak <ndrochak@gol.com>
-
- * corcompare.cs: Reorganized into collaberating classes to analyze
- and generate reports. Still needs to find the MonoTODO's, and
- has a little more prototype code in there, but it's almost done.
-
- * makefile: output XML file in the tools directory for now.
-
-2002-02-15 Nick Drochak <ndrochak@gol.com>
-
- * corcompare.cs: Adding stuff to collect all the missing and todo
- information need to generate nice looking HTML pages. Not quite
- done and needs some re-org, but Duncan can take a look.
-
- * sample.xml: an example of how the XML will look that corcompare
- will generate. Can be used to start working on the XSLT.
-
-2002-02-13 Nick Drochak <ndrochak@gol.com>
-
- * makefile: 'clean' target now removes file generated by CorCompare
-
-2002-02-03 Duncan Mak <duncan@ximian.com>
-
- * serialize.cs: Added namespace block.
-
-2002-02-01 Duncan Mak <duncan@ximian.com>
-
- * serialize.cs: Added a new tool for serializing objects. It
- can create new types dynamically, but can only handle
- arguments that are of primitive types.
-
-2002-01-26 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * EnumCheckAssemblyCollection.cs,
- * assemblies.xml: Files related to EnumCheck checked-in. Now EnumCheck does
- not have any path hardcoded. It takes the assemblies to
- search from a xml files, which by default is assemblies.xml
-
-2002-01-25 Nick Drochak <ndrochak@gol.com>
-
- * .cvsignore: ignore .dll files now since we build NUnitCore.dll ourselves
-
-2002-01-18 Duncan Mak <duncan@ximian.com>
-
- * EnumCheck.cs: A checkin for Miguel to make EnumCheck not hardcode
- path to corlib.dll.
-
-2002-01-19 Nick Drochak <ndrochak@gol.com>
-
- * makefile: corcompare works again now, so make xml of missing types
- * CorCompare.cs: use exception that .NET v1 throws to get types in mono corlib
-
-2002-01-18 Nick Drochak <ndrochak@gol.com>
-
- * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
- don't generate xml from corcompare for now. it throws an error on v1.0 of .NET
-
-2002-01-17 Nick Drochak <ndrochak@gol.com>
-
- * IFaceDisco.cs, XMLUtil.cs: Added new files for interface discovery tool.
- * makefile: added target for IFaceDisco.exe and added to clean target for same
-
-2002-01-08 John Barnette <jbarn@httcb.net>
-
- * Removed todo.cs and related makefile data.
-
-
-
-2002-01-07 John Barnette <jbarn@httcb.net>
-
-
-
- * makefile: added todo target, fixed EnumCheck target, simplified clean
-
-
- * todo.cs: new file. generates todo list XML and compares assemblies
-
-
-
-2002-01-07 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * EnumCheck.cs: Get the numerical values of an enumeration.
-
-2002-01-06 Nick Drochak <ndrochak@gol.com>
-
- * corcompare.cs: Catch the FileNotFoundException and handle it nicely.
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * makefile: build corcompare
- * corcompare.cs: add new file. compares an assembly with mscorlib
diff --git a/mcs/tools/EnumCheck.cs b/mcs/tools/EnumCheck.cs
deleted file mode 100644
index 8c564cc7956..00000000000
--- a/mcs/tools/EnumCheck.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * Namespace: System.Web
- * Class: EnumCheck
- *
- * Author: Gaurav Vaish
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Xml;
-using System.Collections;
-using System.Reflection;
-
-namespace Mono.Enumerations
-{
- public class EnumCheck
- {
- private string className;
- private Type type;
- private EnumCheckAssemblyCollection ecac = new EnumCheckAssemblyCollection();
-
- public static string confFile = "assemblies.xml";
-
- public EnumCheck(string className)
- {
- this.className = className;
- ecac.Parse();
- }
-
- public void Display()
- {
- ecac.ConfigFile = confFile;
- LoadType();
- if(type == null || !type.IsEnum)
- {
- System.Console.Write("-->Failed to load the enumeration: " + className);
- return;
- }
- Array ar = Enum.GetValues(type);
- System.Console.WriteLine("-->Enumeration: {0}", type.ToString());
- for(int i=0; i < ar.Length; i++)
- {
- Enum b = (Enum)ar.GetValue(i);
- System.Console.Write(" {0}", Enum.Format(type, b, "G"));
- System.Console.WriteLine(" ({0}) ", Enum.Format(type, b, "D"));
- }
- }
-
- private void LoadType()
- {
- type = null;
- foreach(string url in ecac)
- {
- try
- {
- Assembly assembly = Assembly.LoadFrom(url);
- foreach(Type t in assembly.GetTypes())
- {
- if(!t.IsEnum)
- continue;
- if(className == t.ToString())
- {
- type = t;
- break;
- }
- }
- } catch(BadImageFormatException)
- {
- } catch(ReflectionTypeLoadException)
- {
- } catch(ArgumentException)
- {
- }
- if(type != null)
- return;
- }
- }
-
- public static void PrintUsage()
- {
- System.Console.WriteLine("Usage:");
- System.Console.WriteLine("EnumCheck [<enum> [<enum> [... ] ] ]");
- System.Console.WriteLine("");
- System.Console.WriteLine("enum := <namespace>[.<subnamespace>[...]].enum_name");
- System.Console.WriteLine("");
- }
-
- public static void Main(string[] args)
- {
- if(args.Length > 0 && (args[0] == "--help" || args[0] == "-h"))
- {
- PrintUsage();
- return;
- }
- EnumCheck check = null;
- string bdir;
- System.Console.Write("Enter assembly configuration file [{0}]:", confFile);
- //System.Console.Write("[{0}]: ", confFile);
- bdir = System.Console.ReadLine();
- while(bdir.EndsWith("/") || bdir.EndsWith("\\"))
- {
- bdir = bdir.Substring(0, bdir.Length - 1);
- }
- if(bdir != "")
- {
- confFile = bdir;
- }
- if(args.Length != 0)
- {
- foreach(string clName in args)
- {
- check = new EnumCheck(clName);
- check.Display();
- System.Console.WriteLine("\n");
- }
- }
- while(true)
- {
- System.Console.Write("Enter the name of the Enumeration (end to stop): ");
- string clName = System.Console.ReadLine();
- if(clName == "stop" || clName == "end" || clName.Length == 0)
- break;
- check = new EnumCheck(clName);
- check.Display();
- System.Console.WriteLine("\n");
- }
- }
- }
-}
diff --git a/mcs/tools/EnumCheckAssemblyCollection.cs b/mcs/tools/EnumCheckAssemblyCollection.cs
deleted file mode 100644
index 470492c25b5..00000000000
--- a/mcs/tools/EnumCheckAssemblyCollection.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Namespace: System.Web
- * Class: EnumCheckAssembly
- *
- * Author: Gaurav Vaish
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.IO;
-using System.Xml;
-using System.Collections;
-using System.Reflection;
-
-namespace Mono.Enumerations
-{
- public class EnumCheckAssemblyCollection: IEnumerable
- {
- public string ConfigFile = "assemblies.xml";
-
- private ArrayList assemblyList = new ArrayList();
-
- public EnumCheckAssemblyCollection()
- {
- }
-
- public void Parse()
- {
- Stream fStream;
- XmlReader reader;
- XmlDocument document;
- string url;
-
- fStream = new FileStream(ConfigFile, FileMode.Open, FileAccess.Read, FileShare.Read);
- reader = new XmlTextReader(fStream);
- document = new XmlDocument();
- document.Load(reader);
- if(document.DocumentElement != null)
- {
- if(document.DocumentElement.LocalName == "assemblies")
- {
- foreach(XmlNode pathNode in document.DocumentElement)
- {
- if(pathNode.NodeType == XmlNodeType.Element && pathNode.LocalName=="path")
- {
- url = pathNode.Attributes["url"].Value;
- while(url.EndsWith("\\") || url.EndsWith("/"))
- {
- url = url.Substring(0, url.Length - 1);
- }
- if(url == null || url.Length == 0)
- {
- continue;
- }
- foreach(XmlNode assemblyNode in pathNode.ChildNodes)
- {
- if(assemblyNode.LocalName == "assembly")
- {
- assemblyList.Add(url + "\\" + assemblyNode.Attributes["file"].Value);
- }
- }
- }
- }
- }
- }
- fStream.Close();
- }
-
- public IEnumerator GetEnumerator()
- {
- return assemblyList.GetEnumerator();
- }
- }
-}
diff --git a/mcs/tools/IFaceDisco.cs b/mcs/tools/IFaceDisco.cs
deleted file mode 100644
index 0f8a06225e9..00000000000
--- a/mcs/tools/IFaceDisco.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-// IFaceDisco.cs
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Collections;
-using System.IO;
-
-namespace Mono.Util
-{
- class IFaceDisco {
- public static void Main(string[] args) {
- Assembly asm;
- Type[] asmTypes;
- InterfaceMapping map;
- Type[] interfaces;
- ArrayList TypesList = new ArrayList();
- ArrayList implementingTypes = new ArrayList();
- string asmFullPath = null;
- string ifaceToDiscover = null;
-
- if (args.Length < 1 || args.Length > 3) {
- Usage();
- return;
- }
-
- for (int i = 0; i < args.Length; i++) {
- string arg = args[i];
-
- if (arg.StartsWith("-") && ((i + 1) < args.Length)) {
- if (arg == "--asm") {
- asmFullPath = args[++i];
- } else {
- Usage();
- return;
- }
- } else {
- // allow only one interface to discover
- if (ifaceToDiscover != null){
- Usage();
- return;
- }
- ifaceToDiscover = arg;
- }
- }
-
- // find the assembly
- if (null == asmFullPath){
- asm = Assembly.GetAssembly(typeof (System.Object));
- }
- else {
- try{
- asm = Assembly.LoadFrom(asmFullPath);
- }
- catch(Exception e){
- Console.WriteLine("Could not open assembly '{0}' for discovery. Error is: "+e.Message, asmFullPath);
- return;
- }
- }
- asmTypes = asm.GetTypes();
-
- // examine all the public types
- foreach(Type t in asmTypes) {
- if (t.IsPublic) {
- // find out which, if any, interfaces are "in" the type
- interfaces= t.GetInterfaces();
- if (null != interfaces){
- // look for the interface we want to discover
- foreach (Type iface in interfaces) {
- // this area seems to throw an exception sometimes, just ignore it
- try{
- if (iface.FullName.ToLower() == args[0].ToLower()) {
- // find out if this type is the one which "declares" the interface
- map = t.GetInterfaceMap(iface);
- if (map.TargetMethods[0].DeclaringType.FullName == t.FullName){
- // if so, then we found a class to report
- implementingTypes.Add(t.FullName);
- } // if
- } // if
- }catch{}
- } // foreach
- } // if
- } // if
- } // foreach
-
- // sort the list to make it easier to find what you are looking for
- implementingTypes.Sort();
- Console.WriteLine(XMLUtil.ToXML(implementingTypes, "Type", "ImplementingTypes"));
- } // Main()
-
- private static void Usage() {
- Console.WriteLine (
- "Mono Interface Discovery Tool\n" +
- "usage: ifacedisco [--asm assembly] interface\n\n" +
- " The full path to 'assembly' should be specified when using --asm.\n" +
- " If 'assembly' is not specified, the assembly that contains System.Object will be used.\n" +
- " Use the fully qualified form for 'interface', e.g. System.Runtime.Serialization.ISerializable\n"
- );
- } // Usage()
-
- } // class IFaceDisco
-} // namespace Mono.Util
diff --git a/mcs/tools/XMLUtil.cs b/mcs/tools/XMLUtil.cs
deleted file mode 100644
index 0643472ad28..00000000000
--- a/mcs/tools/XMLUtil.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// IFaceDisco.cs
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-using System;
-using System.Text;
-using System.Collections;
-
-namespace Mono.Util
-{
- class XMLUtil{
- public static string ToXML(
- ArrayList list,
- string itemWrap,
- string listWrap)
- {
- if (null == itemWrap){
- throw new ArgumentNullException("itemWrap");
- }
- if (null == listWrap){
- throw new ArgumentNullException("listWrap");
- }
- StringBuilder output = new StringBuilder();
- output.Append("<"+listWrap+">");
- foreach(object o in list){
- output.Append("\n<"+itemWrap+">");
- output.Append(o.ToString());
- output.Append("</"+itemWrap+">");
- }
- output.Append("\n</"+listWrap+">");
- return output.ToString();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/tools/assemblies.xml b/mcs/tools/assemblies.xml
deleted file mode 100644
index 1bf42d8c266..00000000000
--- a/mcs/tools/assemblies.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<assemblies>
- <path url="C:\WINNT\Microsoft.NET\Framework\v1.0.3705">
- <assembly file="mscorlib.dll"/>
- <assembly file="System.Web.dll"/>
- <assembly file="System.dll"/>
- <assembly file="System.Drawing.dll"/>
- <assembly file="System.Security.dll"/>
- <assembly file="System.Windows.Forms.dll"/>
- <assembly file="System.Xml.dll"/>
- <assembly file="System.Data.dll"/>
- <assembly file="System.Design.dll"/>
- <assembly file="System.EnterpriseServices.dll"/>
- <assembly file="System.Management.dll"/>
- <assembly file="System.Messaging.dll"/>
- <assembly file="System.Runtime.Remoting.dll"/>
- <assembly file="System.ServiceProcess.dll"/>
- <assembly file="System.Web.RegularExpressions.dll"/>
- <assembly file="System.Web.Services.dll"/>
- </path>
-</assemblies>
diff --git a/mcs/tools/corcompare/.cvsignore b/mcs/tools/corcompare/.cvsignore
deleted file mode 100644
index ee381230de1..00000000000
--- a/mcs/tools/corcompare/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.pdb
-*.exe
diff --git a/mcs/tools/corcompare/ChangeLog b/mcs/tools/corcompare/ChangeLog
deleted file mode 100644
index 4e100611a23..00000000000
--- a/mcs/tools/corcompare/ChangeLog
+++ /dev/null
@@ -1,6 +0,0 @@
-2002-02-25 Nick Drochak <ndrochak@gol.com>
-
- * ToDoAssembly.cs: remove unused code
- * ToDoNamespace.cs: using BindingFlags for GetMembers
- * ToDoType.cs: throw exception if we encounter a member type
- that we didn't expect. Also remove unused property. \ No newline at end of file
diff --git a/mcs/tools/corcompare/CorCompare.cs b/mcs/tools/corcompare/CorCompare.cs
deleted file mode 100644
index c1012aea3ea..00000000000
--- a/mcs/tools/corcompare/CorCompare.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Mono.Util.CorCompare.CorCompareDriver
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Handles command line arguments, and generates appropriate report(s)
- /// based on those arguments
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class CorCompareDriver
- {
- public static void Main(string[] args) {
- // make sure we were called with the proper usage
- if (args.Length < 1) {
- Console.WriteLine("Usage: CorCompare [-t][-n][-x outfile] assembly_to_compare");
- return;
- }
-
- ToDoAssembly td = new ToDoAssembly(args[args.Length-1], "corlib");
-
- for (int i = 0; i < args.Length-1; i++) {
- if (args [i] == "-t") {
- Console.WriteLine(td.CreateClassListReport());
- }
- if (args [i] == "-n") {
- }
- if (args [i] == "-x") {
- td.CreateXMLReport(args[++i]);
- }
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/IMissingMember.cs b/mcs/tools/corcompare/IMissingMember.cs
deleted file mode 100644
index 99c7f9f8f21..00000000000
--- a/mcs/tools/corcompare/IMissingMember.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Mono.Util.CorCompare.IMissingMember
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-namespace Mono.Util.CorCompare {
-
- interface IMissingMember
- {
- string Name { get ; }
-
- string Status { get; }
-
- string Type { get; }
- }
-}
diff --git a/mcs/tools/corcompare/Makefile b/mcs/tools/corcompare/Makefile
deleted file mode 100644
index 1502331d408..00000000000
--- a/mcs/tools/corcompare/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-all: linux
-
-windows: linux
-
-linux: CorCompare.exe
-
-CorCompare.exe:
- ../../nant/NAnt.exe linux
- ./CorCompare.exe -x cormissing.xml ../../class/lib/corlib_cmp.dll
-
-clean:
- rm -f *.exe *.pdb *.dll
- rm -f cormissing.xml
diff --git a/mcs/tools/corcompare/MissingConstructor.cs b/mcs/tools/corcompare/MissingConstructor.cs
deleted file mode 100644
index 50c02f70620..00000000000
--- a/mcs/tools/corcompare/MissingConstructor.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// Mono.Util.CorCompare.MissingConstructor
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class event that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/24/2002 10:43:57 PM
- /// </remarks>
- class MissingConstructor : IMissingMember {
- // e.g. <method name="Equals" status="missing"/>
- MemberInfo mInfo;
-
- public MissingConstructor(MemberInfo info) {
- mInfo = info;
- }
-
- public string Name {
- get {
- return mInfo.Name;
- }
- }
-
- public virtual string Status {
- get {
- return "missing";
- }
- }
-
- public string Type {
- get {
- return "constructor";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingEvent.cs b/mcs/tools/corcompare/MissingEvent.cs
deleted file mode 100644
index 3f012745598..00000000000
--- a/mcs/tools/corcompare/MissingEvent.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// Mono.Util.CorCompare.MissingEvent
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class event that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/24/2002 10:43:57 PM
- /// </remarks>
- class MissingEvent : IMissingMember {
- // e.g. <method name="Equals" status="missing"/>
- MemberInfo mInfo;
-
- public MissingEvent(MemberInfo info) {
- mInfo = info;
- }
-
- public string Name {
- get {
- return mInfo.Name;
- }
- }
-
- public virtual string Status {
- get {
- return "missing";
- }
- }
-
- public string Type {
- get {
- return "event";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingField.cs b/mcs/tools/corcompare/MissingField.cs
deleted file mode 100644
index 91cd03d2303..00000000000
--- a/mcs/tools/corcompare/MissingField.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// Mono.Util.CorCompare.MissingField
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class event that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/24/2002 10:43:57 PM
- /// </remarks>
- class MissingField : IMissingMember {
- // e.g. <method name="Equals" status="missing"/>
- MemberInfo mInfo;
-
- public MissingField(MemberInfo info) {
- mInfo = info;
- }
-
- public string Name {
- get {
- return mInfo.Name;
- }
- }
-
- public virtual string Status {
- get {
- return "missing";
- }
- }
-
- public string Type {
- get {
- return "field";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingMethod.cs b/mcs/tools/corcompare/MissingMethod.cs
deleted file mode 100644
index bc550e93dfd..00000000000
--- a/mcs/tools/corcompare/MissingMethod.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// Mono.Util.CorCompare.MissingMethod
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Text;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class method that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class MissingMethod : IMissingMember
- {
- // e.g. <method name="Equals" status="missing"/>
- MemberInfo mInfo;
-
- public MissingMethod(MemberInfo info) {
- mInfo = info;
- }
-
- public string Name {
- get {
- string s = mInfo.ToString();
- int index = s.IndexOf(' ');
- return s.Substring(index + 1);
- }
- }
-
- public virtual string Status {
- get {
- return "missing";
- }
- }
-
- public string Type {
- get {
- return "method";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingNestedType.cs b/mcs/tools/corcompare/MissingNestedType.cs
deleted file mode 100644
index 141678e6689..00000000000
--- a/mcs/tools/corcompare/MissingNestedType.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// Mono.Util.CorCompare.MissingNestedType
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class event that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/24/2002 10:43:57 PM
- /// </remarks>
- class MissingNestedType : IMissingMember {
- // e.g. <method name="Equals" status="missing"/>
- MemberInfo mInfo;
-
- public MissingNestedType(MemberInfo info) {
- mInfo = info;
- }
-
- public string Name {
- get {
- return mInfo.Name;
- }
- }
-
- public virtual string Status {
- get {
- return "missing";
- }
- }
-
- public string Type {
- get {
- return "nestedType";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingProperty.cs b/mcs/tools/corcompare/MissingProperty.cs
deleted file mode 100644
index eb7d1e75a4c..00000000000
--- a/mcs/tools/corcompare/MissingProperty.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-// Mono.Util.CorCompare.MissingProperty
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Text;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a missing property from a class
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class MissingProperty : IMissingMember
- {
- // e.g. <property name="Length" status="missing"/>
- MemberInfo info;
-
- public MissingProperty(MemberInfo pInfo) {
- info = pInfo;
- }
-
- public string Name {
- get {
- StringBuilder retVal = new StringBuilder(info.Name + "{");
- if (this.NeedsGet) {
- retVal.Append(" get;");
- }
- if (this.NeedsSet) {
- retVal.Append(" set;");
- }
-
- retVal.Append(" }");
- return retVal.ToString();
- }
- }
- public virtual string Status {
- get {
- return "missing";
- }
- }
-
- public string Type {
- get {
- return "property";
- }
- }
-
- public bool NeedsGet = false;
- public bool NeedsSet = false;
- }
-}
diff --git a/mcs/tools/corcompare/MissingType.cs b/mcs/tools/corcompare/MissingType.cs
deleted file mode 100644
index df8190b20a9..00000000000
--- a/mcs/tools/corcompare/MissingType.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Mono.Util.CorCompare.MissingType
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class method that missing.
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class MissingType
- {
- // e.g. <class name="System.Byte" status="missing"/>
- protected Type theType;
- public MissingType(Type t) {
- theType = t;
- }
-
- public override bool Equals(object o) {
- if (o is MissingType) {
- return o.GetHashCode() == this.GetHashCode();
- }
- return false;
- }
-
- public override int GetHashCode() {
- return theType.GetHashCode();
- }
-
- public string Name {
- get {
- return theType.Name;
- }
- }
-
- public string NameSpace {
- get {
- return theType.Namespace;
- }
- }
-
- public virtual string Status {
- get {
- return "missing";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/TODO b/mcs/tools/corcompare/TODO
deleted file mode 100644
index 355c8351eab..00000000000
--- a/mcs/tools/corcompare/TODO
+++ /dev/null
@@ -1,16 +0,0 @@
-TODO
-for CorCompare - 2002/02/25
-
- * The "methods" for a property's set and get are listed in the methods
- element. It would be cool to take them out of there and show that
- info in the property element, like "SomeProp{ get; set; } if it's missing
- both.
-
- * The constructors are just listed as ".ctor" which is not very verbose.
- What we really need here is the parameter list too, but I couldn't find
- a way to get the parameters for constructors, only methods.
-
- * Missing attributes on classes and members are not included at all.
-
- * Compare other assemblies besides corlib (then change name of
- the utility of course :) \ No newline at end of file
diff --git a/mcs/tools/corcompare/ToDoAssembly.cs b/mcs/tools/corcompare/ToDoAssembly.cs
deleted file mode 100644
index 7c1412a8ecf..00000000000
--- a/mcs/tools/corcompare/ToDoAssembly.cs
+++ /dev/null
@@ -1,268 +0,0 @@
-// Mono.Util.CorCompare.ToDoAssembly
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Collections;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents an assembly that has missing or MonoTODO classes
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoAssembly
- {
- // these types are in mono corlib, but not in the dll we are going to examine.
- static string[] ghostTypes = {"System.Object", "System.ValueType", "System.Delegate", "System.Enum"};
- ArrayList MissingTypes = new ArrayList();
- string assemblyToCompare;
- bool analyzed = false;
- ArrayList todoNameSpaces = new ArrayList();
- string name;
-
- public ToDoAssembly(string fileName, string friendlyName)
- {
- assemblyToCompare = fileName;
- name = friendlyName;
- }
-
- public string Name {
- get {
- return name;
- }
- }
-
- public int MissingCount {
- get {
- int sum = 0;
- foreach(ToDoNameSpace ns in todoNameSpaces) {
- sum += ns.MissingCount;
- }
- return sum;
- }
- }
-
- public int ToDoCount {
- get {
- int sum = 0;
- foreach(ToDoNameSpace ns in todoNameSpaces) {
- sum += ns.ToDoCount;
- }
- return sum;
- }
- }
-
- public int ReferenceTypeCount {
- get {
- int sum = 0;
- foreach(ToDoNameSpace ns in todoNameSpaces) {
- sum += ns.ReferenceTypeCount;
- }
- return sum;
- }
- }
-
- bool Analyze()
- {
- if (analyzed) return true;
-
- Type[] mscorlibTypes = GetReferenceTypes();
- if (mscorlibTypes == null)
- {
- Console.WriteLine("Could not find corlib file: {0}", assemblyToCompare);
- return false;
- }
-
- Type[] monocorlibTypes = GetMonoTypes();
-
- foreach(string ns in ToDoNameSpace.GetNamespaces(monocorlibTypes)) {
- todoNameSpaces.Add(new ToDoNameSpace(ns, monocorlibTypes, mscorlibTypes));
- }
-
- analyzed = true;
- return true;
- }
-
- public Type[] GetReferenceTypes()
- {
- // get the types in the corlib we are running with
- Assembly msAsmbl = Assembly.GetAssembly(typeof (System.Object));
- Type[] mscorlibTypes = msAsmbl.GetTypes();
- return mscorlibTypes;
- }
-
- public Type[] GetMonoTypes()
- {
- Type[] monocorlibTypes;
- Assembly monoAsmbl = null;
- try
- {
- monoAsmbl = Assembly.LoadFrom(assemblyToCompare);
- }
- catch(FileNotFoundException)
- {
- return null;
- }
-
- monocorlibTypes = monoAsmbl.GetTypes();
-
- return monocorlibTypes;
- }
-
- public string CreateClassListReport() {
- if (!Analyze() || todoNameSpaces.Count == 0) return "";
-
- StringBuilder output = new StringBuilder();
- foreach (ToDoNameSpace ns in todoNameSpaces)
- {
- string[] missingTypes = ns.MissingTypeNames(true);
- if (missingTypes.Length > 0) {
- string joinedNames = String.Join("\n", missingTypes);
- output.Append(joinedNames + "\n");
- }
- }
- return output.ToString();
- }
-
- public void CreateXMLReport(string filename) {
- bool analyzedOK = Analyze();
-
- XmlDocument outDoc;
- outDoc = new XmlDocument();
- outDoc.AppendChild(outDoc.CreateXmlDeclaration("1.0", null, null));
- XmlElement assembliesElem = outDoc.CreateElement("assemblies");
- outDoc.AppendChild(assembliesElem);
- XmlElement assemblyElem = outDoc.CreateElement("assembly");
- assemblyElem.SetAttribute("name", this.Name);
- assemblyElem.SetAttribute("missing", this.MissingCount.ToString());
- assemblyElem.SetAttribute("todo", this.ToDoCount.ToString());
- assemblyElem.SetAttribute("complete", (100 - 100 * (this.MissingCount + this.ToDoCount) / this.ReferenceTypeCount).ToString());
- assembliesElem.AppendChild(assemblyElem);
- XmlElement namespacesElem = outDoc.CreateElement("namespaces");
- assemblyElem.AppendChild(namespacesElem);
-
- if (analyzedOK && todoNameSpaces.Count > 0) {
- XmlElement namespaceElem;
- XmlElement classesElem;
- XmlElement classElem;
- XmlElement memberElem = null;
- foreach (ToDoNameSpace ns in todoNameSpaces) {
- namespaceElem = outDoc.CreateElement("namespace");
- namespaceElem.SetAttribute("name", ns.name);
- MissingType[] missingTypes = ns.MissingTypes;
- classesElem = null;
- if (missingTypes.Length > 0) {
- classesElem = outDoc.CreateElement("classes");
- namespaceElem.AppendChild(classesElem);
-
- foreach (MissingType type in missingTypes) {
- classElem = outDoc.CreateElement("class");
- classElem.SetAttribute("name", type.Name);
- classElem.SetAttribute("status", type.Status);
- classesElem.AppendChild(classElem);
- }
-
- namespaceElem.SetAttribute("missing", ns.MissingCount.ToString());
- }
-
- ToDoType[] todoTypes = ns.ToDoTypes;
- if (todoTypes.Length > 0) {
- if (classesElem == null) {
- classesElem = outDoc.CreateElement("classes");
- namespaceElem.AppendChild(classesElem);
- }
- foreach (ToDoType type in todoTypes) {
- classElem = outDoc.CreateElement("class");
- classElem.SetAttribute("name", type.Name);
- classElem.SetAttribute("status", type.Status);
- classElem.SetAttribute("missing", type.MissingCount.ToString());
- classElem.SetAttribute("todo", type.ToDoCount.ToString());
- classesElem.AppendChild(classElem);
-
- memberElem = CreateMemberCollectionElement("methods", type.MissingMethods, type.ToDoMethods, outDoc);
- if (memberElem != null) {
- classElem.AppendChild(memberElem);
- }
-
- memberElem = CreateMemberCollectionElement("properties", type.MissingProperties, type.ToDoProperties, outDoc);
- if (memberElem != null) {
- classElem.AppendChild(memberElem);
- }
-
- memberElem = CreateMemberCollectionElement("events", type.MissingEvents, type.ToDoEvents, outDoc);
- if (memberElem != null) {
- classElem.AppendChild(memberElem);
- }
-
- memberElem = CreateMemberCollectionElement("fields", type.MissingFields, type.ToDoFields, outDoc);
- if (memberElem != null) {
- classElem.AppendChild(memberElem);
- }
-
- memberElem = CreateMemberCollectionElement("constructors", type.MissingConstructors, type.ToDoConstructors, outDoc);
- if (memberElem != null) {
- classElem.AppendChild(memberElem);
- }
-
- memberElem = CreateMemberCollectionElement("nestedTypes", type.MissingNestedTypes, type.ToDoNestedTypes, outDoc);
- if (memberElem != null) {
- classElem.AppendChild(memberElem);
- }
- }
- namespaceElem.SetAttribute("todo", ns.ToDoCount.ToString());
- }
- if (ns.ReferenceTypeCount > 0) {
- namespaceElem.SetAttribute("complete", (100 - 100 * (ns.MissingCount + ns.ToDoCount) / ns.ReferenceTypeCount).ToString());
- }
- else {
- namespaceElem.SetAttribute("complete", "100");
- }
- namespacesElem.AppendChild(namespaceElem);
- }
- }
-
- outDoc.Save(filename);
- }
-
- static XmlElement CreateMemberCollectionElement(string name, ArrayList missingList, ArrayList todoList, XmlDocument doc) {
- XmlElement element = null;
- if (missingList.Count > 0) {
- element = doc.CreateElement(name);
- foreach (IMissingMember missing in missingList) {
- element.AppendChild(CreateMissingElement(missing, doc));
- }
- }
- if (todoList.Count > 0) {
- if (element == null) {
- element = doc.CreateElement(name);
- }
- foreach (IMissingMember missing in todoList) {
- element.AppendChild(CreateMissingElement(missing, doc));
- }
- }
- if (element != null) {
- element.SetAttribute("missing", missingList.Count.ToString());
- element.SetAttribute("todo", todoList.Count.ToString());
- }
- return element;
- }
-
- static XmlElement CreateMissingElement(IMissingMember member, XmlDocument doc) {
- XmlElement missingElement = doc.CreateElement(member.Type);
- missingElement.SetAttribute("name", (member.Name));
- missingElement.SetAttribute("status", (member.Status));
- return missingElement;
- }
- }
-}
diff --git a/mcs/tools/corcompare/ToDoConstructor.cs b/mcs/tools/corcompare/ToDoConstructor.cs
deleted file mode 100644
index 91e9825d034..00000000000
--- a/mcs/tools/corcompare/ToDoConstructor.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Mono.Util.CorCompare.ToDoConstructor
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class method that is marked with MonoTODO
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoConstructor : MissingConstructor
- {
- // e.g. <method name="ToString" status="todo" note="this is the note from MonoTODO"/>
- string todoNote = "";
-
- public ToDoConstructor(MemberInfo info) : base(info) {
- }
- public ToDoConstructor(MemberInfo info, string note) :base(info) {
- todoNote = note;
- }
- public string Note {
- get {
- return todoNote;
- }
- }
- public override string Status {
- get {
- return "todo";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/ToDoEvent.cs b/mcs/tools/corcompare/ToDoEvent.cs
deleted file mode 100644
index c849bcefeec..00000000000
--- a/mcs/tools/corcompare/ToDoEvent.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Mono.Util.CorCompare.ToDoEvent
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class method that is marked with MonoTODO
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoEvent : MissingEvent
- {
- // e.g. <method name="ToString" status="todo" note="this is the note from MonoTODO"/>
- string todoNote = "";
-
- public ToDoEvent(MemberInfo info) : base(info) {
- }
- public ToDoEvent(MemberInfo info, string note) :base(info) {
- todoNote = note;
- }
- public string Note {
- get {
- return todoNote;
- }
- }
- public override string Status {
- get {
- return "todo";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/ToDoField.cs b/mcs/tools/corcompare/ToDoField.cs
deleted file mode 100644
index 5a55dfc7490..00000000000
--- a/mcs/tools/corcompare/ToDoField.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Mono.Util.CorCompare.ToDoField
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class method that is marked with MonoTODO
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoField : MissingField
- {
- // e.g. <method name="ToString" status="todo" note="this is the note from MonoTODO"/>
- string todoNote = "";
-
- public ToDoField(MemberInfo info) : base(info) {
- }
- public ToDoField(MemberInfo info, string note) :base(info) {
- todoNote = note;
- }
- public string Note {
- get {
- return todoNote;
- }
- }
- public override string Status {
- get {
- return "todo";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/ToDoMethod.cs b/mcs/tools/corcompare/ToDoMethod.cs
deleted file mode 100644
index 89534515cbd..00000000000
--- a/mcs/tools/corcompare/ToDoMethod.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Mono.Util.CorCompare.ToDoMethod
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class method that is marked with MonoTODO
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoMethod : MissingMethod
- {
- // e.g. <method name="ToString" status="todo" note="this is the note from MonoTODO"/>
- string todoNote = "";
-
- public ToDoMethod(MemberInfo info) : base(info) {
- }
- public ToDoMethod(MemberInfo info, string note) :base(info) {
- todoNote = note;
- }
- public string Note {
- get {
- return todoNote;
- }
- }
- public override string Status {
- get {
- return "todo";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/ToDoNameSpace.cs b/mcs/tools/corcompare/ToDoNameSpace.cs
deleted file mode 100644
index f64c23a17f2..00000000000
--- a/mcs/tools/corcompare/ToDoNameSpace.cs
+++ /dev/null
@@ -1,288 +0,0 @@
-// Mono.Util.CorCompare.ToDoNameSpace
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Collections;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a namespace that has missing and/or MonoTODO classes.
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoNameSpace
- {
- // e.g. <namespace name="System" missing="267" todo="453" complete="21">
- MissingType[] missingTypes;
- ToDoType[] todoTypes;
- public string name;
- int complete = 0;
- Type[] existingTypes;
- int referenceTypeCount;
-
- public static ArrayList GetNamespaces(Type[] types) {
- ArrayList nsList = new ArrayList();
- foreach (Type t in types) {
- if (!nsList.Contains(t.Namespace)) {
- nsList.Add(t.Namespace);
- }
- }
- return nsList;
- }
-
- public ToDoNameSpace(string nameSpace, Type[] types) {
- name = nameSpace;
- existingTypes = Filter(types, name);
- }
-
- public ToDoNameSpace(string nameSpace, Type[] types,
- Type[] referenceTypes) {
- name = nameSpace;
- existingTypes = Filter(types, name);
- CompareWith(referenceTypes);
- }
-
- public int MissingCount {
- get {
- return missingTypes.Length;
- }
- }
-
- public int ToDoCount {
- get {
- return todoTypes.Length;
- }
- }
-
- public int ReferenceTypeCount {
- get {
- return referenceTypeCount;
- }
- }
-
- Type[] Filter(Type[] types, string ns) {
- ArrayList filteredTypes = new ArrayList();
- foreach(Type t in types) {
- if (t.Namespace == ns) {
- filteredTypes.Add(t);
- }
- }
- return (Type[])filteredTypes.ToArray(typeof(Type));
- }
-
- public int Complete {
- get {
- return complete;
- }
- }
-
- public void CompareWith(Type[] referenceTypes) {
- Type[] filteredReferenceTypes = Filter(referenceTypes, name);
- referenceTypeCount = 0;
- if (null != existingTypes) {
- referenceTypeCount = filteredReferenceTypes.Length;
- missingTypes = GetMissingTypes(filteredReferenceTypes);
- todoTypes = GetToDoTypes(filteredReferenceTypes);
- if (null != filteredReferenceTypes &&
- filteredReferenceTypes.Length > 0) {
- int needLoveCount = 0;
- if (null != missingTypes) {
- needLoveCount += missingTypes.Length;
- }
- if (null != todoTypes) {
- needLoveCount += todoTypes.Length;
- }
- complete = 100 * needLoveCount /
- filteredReferenceTypes.Length;
- }
- }
- }
-
- MissingType[] GetMissingTypes(Type[] referenceTypes) {
- ArrayList TypesList = new ArrayList();
- ArrayList MissingTypes = new ArrayList();
- bool foundIt;
- foreach(Type subt in existingTypes) {
- if (null != subt && !TypesList.Contains(subt.Name)) {
- TypesList.Add(subt.Name);
- }
- }
- TypesList.Sort();
- foreach(Type t in referenceTypes) {
- foundIt = (TypesList.BinarySearch(t.Name) >= 0);
- if (t.IsPublic && !foundIt) {
- MissingTypes.Add(new MissingType(t));
- }
- }
- return (MissingType[])MissingTypes.ToArray(typeof(MissingType));
- }
-
- ToDoType[] GetToDoTypes(Type[] referenceTypes) {
- // todo types are those marked with [MonoTODO] or having missing or
- // todo members
- ArrayList TypesList = new ArrayList();
- ArrayList ToDoTypes = new ArrayList();
-
- bool foundIt = false;
- Object[] myAttributes;
-
- int index;
-
- // look at all the existing types in this namespace for MonoTODO attrib
- foreach(Type t in existingTypes) {
- if (t.IsPublic) {
- // assume we won't find it
- foundIt = false;
-
- // get all the custom attributes on the type
- myAttributes = t.GetCustomAttributes(false);
- foreach (object o in myAttributes) {
- // check to see if any of them are the MonoTODO attrib
- if (o.ToString() == "System.MonoTODOAttribute"){
- // if so, this is a todo type
- ToDoTypes.Add(new ToDoType(t));
- // and we can stop look at the custom attribs
- break;
- }
- }
-
- // look at all the members of the type
- foreach (MemberInfo mi in t.GetMembers(BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public)) {
- // see if any of them have the MonoTODO attrib
- myAttributes = mi.GetCustomAttributes(false);
- foreach (object o in myAttributes) {
- if (o.ToString() == "System.MonoTODOAttribute") {
- // the first time we find one for this type add the type to the list
- if (!foundIt) {
- index = ToDoType.IndexOf(t, ToDoTypes);
- if (index < 0) {
- ToDoTypes.Add(new ToDoType(t));
- }
- foundIt = true;
- }
- // add any todo member infos to the todo type
- ((ToDoType)(ToDoTypes[ToDoTypes.Count-1])).AddToDoMember(t, mi);
- }
- }
- }
- }
- }
- // find types with missing members
- foreach (Type t in referenceTypes) {
- if (t.IsPublic && !IsMissingType(t)) {
- bool addedIt = false;
- index = -1;
-
- foreach (MemberInfo mi in t.GetMembers(BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public)) {
- if (t.Name == mi.DeclaringType.Name && IsMissingMember(mi, t.Name, existingTypes)) {
- if (!addedIt) {
- index = ToDoType.IndexOf(t, ToDoTypes);
- if (index >= 0) {
- }
- else {
- index = ToDoTypes.Add(new ToDoType(t));
- }
- addedIt = true;
- }
- if (index >= 0) {
- ((ToDoType)(ToDoTypes[index])).AddMissingMember(mi);
- }
- else {
- throw new Exception("Don't know which ToDoType to add this missing member");
- }
- }
- }
- }
- }
-
- return (ToDoType[])ToDoTypes.ToArray(typeof(ToDoType));
- }
-
- bool IsMissingType(Type t) {
- foreach (MissingType mt in missingTypes) {
- if (t.Name == mt.Name) {
- return true;
- }
- }
- return false;
- }
-
- static bool IsMissingMember(MemberInfo mi, string typeName, Type[] typesToSearch) {
- foreach (Type t in typesToSearch) {
- if (t.Name == typeName) {
- foreach (MemberInfo trialMI in t.GetMembers(BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public)) {
- if (mi.Name == trialMI.Name && mi.MemberType == trialMI.MemberType) {
- if (mi.MemberType == MemberTypes.Method) {
- if (IsParameterListEqual(((MethodInfo)mi).GetParameters(), ((MethodInfo)trialMI).GetParameters())) {
- return false;
- }
- }
- else {
- return false;
- }
- }
- }
- }
- }
- return true;
- }
-
- static bool IsParameterListEqual(ParameterInfo[] piArray1, ParameterInfo[] piArray2) {
- if (piArray1.Length != piArray2.Length) {
- return false;
- }
-
- foreach (ParameterInfo pi1 in piArray1) {
- if (pi1.ParameterType.Name != GetTypeAt(pi1.Position, piArray2).Name) {
- return false;
- }
- }
-
- return true;
- }
-
- static Type GetTypeAt(int position, ParameterInfo[] piArray){
- foreach (ParameterInfo pi in piArray) {
- if (pi.Position == position) {
- return pi.ParameterType;
- }
- }
- throw new Exception("contract violation: need to call with existing position");
- }
-
- public MissingType[] MissingTypes {
- get {
- return missingTypes;
- }
- }
-
- public ToDoType[] ToDoTypes {
- get {
- return todoTypes;
- }
- }
-
- public string[] MissingTypeNames(bool qualify){
- ArrayList names = new ArrayList();
- if (qualify) {
- foreach (MissingType t in missingTypes) {
- names.Add(t.NameSpace + "." + t.Name);
- }
- }
- else {
- foreach (MissingType t in missingTypes) {
- names.Add(t.Name);
- }
- }
- return (string[])names.ToArray(typeof(string));
- }
- }
-}
diff --git a/mcs/tools/corcompare/ToDoNestedType.cs b/mcs/tools/corcompare/ToDoNestedType.cs
deleted file mode 100644
index c7cccb10891..00000000000
--- a/mcs/tools/corcompare/ToDoNestedType.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Mono.Util.CorCompare.ToDoNestedType
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class's property that is marked with a MonoTODO
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoNestedType : MissingNestedType
- {
- // e.g. <property name="Count" status="todo" note="another note"/>
- string todoNote = "";
-
- public ToDoNestedType(MemberInfo pInfo) : base(pInfo) {
- }
- public ToDoNestedType(MemberInfo pInfo, string note) :base(pInfo) {
- todoNote = note;
- }
- public string Note {
- get {
- return todoNote;
- }
- }
- public override string Status {
- get {
- return "todo";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/ToDoProperty.cs b/mcs/tools/corcompare/ToDoProperty.cs
deleted file mode 100644
index 43193a1e6d0..00000000000
--- a/mcs/tools/corcompare/ToDoProperty.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Mono.Util.CorCompare.ToDoProperty
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class's property that is marked with a MonoTODO
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoProperty : MissingProperty
- {
- // e.g. <property name="Count" status="todo" note="another note"/>
- string todoNote = "";
-
- public ToDoProperty(MemberInfo pInfo) : base(pInfo) {
- }
- public ToDoProperty(MemberInfo pInfo, string note) :base(pInfo) {
- todoNote = note;
- }
- public string Note {
- get {
- return todoNote;
- }
- }
- public override string Status {
- get {
- return "todo";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/ToDoType.cs b/mcs/tools/corcompare/ToDoType.cs
deleted file mode 100644
index 9235ed5ab8a..00000000000
--- a/mcs/tools/corcompare/ToDoType.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-// Mono.Util.CorCompare.ToDoType
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Collections;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class that is marked with MonoTODO
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoType : MissingType
- {
- // e.g. <class name="System.Array" status="todo" missing="5" todo="6" complete="45">
-
- ArrayList missingMethodList = new ArrayList();
- public ArrayList MissingMethods {
- get {
- return missingMethodList;
- }
- }
-
- ArrayList todoMethodList = new ArrayList();
- public ArrayList ToDoMethods {
- get {
- return todoMethodList;
- }
- }
-
- ArrayList missingPropertyList = new ArrayList();
- public ArrayList MissingProperties {
- get {
- return missingPropertyList;
- }
- }
-
- ArrayList todoPropertyList = new ArrayList();
- public ArrayList ToDoProperties {
- get {
- return todoPropertyList;
- }
- }
-
- ArrayList missingEventList = new ArrayList();
- public ArrayList MissingEvents {
- get {
- return missingEventList;
- }
- }
-
- ArrayList todoEventList = new ArrayList();
- public ArrayList ToDoEvents {
- get {
- return todoEventList;
- }
- }
-
- ArrayList missingFieldList = new ArrayList();
- public ArrayList MissingFields {
- get {
- return missingFieldList;
- }
- }
-
- ArrayList todoFieldList = new ArrayList();
- public ArrayList ToDoFields {
- get {
- return todoFieldList;
- }
- }
-
- ArrayList missingConstructorList = new ArrayList();
- public ArrayList MissingConstructors {
- get {
- return missingConstructorList;
- }
- }
-
- ArrayList todoConstructorList = new ArrayList();
- public ArrayList ToDoConstructors {
- get {
- return todoConstructorList;
- }
- }
-
- ArrayList missingNestedTypeList = new ArrayList();
- public ArrayList MissingNestedTypes {
- get {
- return missingNestedTypeList;
- }
- }
-
- ArrayList todoNestedTypeList = new ArrayList();
- public ArrayList ToDoNestedTypes {
- get {
- return todoNestedTypeList;
- }
- }
-
- public ToDoType(Type t) : base(t) {
- }
-
- public int MissingCount {
- get {
- return missingMethodList.Count + missingPropertyList.Count;
- }
- }
-
- public int ToDoCount {
- get {
- return todoMethodList.Count + todoPropertyList.Count;
- }
- }
-
- public static int IndexOf(Type t, ArrayList todoTypes) {
- for(int index = 0; index < todoTypes.Count; index++) {
- if (((ToDoType)todoTypes[index]).Name == t.Name) {
- return index;
- }
- }
- return -1;
- }
-
- public override string Status {
- get {
- return "todo";
- }
- }
-
- public void AddToDoMember(Type t, MemberInfo info){
- switch (info.MemberType){
- case MemberTypes.Method:
- todoMethodList.Add(new ToDoMethod(info));
- break;
- case MemberTypes.Property:
- todoPropertyList.Add(new ToDoProperty(info));
- break;
- case MemberTypes.Event:
- todoEventList.Add(new ToDoEvent(info));
- break;
- case MemberTypes.Field:
- todoFieldList.Add(new ToDoField(info));
- break;
- case MemberTypes.Constructor:
- todoConstructorList.Add(new ToDoConstructor(info));
- break;
- case MemberTypes.NestedType:
- todoNestedTypeList.Add(new ToDoNestedType(info));
- break;
- default:
- throw new Exception("Didn't code todo member type: " + info.MemberType.ToString());
- }
- }
-
- public void AddMissingMember(MemberInfo info){
- switch (info.MemberType){
- case MemberTypes.Method:
- missingMethodList.Add(new MissingMethod(info));
- break;
- case MemberTypes.Property:
- missingPropertyList.Add(new MissingProperty(info));
- break;
- case MemberTypes.Event:
- missingEventList.Add(new MissingEvent(info));
- break;
- case MemberTypes.Field:
- missingFieldList.Add(new MissingField(info));
- break;
- case MemberTypes.Constructor:
- missingConstructorList.Add(new MissingConstructor(info));
- break;
- case MemberTypes.NestedType:
- missingNestedTypeList.Add(new MissingNestedType(info));
- break;
- default:
- throw new Exception("Didn't code missing member type: " + info.MemberType.ToString());
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/corcompare.build b/mcs/tools/corcompare/corcompare.build
deleted file mode 100644
index 57a16bf4e63..00000000000
--- a/mcs/tools/corcompare/corcompare.build
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<project name="CorCompare" default="linux">
- <target name="linux">
- <csc target="exe" output="./CorCompare.exe">
- <sources>
- <includes name="*.cs" />
- </sources>
- </csc>
- </target>
-
-</project>
diff --git a/mcs/tools/ictool/Makefile b/mcs/tools/ictool/Makefile
deleted file mode 100644
index 27fae41ae61..00000000000
--- a/mcs/tools/ictool/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-CSC=csc.exe
-CSCFLAGS=/nologo /debug+ /debug:full
-
-all: ictool.exe
-
-ictool.exe: ictool.cs depgraph.cs peer.cs
- $(CSC) $(CSCFLAGS) /out:ictool.exe ictool.cs depgraph.cs peer.cs
-
-clean:
- rm -f *.exe *.pdb *.dll
diff --git a/mcs/tools/ictool/depgraph.cs b/mcs/tools/ictool/depgraph.cs
deleted file mode 100644
index 57e96ff3e9c..00000000000
--- a/mcs/tools/ictool/depgraph.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// file: depgraph.cs
-// author: Dan Lewis (dihlewis@yahoo.co.uk)
-// (C) 2002
-//
-
-using System;
-using System.Collections;
-
-class DependencyGraph {
- public DependencyGraph () {
- nodes = new Hashtable ();
- }
-
- public void AddNode (object o) {
- if (!nodes.Contains (o))
- nodes.Add (o, new Node (o));
- }
-
- public void AddEdge (object from, object to) {
- if (!nodes.Contains (from))
- AddNode (from);
- if (!nodes.Contains (to))
- AddNode (from);
-
- Node from_node = (Node)nodes[from];
- Node to_node = (Node)nodes[to];
-
- from_node.edges.Add (to_node);
- }
-
- public IList TopologicalSort () {
- foreach (Node node in nodes.Values)
- node.marked = false;
-
- IList list = new ArrayList ();
- foreach (Node node in nodes.Values) {
- if (!node.marked)
- Visit (node, list);
- }
-
- return list;
- }
-
- // private
-
- private void Visit (Node node, IList list) {
- node.marked = true;
- foreach (Node adj in node.edges) {
- if (!adj.marked)
- Visit (adj, list);
- }
-
- list.Insert (0, node.value);
- }
-
- private class Node {
- public Node (object o) {
- this.value = o;
- this.edges = new ArrayList ();
- }
-
- public object value;
- public ArrayList edges;
- public bool marked;
- }
-
- private Hashtable nodes;
-}
diff --git a/mcs/tools/ictool/ictool-config.xml b/mcs/tools/ictool/ictool-config.xml
deleted file mode 100644
index 9716dc6ee04..00000000000
--- a/mcs/tools/ictool/ictool-config.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<config>
- <!-- assembly inputs -->
-
- <assemblypath path="..\..\class\lib"/>
-
- <assembly file="corlib_cmp.dll"/>
- <assembly file="System.dll"/>
-
- <!-- output files -->
-
- <outputpath path="."/>
-
- <outputfile name="types" file="icall_types.h">
- <include><![CDATA[#include "icall.h"]]></include>
- </outputfile>
-
- <outputfile name="methods" file="icall_methods.h"/>
- <outputfile name="map" file="icall_map.c"/>
-
- <!-- typemap -->
-
- <typemap>
- <!-- base types -->
-
- <namespace name="System">
-
- <!-- default types are taken from the running assembly -->
-
- <type name="Object" peer="MonoObject" opaque="true" default="true"/>
-
- <type name="Void" peer="void" opaque="true" default="true"/>
- <type name="Boolean" peer="MonoBoolean" opaque="true" default="true"/>
- <type name="Int64" peer="gint64" opaque="true" default="true"/>
- <type name="Int32" peer="gint32" opaque="true" default="true"/>
- <type name="Int16" peer="gint16" opaque="true" default="true"/>
- <type name="Byte" peer="gint8" opaque="true" default="true"/>
- <type name="UInt64" peer="guint64" opaque="true" default="true"/>
- <type name="UInt32" peer="guint32" opaque="true" default="true"/>
- <type name="UInt16" peer="guint16" opaque="true" default="true"/>
- <type name="SByte" peer="guint8" opaque="true" default="true"/>
- <type name="IntPtr" peer="gpointer" opaque="true" default="true"/>
- <type name="UIntPtr" peer="gpointer" opaque="true" default="true"/>
- <type name="Single" peer="gfloat" opaque="true" default="true"/>
- <type name="Double" peer="gdouble" opaque="true" default="true"/>
- <type name="Char" peer="gunichar2" opaque="true" default="true"/>
- <type name="Array" peer="MonoArray" opaque="true" default="true"/>
-
- <!-- non-defaulting system types -->
-
- <type name="Decimal" peer="decimal_repr" opaque="true"/>
- <type name="String" peer="MonoString" opaque="true"/>
-
- </namespace>
-
- <!-- reflection types -->
-
- <namespace name="System">
- <type name="RuntimeTypeHandle" peer="MonoType *" opaque="true"/>
- <type name="RuntimeMethodHandle" peer="MonoMethod *" opaque="true"/>
- <type name="RuntimeFieldHandle" peer="MonoClassField *" opaque="true"/>
-
- <type name="Type" peer="MonoReflectionType"/>
- <type name="MonoTypeInfo" peer="MonoTypeInfo"/>
- <type name="MonoEnumInfo" peer="MonoEnumInfo"/>
- </namespace>
-
- <namespace name="System.Reflection">
- <type name="MonoMethod" peer="MonoReflectionMethod"/>
- <type name="MonoField" peer="MonoReflectionField"/>
- <type name="MonoFieldInfo" peer="MonoFieldInfo"/>
- <type name="MonoProperty" peer="MonoReflectionProperty"/>
- <type name="ParameterInfo" peer="MonoParameterInfo"/>
- <type name="MonoMethodInfo" peer="MonoMethodInfo"/>
- <type name="MonoPropertyInfo" peer="MonoPropertyInfo"/>
- <type name="Assembly" peer="MonoReflectionAssembly"/>
- <type name="Module" peer="MonoReflectionModule"/>
- <type name="AssemblyName" peer="MonoReflectionAssemblyName"/>
- </namespace>
-
- <namespace name="System.Reflection.Emit">
- <type name="ILGenerator" peer="MonoReflectionILGen"/>
- <type name="ILExceptionInfo" peer="MonoILExceptionInfo"/>
- <type name="ILExceptionBlock" peer="MonoILExceptionBlock"/>
- <type name="LocalBuilder" peer="MonoReflectionLocalBuilder"/>
- <type name="ParameterBuilder" peer="MonoReflectionParamBuilder"/>
- <type name="ConstructorBuilder" peer="MonoReflectionCtorBuilder"/>
- <type name="MethodBuilder" peer="MonoReflectionMethodBuilder"/>
- <type name="FieldBuilder" peer="MonoReflectionFieldBuilder"/>
- <type name="PropertyBuilder" peer="MonoReflectionPropertyBuilder"/>
- <type name="ModuleBuilder" peer="MonoReflectionModuleBuilder"/>
- <type name="TypeBuilder" peer="MonoReflectionTypeBuilder"/>
- <type name="Label" peer="MonoReflectionLabel"/>
- </namespace>
-
- <!-- enumerations -->
-
- <namespace name="System.Net.Sockets">
- <type name="SocketType" peer="MonoSocketType"/>
- <type name="AddressFamily" peer="MonoAddressFamily"/>
- <type name="ProtocolType" peer="MonoProtocolType"/>
- <type name="SocketOptionLevel" peer="MonoSocketOptionLevel"/>
- <type name="SocketOptionName" peer="MonoSocketOptionName"/>
- </namespace>
- </typemap>
-</config>
diff --git a/mcs/tools/ictool/ictool.cs b/mcs/tools/ictool/ictool.cs
deleted file mode 100644
index 9b4e0dd4472..00000000000
--- a/mcs/tools/ictool/ictool.cs
+++ /dev/null
@@ -1,428 +0,0 @@
-//
-// file: ictool.cs
-// author: Dan Lewis (dihlewis@yahoo.co.uk)
-// (C) 2002
-//
-// description:
-//
-// Tool for generating C prototypes and structures suitable for use by the runtime
-// from a list of supplied assemblies. See ictool-config.xml for configuration details.
-//
-
-using System;
-using System.IO;
-using System.Xml;
-using System.Reflection;
-using System.Collections;
-
-public class ICTool {
- public static void Main (string[] args) {
- string filename = "ictool-config.xml";
- if (args.Length == 1) {
- filename = args[0];
- }
- else if (args.Length > 1) {
- Console.Error.WriteLine ("Usage: ictool.exe [config.xml]");
- Environment.Exit (-1);
- }
-
- try {
- Stream config = File.OpenRead (filename);
- Configure (config);
- }
- catch (Exception e) {
- Console.Error.WriteLine ("Error: could not read configuration file.");
- Console.Error.WriteLine (e);
- Environment.Exit (-1);
- }
-
- EmitPrototypes ();
- EmitStructures ();
- }
-
- // private
-
- private static void EmitPrototypes () {
- StreamWriter methods_file = GetOutputFile ("methods");
- StreamWriter map_file = GetOutputFile ("map");
-
- // includes
-
- methods_file.WriteLine ("#include \"{0}\"\n", output_files["types"]);
- map_file.WriteLine ("#include \"{0}\"\n", output_files["methods"]);
-
- map_file.Write (
- "static gpointer icall_map [] = {\n\t"
- );
-
- ArrayList map_lines = new ArrayList ();
-
- BindingFlags binding =
- BindingFlags.DeclaredOnly |
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic;
-
- foreach (Type type in types.Values) {
- bool has_icall = false;
- MethodInfo[] methods = type.GetMethods (binding);
-
- foreach (MethodInfo method in methods) {
- if (IsInternalCall (method)) {
- has_icall = true;
- break;
- }
- }
-
- if (!has_icall)
- continue;
-
- methods_file.WriteLine ("\n/* {0} */\n", type.FullName);
- //map_lines.Add (String.Format ("\n/* {0} */\n", type.FullName));
-
- foreach (MethodInfo method in methods) {
- if (!IsInternalCall (method))
- continue;
-
- // function name
-
- string func_name = String.Format ("ves_icall_{0}_{1}",
-
- type.FullName,
- method.Name
- );
-
- func_name = func_name.Replace ('.', '_');
-
- // map file
-
- map_lines.Add (String.Format (
- "\"{0}::{1}\", {2}",
-
- type.FullName.Replace ('.', '_'),
- method.Name,
- func_name
- ));
-
- // methods file
-
- ArrayList args = new ArrayList ();
-
- // FIXME: return types that are structs need to be inserted
- // into the argument list as a destination pointer
-
- // object/value instance pointer
-
- if (IsInstanceMethod (method)) {
- args.Add (String.Format (
- "{0}{1}",
-
- peer_map.GetPeer (method.DeclaringType).GetTypedef (1),
- "this"
- ));
- }
-
- // arguments
-
- foreach (ParameterInfo param in method.GetParameters ()) {
- Type arg_type = param.ParameterType;
-
- int refs = 0;
- if (arg_type.IsByRef) {
- arg_type = arg_type.GetElementType ();
- ++ refs;
- }
-
- Peer arg_peer = peer_map.GetPeer (arg_type);
- if (!arg_peer.IsValueType)
- ++ refs;
-
- args.Add (String.Format ("{0}{1}", arg_peer.GetTypedef (refs), param.Name));
- }
-
- Peer ret = peer_map.GetPeer (method.ReturnType);
- methods_file.WriteLine ("static {0}", ret.GetTypedef (ret.IsValueType ? 0 : 1));
- methods_file.WriteLine ("{0} ({1});",
-
- func_name,
- Join (", ", args)
- );
- methods_file.WriteLine ();
- }
-
- }
-
- methods_file.Close ();
-
- // write map file and close it
-
- map_file.Write (
- "{0}\n}};\n", Join (",\n\t", map_lines)
- );
-
- map_file.Close ();
- }
-
- private static bool IsInternalCall (MethodInfo meth) {
- return (meth.GetMethodImplementationFlags () & MethodImplAttributes.InternalCall) != 0;
- }
-
- private static bool IsInstanceMethod (MethodInfo meth) {
- return (meth.CallingConvention & CallingConventions.HasThis) != 0;
- }
-
- private static void EmitStructures () {
- StreamWriter file = GetOutputFile ("types");
-
- // build dependency graph
-
- DependencyGraph dg = new DependencyGraph ();
- foreach (Peer peer in peer_map.Peers) {
- dg.AddNode (peer);
-
- // peer depends on nearest base
-
- if (peer.NearestBase != null)
- dg.AddEdge (peer.NearestBase, peer);
-
- // peer depends on any value types used for fields
-
- foreach (PeerField field in peer.Fields) {
- if (field.Peer.IsValueType)
- dg.AddEdge (field.Peer, peer);
- }
- }
-
- // write structures in order
-
- foreach (Peer peer in dg.TopologicalSort ()) {
- if (peer.IsOpaque)
- continue;
-
- if (peer.IsEnum) {
- file.WriteLine ("typedef {0} {1};", peer.UnderlyingPeer.Name, peer.Name);
- file.WriteLine ("enum _{0} {{", peer.Name);
-
- ArrayList enum_lines = new ArrayList ();
- foreach (string name in peer.EnumConstants.Keys) {
- enum_lines.Add (String.Format ("\t{0}_{1} = {2}",
- peer.Name,
- name,
- peer.EnumConstants[name]
- ));
- }
-
- file.WriteLine ("{0}\n}};\n", Join (",\n", enum_lines));
- }
- else {
- file.WriteLine ("typedef struct _{0} {{", peer.Name);
-
- // base type
-
- if (peer.NearestBase != null) {
- file.WriteLine ("\t{0} __base;", peer.NearestBase.Name);
- file.WriteLine ();
- }
-
- // fields
-
- foreach (PeerField field in peer.Fields) {
- bool use_struct = true;
- if (field.Peer.IsValueType || field.Peer.IsOpaque)
- use_struct = false;
-
- file.WriteLine ("\t{0}{1}{2};",
- use_struct ? "struct _" : "",
- field.Peer.GetTypedef (field.Peer.IsValueType ? 0 : 1),
- field.Name
- );
- }
-
- file.WriteLine ("}} {0};\n", peer.Name);
- }
- }
- }
-
- private static void LoadAssemblies () {
- types = new Hashtable ();
-
- foreach (string filename in assemblies) {
- Assembly assembly;
-
- // find assembly
-
- FileInfo info = null;
- foreach (string path in assembly_paths) {
- info = new FileInfo (Path.Combine (path, filename));
- if (info.Exists)
- break;
- }
-
- if (!info.Exists) {
- Console.Error.WriteLine ("Error: assembly {0} not found.", filename);
- Environment.Exit (-1);
- }
-
- // load assembly
-
- assembly = Assembly.LoadFrom (info.FullName);
-
- // load types
-
- ArrayList loaded_types;
-
- try {
- loaded_types = new ArrayList (assembly.GetTypes ());
- }
- catch (ReflectionTypeLoadException e) {
- loaded_types = new ArrayList ();
- foreach (Type type in e.Types) {
- if (type != null)
- loaded_types.Add (type);
- }
-
- foreach (Exception f in e.LoaderExceptions) {
- if (f is TypeLoadException) {
- Console.Error.WriteLine ("Warning: {0} could not be loaded from assembly {1}.",
- ((TypeLoadException)f).TypeName,
- filename
- );
- }
- else
- Console.Error.WriteLine (f);
- }
- }
-
- // add to type dictionary
-
- foreach (Type type in loaded_types) {
- if (!types.Contains (type.FullName))
- types.Add (type.FullName, type);
- }
- }
- }
-
- private static void Configure (Stream input) {
- XmlDocument doc = new XmlDocument ();
- doc.Load (input);
-
- // assemblies
-
- assembly_paths = new ArrayList ();
- assembly_paths.Add (".");
-
- foreach (XmlNode node in doc.SelectNodes ("config/assemblypath")) {
- assembly_paths.Add (node.Attributes["path"].Value);
- }
-
- assemblies = new ArrayList ();
- foreach (XmlNode node in doc.SelectNodes ("config/assembly")) {
- assemblies.Add (node.Attributes["file"].Value);
- }
-
- LoadAssemblies ();
-
- // outputfiles
-
- output_path = ".";
- XmlNode path_node = doc.SelectSingleNode ("config/outputpath");
- if (path_node != null)
- output_path = path_node.Attributes["path"].Value;
-
- output_files = new Hashtable ();
- output_includes = new Hashtable ();
- foreach (XmlNode node in doc.SelectNodes ("config/outputfile")) {
- string name = node.Attributes["name"].Value;
- output_files.Add (name, node.Attributes["file"].Value);
-
- foreach (XmlNode child in node.ChildNodes) {
- if (child.Name == "include")
- output_includes[name] = child.InnerText;
- }
- }
-
- // typemap
-
- peer_map = new PeerMap ();
- foreach (XmlNode node in doc.SelectNodes ("config/typemap/namespace")) {
- string ns = node.Attributes["name"].Value;
-
- foreach (XmlNode child in node.ChildNodes) {
- if (child.Name == "type") {
- string name = child.Attributes["name"].Value;
- string peer_name = child.Attributes["peer"].Value;
-
- bool opaque = false;
- if (child.Attributes["opaque"] != null && child.Attributes["opaque"].Value == "true")
- opaque = true;
-
- String fullname = String.Format ("{0}.{1}", ns, name);
-
- Type type;
- if (child.Attributes["default"] != null && child.Attributes["default"].Value == "true")
- type = Type.GetType (fullname);
- else
- type = (Type)types [fullname];
-
- if (type != null)
- peer_map.Add (new Peer (type, peer_name, opaque));
- }
- }
- }
-
- peer_map.ResolvePeers ();
- }
-
- private static StreamWriter GetOutputFile (string name) {
- string filename = Path.Combine (output_path, (string)output_files[name]);
- StreamWriter file = File.CreateText (filename);
- file.AutoFlush = true;
-
- file.Write (
-
-// (verbatim string)
-
-@"/**
- * {0}
- *
- * This file was automatically generated on {1} by ictool.exe from
- * the following assemblies:
- * {2}
- */
-
-",
-
- output_files[name],
- DateTime.Now.ToString ("d"),
- Join (", ", assemblies)
- );
-
- if (output_includes.Contains (name)) {
- file.WriteLine (output_includes [name]);
- file.WriteLine ();
- }
-
- return file;
- }
-
- private static string Join (string separator, ICollection values) {
- // note to microsoft: please implement this in String :)
-
- string[] strs = new string[values.Count];
-
- int i = 0;
- foreach (object value in values)
- strs[i ++] = value.ToString ();
-
- return String.Join (separator, strs);
- }
-
- private static ArrayList assembly_paths;
- private static ArrayList assemblies;
- private static string output_path;
- private static Hashtable output_files;
- private static Hashtable output_includes;
- private static PeerMap peer_map;
- private static Hashtable types;
-}
diff --git a/mcs/tools/ictool/peer.cs b/mcs/tools/ictool/peer.cs
deleted file mode 100644
index 6c3e0998f41..00000000000
--- a/mcs/tools/ictool/peer.cs
+++ /dev/null
@@ -1,284 +0,0 @@
-//
-// file: peer.cs
-// author: Dan Lewis (dihlewis@yahoo.co.uk)
-// (C) 2002
-//
-
-using System;
-using System.Reflection;
-using System.Collections;
-
-class Peer {
- public Peer (Type clr_type, string name, bool is_opaque) {
- this.clr_type = clr_type;
- this.name = name;
- this.is_opaque = is_opaque;
-
- this.nearest_base = null; // resolve later
- this.underlying = null;
- this.enum_constants = null;
- this.fields = new PeerFieldCollection ();
-
- this.is_enum = CLRIsEnum (clr_type);
- this.is_value_type = CLRIsValueType (clr_type);
- }
-
- public string Name {
- get { return name; }
- }
-
- public Type CLRType {
- get { return clr_type; }
- }
-
- public bool IsOpaque {
- get { return is_opaque; }
- }
-
- public bool IsValueType {
- get { return is_value_type; }
- }
-
- public bool IsEnum {
- get { return is_enum; }
- }
-
- public Peer NearestBase {
- get { return nearest_base; }
- set { nearest_base = value; }
- }
-
- public Peer UnderlyingPeer {
- get { return underlying; }
- set { underlying = value; }
- }
-
- public IDictionary EnumConstants {
- get { return enum_constants; }
- set { enum_constants = value; }
- }
-
- public PeerFieldCollection Fields {
- get { return fields; }
- }
-
- public string GetTypedef (int refs) {
- if (refs == 0)
- return String.Format ("{0} ", name);
-
- return String.Format ("{0} {1}", name, new string ('*', refs));
- }
-
- // internal
-
- internal static bool CLRIsValueType (Type clr_type) {
- return clr_type.IsValueType;
- /*
- if (clr_type.BaseType == null)
- return false;
-
- return
- clr_type.BaseType.FullName == "System.ValueType" ||
- clr_type.BaseType.FullName == "System.Enum";
- */
- }
-
- internal static bool CLRIsEnum (Type clr_type) {
- return clr_type.IsEnum;
- /*
- if (clr_type.BaseType == null)
- return false;
-
- return clr_type.BaseType.FullName == "System.Enum";
- */
- }
-
- internal static Type CLRUnderlyingType (Type clr_type) {
- return Enum.GetUnderlyingType (clr_type);
- /*
- Type ebase = type.BaseType;
-
- return (Type)ebase.InvokeMember ("GetUnderlyingType",
- BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Static,
- null, null,
- new object[] { type }
- );
- */
- }
-
- // private
-
- private Type clr_type;
- private bool is_opaque;
- private bool is_value_type;
- private bool is_enum;
-
- private string name;
- private Peer nearest_base;
- private Peer underlying;
- private IDictionary enum_constants;
- private PeerFieldCollection fields;
-}
-
-class PeerField {
- public PeerField (Peer peer, string name) {
- this.peer = peer;
- this.name = name;
- }
-
- public Peer Peer {
- get { return peer; }
- }
-
- public string Name {
- get { return name; }
- }
-
- private Peer peer;
- private string name;
-}
-
-class PeerFieldCollection : CollectionBase {
- public void Add (PeerField f) {
- List.Add (f);
- }
-
- public PeerField this[int i] {
- get { return (PeerField)List[i]; }
- }
-}
-
-class PeerMap {
- public PeerMap () {
- peers = new Hashtable ();
- }
-
- public void Add (Peer peer) {
- Add (peer.CLRType, peer);
- }
-
- public void Add (Type clr_type, Peer peer) {
- peers.Add (clr_type, peer);
- }
-
- public ICollection Peers {
- get { return peers.Values; }
- }
-
- public Peer this[Type clr_type] {
- get {
- if (peers.Contains (clr_type))
- return (Peer)peers[clr_type];
-
- return null;
- }
- }
-
- public Peer GetPeer (Type clr_type) {
- Peer peer;
-
- if (Peer.CLRIsValueType (clr_type)) {
- peer = this[clr_type];
- if (peer != null)
- return peer;
-
- if (Peer.CLRIsEnum (clr_type)) {
- peer = this[Peer.CLRUnderlyingType (clr_type)];
- if (peer != null)
- return peer;
-
- throw new ArgumentException ("Could not find peer or underlying peer for enum " + clr_type);
- }
- else
- throw new ArgumentException ("Could not find peer for value type " + clr_type);
- }
- else {
- Type type = clr_type;
- while (type != null) {
- peer = this[type];
- if (peer != null)
- return peer;
-
- type = type.BaseType;
- }
-
- throw new ArgumentException ("Could not find peer for class " + clr_type);
- }
- }
-
- public void ResolvePeers () {
- BindingFlags binding =
- BindingFlags.DeclaredOnly |
- BindingFlags.Instance |
- BindingFlags.NonPublic |
- BindingFlags.Public;
-
- // base type
-
- foreach (Peer peer in Peers) {
- if (peer.IsOpaque || peer.IsValueType || peer.CLRType.BaseType == null)
- continue;
-
- peer.NearestBase = GetPeer (peer.CLRType.BaseType);
- if (peer.NearestBase == null) {
- Console.Error.WriteLine ("Error: cannot find an internal base type for {0}.", peer.Name);
- Environment.Exit (-1);
- }
- }
-
- // fields
-
- foreach (Peer peer in Peers) {
- if (peer.IsOpaque || peer.IsEnum)
- continue;
-
- Type clr_base = null;
- if (peer.NearestBase != null)
- clr_base = peer.NearestBase.CLRType;
-
- Stack declared = new Stack ();
- Type type = peer.CLRType;
-
- while (type != clr_base) {
- declared.Push (type);
- type = type.BaseType;
- }
-
- // build declared field list
-
- while (declared.Count > 0) {
- type = (Type)declared.Pop ();
- foreach (FieldInfo info in type.GetFields (binding)) {
- PeerField field = new PeerField (
- GetPeer (info.FieldType),
- info.Name
- );
-
- peer.Fields.Add (field);
- }
- }
- }
-
- // enums
-
- foreach (Peer peer in Peers) {
- if (peer.IsOpaque || !peer.IsEnum)
- continue;
-
- Type clr_type = peer.CLRType;
-
- // constants
-
- Hashtable constants = new Hashtable ();
- foreach (string name in Enum.GetNames (clr_type))
- constants.Add (name, (int)Enum.Parse (clr_type, name));
-
- peer.UnderlyingPeer = GetPeer (Enum.GetUnderlyingType (clr_type));
- peer.EnumConstants = constants;
- }
- }
-
- // private
-
- private Hashtable peers;
-}
diff --git a/mcs/tools/makefile b/mcs/tools/makefile
deleted file mode 100644
index 931268a2c9d..00000000000
--- a/mcs/tools/makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-CSC=csc.exe
-CSCFLAGS=/nologo /debug+ /debug:full
-
-windows: linux
-
-linux: verifier.exe EnumCheck.exe IFaceDisco.exe CorCompare.exe update
-
-verifier.exe: verifier.cs
- $(CSC) $(CSCFLAGS) verifier.cs
-
-CorCompare.exe:
- (cd corcompare; make CorCompare.exe)
-
-update: CorCompare.exe
- ./corcompare/CorCompare.exe -x cormissing.xml ../class/lib/corlib_cmp.dll
- ./corcompare/CorCompare.exe -t ../class/lib/corlib_cmp.dll > ../../mono/doc/pending-classes.in
-
-EnumCheck: EnumCheck.exe
-
-EnumCheck.exe: EnumCheck.cs EnumCheckAssemblyCollection.cs
- $(CSC) $(CSCFLAGS) /out:EnumCheck.exe EnumCheck.cs EnumCheckAssemblyCollection.cs
-
-IFaceDisco.exe: IFaceDisco.cs XMLUtil.cs
- $(CSC) $(CSCFLAGS) /out:IFaceDisco.exe IFaceDisco.cs XMLUtil.cs
-
-clean:
- (cd corcompare; make clean)
- rm -f *.exe *.pdb *.dll
- rm -f cormissing.xml
- rm -f ../../mono/doc/pending-classes.in
diff --git a/mcs/tools/sample.xml b/mcs/tools/sample.xml
deleted file mode 100644
index 4cfbc4f53f3..00000000000
--- a/mcs/tools/sample.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<assemblies>
- <assembly name="corlib" missing="1753" todo="2312" complete="8">
- <namespaces>
- <namespace name="System" missing="267" todo="453" complete="21">
- <classes>
- <class name="System.Byte" status="missing"/>
- <class name="System.Array" status="todo" missing="5" todo="6" complete="45">
- <methods>
- <method name="ToString" status="todo" note="this is the note from MonoTODO"/>
- <method name="Equals" status="missing"/>
- </methods>
- <properties>
- <property name="Count" status="todo" note="another note"/>
- </properties>
- </class>
- </classes>
- </namespace>
- </namespaces>
- </assembly>
-</assemblies> \ No newline at end of file
diff --git a/mcs/tools/sample_cast_const.cs b/mcs/tools/sample_cast_const.cs
deleted file mode 100755
index 04969312cde..00000000000
--- a/mcs/tools/sample_cast_const.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-
-class X {
- static void w (string s)
- {
- Console.WriteLine ("\t" + s);
- }
-
- static void Main ()
- {
- object [,] names =
- { { "Byte", "byte" },
- { "SByte", "sbyte" },
- { "Short", "short" },
- { "UShort", "ushort" },
- { "Int", "int32" },
- { "UInt", "uint32" },
- { "Long", "int64" },
- { "ULong", "uint64" },
- { "Float", "float" },
- { "Double", "double" },
- { null, null }
- };
-
- for (int i = 0; names [i,0] != null; i++){
- string big = names [i, 0] + "Constant";
- string small = "TypeManager." + names [i, 1] + "_type";
- string nat = ((string) names [i,0]).ToLower ();
-
- w ("\t\tif (expr is " + big + "){");
- w ("\t\t\t" + nat + " v = ((" + big + ") expr).Value;");
- w ("");
-
- for (int j = 0; names [j,0] != null; j++){
- string b = names [j, 0] + "Constant";
- string s = "TypeManager." + names [j, 1] + "_type";
- string n = ((string) names [j,0]).ToLower ();
-
- if (i == j)
- continue;
-
- w ("\t\t\tif (target_type == " + s + ")");
- w ("\t\t\t\treturn new " + b + " ((" + n + ") v);");
- }
- w ("\t\t}");
- }
- }
-}
-
diff --git a/mcs/tools/serialize.cs b/mcs/tools/serialize.cs
deleted file mode 100755
index 01b83f83b87..00000000000
--- a/mcs/tools/serialize.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// Serialize.cs
-//
-// This program creates a SerializationInfo and requests an object
-// to serialize itself.
-//
-// We serialize because we need to know the *exact* names that are
-// used for the values being serialized.
-//
-// Author: Miguel de Icaza
-// Duncan Mak
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Formatters.Soap;
-using System.IO;
-
-namespace Mono.Serialize {
- class Driver {
- static object StaticCreateObject ()
- {
- //
- // Change the object type here.
- //
- return null;
- }
-
- static object LiveCreateObject (Type obj, Type[] types, string[] values)
- {
- if (types.Length != values.Length)
- throw new ArgumentException ();
-
- object[] a = new object [types.Length];
-
- for (int i = 0; i < a.Length; i++)
- a [i] = Convert.ChangeType (values [i], types [i]);
-
- return Activator.CreateInstance (obj, a);
- }
-
- static void Main (string[] args)
- {
- object x = null;
- string strTypes = null;
- string argValues = null;
-
- if (args.Length == 1) {
- Type t = Type.GetType (args[0]);
- Console.WriteLine ("\nPlease enter the arguments to the constructor for type {0}", t.ToString());
- strTypes = Console.ReadLine ();
- Console.WriteLine ("\nPlease enter the values");
- argValues = Console.ReadLine ();
- Type[] types = ToTypeArray (strTypes.Split (','));
- string[] param = argValues.Split (',');
-
- x = LiveCreateObject (t, types, param);
- } else {
- x = StaticCreateObject ();
- }
-
- string fileName = x.GetType().FullName + ".xml";
- Stream output = new FileStream (fileName, FileMode.Create,
- FileAccess.Write, FileShare.None);
- IFormatter formatter = new SoapFormatter ();
-
- formatter.Serialize ((Stream) output, x);
- output.Close ();
- }
-
- public static Type[] ToTypeArray (string[] strTypes)
- {
- Type[] t = new Type [strTypes.Length];
-
- for (int i = 0; i < strTypes.Length; i++)
- t [i] = StringToType (strTypes [i]);
- return t;
- }
-
- public static Type StringToType (string s)
- {
- switch (s) {
- case "bool":
- return typeof (System.Boolean);
- break;
- case "byte":
- return typeof (System.Byte);
- break;
- case "sbyte":
- return typeof (System.SByte);
- break;
- case "char":
- return typeof (System.Char);
- break;
- case "decimal":
- return typeof (System.Decimal);
- break;
- case "double":
- return typeof (System.Double);
- break;
- case "float":
- return typeof (System.Single);
- break;
- case "int":
- return typeof (System.Int32);
- break;
- case "uint":
- return typeof (System.UInt32);
- break;
- case "long":
- return typeof (System.Int64);
- break;
- case "ulong":
- return typeof (System.UInt64);
- break;
- case "object":
- return typeof (System.Object);
- break;
- case "short":
- return typeof (System.Int16);
- break;
- case "ushort":
- return typeof (System.UInt16);
- break;
- case "string":
- return typeof (System.String);
- break;
- default:
- return Type.GetType (s);
- break;
- }
- }
- }
-}
diff --git a/mcs/tools/verifier.cs b/mcs/tools/verifier.cs
deleted file mode 100644
index 25268147b26..00000000000
--- a/mcs/tools/verifier.cs
+++ /dev/null
@@ -1,1587 +0,0 @@
-//
-// verifier.cs: compares two assemblies and reports differences.
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-// (C) Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Reflection;
-
-namespace Mono.Verifier {
-
-
-
- ////////////////////////////////
- // Collections
- ////////////////////////////////
-
- public abstract class MemberCollection : IEnumerable {
-
- public delegate MemberInfo [] InfoQuery (Type type, BindingFlags bindings);
- public delegate bool MemberComparer (MemberInfo mi1, MemberInfo mi2);
-
- protected SortedList list;
- protected MemberComparer comparer;
-
- protected BindingFlags bindings;
-
- protected MemberCollection (Type type, InfoQuery query, MemberComparer comparer, BindingFlags bindings)
- {
- if (query == null)
- throw new NullReferenceException ("Invalid query delegate.");
-
- if (comparer == null)
- throw new NullReferenceException ("Invalid comparer.");
-
- this.comparer = comparer;
- this.bindings = bindings;
-
- this.list = new SortedList ();
-
- MemberInfo [] data = query (type, bindings);
- foreach (MemberInfo info in data) {
- this.list [info.Name] = info;
- }
- }
-
-
-
- public MemberInfo this [string name] {
- get {
- return list [name] as MemberInfo;
- }
- }
-
-
- public override int GetHashCode ()
- {
- return list.GetHashCode ();
- }
-
-
- public override bool Equals (object o)
- {
- bool res = (o is MemberCollection);
- if (res) {
- MemberCollection another = o as MemberCollection;
- IEnumerator it = GetEnumerator ();
- while (it.MoveNext () && res) {
- MemberInfo inf1 = it.Current as MemberInfo;
- MemberInfo inf2 = another [inf1.Name];
- res &= comparer (inf1, inf2);
- }
- }
- return res;
- }
-
-
-
- public static bool operator == (MemberCollection c1, MemberCollection c2)
- {
- return c1.Equals (c2);
- }
-
- public static bool operator != (MemberCollection c1, MemberCollection c2)
- {
- return !(c1 == c2);
- }
-
-
-
- public IEnumerator GetEnumerator()
- {
- return new Iterator (this);
- }
-
-
- internal class Iterator : IEnumerator {
- private MemberCollection host;
- private int pos;
-
- internal Iterator (MemberCollection host)
- {
- this.host=host;
- this.Reset ();
- }
-
- /// <summary></summary>
- public object Current
- {
- get {
- if (host != null && pos >=0 && pos < host.list.Count) {
- return host.list.GetByIndex (pos);
- } else {
- return null;
- }
- }
- }
-
- /// <summary></summary>
- public bool MoveNext ()
- {
- if (host!=null) {
- return (++pos) < host.list.Count;
- } else {
- return false;
- }
- }
-
- /// <summary></summary>
- public void Reset ()
- {
- this.pos = -1;
- }
- }
-
- }
-
-
-
-
- //--- Method collections
-
- /// <summary>
- /// Abstract collection of class' methods.
- /// </summary>
- public abstract class MethodCollectionBase : MemberCollection {
-
-
- protected MethodCollectionBase (Type type, BindingFlags bindings)
- : base (type, new InfoQuery (Query), new MemberComparer (Comparer), bindings)
- {
- }
-
-
- private static MemberInfo [] Query (Type type, BindingFlags bindings)
- {
- // returns MethodInfo []
- return type.GetMethods (bindings);
- }
-
- private static bool Comparer (MemberInfo mi1, MemberInfo mi2)
- {
- bool res = false;
- if (mi1 is MethodInfo && (mi2 == null || mi2 is MethodInfo)) {
- MethodInfo inf1 = mi1 as MethodInfo;
- MethodInfo inf2 = mi2 as MethodInfo;
- res = Compare.Methods (inf1, inf2);
- } else {
- Verifier.log.Write ("internal-error", "Wrong comparer arguments.", ImportanceLevel.HIGH);
- }
- return res;
- }
- }
-
-
-
- /// <summary>
- /// Collection of public instance methods of a class.
- /// </summary>
- public class PublicMethods : MethodCollectionBase {
-
- public PublicMethods (Type type)
- : base (type, BindingFlags.Public | BindingFlags.Instance)
- {
- }
- }
-
- /// <summary>
- /// Collection of public static methods of a class.
- /// </summary>
- public class PublicStaticMethods : MethodCollectionBase {
-
- public PublicStaticMethods (Type type)
- : base (type, BindingFlags.Public | BindingFlags.Static)
- {
- }
- }
-
- /// <summary>
- /// Collection of non-public instance methods of a class.
- /// </summary>
- public class NonPublicMethods : MethodCollectionBase {
-
- public NonPublicMethods (Type type)
- : base (type, BindingFlags.NonPublic | BindingFlags.Instance)
- {
- }
- }
-
- /// <summary>
- /// Collection of non-public static methods of a class.
- /// </summary>
- public class NonPublicStaticMethods : MethodCollectionBase {
-
- public NonPublicStaticMethods (Type type)
- : base (type, BindingFlags.NonPublic | BindingFlags.Static)
- {
- }
- }
-
-
-
-
-
- //--- Field collections
-
- public abstract class FieldCollectionBase : MemberCollection {
-
-
- protected FieldCollectionBase (Type type, BindingFlags bindings)
- : base (type, new InfoQuery (Query), new MemberComparer (Comparer), bindings)
- {
- }
-
-
- private static MemberInfo [] Query (Type type, BindingFlags bindings)
- {
- // returns FieldInfo []
- return type.GetFields (bindings);
- }
-
- private static bool Comparer (MemberInfo mi1, MemberInfo mi2)
- {
- bool res = false;
- if (mi1 is FieldInfo && (mi2 == null || mi2 is FieldInfo)) {
- FieldInfo inf1 = mi1 as FieldInfo;
- FieldInfo inf2 = mi2 as FieldInfo;
- res = Compare.Fields (inf1, inf2);
- } else {
- Verifier.log.Write ("internal-error", "Wrong comparer arguments.", ImportanceLevel.HIGH);
- }
- return res;
- }
- }
-
-
- public class PublicFields : FieldCollectionBase {
-
- public PublicFields (Type type)
- : base (type, BindingFlags.Public | BindingFlags.Instance)
- {
- }
- }
-
- public class PublicStaticFields : FieldCollectionBase {
-
- public PublicStaticFields (Type type)
- : base (type, BindingFlags.Public | BindingFlags.Static)
- {
- }
- }
-
- public class NonPublicFields : FieldCollectionBase {
-
- public NonPublicFields (Type type)
- : base (type, BindingFlags.NonPublic | BindingFlags.Instance)
- {
- }
- }
-
- public class NonPublicStaticFields : FieldCollectionBase {
-
- public NonPublicStaticFields (Type type)
- : base (type, BindingFlags.NonPublic | BindingFlags.Static)
- {
- }
- }
-
-
-
-
-
- public abstract class AbstractTypeStuff {
- public readonly Type type;
-
- public AbstractTypeStuff (Type type)
- {
- if (type == null)
- throw new NullReferenceException ("Invalid type.");
-
- this.type = type;
- }
-
- public override int GetHashCode ()
- {
- return type.GetHashCode ();
- }
-
- public static bool operator == (AbstractTypeStuff t1, AbstractTypeStuff t2)
- {
- if ((t1 as object) == null) {
- if ((t2 as object) == null) return true;
- return false;
- }
- return t1.Equals (t2);
- }
-
- public static bool operator != (AbstractTypeStuff t1, AbstractTypeStuff t2)
- {
- return !(t1 == t2);
- }
-
- public override bool Equals (object o)
- {
- return (o is AbstractTypeStuff && CompareTypes (o as AbstractTypeStuff));
- }
-
- protected virtual bool CompareTypes (AbstractTypeStuff that)
- {
- Verifier.Log.Write ("info", "Comparing types.", ImportanceLevel.LOW);
- bool res;
-
- res = Compare.Types (this.type, that.type);
-
- return res;
- }
-
- }
-
-
-
-
- /// <summary>
- /// Represents a class.
- /// </summary>
- public class ClassStuff : AbstractTypeStuff {
-
- public PublicMethods publicMethods;
- public PublicStaticMethods publicStaticMethods;
- public NonPublicMethods nonpublicMethods;
- public NonPublicStaticMethods nonpublicStaticMethods;
-
- public PublicFields publicFields;
- public PublicStaticFields publicStaticFields;
- public NonPublicFields nonpublicFields;
- public NonPublicStaticFields nonpublicStaticFields;
-
- public ClassStuff (Type type) : base (type)
- {
- publicMethods = new PublicMethods (type);
- publicStaticMethods = new PublicStaticMethods (type);
- nonpublicMethods = new NonPublicMethods (type);
- nonpublicStaticMethods = new NonPublicStaticMethods (type);
-
- publicFields = new PublicFields (type);
- publicStaticFields = new PublicStaticFields (type);
- nonpublicFields = new NonPublicFields (type);
- nonpublicStaticFields = new NonPublicStaticFields (type);
- }
-
-
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- private bool CompareMethods (ClassStuff that)
- {
- bool res = true;
- bool ok;
-
- Verifier.Log.Write ("info", "Comparing public instance methods.", ImportanceLevel.LOW);
- ok = (this.publicMethods == that.publicMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing public static methods.", ImportanceLevel.LOW);
- ok = (this.publicStaticMethods == that.publicStaticMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing non-public instance methods.", ImportanceLevel.LOW);
- ok = (this.nonpublicMethods == that.nonpublicMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing non-public static methods.", ImportanceLevel.LOW);
- ok = (this.nonpublicStaticMethods == that.nonpublicStaticMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- return res;
- }
-
-
- private bool CompareFields (ClassStuff that)
- {
- bool res = true;
- bool ok;
-
- Verifier.Log.Write ("info", "Comparing public instance fields.", ImportanceLevel.LOW);
- ok = (this.publicFields == that.publicFields);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing public static fields.", ImportanceLevel.LOW);
- ok = (this.publicStaticFields == that.publicStaticFields);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing non-public instance fields.", ImportanceLevel.LOW);
- ok = (this.nonpublicFields == that.nonpublicFields);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing non-public static fields.", ImportanceLevel.LOW);
- ok = (this.nonpublicStaticFields == that.nonpublicStaticFields);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- return res;
- }
-
-
- public override bool Equals (object o)
- {
- bool res = (o is ClassStuff);
- if (res) {
- ClassStuff that = o as ClassStuff;
-
- res &= this.CompareTypes (that);
- if (!res && Verifier.stopOnError) return res;
-
- res &= this.CompareMethods (that);
- if (!res && Verifier.stopOnError) return res;
-
- res &= this.CompareFields (that);
- if (!res && Verifier.stopOnError) return res;
-
- }
- return res;
- }
-
- }
-
-
-
- /// <summary>
- /// Represents an interface.
- /// </summary>
- public class InterfaceStuff : AbstractTypeStuff {
-
- public PublicMethods publicMethods;
-
- public InterfaceStuff (Type type) : base (type)
- {
- publicMethods = new PublicMethods (type);
- }
-
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- public override bool Equals (object o)
- {
- bool res = (o is InterfaceStuff);
- if (res) {
- bool ok;
- InterfaceStuff that = o as InterfaceStuff;
-
- res = this.CompareTypes (that);
- if (!res && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing interface methods.", ImportanceLevel.LOW);
- ok = (this.publicMethods == that.publicMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
- }
- return res;
- }
-
- }
-
-
-
- /// <summary>
- /// Represents an enumeration.
- /// </summary>
- public class EnumStuff : AbstractTypeStuff {
-
- //public FieldInfo [] members;
-
- public string baseType;
- public Hashtable enumTable;
- public bool isFlags;
-
- public EnumStuff (Type type) : base (type)
- {
- //members = type.GetFields (BindingFlags.Public | BindingFlags.Static);
-
- Array values = Enum.GetValues (type);
- Array names = Enum.GetNames (type);
-
- baseType = Enum.GetUnderlyingType (type).Name;
-
- enumTable = new Hashtable ();
-
- object [] attrs = type.GetCustomAttributes (false);
- isFlags = (attrs != null && attrs.Length > 0);
- if (isFlags) {
- foreach (object attr in attrs) {
- isFlags |= (attr is FlagsAttribute);
- }
- }
-
- int indx = 0;
- foreach (string id in names) {
- enumTable [id] = Convert.ToInt64(values.GetValue(indx) as Enum);
- ++indx;
- }
- }
-
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- public override bool Equals (object o)
- {
- bool res = (o is EnumStuff);
- bool ok;
-
- if (res) {
- EnumStuff that = o as EnumStuff;
- ok = this.CompareTypes (that);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- ok = (this.baseType == that.baseType);
- res &= ok;
- if (!ok) {
- Verifier.log.Write ("error",
- String.Format ("Underlying types mismatch [{0}, {1}].", this.baseType, that.baseType),
- ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- Verifier.Log.Write ("info", "Comparing [Flags] attribute.");
- ok = !(this.isFlags ^ that.isFlags);
- res &= ok;
- if (!ok) {
- Verifier.log.Write ("error",
- String.Format ("[Flags] attribute mismatch ({0} : {1}).", this.isFlags ? "Yes" : "No", that.isFlags ? "Yes" : "No"),
- ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- Verifier.Log.Write ("info", "Comparing enum values.");
-
- ICollection names = enumTable.Keys;
- foreach (string id in names) {
- ok = that.enumTable.ContainsKey (id);
- res &= ok;
- if (!ok) {
- Verifier.log.Write ("error", String.Format("{0} absent in enumeration.", id),
- ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- if (ok) {
- long val1 = (long) this.enumTable [id];
- long val2 = (long) that.enumTable [id];
- ok = (val1 == val2);
- res &= ok;
- if (!ok) {
- Verifier.log.Write ("error",
- String.Format ("Enum values mismatch [{0}: {1} != {2}].", id, val1, val2),
- ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
- }
- }
- }
- return res;
- }
- }
-
-
-
- public sealed class TypeArray {
- public static readonly TypeArray empty = new TypeArray (Type.EmptyTypes);
-
- public Type [] types;
-
- public TypeArray (Type [] types)
- {
- this.types = new Type [types.Length];
- for (int i = 0; i < types.Length; i++) {
- this.types.SetValue (types.GetValue (i), i);
- }
- }
- }
-
-
-
- public class AssemblyLoader {
- public delegate void Hook (TypeArray assemblyTypes);
-
- private static Hashtable cache;
-
- private Hook hook;
-
- static AssemblyLoader ()
- {
- cache = new Hashtable (11);
- }
-
- public AssemblyLoader (Hook hook)
- {
- if (hook == null)
- throw new NullReferenceException ("Invalid loader hook.");
-
- this.hook = hook;
- }
-
-
- public bool LoadFrom (string assemblyName)
- {
- bool res = false;
- try {
- TypeArray types = TypeArray.empty;
-
- lock (cache) {
- if (cache.Contains (assemblyName)) {
- types = (cache [assemblyName] as TypeArray);
- if (types == null) types = TypeArray.empty;
- } else {
- Assembly asm = Assembly.LoadFrom (assemblyName);
- Type [] allTypes = asm.GetTypes ();
- if (allTypes == null) allTypes = Type.EmptyTypes;
- types = new TypeArray (allTypes);
- cache [assemblyName] = types;
- }
- }
- hook (types);
- res = true;
- } catch (ReflectionTypeLoadException rtle) {
- // FIXME: Should we try to recover? Use loaded portion of types.
- Type [] loaded = rtle.Types;
- for (int i = 0, xCnt = 0; i < loaded.Length; i++) {
- if (loaded [i] == null) {
- Verifier.log.Write ("fatal error",
- String.Format ("Unable to load {0}, reason - {1}", loaded [i], rtle.LoaderExceptions [xCnt++]),
- ImportanceLevel.LOW);
- }
- }
- } catch (FileNotFoundException fnfe) {
- Verifier.log.Write ("fatal error", fnfe.ToString (), ImportanceLevel.LOW);
- } catch (Exception x) {
- Verifier.log.Write ("fatal error", x.ToString (), ImportanceLevel.LOW);
- }
-
- return res;
- }
-
- }
-
-
-
-
- public abstract class AbstractTypeCollection : SortedList {
-
- private AssemblyLoader loader;
-
- public AbstractTypeCollection ()
- {
- loader = new AssemblyLoader (new AssemblyLoader.Hook (LoaderHook));
- }
-
- public AbstractTypeCollection (string assemblyName) : this ()
- {
- LoadFrom (assemblyName);
- }
-
- public abstract void LoaderHook (TypeArray types);
-
-
- public bool LoadFrom (string assemblyName)
- {
- return loader.LoadFrom (assemblyName);
- }
-
- }
-
-
-
- public class ClassCollection : AbstractTypeCollection {
-
- public ClassCollection () : base ()
- {
- }
-
- public ClassCollection (string assemblyName)
- : base (assemblyName)
- {
- }
-
-
- public override void LoaderHook (TypeArray types)
- {
- foreach (Type type in types.types) {
- if (type.IsClass) {
- this [type.FullName] = new ClassStuff (type);
- }
- }
- }
-
- }
-
-
- public class InterfaceCollection : AbstractTypeCollection {
-
- public InterfaceCollection () : base ()
- {
- }
-
- public InterfaceCollection (string assemblyName)
- : base (assemblyName)
- {
- }
-
-
- public override void LoaderHook (TypeArray types)
- {
- foreach (Type type in types.types) {
- if (type.IsInterface) {
- this [type.FullName] = new InterfaceStuff (type);
- }
- }
- }
-
- }
-
-
-
- public class EnumCollection : AbstractTypeCollection {
-
- public EnumCollection () : base ()
- {
- }
-
- public EnumCollection (string assemblyName)
- : base (assemblyName)
- {
- }
-
- public override void LoaderHook (TypeArray types)
- {
- foreach (Type type in types.types) {
- if (type.IsEnum) {
- this [type.FullName] = new EnumStuff (type);
- }
- }
- }
- }
-
-
-
- public class AssemblyStuff {
-
- public string name;
- public bool valid;
-
- public ClassCollection classes;
- public InterfaceCollection interfaces;
- public EnumCollection enums;
-
-
- protected delegate bool Comparer (AssemblyStuff asm1, AssemblyStuff asm2);
- private static ArrayList comparers;
-
- static AssemblyStuff ()
- {
- comparers = new ArrayList ();
- comparers.Add (new Comparer (CompareNumClasses));
- comparers.Add (new Comparer (CompareNumInterfaces));
- comparers.Add (new Comparer (CompareClasses));
- comparers.Add (new Comparer (CompareInterfaces));
- comparers.Add (new Comparer (CompareEnums));
- }
-
- protected static bool CompareNumClasses (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = (asm1.classes.Count == asm2.classes.Count);
- if (!res) Verifier.Log.Write ("error", "Number of classes mismatch.", ImportanceLevel.MEDIUM);
- return res;
- }
-
- protected static bool CompareNumInterfaces (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = (asm1.interfaces.Count == asm2.interfaces.Count);
- if (!res) Verifier.Log.Write ("error", "Number of interfaces mismatch.", ImportanceLevel.MEDIUM);
- return res;
- }
-
-
- protected static bool CompareClasses (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = true;
- Verifier.Log.Write ("info", "Comparing classes.");
-
- foreach (DictionaryEntry c in asm1.classes) {
- string className = c.Key as string;
-
- if (Verifier.Excluded.Contains (className)) {
- Verifier.Log.Write ("info", String.Format ("Ignoring class {0}.", className), ImportanceLevel.MEDIUM);
- continue;
- }
-
- Verifier.Log.Write ("class", className);
-
- ClassStuff class1 = c.Value as ClassStuff;
- ClassStuff class2 = asm2.classes [className] as ClassStuff;
-
- if (class2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such class in {0}", asm2.name));
- res = false;
- if (Verifier.stopOnError || !Verifier.ignoreMissingTypes) return res;
- continue;
- }
-
- res &= (class1 == class2);
- if (!res && Verifier.stopOnError) return res;
- }
-
- return res;
- }
-
-
- protected static bool CompareInterfaces (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = true;
- Verifier.Log.Write ("info", "Comparing interfaces.");
-
- foreach (DictionaryEntry ifc in asm1.interfaces) {
- string ifcName = ifc.Key as string;
- Verifier.Log.Write ("interface", ifcName);
-
- InterfaceStuff ifc1 = ifc.Value as InterfaceStuff;
- InterfaceStuff ifc2 = asm2.interfaces [ifcName] as InterfaceStuff;
-
- if (ifc2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such interface in {0}", asm2.name));
- res = false;
- if (Verifier.stopOnError || !Verifier.ignoreMissingTypes) return res;
- continue;
- }
-
- res &= (ifc1 == ifc2);
- if (!res && Verifier.stopOnError) return res;
-
- }
-
- return res;
- }
-
-
- protected static bool CompareEnums (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = true;
- Verifier.Log.Write ("info", "Comparing enums.");
-
- foreach (DictionaryEntry e in asm1.enums) {
- string enumName = e.Key as string;
- Verifier.Log.Write ("enum", enumName);
-
- EnumStuff e1 = e.Value as EnumStuff;
- EnumStuff e2 = asm2.enums [enumName] as EnumStuff;
-
- if (e2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such enum in {0}", asm2.name));
- res = false;
- if (Verifier.stopOnError || !Verifier.ignoreMissingTypes) return res;
- continue;
- }
- res &= (e1 == e2);
- if (!res && Verifier.stopOnError) return res;
- }
-
- return res;
- }
-
-
-
- public AssemblyStuff (string assemblyName)
- {
- this.name = assemblyName;
- valid = false;
- }
-
- public bool Load ()
- {
- bool res = true;
- bool ok;
-
- classes = new ClassCollection ();
- ok = classes.LoadFrom (name);
- res &= ok;
- if (!ok) Verifier.log.Write ("error", String.Format ("Unable to load classes from {0}.", name), ImportanceLevel.HIGH);
-
- interfaces = new InterfaceCollection ();
- ok = interfaces.LoadFrom (name);
- res &= ok;
- if (!ok) Verifier.log.Write ("error", String.Format ("Unable to load interfaces from {0}.", name), ImportanceLevel.HIGH);
-
- enums = new EnumCollection ();
- ok = enums.LoadFrom (name);
- res &= ok;
- if (!ok) Verifier.log.Write ("error", String.Format ("Unable to load enums from {0}.", name), ImportanceLevel.HIGH);
-
- valid = res;
- return res;
- }
-
-
- public override bool Equals (object o)
- {
- bool res = (o is AssemblyStuff);
- if (res) {
- AssemblyStuff that = o as AssemblyStuff;
- IEnumerator it = comparers.GetEnumerator ();
- while ((res || !Verifier.stopOnError) && it.MoveNext ()) {
- Comparer compare = it.Current as Comparer;
- res &= compare (this, that);
- }
- }
- return res;
- }
-
-
- public static bool operator == (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- return asm1.Equals (asm2);
- }
-
- public static bool operator != (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- return !(asm1 == asm2);
- }
-
- public override int GetHashCode ()
- {
- return classes.GetHashCode () ^ interfaces.GetHashCode ();
- }
-
-
- public override string ToString ()
- {
- string res;
- if (valid) {
- res = String.Format ("Asssembly {0}, valid, {1} classes, {2} interfaces, {3} enums.",
- name, classes.Count, interfaces.Count, enums.Count);
- } else {
- res = String.Format ("Asssembly {0}, invalid.", name);
- }
- return res;
- }
-
- }
-
-
-
-
- ////////////////////////////////
- // Compare
- ////////////////////////////////
-
- public sealed class Compare {
-
- private Compare ()
- {
- }
-
-
- public static bool Parameters (ParameterInfo[] params1, ParameterInfo[] params2)
- {
- bool res = true;
- if (params1.Length != params2.Length) {
- Verifier.Log.Write ("Parameter count mismatch.");
- return false;
- }
-
- int count = params1.Length;
-
- for (int i = 0; i < count && res; i++) {
- if (params1 [i].Name != params2 [i].Name) {
- Verifier.Log.Write ("error", String.Format ("Parameters names mismatch {0}, {1}.", params1 [i].Name, params2 [i].Name));
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- Verifier.Log.Write ("parameter", params1 [i].Name);
-
- if (!Compare.Types (params1 [i].ParameterType, params2 [i].ParameterType)) {
- Verifier.Log.Write ("error", String.Format ("Parameters types mismatch {0}, {1}.", params1 [i].ParameterType, params2 [i].ParameterType));
- res = false;
- if (Verifier.stopOnError) break;
- }
-
-
- if (Verifier.checkOptionalFlags) {
- if (params1 [i].IsIn != params2 [i].IsIn) {
- Verifier.Log.Write ("error", "[in] mismatch.");
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- if (params1 [i].IsOut != params2 [i].IsOut) {
- Verifier.Log.Write ("error", "[out] mismatch.");
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- if (params1 [i].IsRetval != params2 [i].IsRetval) {
- Verifier.Log.Write ("error", "[ref] mismatch.");
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- if (params1 [i].IsOptional != params2 [i].IsOptional) {
- Verifier.Log.Write ("error", "Optional flag mismatch.");
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- } // checkOptionalFlags
-
-
- }
-
- return res;
- }
-
-
-
- public static bool Methods (MethodInfo mi1, MethodInfo mi2)
- {
-
- if (mi2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such method {0}.", mi1.Name), ImportanceLevel.MEDIUM);
- return false;
- }
-
-
- Verifier.Log.Flush ();
- Verifier.Log.Write ("method", String.Format ("{0}.", mi1.Name));
- bool res = true;
- bool ok;
- string expected;
-
- ok = Compare.Types (mi1.ReturnType, mi2.ReturnType);
- res &= ok;
- if (!ok) {
- Verifier.Log.Write ("error", "Return types mismatch.", ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
-
-
- ok = (mi1.IsAbstract == mi2.IsAbstract);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsAbstract) ? "abstract" : "non-abstract";
- Verifier.Log.Write ("error", String.Format ("Expected to be {0}.", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (mi1.IsVirtual == mi2.IsVirtual);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsVirtual) ? "virtual" : "non-virtual";
- Verifier.Log.Write ("error", String.Format ("Expected to be {0}.", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (mi1.IsFinal == mi2.IsFinal);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsFinal) ? "final" : "overridable";
- Verifier.Log.Write ("error", String.Format ("Expected to be {0}.", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
-
- // compare access modifiers
-
- ok = (mi1.IsPrivate == mi2.IsPrivate);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsPublic) ? "public" : "private";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
- ok = (mi1.IsFamily == mi2.IsFamily);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsFamily) ? "protected" : "!protected";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (mi1.IsAssembly == mi2.IsAssembly);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsAssembly) ? "internal" : "!internal";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
- ok = (mi1.IsStatic == mi2.IsStatic);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsStatic) ? "static" : "instance";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
-
- // parameters
-
- ok = Compare.Parameters (mi1.GetParameters (), mi2.GetParameters ());
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
-
- ok = (mi1.CallingConvention == mi2.CallingConvention);
- res &= ok;
- if (!ok) {
- Verifier.Log.Write ("error", "Calling conventions mismatch.", ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
-
-
- return res;
- }
-
-
- public static bool Fields (FieldInfo fi1, FieldInfo fi2)
- {
- if (fi2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such field {0}.", fi1.Name), ImportanceLevel.MEDIUM);
- return false;
- }
-
- bool res = true;
- bool ok;
- string expected;
-
- Verifier.Log.Write ("field", String.Format ("{0}.", fi1.Name));
-
- ok = (fi1.IsPrivate == fi2.IsPrivate);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsPublic) ? "public" : "private";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (fi1.IsFamily == fi2.IsFamily);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsFamily) ? "protected" : "!protected";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (fi1.IsAssembly == fi2.IsAssembly);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsAssembly) ? "internal" : "!internal";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (fi1.IsInitOnly == fi2.IsInitOnly);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsInitOnly) ? "readonly" : "!readonly";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (fi1.IsStatic == fi2.IsStatic);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsStatic) ? "static" : "instance";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- return res;
- }
-
-
-
- public static bool Types (Type type1, Type type2)
- {
- // NOTE:
- // simply calling type1.Equals (type2) won't work,
- // types are in different assemblies hence they have
- // different (fully-qualified) names.
- int eqFlags = 0;
- eqFlags |= (type1.IsAbstract == type2.IsAbstract) ? 0 : 0x001;
- eqFlags |= (type1.IsClass == type2.IsClass) ? 0 : 0x002;
- eqFlags |= (type1.IsValueType == type2.IsValueType) ? 0 : 0x004;
- eqFlags |= (type1.IsPublic == type2.IsPublic) ? 0 : 0x008;
- eqFlags |= (type1.IsSealed == type2.IsSealed) ? 0 : 0x010;
- eqFlags |= (type1.IsEnum == type2.IsEnum) ? 0 : 0x020;
- eqFlags |= (type1.IsPointer == type2.IsPointer) ? 0 : 0x040;
- eqFlags |= (type1.IsPrimitive == type2.IsPrimitive) ? 0 : 0x080;
- bool res = (eqFlags == 0);
-
- if (!res) {
- // TODO: convert flags into descriptive message.
- Verifier.Log.Write ("error", "Types mismatch (0x" + eqFlags.ToString("X") + ").", ImportanceLevel.HIGH);
- }
-
-
- bool ok;
-
- ok = (type1.Attributes & TypeAttributes.BeforeFieldInit) ==
- (type2.Attributes & TypeAttributes.BeforeFieldInit);
- if (!ok) {
- Verifier.Log.Write ("error", "Types attributes mismatch: BeforeFieldInit.", ImportanceLevel.HIGH);
- }
- res &= ok;
-
- ok = (type1.Attributes & TypeAttributes.ExplicitLayout) ==
- (type2.Attributes & TypeAttributes.ExplicitLayout);
- if (!ok) {
- Verifier.Log.Write ("error", "Types attributes mismatch: ExplicitLayout.", ImportanceLevel.HIGH);
- }
- res &= ok;
-
- ok = (type1.Attributes & TypeAttributes.SequentialLayout) ==
- (type2.Attributes & TypeAttributes.SequentialLayout);
- if (!ok) {
- Verifier.Log.Write ("error", "Types attributes mismatch: SequentialLayout.", ImportanceLevel.HIGH);
- }
- res &= ok;
-
- ok = (type1.Attributes & TypeAttributes.Serializable) ==
- (type2.Attributes & TypeAttributes.Serializable);
- if (!ok) {
- Verifier.Log.Write ("error", "Types attributes mismatch: Serializable.", ImportanceLevel.HIGH);
- }
- res &= ok;
-
- return res;
- }
-
- }
-
-
-
-
- ////////////////////////////////
- // Log
- ////////////////////////////////
-
- public enum ImportanceLevel : int {
- LOW = 0, MEDIUM, HIGH
- }
-
-
- public interface ILogger {
-
- void Write (string tag, string msg, ImportanceLevel importance);
- void Write (string msg, ImportanceLevel level);
- void Write (string tag, string msg);
- void Write (string msg);
- ImportanceLevel DefaultImportance {get; set;}
- void Flush ();
- void Close ();
- }
-
-
- public abstract class AbstractLogger : ILogger {
- private ImportanceLevel defImportance = ImportanceLevel.MEDIUM;
-
- public abstract void Write (string tag, string msg, ImportanceLevel importance);
- public abstract void Write (string msg, ImportanceLevel level);
-
- public virtual void Write (string tag, string msg)
- {
- Write (tag, msg, DefaultImportance);
- }
-
- public virtual void Write (string msg)
- {
- Write (msg, DefaultImportance);
- }
-
- public virtual ImportanceLevel DefaultImportance {
- get {
- return defImportance;
- }
- set {
- defImportance = value < ImportanceLevel.LOW
- ? ImportanceLevel.LOW
- : value > ImportanceLevel.HIGH
- ? ImportanceLevel.HIGH
- : value;
- }
- }
-
- public abstract void Flush ();
- public abstract void Close ();
-
- }
-
-
-
- public class TextLogger : AbstractLogger {
-
- private TextWriter writer;
-
- public TextLogger (TextWriter writer)
- {
- if (writer == null)
- throw new NullReferenceException ();
-
- this.writer = writer;
- }
-
- private void DoWrite (string tag, string msg)
- {
- if (tag != null && tag.Length > 0) {
- writer.WriteLine ("[{0}]\t{1}", tag, msg);
- } else {
- writer.WriteLine ("\t\t" + msg);
- }
- }
-
- public override void Write (string tag, string msg, ImportanceLevel importance)
- {
- int v = Log.VerboseLevel;
- switch (v) {
- case 0 :
- break;
- case 1 :
- if (importance >= ImportanceLevel.HIGH) {
- DoWrite (tag, msg);
- }
- break;
- case 2 :
- if (importance >= ImportanceLevel.MEDIUM) {
- DoWrite (tag, msg);
- }
- break;
- case 3 :
- DoWrite (tag, msg);
- break;
- default:
- break;
- }
- }
-
- public override void Write (string msg, ImportanceLevel importance)
- {
- Write (null, msg, importance);
- }
-
- public override void Flush ()
- {
- Console.Out.Flush ();
- }
-
- public override void Close ()
- {
- if (writer != Console.Out && writer != Console.Error) {
- writer.Close ();
- }
- }
- }
-
-
-
- public sealed class Log {
-
- private static int verbose = 3;
-
- private ArrayList consumers;
-
- public Log (bool useDefault)
- {
- consumers = new ArrayList ();
- if (useDefault) AddConsumer (new TextLogger (Console.Out));
- }
-
- public Log () : this (true)
- {
- }
-
-
- public static int VerboseLevel {
- get {
- return verbose;
- }
- set {
- verbose = (value < 0)
- ? 0
- : (value > 3)
- ? 3 : value;
- }
- }
-
- public void AddConsumer (ILogger consumer)
- {
- consumers.Add (consumer);
- }
-
-
- public void Write (string tag, string msg, ImportanceLevel importance)
- {
- foreach (ILogger logger in consumers) {
- if (tag == null || tag == "") {
- logger.Write (msg, importance);
- } else {
- logger.Write (tag, msg, importance);
- }
- }
- }
-
- public void Write (string msg, ImportanceLevel importance)
- {
- Write (null, msg, importance);
- }
-
-
- public void Write (string tag, string msg)
- {
- foreach (ILogger logger in consumers) {
- if (tag == null || tag == "") {
- logger.Write (msg);
- } else {
- logger.Write (tag, msg);
- }
- }
- }
-
- public void Write (string msg)
- {
- Write (null, msg);
- }
-
-
- public void Flush ()
- {
- foreach (ILogger logger in consumers) {
- logger.Flush ();
- }
- }
-
-
- public void Close ()
- {
- foreach (ILogger logger in consumers) {
- logger.Flush ();
- logger.Close ();
- }
- }
-
- }
-
-
-
-
-
-
- ////////////////////////////////
- // Main
- ////////////////////////////////
-
- public class Verifier {
-
- public static readonly Log log = new Log ();
- public static bool stopOnError = false;
- public static bool ignoreMissingTypes = true;
- public static bool checkOptionalFlags = true;
-
- private static readonly IList excluded;
-
- static Verifier ()
- {
- excluded = new ArrayList ();
- excluded.Add ("<PrivateImplementationDetails>");
- }
-
-
- private Verifier ()
- {
- }
-
- public static Log Log {
- get {
- return log;
- }
- }
-
- public static IList Excluded {
- get {
- return excluded;
- }
- }
-
-
-
- public static void Main (String [] args)
- {
- if (args.Length < 2) {
- Console.WriteLine ("Usage: verifier assembly1 assembly2");
- } else {
- string name1 = args [0];
- string name2 = args [1];
-
- bool ok = false;
-
- AssemblyStuff asm1 = new AssemblyStuff (name1);
- AssemblyStuff asm2 = new AssemblyStuff (name2);
- ok = asm1.Load ();
- if (!ok) {
- Console.WriteLine ("Unable to load assembly {0}.", name1);
- Environment.Exit (-1);
- }
-
- ok = asm2.Load ();
- if (!ok) {
- Console.WriteLine ("Unable to load assembly {0}.", name2);
- Environment.Exit (-1);
- }
-
-
- try {
- ok = (asm1 == asm2);
- } catch {
- ok = false;
- } finally {
- Log.Close ();
- }
-
- if (!ok) {
- Console.WriteLine ("--- not equal");
- Environment.Exit (-1);
- }
- }
- }
-
- }
-
-
-}
-