├── .gitignore ├── .travis.yml ├── .vscode ├── launch.json └── tasks.json ├── IFC-dotnet.sln ├── IFC.xml ├── LICENSE ├── README.md ├── build.sh ├── src └── IFC-dotnet │ ├── Exceptions.cs │ ├── IFC-dotnet.csproj │ ├── IFC.cs │ ├── IfcSelect.cs │ ├── Model.cs │ ├── STEP.g4 │ ├── STEPListener.cs │ ├── TypeConverters.cs │ └── antlr │ ├── STEP.tokens │ ├── STEPBaseListener.cs │ ├── STEPLexer.cs │ ├── STEPLexer.tokens │ ├── STEPListener.cs │ └── STEPParser.cs └── tests └── IFC-dotnet-test ├── IFC-dotnet-test.csproj ├── SerializationTests.cs └── models ├── 20160125WestRiverSide Hospital - IFC4-Autodesk_Hospital_Sprinkle.ifc ├── AC-20-Smiley-West-10-Bldg.ifc └── example.ifc /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignorable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | *.ndf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | node_modules/ 238 | 239 | # Typescript v1 declaration files 240 | typings/ 241 | 242 | # Visual Studio 6 build log 243 | *.plg 244 | 245 | # Visual Studio 6 workspace options file 246 | *.opt 247 | 248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 249 | *.vbw 250 | 251 | # Visual Studio LightSwitch build output 252 | **/*.HTMLClient/GeneratedArtifacts 253 | **/*.DesktopClient/GeneratedArtifacts 254 | **/*.DesktopClient/ModelManifest.xml 255 | **/*.Server/GeneratedArtifacts 256 | **/*.Server/ModelManifest.xml 257 | _Pvt_Extensions 258 | 259 | # Paket dependency manager 260 | .paket/paket.exe 261 | paket-files/ 262 | 263 | # FAKE - F# Make 264 | .fake/ 265 | 266 | # JetBrains Rider 267 | .idea/ 268 | *.sln.iml 269 | 270 | # CodeRush 271 | .cr/ 272 | 273 | # Python Tools for Visual Studio (PTVS) 274 | __pycache__/ 275 | *.pyc 276 | 277 | # Cake - Uncomment if you are using it 278 | # tools/** 279 | # !tools/packages.config 280 | 281 | # Telerik's JustMock configuration file 282 | *.jmconfig 283 | 284 | # BizTalk build output 285 | *.btp.cs 286 | *.btm.cs 287 | *.odx.cs 288 | *.xsd.cs 289 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | solution: ./src/IFC-dotnet.sln 3 | mono: none 4 | dotnet: 2.0.0 5 | dist: trusty 6 | script: 7 | - dotnet restore 8 | - dotnet build 9 | - cd tests/IFC-dotnet-test 10 | - dotnet xunit 11 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceRoot}/src/IFC-dotnet-test/bin/Debug/netcoreapp2.0/IFC-dotnet-test.dll", 14 | "args": [], 15 | "cwd": "${workspaceRoot}/src/IFC-dotnet-test", 16 | // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window 17 | "console": "internalConsole", 18 | "stopAtEntry": false, 19 | "internalConsoleOptions": "openOnSessionStart" 20 | }, 21 | { 22 | "name": ".NET Core Attach", 23 | "type": "coreclr", 24 | "request": "attach", 25 | "processId": "${command:pickProcess}" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "command": "dotnet", 4 | "isShellCommand": true, 5 | "args": [], 6 | "tasks": [ 7 | { 8 | "taskName": "build", 9 | "args": [ 10 | "${workspaceRoot}/src/IFC-dotnet-test/IFC-dotnet-test.csproj" 11 | ], 12 | "isBuildCommand": true, 13 | "problemMatcher": "$msCompile" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /IFC-dotnet.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26124.0 5 | MinimumVisualStudioVersion = 15.0.26124.0 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IFC-dotnet", "src\IFC-dotnet\IFC-dotnet.csproj", "{301045AC-77F1-4B10-B668-0213CB53A2AB}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IFC-dotnet-test", "tests\IFC-dotnet-test\IFC-dotnet-test.csproj", "{3FA9536F-5D93-49B0-88E6-365400E8BB60}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|x64 = Debug|x64 14 | Debug|x86 = Debug|x86 15 | Release|Any CPU = Release|Any CPU 16 | Release|x64 = Release|x64 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 23 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 24 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Debug|Any CPU.Build.0 = Debug|Any CPU 25 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Debug|x64.ActiveCfg = Debug|x64 26 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Debug|x64.Build.0 = Debug|x64 27 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Debug|x86.ActiveCfg = Debug|x86 28 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Debug|x86.Build.0 = Debug|x86 29 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Release|Any CPU.ActiveCfg = Release|Any CPU 30 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Release|Any CPU.Build.0 = Release|Any CPU 31 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Release|x64.ActiveCfg = Release|x64 32 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Release|x64.Build.0 = Release|x64 33 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Release|x86.ActiveCfg = Release|x86 34 | {301045AC-77F1-4B10-B668-0213CB53A2AB}.Release|x86.Build.0 = Release|x86 35 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 36 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Debug|Any CPU.Build.0 = Debug|Any CPU 37 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Debug|x64.ActiveCfg = Debug|x64 38 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Debug|x64.Build.0 = Debug|x64 39 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Debug|x86.ActiveCfg = Debug|x86 40 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Debug|x86.Build.0 = Debug|x86 41 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Release|Any CPU.ActiveCfg = Release|Any CPU 42 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Release|Any CPU.Build.0 = Release|Any CPU 43 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Release|x64.ActiveCfg = Release|x64 44 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Release|x64.Build.0 = Release|x64 45 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Release|x86.ActiveCfg = Release|x86 46 | {3FA9536F-5D93-49B0-88E6-365400E8BB60}.Release|x86.Build.0 = Release|x86 47 | EndGlobalSection 48 | EndGlobal 49 | -------------------------------------------------------------------------------- /IFC.xml: -------------------------------------------------------------------------------- 1 | 3ZdNj5swEIZ/DdeKYAjsdbPph9SqVXNo9+iFCXhrGOSYhfTX14RxCIVUlVaLUDgg+/V47Hn1TBQctsmbD4qX2RdMQDqemzQOe3A8L2K+ebfCsRPCIOyEVImkk1a9sBO/gUSX1EokcBgEakSpRTkUYywKiPVA40phPQzboxyeWvIURsIu5nKs/hCJzqiswO31jyDSzJ68cmnlice/UoVVQec5Htufnm455zYXxR8ynmB9IbGtwzYKUXejvNmAbK21tnX73l9ZPd9bQaH/awPtOOijrR0SYwVNUekMUyy43Pbq/ak+aDO4ZpbpXJrhygyhEfpnK78LaPZoVwqtjhdL7fSREjyD1kdigFcajdSf+xmxpBzdTdvrXS3WVoOViinKI3y4SoGiwrPRhl/AHMxlTIgCybV4GWbnRFJ6juvdNAMydNpcOvqFy4qSftrH3xQmlUH2b9uHptaZ0LAr+amK2vTY0GhKDEpD828zxmXSBhYRgtSi7G7dzese+JXFNLuA3TbBa5yxfX672LExdt5M2LEp7L4+PcMSqXP9+ai7u3Xo/DF0bCbo/OvQPcBeFEILLBaHn2FtPvyiW8cvGOPnz4RfMIXf9/Zv1NKQO+M1B3LrKVvuKyETUaRbCXlbxNIcCqIZHbI/ALfbleG4K9czdWU4hd9SsfOj6M2wM9P+m+60dvHdzLZ/AA== -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Ian Keough 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # THIS PROJECT HAS BEEN MERGED INTO [IFC-gen](https://github.com/ikeough/IFC-gen/blob/master/README.md) AND IS NO LONGER IN DEVELOPMENT HERE. 2 | 3 | # IFC-dotnet 4 | 5 | An [Industry Foundation Classes](http://www.buildingsmart-tech.org/specifications/ifc-overview/ifc-overview-summary) (IFC) library for .NET Core. 6 | 7 | # Pre-requisites 8 | - [.NET Core](https://www.microsoft.com/net/core) 9 | 10 | # To Build 11 | ``` 12 | cd src 13 | dotnet build 14 | ``` 15 | 16 | # To Test 17 | ``` 18 | cd tests 19 | cd IFC-dotnet-test 20 | dotnet xunit 21 | ``` 22 | 23 | # Design Considerations 24 | Most of the code in this repository is generated automatically using [IFC-gen](https://github.com/ikeough/IFC-gen/blob/master/README.md). The templates for code generation and certain base classes have been designed to generate an idiomatic C# library. 25 | 26 | - All EXPRESS `TYPE` have a corresponding class derived from `IfcType`, which is a wrapper class whose `Value` property holds the actual value. 27 | - All EXPRESS `ENUM` have a corresponding enum. 28 | - All EXPRESS collection types: 'LIST', 'SET', and 'ARRAY', currently generate `List` fields in C#. This solution does not conform to the EXPRESS specification for those types. So it will be updated in the future. 29 | - EXPRESS `SELECT` types are created as classes derived from the `Select` base class. The `Select` base class has generic parameters corresponding to the types which can be selected in the `SELECT`. Additionally, the code generator creates one constructor for each selection type to aid in discovery of selectable types. Other languages which support discriminated unions may prefer to use that mechanism for modeling `SELECT`. 30 | - All EXPRESS `ENTITY` have a corresponding class. 31 | - All IFC attributes are generated as public class properties with a getter and setter. Chances are these will become more restrictive in the future. For those attributes not marked as `OPTIONAL`, the entity's corresponding class constructor will have parameters corresponding to the property, and a corresponding assignment will be generated in the constructor body. 32 | - Attributes marked as `DERIVED` are not currently turned into properties. Although the grammar generates a parser which can understand `DERIVE` and `WHERE` statements, these are not currently converted to code in property or method bodies. 33 | - Types derived from `IfcRelationship` do not have corresponding parameters in the generated constructors. Many types have _many_ relationship properties. Adding all of these to the constructor made the constructors unwieldy. It's possible that these are required, but my present intuition is that a higher-level factory class for properly generating entities and establishing their relationships is a better way to do this. Whether these higher level libraries can also be auto-generated is a point on which I welcome all feedback. 34 | - EXPRESS `WHERE` statements do not currently generate code. One possible pattern for this would be to generate static constructors for classes, placing the data validation logic in the static constructor and throwing an exception if the data validation fails. But, I feel like data validation needs to be done whenever the state of the object changes, so these data validation methods should either be reactive to property value changes, or they should live in a separate class containing testing methods for validating objects of certain types. 35 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dir=$(pwd) 3 | cd src/IFC-dotnet 4 | java -jar /usr/local/lib/antlr-4.7-complete.jar -Dlanguage=CSharp -package STEP -o ./antlr STEP.g4 5 | cd $dir 6 | dotnet build -c Release 7 | cd tests/IFC-dotnet-test 8 | dotnet xunit -c Release 9 | cd $dir -------------------------------------------------------------------------------- /src/IFC-dotnet/Exceptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace IFC4 4 | { 5 | 6 | /// 7 | /// Exception thrown when an unknown type is encountered. 8 | /// 9 | public class STEPUnknownTypeException : Exception 10 | { 11 | private string desiredType; 12 | 13 | public override string Message 14 | { 15 | get 16 | { 17 | return $"A type corresponding to, {desiredType}, cannot be found in IFC-dotnet assembly."; 18 | } 19 | } 20 | 21 | public STEPUnknownTypeException(string desiredType) 22 | { 23 | this.desiredType = desiredType; 24 | } 25 | } 26 | 27 | /// 28 | /// Exception thrown when a type cannot be coerced into a target type. 29 | /// 30 | public class STEPParserException : Exception 31 | { 32 | private string parseValue; 33 | private Type destinationType; 34 | public override string Message 35 | { 36 | get{return $"The specified value, {parseValue}, could not be coerced into the type, {destinationType.Name}";} 37 | } 38 | 39 | public STEPParserException(Type destinationType, string parseValue) 40 | { 41 | this.destinationType = destinationType; 42 | this.parseValue = parseValue; 43 | } 44 | } 45 | 46 | /// 47 | /// Exception thrown when there is a mismatch in parameters between the type and what is provided in the STEP file. 48 | /// 49 | public class STEPParameterMismatchException : Exception 50 | { 51 | Type type; 52 | int providedCount; 53 | int expectedCount; 54 | 55 | public override string Message 56 | { 57 | get 58 | { 59 | return $"{type}'s constructor expects {expectedCount} parameters but {providedCount} parameters are provided."; 60 | } 61 | } 62 | 63 | public STEPParameterMismatchException(Type type, int providedCount, int expectedCount) 64 | { 65 | this.type = type; 66 | this.providedCount = providedCount; 67 | this.expectedCount = expectedCount; 68 | } 69 | } 70 | 71 | /// 72 | /// Exception thrown when an identifier is found for which there is not construction. 73 | /// 74 | public class STEPIdentifierNotFoundException : Exception 75 | { 76 | private int id; 77 | private int currLine; 78 | 79 | public override string Message 80 | { 81 | get 82 | { 83 | return $"The id, {id}, found at line, {currLine}, could not be found in the STEP file being opened."; 84 | } 85 | } 86 | 87 | public STEPIdentifierNotFoundException(int id, int currLine) 88 | { 89 | this.id = id; 90 | this.currLine = currLine; 91 | } 92 | } 93 | 94 | /// 95 | /// Exception thrown when the specified id does not correspond to an instance in the Model. 96 | /// 97 | public class InstanceNotFoundException : Exception 98 | { 99 | private Guid id; 100 | public override string Message 101 | { 102 | get 103 | { 104 | return $"An instance with Id, {id}, does not exist in the model."; 105 | } 106 | } 107 | 108 | public InstanceNotFoundException(Guid id) 109 | { 110 | this.id = id; 111 | } 112 | 113 | } 114 | 115 | /// 116 | /// Exception thrown when an instance with the same id already exists in the model. 117 | /// 118 | public class DuplicateInstanceException : Exception 119 | { 120 | private Guid id; 121 | 122 | public override string Message 123 | { 124 | get 125 | { 126 | return $"An instance with the specified Id, {id}, already exists in the Model."; 127 | } 128 | } 129 | 130 | public DuplicateInstanceException(Guid id) 131 | { 132 | this.id = id; 133 | } 134 | } 135 | } -------------------------------------------------------------------------------- /src/IFC-dotnet/IFC-dotnet.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 0.0.1-beta1 5 | Ian Keough 6 | IFC-dotnet 7 | IFC-dotnet 8 | 3021 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/IFC-dotnet/Model.cs: -------------------------------------------------------------------------------- 1 | using Antlr4.Runtime; 2 | using Antlr4.Runtime.Tree; 3 | using Newtonsoft.Json; 4 | using System; 5 | using System.Collections; 6 | using System.ComponentModel; 7 | using System.Diagnostics; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Transactions; 12 | using System.Collections.Generic; 13 | 14 | namespace IFC4 15 | { 16 | public abstract class STEPError 17 | { 18 | protected int currId; 19 | 20 | public virtual string Message 21 | { 22 | get{return $"There was an error reading the STEP file at Id, {currId}.";} 23 | } 24 | 25 | public STEPError(int currId) 26 | { 27 | this.currId = currId; 28 | } 29 | } 30 | 31 | public class MissingIdError : STEPError 32 | { 33 | private int missingId; 34 | public override string Message 35 | { 36 | get{return $"Id {missingId}, referenced in constructor, {currId}, could not be found in the file.";} 37 | } 38 | 39 | public MissingIdError(int id, int missingId):base(id) 40 | { 41 | this.missingId = missingId; 42 | } 43 | } 44 | 45 | /// 46 | /// Model provides a container for instances of BaseIfc. 47 | /// 48 | public class Model 49 | { 50 | private Dictionary instances; 51 | 52 | [JsonProperty("instances")] 53 | public Dictionary Instances 54 | { 55 | get{ return instances;} 56 | } 57 | 58 | public Model() 59 | { 60 | instances = new Dictionary(); 61 | } 62 | 63 | internal Model(Dictionary instances) 64 | { 65 | this.instances = instances; 66 | } 67 | 68 | /// 69 | /// Add an instance to the model. 70 | /// 71 | /// The instance to add to the Model. 72 | /// Another instance already exists in the model with the same id. 73 | public void AddInstance(BaseIfc instance) 74 | { 75 | if(instances.ContainsKey(instance.Id)) 76 | { 77 | throw new DuplicateInstanceException(instance.Id); 78 | } 79 | 80 | instances.Add(instance.Id, instance); 81 | } 82 | 83 | /// 84 | /// Remove an instance from the model. 85 | /// 86 | /// 87 | /// The specified instance does not exist in the model. 88 | public void RemoveInstance(Guid id) 89 | { 90 | if(!instances.ContainsKey(id)) 91 | { 92 | throw new InstanceNotFoundException(id); 93 | } 94 | 95 | instances.Remove(id); 96 | } 97 | 98 | /// 99 | /// Finds an instance in the model, given its unique identifier. 100 | /// 101 | /// The unique id of the instance to find. 102 | /// An BaseIfc instance or null if no instance can be found with the provided id. 103 | public BaseIfc InstanceById(Guid id) 104 | { 105 | if(instances.ContainsKey(id)) 106 | { 107 | return instances[id]; 108 | } 109 | 110 | return null; 111 | } 112 | 113 | /// 114 | /// Find all instances of type T in the model. 115 | /// 116 | /// A collection of objects whose type is T. 117 | public IEnumerable AllInstancesOfType() 118 | { 119 | return instances.Values.OfType(); 120 | } 121 | 122 | /// 123 | /// Find all instances derived from type T in the model. 124 | /// 125 | /// A collection of objects whose types are derived from T. 126 | public IEnumerable AllInstancesDerivedFromType() 127 | { 128 | return instances.Where(i=>typeof(T).IsAssignableFrom(i.Value.GetType())).Select(e=>e.Value); 129 | } 130 | 131 | /// 132 | /// Serialize the model to JSON. 133 | /// 134 | /// A string representing the model serialized to JSON. The string will be indented and include type references. 135 | public string ToJSON() 136 | { 137 | var settings = new JsonSerializerSettings(){ 138 | Formatting = Formatting.Indented, 139 | TypeNameHandling = TypeNameHandling.Objects 140 | }; 141 | var json = JsonConvert.SerializeObject(this, settings); 142 | return json; 143 | } 144 | 145 | /// 146 | /// Serialize the model to a DOT graph notation. 147 | /// 148 | /// A string representing the model serialized in DOT notation. 149 | public string ToDOT() 150 | { 151 | var relationships = AllInstancesDerivedFromType(); 152 | var visited = new List(); // Ids of visited nodes; 153 | 154 | var relations = new StringBuilder(); 155 | foreach(var r in relationships) 156 | { 157 | var rType = r.GetType(); 158 | foreach(var p in r.GetType().GetProperties().Where(p=>p.DeclaringType == r.GetType())) 159 | { 160 | var pVal = p.GetValue(r); 161 | if(pVal is IList && pVal.GetType().IsGenericType) 162 | { 163 | var vs = (IList)pVal; 164 | foreach(BaseIfc v in vs) 165 | { 166 | relations.AppendLine($"\t\"{r.Id} : {rType.Name}\" -- \"{v.Id} : {v.GetType().Name}\""); 167 | } 168 | } 169 | else if(pVal is BaseIfc) 170 | { 171 | var v = (BaseIfc)pVal; 172 | relations.AppendLine($"\t\"{r.Id} : {rType.Name}\" -- \"{v.Id} : {v.GetType().Name}\""); 173 | } 174 | else if(pVal == null) 175 | { 176 | relations.AppendLine($"\t\"{r.Id} : {rType.Name}\" -- \"null\""); 177 | } 178 | } 179 | } 180 | string graph = 181 | $@"graph model{{ 182 | rankdir=LR 183 | node [shape=box]; 184 | {relations.ToString()} 185 | }}"; 186 | return graph; 187 | } 188 | 189 | /// 190 | /// Create a Model given a STEP file. 191 | /// 192 | /// The path to the STEP file. 193 | /// A Model. 194 | /// The specified file path does not exist. 195 | public static Model FromSTEP(string filePath, out IList errors) 196 | { 197 | if(!File.Exists(filePath)) 198 | { 199 | throw new FileNotFoundException($"The specified IFC STEP file does not exist: {filePath}."); 200 | } 201 | 202 | Model model = new Model(); 203 | 204 | using (FileStream fs = new FileStream(filePath, FileMode.Open)) 205 | { 206 | var input = new AntlrInputStream(fs); 207 | var lexer = new STEP.STEPLexer(input); 208 | var tokens = new CommonTokenStream(lexer); 209 | 210 | var parser = new STEP.STEPParser(tokens); 211 | parser.BuildParseTree = true; 212 | 213 | var tree = parser.file(); 214 | var walker = new ParseTreeWalker(); 215 | 216 | var listener = new STEP.STEPListener(); 217 | walker.Walk(listener, tree); 218 | 219 | var err = new List(); 220 | foreach(var data in listener.InstanceData) 221 | { 222 | if(data.Value.ConstructedGuid != null && model.InstanceById(data.Value.ConstructedGuid) != null) 223 | { 224 | // Instance may have been previously constructed as the result 225 | // of another construction. 226 | continue; 227 | } 228 | 229 | var instance = ConstructRecursive(data.Value, listener.InstanceData, model, data.Key, err); 230 | model.AddInstance(instance); 231 | } 232 | errors = err; 233 | } 234 | return model; 235 | } 236 | 237 | /// 238 | /// Recursively construct instances provided instance data. 239 | /// Construction is recursive because the instance data my include other 240 | /// instance data or id references to instances which have not yet been 241 | /// constructed. 242 | /// 243 | /// The instance data from which to construct the instance. 244 | /// The dictionary containing instance data gathered from the parser. 245 | /// The Model in which constructed instances will be stored. 246 | /// 247 | private static BaseIfc ConstructRecursive(STEP.InstanceData data, Dictionary instanceDataMap, Model model, int currLine, IList errors) 248 | { 249 | Debug.WriteLine($"{currLine},{data.Id} : Constructing type {data.Type.Name} with parameters [{string.Join(",",data.Parameters)}]"); 250 | 251 | for(var i=data.Parameters.Count()-1; i>=0; i--) 252 | { 253 | var instData = data.Parameters[i] as STEP.InstanceData; 254 | if(instData != null) 255 | { 256 | var subInstance = ConstructRecursive(instData, instanceDataMap, model, currLine, errors); 257 | data.Parameters[i] = subInstance; 258 | continue; 259 | } 260 | 261 | var stepId = data.Parameters[i] as STEP.STEPId; 262 | if(stepId != null) 263 | { 264 | if(instanceDataMap.ContainsKey(stepId.Value)) 265 | { 266 | var guid = instanceDataMap[stepId.Value].ConstructedGuid; 267 | var existingInst = model.InstanceById(guid); 268 | if(existingInst != null) 269 | { 270 | data.Parameters[i] = existingInst; 271 | continue; 272 | } 273 | } 274 | else 275 | { 276 | // A missing identifier results in an error. 277 | // set the data to null; 278 | errors.Add(new MissingIdError(currLine, stepId.Value)); 279 | data.Parameters[i] = null; 280 | continue; 281 | } 282 | 283 | var subInstance = ConstructRecursive(instanceDataMap[stepId.Value], instanceDataMap, model, currLine, errors); 284 | data.Parameters[i] = subInstance; 285 | continue; 286 | } 287 | 288 | var list = data.Parameters[i] as List; 289 | if(list != null) 290 | { 291 | // The parameters will have been stored in a List during parsing. 292 | // We need to create a List where T is the type expected by the constructor 293 | // in the STEP file. 294 | var listType = typeof(List<>); 295 | var instanceType = data.Constructor.GetParameters()[i].ParameterType.GetGenericArguments()[0]; 296 | var constructedListType = listType.MakeGenericType(instanceType); 297 | var subInstances = (IList)Activator.CreateInstance(constructedListType); 298 | 299 | if(!list.Any()) 300 | { 301 | // Return our newly type empty list. 302 | data.Parameters[i] = subInstances; 303 | continue; 304 | } 305 | 306 | foreach(var item in list) 307 | { 308 | if(item is STEP.STEPId) 309 | { 310 | var id = item as STEP.STEPId; 311 | var subInstance = ConstructRecursive(instanceDataMap[id.Value], instanceDataMap, model, currLine, errors); 312 | 313 | // The object must be converted to the type expected in the list 314 | // for Select types, this will be a recursive build of the base select type. 315 | var convert = Convert(instanceType, subInstance); 316 | subInstances.Add(convert); 317 | } 318 | else if(item is STEP.InstanceData) 319 | { 320 | var subInstance = ConstructRecursive((STEP.InstanceData)item, instanceDataMap, model, currLine, errors); 321 | var convert = Convert(instanceType, subInstance); 322 | subInstances.Add(convert); 323 | } 324 | else 325 | { 326 | var subInstance = item; 327 | var convert = Convert(instanceType, subInstance); 328 | subInstances.Add(convert); 329 | } 330 | } 331 | // Replace the list of STEPId with a list of instance references. 332 | data.Parameters[i] = subInstances; 333 | } 334 | } 335 | 336 | // Do one final pass on all parameters to ensure 337 | // that they are of the correct type. 338 | for(var i=data.Parameters.Count-1; i>=0; i--) 339 | { 340 | if(data.Parameters[i] == null) 341 | { 342 | continue; 343 | } 344 | 345 | var pType = data.Parameters[i].GetType(); 346 | var expectedType = data.Constructor.GetParameters()[i].ParameterType; 347 | 348 | data.Parameters[i] = Convert(expectedType, data.Parameters[i]); 349 | } 350 | 351 | // Construct the instance, assuming that all required sub-instances 352 | // have already been constructed. 353 | var instance = (BaseIfc)data.Constructor.Invoke(data.Parameters.ToArray()); 354 | 355 | if(instanceDataMap.ContainsKey(data.Id)) 356 | { 357 | // We'll only get here if the instance is not being constructed 358 | // as a sub-instance. 359 | instanceDataMap[data.Id].ConstructedGuid = instance.Id; 360 | } 361 | 362 | Debug.WriteLine($"{currLine},{data.Id} : Constructed type {data.Type.Name} with parameters [{string.Join(",",data.Parameters)}]"); 363 | 364 | return instance; 365 | } 366 | 367 | /// 368 | /// 369 | /// 370 | /// 371 | /// 372 | /// 373 | private static object Convert(Type expectedType, object value) 374 | { 375 | // Bail out immediately if a direct cast is available. 376 | if(expectedType.IsAssignableFrom(value.GetType())) 377 | { 378 | return value; 379 | } 380 | 381 | var converter = TypeDescriptor.GetConverter(expectedType); 382 | if(converter != null && converter.CanConvertFrom(value.GetType())) 383 | { 384 | return converter.ConvertFrom(value); 385 | } 386 | else 387 | { 388 | throw new Exception($"There was no type converter available to convert from {value.GetType()} to {expectedType}."); 389 | } 390 | } 391 | } 392 | } -------------------------------------------------------------------------------- /src/IFC-dotnet/STEP.g4: -------------------------------------------------------------------------------- 1 | grammar STEP; 2 | 3 | author 4 | : AnyString 5 | ; 6 | 7 | authorisation 8 | : AnyString 9 | ; 10 | 11 | collection 12 | : '(' collectionValue (',' collectionValue)* ')' 13 | | '()' 14 | ; 15 | 16 | collectionValue 17 | : RealLiteral 18 | | IntegerLiteral 19 | | StringLiteral 20 | | AnyString 21 | | Id 22 | | constructor 23 | | Undefined 24 | ; 25 | 26 | constructor 27 | : TypeRef '(' parameter? (',' parameter)* ')' 28 | ; 29 | 30 | data 31 | : DATA ';' instance* ENDSEC ';' 32 | ; 33 | 34 | description 35 | : AnyString 36 | | collection 37 | ; 38 | 39 | file 40 | : ISO header data ISO_END 41 | ; 42 | 43 | fileDescription 44 | : FILE_DESCRIPTION '(' description ',' implementation ')' ';' 45 | ; 46 | 47 | fileName 48 | : FILE_NAME '(' name ',' timeStamp ',' (author|collection) ',' (organization|collection) ',' preprocessor_version ',' originating_system ',' authorisation ')' ';' 49 | ; 50 | 51 | filePath 52 | : '\'' Letter* '.' Letter* '\'' 53 | ; 54 | 55 | fileSchema 56 | : FILE_SCHEMA '(' '(' AnyString ')' ')' ';' 57 | ; 58 | 59 | header 60 | : HEADER ';' fileDescription fileName fileSchema ENDSEC ';' 61 | ; 62 | 63 | implementation 64 | : AnyString 65 | ; 66 | 67 | instance 68 | : Id '=' constructor ';' 69 | ; 70 | 71 | name 72 | : AnyString 73 | | filePath 74 | ; 75 | 76 | originating_system 77 | : AnyString 78 | ; 79 | 80 | organization 81 | : AnyString 82 | ; 83 | 84 | parameter 85 | : constructor 86 | | collection 87 | | Undefined 88 | | StringLiteral 89 | | Derived 90 | | Enum 91 | | BoolLogical 92 | | RealLiteral 93 | | AnyString 94 | | Id 95 | | IntegerLiteral 96 | ; 97 | 98 | preprocessor_version 99 | : AnyString 100 | ; 101 | 102 | timeStamp 103 | : DateTime 104 | ; 105 | 106 | // Lexer 107 | 108 | fragment 109 | Digit 110 | : [0-9] 111 | ; 112 | 113 | fragment 114 | Digits 115 | : Digit Digit* 116 | ; 117 | 118 | IntegerLiteral 119 | : '-'? Digits 120 | ; 121 | 122 | Letter 123 | : [a-zA-Z] 124 | ; 125 | 126 | CapitalLetter 127 | : [A-Z] 128 | ; 129 | 130 | DateTime 131 | : '\'' Digits '-' Digits '-' Digits 'T' Digits ':' Digits ':' Digits '\'' 132 | ; 133 | 134 | Derived 135 | : '*' 136 | ; 137 | 138 | BoolLogical 139 | : '.' ('T'|'F'|'U') '.' 140 | ; 141 | 142 | Enum 143 | : '.' [A-Z]([A-Z]|[0-9]|'_')* '.' 144 | ; 145 | 146 | RealLiteral 147 | : '-'? Digits '.' Digits* (('e'|'E') '-'? Digits)? // IFC: Scientific 'E' was not supported. 148 | ; 149 | 150 | DATA : 'DATA' ; 151 | ENDSEC : 'ENDSEC' ; 152 | FILE_DESCRIPTION : 'FILE_DESCRIPTION' ; 153 | FILE_NAME : 'FILE_NAME' ; 154 | FILE_SCHEMA : 'FILE_SCHEMA' ; 155 | HEADER : 'HEADER' ; 156 | Id 157 | : '#' Digits 158 | ; 159 | 160 | ISO 161 | : 'ISO' '-' Digits '-' Digits ';' 162 | ; 163 | 164 | ISO_END 165 | : 'END-ISO' '-' Digits '-' Digits ';' 166 | ; 167 | 168 | StringLiteral 169 | : '"' Letter* '"' 170 | ; 171 | 172 | TypeRef 173 | : CapitalLetter (CapitalLetter|Digit)* 174 | ; 175 | 176 | Undefined 177 | : '$' 178 | ; 179 | 180 | AnyString 181 | : '\'' .*? '\'' 182 | ; 183 | 184 | NewlineChar 185 | : [\r\n\u000c]+ -> skip ; 186 | 187 | WS 188 | : [ \t\r\n\u000c]+ -> skip ; 189 | 190 | Comments 191 | : '/*' .*? '*/' -> skip ; -------------------------------------------------------------------------------- /src/IFC-dotnet/STEPListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using IFC4; 6 | 7 | namespace STEP 8 | { 9 | public class STEPId 10 | { 11 | public int Value {get;set;} 12 | 13 | public STEPId(int value) 14 | { 15 | Value = value; 16 | } 17 | } 18 | 19 | public class InstanceData 20 | { 21 | public int Id{get;set;} 22 | public Type Type{get;set;} 23 | public List Parameters{get;set;} 24 | 25 | public System.Reflection.ConstructorInfo Constructor{get;set;} 26 | 27 | /// 28 | /// The unique identifer of an BaseIfc instance constructed using this data. 29 | /// 30 | /// 31 | public Guid ConstructedGuid{get;set;} 32 | 33 | public bool HasDependencies 34 | { 35 | get 36 | { 37 | return Parameters.Any(p=>p is STEPId); 38 | } 39 | } 40 | 41 | public InstanceData(int id, Type type, List parameters, System.Reflection.ConstructorInfo ctorInfo) 42 | { 43 | Id = id; 44 | Type = type; 45 | Parameters = parameters; 46 | Constructor = ctorInfo; 47 | } 48 | } 49 | 50 | public class STEPListener : STEPBaseListener 51 | { 52 | private int currId; 53 | private IEnumerable enums; 54 | private IEnumerable types; 55 | 56 | private Dictionary instanceData; 57 | 58 | public Dictionary InstanceData 59 | { 60 | get{return instanceData;} 61 | } 62 | 63 | public STEPListener() 64 | { 65 | instanceData = new Dictionary(); 66 | 67 | // Parsing will involve finding many enum values 68 | // Cache the enum types for lookup during parsing. 69 | enums = typeof(IFC4.Model).Assembly.GetTypes().Where(t=>t.IsEnum).ToList(); 70 | 71 | types = typeof(IFC4.Model).Assembly.GetTypes().Where(t=>!t.IsEnum).ToList(); 72 | } 73 | 74 | public override void EnterInstance(STEPParser.InstanceContext context) 75 | { 76 | currId = int.Parse(context.Id().GetText().TrimStart('#')); 77 | } 78 | 79 | public override void EnterConstructor(STEPParser.ConstructorContext context) 80 | { 81 | // Only cache an instance if it's an outer instance. 82 | if(context.Parent is STEPParser.InstanceContext) 83 | { 84 | instanceData.Add(currId, ParseConstructor(currId, context)); 85 | } 86 | } 87 | 88 | private System.Reflection.ConstructorInfo GetMostLikelyConstructorForType(Type t) 89 | { 90 | return t.GetConstructors().OrderBy(c=>c.GetParameters().Count()).Last(); 91 | } 92 | 93 | private InstanceData ParseConstructor(int id, STEPParser.ConstructorContext context) 94 | { 95 | //Console.WriteLine($"Parsing context: {currId.Value} {context.GetText()}"); 96 | 97 | var typeName = context.TypeRef().GetText(); 98 | var ifcType = types.FirstOrDefault(t=>t.Name.ToUpper() == typeName); 99 | 100 | if(ifcType == null) 101 | { 102 | throw new STEPUnknownTypeException(typeName); 103 | } 104 | 105 | // Use the constructor which includes all non-optional parameters. 106 | var ctor = GetMostLikelyConstructorForType(ifcType); 107 | var ctorParams = ctor.GetParameters(); 108 | 109 | var constructorParams = new List(); 110 | 111 | var cParams = context.parameter(); 112 | 113 | for(var i=0; i(t, result); 199 | 200 | throw new STEPParserException(typeof(bool?), value); 201 | } 202 | 203 | private dynamic ParseId(string value) 204 | { 205 | int result; 206 | if(!int.TryParse(value.TrimStart('#'), out result)) 207 | { 208 | throw new STEPParserException(typeof(STEPId), value); 209 | } 210 | return new STEPId(result); 211 | } 212 | 213 | private dynamic ParseInt(Type t, string value) 214 | { 215 | int result; 216 | if(!int.TryParse(value, out result)) 217 | { 218 | throw new STEPParserException(typeof(int), value); 219 | } 220 | 221 | if(t == typeof(int)) 222 | { 223 | return result; 224 | } 225 | 226 | return CreateIfcTypeOrUseConstructorParameterTypeToConstruct(t, result); 227 | } 228 | 229 | private dynamic ParseReal(Type t, string value) 230 | { 231 | double result; 232 | if(!double.TryParse(value, out result)) 233 | { 234 | throw new STEPParserException(typeof(double), value); 235 | } 236 | 237 | if(t == typeof(double)) 238 | { 239 | return result; 240 | } 241 | 242 | return CreateIfcTypeOrUseConstructorParameterTypeToConstruct(t, result); 243 | } 244 | 245 | private object CreateIfcTypeOrUseConstructorParameterTypeToConstruct(Type typeToConstruct, TValue value) 246 | { 247 | var cTor = GetMostLikelyConstructorForType(typeToConstruct); 248 | var cTorParam = cTor.GetParameters()[0]; 249 | 250 | if(cTorParam.ParameterType == typeof(TValue)) 251 | { 252 | return Activator.CreateInstance(typeToConstruct, new object[]{value}); 253 | } 254 | else 255 | { 256 | var p = Activator.CreateInstance(cTorParam.ParameterType, new object[]{value}); 257 | return Activator.CreateInstance(typeToConstruct, new object[]{p}); 258 | } 259 | } 260 | 261 | private dynamic ParseString(Type t, string value) 262 | { 263 | string result = null; 264 | try 265 | { 266 | result = TrimQuotes(value); 267 | if(t == typeof(string)) 268 | { 269 | return result; 270 | } 271 | return CreateIfcTypeOrUseConstructorParameterTypeToConstruct(t, result); 272 | } 273 | catch(Exception) 274 | { 275 | throw new STEPParserException(typeof(string), value); 276 | } 277 | } 278 | 279 | private string TrimQuotes(string value) 280 | { 281 | return value.TrimStart('\'').TrimEnd('\''); 282 | } 283 | 284 | private string TrimDots(string value) 285 | { 286 | return value.TrimStart('.').TrimEnd('.'); 287 | } 288 | 289 | private dynamic ParseEnum(Type t, string value) 290 | { 291 | var trimmedValue = TrimDots(value); 292 | if(!t.IsEnum) 293 | { 294 | throw new STEPParserException(t, value); 295 | } 296 | 297 | try 298 | { 299 | return Enum.Parse(t, trimmedValue); 300 | } 301 | catch 302 | { 303 | throw new STEPParserException(typeof(Enum), trimmedValue); 304 | } 305 | } 306 | 307 | private dynamic ParseCollection(Type t, STEPParser.CollectionContext value) 308 | { 309 | //Console.WriteLine(t.Name); 310 | 311 | // Ex: #25 = IFCDIRECTION((1., 0., 0.)); 312 | // IfcDirection takes a List as its input parameters, so we get the type argument - double - and 313 | // do the coercion for all the items. 314 | 315 | // Ex: #31 = IFCSITE('3BoQ8L5UXBEOT1kW0PLzej', #2, 'Default Site', 'Description of Default Site', $, #32, $, $, .ELEMENT., (24, 28, 0), (54, 25, 0), 10., $, $); 316 | // IfcSite takes two IfcCompoundPlaneMeasure objects. It seems that some IFC exporters will not specify a type's constructor, they'll just 317 | // specify the arguments as a collection. 318 | 319 | Type collectionType; 320 | System.Reflection.ConstructorInfo ctor = null; 321 | 322 | if(t.IsGenericType) 323 | { 324 | collectionType = t.GetGenericArguments()[0]; 325 | } 326 | else 327 | { 328 | ctor = GetMostLikelyConstructorForType(t); 329 | collectionType = ctor.GetParameters()[0].ParameterType.GetGenericArguments()[0]; 330 | } 331 | 332 | var result = new List(); 333 | 334 | foreach(var cv in value.collectionValue()) 335 | { 336 | if(cv.Id() != null) 337 | { 338 | result.Add(ParseId(cv.Id().GetText())); 339 | } 340 | else if(cv.AnyString() != null) 341 | { 342 | result.Add(ParseString(collectionType, cv.AnyString().GetText())); 343 | } 344 | else if(cv.StringLiteral() != null) 345 | { 346 | result.Add(ParseString(collectionType, cv.StringLiteral().GetText())); 347 | } 348 | else if(cv.IntegerLiteral() != null) 349 | { 350 | result.Add(ParseInt(collectionType, cv.IntegerLiteral().GetText())); 351 | } 352 | else if(cv.RealLiteral() != null) 353 | { 354 | result.Add(ParseReal(collectionType, cv.RealLiteral().GetText())); 355 | } 356 | else if(cv.constructor() != null) 357 | { 358 | result.Add(ParseConstructor(currId, cv.constructor())); 359 | } 360 | } 361 | 362 | if(ctor != null) 363 | { 364 | //Console.WriteLine($"Found implicit constructor of type, {t}"); 365 | return new InstanceData(-1, t, new List(){result}, ctor); 366 | } 367 | 368 | return result; 369 | } 370 | } 371 | } -------------------------------------------------------------------------------- /src/IFC-dotnet/TypeConverters.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Globalization; 4 | 5 | namespace IFC4 6 | { 7 | /// 8 | /// Convert a select to any one of the types along its selection path. 9 | /// Ex: A select may have selects as its choices, which may have selects as 10 | /// their choices. This converter walls the selection tree to a valid leaf 11 | /// and converts. 12 | /// 13 | internal class SelectConverter : TypeConverter 14 | { 15 | public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 16 | { 17 | var t = FindChoiceWhichCanConvertType(typeof(TSelect), sourceType); 18 | return t != null; 19 | } 20 | 21 | private Type FindChoiceWhichCanConvertType(Type select, Type target) 22 | { 23 | var args = select.BaseType.GetGenericArguments(); 24 | foreach(var t in args) 25 | { 26 | if(t.IsAssignableFrom(target)) 27 | { 28 | return t; 29 | } 30 | 31 | if(typeof(Select).IsAssignableFrom(t)) 32 | { 33 | var test = FindChoiceWhichCanConvertType(t, target); 34 | if(test != null) 35 | { 36 | return test; 37 | } 38 | } 39 | } 40 | return null; 41 | } 42 | 43 | private object ReconstructSelectFromLeaf(Type select, object value) 44 | { 45 | // If the select has a constructor which takes 46 | // an instance of value, then use it and return 47 | try 48 | { 49 | return Activator.CreateInstance(select, new object[]{value}); 50 | } 51 | catch 52 | { 53 | //Console.WriteLine($"Could not construct instance of {select.Name} using a parameter of type {value.GetType()}"); 54 | } 55 | 56 | foreach(var t in select.BaseType.GetGenericArguments()) 57 | { 58 | if(t.IsAssignableFrom(typeof(Select))) 59 | { 60 | var result = ReconstructSelectFromLeaf(t, value); 61 | if(result != null) 62 | { 63 | return Activator.CreateInstance(select, new object[]{result}); 64 | } 65 | } 66 | } 67 | 68 | return null; 69 | } 70 | 71 | public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) 72 | { 73 | return (TSelect)ReconstructSelectFromLeaf(typeof(TSelect), value); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /src/IFC-dotnet/antlr/STEP.tokens: -------------------------------------------------------------------------------- 1 | T__0=1 2 | T__1=2 3 | T__2=3 4 | T__3=4 5 | T__4=5 6 | T__5=6 7 | T__6=7 8 | T__7=8 9 | IntegerLiteral=9 10 | Letter=10 11 | CapitalLetter=11 12 | DateTime=12 13 | Derived=13 14 | BoolLogical=14 15 | Enum=15 16 | RealLiteral=16 17 | DATA=17 18 | ENDSEC=18 19 | FILE_DESCRIPTION=19 20 | FILE_NAME=20 21 | FILE_SCHEMA=21 22 | HEADER=22 23 | Id=23 24 | ISO=24 25 | ISO_END=25 26 | StringLiteral=26 27 | TypeRef=27 28 | Undefined=28 29 | AnyString=29 30 | NewlineChar=30 31 | WS=31 32 | Comments=32 33 | '('=1 34 | ','=2 35 | ')'=3 36 | '()'=4 37 | ';'=5 38 | '\''=6 39 | '.'=7 40 | '='=8 41 | '*'=13 42 | 'DATA'=17 43 | 'ENDSEC'=18 44 | 'FILE_DESCRIPTION'=19 45 | 'FILE_NAME'=20 46 | 'FILE_SCHEMA'=21 47 | 'HEADER'=22 48 | '$'=28 49 | -------------------------------------------------------------------------------- /src/IFC-dotnet/antlr/STEPBaseListener.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // ANTLR Version: 4.7 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | // Generated from STEP.g4 by ANTLR 4.7 12 | 13 | // Unreachable code detected 14 | #pragma warning disable 0162 15 | // The variable '...' is assigned but its value is never used 16 | #pragma warning disable 0219 17 | // Missing XML comment for publicly visible type or member '...' 18 | #pragma warning disable 1591 19 | // Ambiguous reference in cref attribute 20 | #pragma warning disable 419 21 | 22 | namespace STEP { 23 | 24 | using Antlr4.Runtime.Misc; 25 | using IErrorNode = Antlr4.Runtime.Tree.IErrorNode; 26 | using ITerminalNode = Antlr4.Runtime.Tree.ITerminalNode; 27 | using IToken = Antlr4.Runtime.IToken; 28 | using ParserRuleContext = Antlr4.Runtime.ParserRuleContext; 29 | 30 | /// 31 | /// This class provides an empty implementation of , 32 | /// which can be extended to create a listener which only needs to handle a subset 33 | /// of the available methods. 34 | /// 35 | [System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.7")] 36 | [System.CLSCompliant(false)] 37 | public partial class STEPBaseListener : ISTEPListener { 38 | /// 39 | /// Enter a parse tree produced by . 40 | /// The default implementation does nothing. 41 | /// 42 | /// The parse tree. 43 | public virtual void EnterAuthor([NotNull] STEPParser.AuthorContext context) { } 44 | /// 45 | /// Exit a parse tree produced by . 46 | /// The default implementation does nothing. 47 | /// 48 | /// The parse tree. 49 | public virtual void ExitAuthor([NotNull] STEPParser.AuthorContext context) { } 50 | /// 51 | /// Enter a parse tree produced by . 52 | /// The default implementation does nothing. 53 | /// 54 | /// The parse tree. 55 | public virtual void EnterAuthorisation([NotNull] STEPParser.AuthorisationContext context) { } 56 | /// 57 | /// Exit a parse tree produced by . 58 | /// The default implementation does nothing. 59 | /// 60 | /// The parse tree. 61 | public virtual void ExitAuthorisation([NotNull] STEPParser.AuthorisationContext context) { } 62 | /// 63 | /// Enter a parse tree produced by . 64 | /// The default implementation does nothing. 65 | /// 66 | /// The parse tree. 67 | public virtual void EnterCollection([NotNull] STEPParser.CollectionContext context) { } 68 | /// 69 | /// Exit a parse tree produced by . 70 | /// The default implementation does nothing. 71 | /// 72 | /// The parse tree. 73 | public virtual void ExitCollection([NotNull] STEPParser.CollectionContext context) { } 74 | /// 75 | /// Enter a parse tree produced by . 76 | /// The default implementation does nothing. 77 | /// 78 | /// The parse tree. 79 | public virtual void EnterCollectionValue([NotNull] STEPParser.CollectionValueContext context) { } 80 | /// 81 | /// Exit a parse tree produced by . 82 | /// The default implementation does nothing. 83 | /// 84 | /// The parse tree. 85 | public virtual void ExitCollectionValue([NotNull] STEPParser.CollectionValueContext context) { } 86 | /// 87 | /// Enter a parse tree produced by . 88 | /// The default implementation does nothing. 89 | /// 90 | /// The parse tree. 91 | public virtual void EnterConstructor([NotNull] STEPParser.ConstructorContext context) { } 92 | /// 93 | /// Exit a parse tree produced by . 94 | /// The default implementation does nothing. 95 | /// 96 | /// The parse tree. 97 | public virtual void ExitConstructor([NotNull] STEPParser.ConstructorContext context) { } 98 | /// 99 | /// Enter a parse tree produced by . 100 | /// The default implementation does nothing. 101 | /// 102 | /// The parse tree. 103 | public virtual void EnterData([NotNull] STEPParser.DataContext context) { } 104 | /// 105 | /// Exit a parse tree produced by . 106 | /// The default implementation does nothing. 107 | /// 108 | /// The parse tree. 109 | public virtual void ExitData([NotNull] STEPParser.DataContext context) { } 110 | /// 111 | /// Enter a parse tree produced by . 112 | /// The default implementation does nothing. 113 | /// 114 | /// The parse tree. 115 | public virtual void EnterDescription([NotNull] STEPParser.DescriptionContext context) { } 116 | /// 117 | /// Exit a parse tree produced by . 118 | /// The default implementation does nothing. 119 | /// 120 | /// The parse tree. 121 | public virtual void ExitDescription([NotNull] STEPParser.DescriptionContext context) { } 122 | /// 123 | /// Enter a parse tree produced by . 124 | /// The default implementation does nothing. 125 | /// 126 | /// The parse tree. 127 | public virtual void EnterFile([NotNull] STEPParser.FileContext context) { } 128 | /// 129 | /// Exit a parse tree produced by . 130 | /// The default implementation does nothing. 131 | /// 132 | /// The parse tree. 133 | public virtual void ExitFile([NotNull] STEPParser.FileContext context) { } 134 | /// 135 | /// Enter a parse tree produced by . 136 | /// The default implementation does nothing. 137 | /// 138 | /// The parse tree. 139 | public virtual void EnterFileDescription([NotNull] STEPParser.FileDescriptionContext context) { } 140 | /// 141 | /// Exit a parse tree produced by . 142 | /// The default implementation does nothing. 143 | /// 144 | /// The parse tree. 145 | public virtual void ExitFileDescription([NotNull] STEPParser.FileDescriptionContext context) { } 146 | /// 147 | /// Enter a parse tree produced by . 148 | /// The default implementation does nothing. 149 | /// 150 | /// The parse tree. 151 | public virtual void EnterFileName([NotNull] STEPParser.FileNameContext context) { } 152 | /// 153 | /// Exit a parse tree produced by . 154 | /// The default implementation does nothing. 155 | /// 156 | /// The parse tree. 157 | public virtual void ExitFileName([NotNull] STEPParser.FileNameContext context) { } 158 | /// 159 | /// Enter a parse tree produced by . 160 | /// The default implementation does nothing. 161 | /// 162 | /// The parse tree. 163 | public virtual void EnterFilePath([NotNull] STEPParser.FilePathContext context) { } 164 | /// 165 | /// Exit a parse tree produced by . 166 | /// The default implementation does nothing. 167 | /// 168 | /// The parse tree. 169 | public virtual void ExitFilePath([NotNull] STEPParser.FilePathContext context) { } 170 | /// 171 | /// Enter a parse tree produced by . 172 | /// The default implementation does nothing. 173 | /// 174 | /// The parse tree. 175 | public virtual void EnterFileSchema([NotNull] STEPParser.FileSchemaContext context) { } 176 | /// 177 | /// Exit a parse tree produced by . 178 | /// The default implementation does nothing. 179 | /// 180 | /// The parse tree. 181 | public virtual void ExitFileSchema([NotNull] STEPParser.FileSchemaContext context) { } 182 | /// 183 | /// Enter a parse tree produced by . 184 | /// The default implementation does nothing. 185 | /// 186 | /// The parse tree. 187 | public virtual void EnterHeader([NotNull] STEPParser.HeaderContext context) { } 188 | /// 189 | /// Exit a parse tree produced by . 190 | /// The default implementation does nothing. 191 | /// 192 | /// The parse tree. 193 | public virtual void ExitHeader([NotNull] STEPParser.HeaderContext context) { } 194 | /// 195 | /// Enter a parse tree produced by . 196 | /// The default implementation does nothing. 197 | /// 198 | /// The parse tree. 199 | public virtual void EnterImplementation([NotNull] STEPParser.ImplementationContext context) { } 200 | /// 201 | /// Exit a parse tree produced by . 202 | /// The default implementation does nothing. 203 | /// 204 | /// The parse tree. 205 | public virtual void ExitImplementation([NotNull] STEPParser.ImplementationContext context) { } 206 | /// 207 | /// Enter a parse tree produced by . 208 | /// The default implementation does nothing. 209 | /// 210 | /// The parse tree. 211 | public virtual void EnterInstance([NotNull] STEPParser.InstanceContext context) { } 212 | /// 213 | /// Exit a parse tree produced by . 214 | /// The default implementation does nothing. 215 | /// 216 | /// The parse tree. 217 | public virtual void ExitInstance([NotNull] STEPParser.InstanceContext context) { } 218 | /// 219 | /// Enter a parse tree produced by . 220 | /// The default implementation does nothing. 221 | /// 222 | /// The parse tree. 223 | public virtual void EnterName([NotNull] STEPParser.NameContext context) { } 224 | /// 225 | /// Exit a parse tree produced by . 226 | /// The default implementation does nothing. 227 | /// 228 | /// The parse tree. 229 | public virtual void ExitName([NotNull] STEPParser.NameContext context) { } 230 | /// 231 | /// Enter a parse tree produced by . 232 | /// The default implementation does nothing. 233 | /// 234 | /// The parse tree. 235 | public virtual void EnterOriginating_system([NotNull] STEPParser.Originating_systemContext context) { } 236 | /// 237 | /// Exit a parse tree produced by . 238 | /// The default implementation does nothing. 239 | /// 240 | /// The parse tree. 241 | public virtual void ExitOriginating_system([NotNull] STEPParser.Originating_systemContext context) { } 242 | /// 243 | /// Enter a parse tree produced by . 244 | /// The default implementation does nothing. 245 | /// 246 | /// The parse tree. 247 | public virtual void EnterOrganization([NotNull] STEPParser.OrganizationContext context) { } 248 | /// 249 | /// Exit a parse tree produced by . 250 | /// The default implementation does nothing. 251 | /// 252 | /// The parse tree. 253 | public virtual void ExitOrganization([NotNull] STEPParser.OrganizationContext context) { } 254 | /// 255 | /// Enter a parse tree produced by . 256 | /// The default implementation does nothing. 257 | /// 258 | /// The parse tree. 259 | public virtual void EnterParameter([NotNull] STEPParser.ParameterContext context) { } 260 | /// 261 | /// Exit a parse tree produced by . 262 | /// The default implementation does nothing. 263 | /// 264 | /// The parse tree. 265 | public virtual void ExitParameter([NotNull] STEPParser.ParameterContext context) { } 266 | /// 267 | /// Enter a parse tree produced by . 268 | /// The default implementation does nothing. 269 | /// 270 | /// The parse tree. 271 | public virtual void EnterPreprocessor_version([NotNull] STEPParser.Preprocessor_versionContext context) { } 272 | /// 273 | /// Exit a parse tree produced by . 274 | /// The default implementation does nothing. 275 | /// 276 | /// The parse tree. 277 | public virtual void ExitPreprocessor_version([NotNull] STEPParser.Preprocessor_versionContext context) { } 278 | /// 279 | /// Enter a parse tree produced by . 280 | /// The default implementation does nothing. 281 | /// 282 | /// The parse tree. 283 | public virtual void EnterTimeStamp([NotNull] STEPParser.TimeStampContext context) { } 284 | /// 285 | /// Exit a parse tree produced by . 286 | /// The default implementation does nothing. 287 | /// 288 | /// The parse tree. 289 | public virtual void ExitTimeStamp([NotNull] STEPParser.TimeStampContext context) { } 290 | 291 | /// 292 | /// The default implementation does nothing. 293 | public virtual void EnterEveryRule([NotNull] ParserRuleContext context) { } 294 | /// 295 | /// The default implementation does nothing. 296 | public virtual void ExitEveryRule([NotNull] ParserRuleContext context) { } 297 | /// 298 | /// The default implementation does nothing. 299 | public virtual void VisitTerminal([NotNull] ITerminalNode node) { } 300 | /// 301 | /// The default implementation does nothing. 302 | public virtual void VisitErrorNode([NotNull] IErrorNode node) { } 303 | } 304 | } // namespace STEP 305 | -------------------------------------------------------------------------------- /src/IFC-dotnet/antlr/STEPLexer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // ANTLR Version: 4.7 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | // Generated from STEP.g4 by ANTLR 4.7 12 | 13 | // Unreachable code detected 14 | #pragma warning disable 0162 15 | // The variable '...' is assigned but its value is never used 16 | #pragma warning disable 0219 17 | // Missing XML comment for publicly visible type or member '...' 18 | #pragma warning disable 1591 19 | // Ambiguous reference in cref attribute 20 | #pragma warning disable 419 21 | 22 | namespace STEP { 23 | using System; 24 | using System.IO; 25 | using System.Text; 26 | using Antlr4.Runtime; 27 | using Antlr4.Runtime.Atn; 28 | using Antlr4.Runtime.Misc; 29 | using DFA = Antlr4.Runtime.Dfa.DFA; 30 | 31 | [System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.7")] 32 | [System.CLSCompliant(false)] 33 | public partial class STEPLexer : Lexer { 34 | protected static DFA[] decisionToDFA; 35 | protected static PredictionContextCache sharedContextCache = new PredictionContextCache(); 36 | public const int 37 | T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, IntegerLiteral=9, 38 | Letter=10, CapitalLetter=11, DateTime=12, Derived=13, BoolLogical=14, 39 | Enum=15, RealLiteral=16, DATA=17, ENDSEC=18, FILE_DESCRIPTION=19, FILE_NAME=20, 40 | FILE_SCHEMA=21, HEADER=22, Id=23, ISO=24, ISO_END=25, StringLiteral=26, 41 | TypeRef=27, Undefined=28, AnyString=29, NewlineChar=30, WS=31, Comments=32; 42 | public static string[] channelNames = { 43 | "DEFAULT_TOKEN_CHANNEL", "HIDDEN" 44 | }; 45 | 46 | public static string[] modeNames = { 47 | "DEFAULT_MODE" 48 | }; 49 | 50 | public static readonly string[] ruleNames = { 51 | "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "Digit", 52 | "Digits", "IntegerLiteral", "Letter", "CapitalLetter", "DateTime", "Derived", 53 | "BoolLogical", "Enum", "RealLiteral", "DATA", "ENDSEC", "FILE_DESCRIPTION", 54 | "FILE_NAME", "FILE_SCHEMA", "HEADER", "Id", "ISO", "ISO_END", "StringLiteral", 55 | "TypeRef", "Undefined", "AnyString", "NewlineChar", "WS", "Comments" 56 | }; 57 | 58 | 59 | public STEPLexer(ICharStream input) 60 | : this(input, Console.Out, Console.Error) { } 61 | 62 | public STEPLexer(ICharStream input, TextWriter output, TextWriter errorOutput) 63 | : base(input, output, errorOutput) 64 | { 65 | Interpreter = new LexerATNSimulator(this, _ATN, decisionToDFA, sharedContextCache); 66 | } 67 | 68 | private static readonly string[] _LiteralNames = { 69 | null, "'('", "','", "')'", "'()'", "';'", "'''", "'.'", "'='", null, null, 70 | null, null, "'*'", null, null, null, "'DATA'", "'ENDSEC'", "'FILE_DESCRIPTION'", 71 | "'FILE_NAME'", "'FILE_SCHEMA'", "'HEADER'", null, null, null, null, null, 72 | "'$'" 73 | }; 74 | private static readonly string[] _SymbolicNames = { 75 | null, null, null, null, null, null, null, null, null, "IntegerLiteral", 76 | "Letter", "CapitalLetter", "DateTime", "Derived", "BoolLogical", "Enum", 77 | "RealLiteral", "DATA", "ENDSEC", "FILE_DESCRIPTION", "FILE_NAME", "FILE_SCHEMA", 78 | "HEADER", "Id", "ISO", "ISO_END", "StringLiteral", "TypeRef", "Undefined", 79 | "AnyString", "NewlineChar", "WS", "Comments" 80 | }; 81 | public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); 82 | 83 | [NotNull] 84 | public override IVocabulary Vocabulary 85 | { 86 | get 87 | { 88 | return DefaultVocabulary; 89 | } 90 | } 91 | 92 | public override string GrammarFileName { get { return "STEP.g4"; } } 93 | 94 | public override string[] RuleNames { get { return ruleNames; } } 95 | 96 | public override string[] ChannelNames { get { return channelNames; } } 97 | 98 | public override string[] ModeNames { get { return modeNames; } } 99 | 100 | public override string SerializedAtn { get { return new string(_serializedATN); } } 101 | 102 | static STEPLexer() { 103 | decisionToDFA = new DFA[_ATN.NumberOfDecisions]; 104 | for (int i = 0; i < _ATN.NumberOfDecisions; i++) { 105 | decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i); 106 | } 107 | } 108 | private static char[] _serializedATN = { 109 | '\x3', '\x608B', '\xA72A', '\x8133', '\xB9ED', '\x417C', '\x3BE7', '\x7786', 110 | '\x5964', '\x2', '\"', '\x127', '\b', '\x1', '\x4', '\x2', '\t', '\x2', 111 | '\x4', '\x3', '\t', '\x3', '\x4', '\x4', '\t', '\x4', '\x4', '\x5', '\t', 112 | '\x5', '\x4', '\x6', '\t', '\x6', '\x4', '\a', '\t', '\a', '\x4', '\b', 113 | '\t', '\b', '\x4', '\t', '\t', '\t', '\x4', '\n', '\t', '\n', '\x4', '\v', 114 | '\t', '\v', '\x4', '\f', '\t', '\f', '\x4', '\r', '\t', '\r', '\x4', '\xE', 115 | '\t', '\xE', '\x4', '\xF', '\t', '\xF', '\x4', '\x10', '\t', '\x10', '\x4', 116 | '\x11', '\t', '\x11', '\x4', '\x12', '\t', '\x12', '\x4', '\x13', '\t', 117 | '\x13', '\x4', '\x14', '\t', '\x14', '\x4', '\x15', '\t', '\x15', '\x4', 118 | '\x16', '\t', '\x16', '\x4', '\x17', '\t', '\x17', '\x4', '\x18', '\t', 119 | '\x18', '\x4', '\x19', '\t', '\x19', '\x4', '\x1A', '\t', '\x1A', '\x4', 120 | '\x1B', '\t', '\x1B', '\x4', '\x1C', '\t', '\x1C', '\x4', '\x1D', '\t', 121 | '\x1D', '\x4', '\x1E', '\t', '\x1E', '\x4', '\x1F', '\t', '\x1F', '\x4', 122 | ' ', '\t', ' ', '\x4', '!', '\t', '!', '\x4', '\"', '\t', '\"', '\x4', 123 | '#', '\t', '#', '\x3', '\x2', '\x3', '\x2', '\x3', '\x3', '\x3', '\x3', 124 | '\x3', '\x4', '\x3', '\x4', '\x3', '\x5', '\x3', '\x5', '\x3', '\x5', 125 | '\x3', '\x6', '\x3', '\x6', '\x3', '\a', '\x3', '\a', '\x3', '\b', '\x3', 126 | '\b', '\x3', '\t', '\x3', '\t', '\x3', '\n', '\x3', '\n', '\x3', '\v', 127 | '\x3', '\v', '\a', '\v', ']', '\n', '\v', '\f', '\v', '\xE', '\v', '`', 128 | '\v', '\v', '\x3', '\f', '\x5', '\f', '\x63', '\n', '\f', '\x3', '\f', 129 | '\x3', '\f', '\x3', '\r', '\x3', '\r', '\x3', '\xE', '\x3', '\xE', '\x3', 130 | '\xF', '\x3', '\xF', '\x3', '\xF', '\x3', '\xF', '\x3', '\xF', '\x3', 131 | '\xF', '\x3', '\xF', '\x3', '\xF', '\x3', '\xF', '\x3', '\xF', '\x3', 132 | '\xF', '\x3', '\xF', '\x3', '\xF', '\x3', '\xF', '\x3', '\x10', '\x3', 133 | '\x10', '\x3', '\x11', '\x3', '\x11', '\x3', '\x11', '\x3', '\x11', '\x3', 134 | '\x12', '\x3', '\x12', '\x3', '\x12', '\a', '\x12', '\x82', '\n', '\x12', 135 | '\f', '\x12', '\xE', '\x12', '\x85', '\v', '\x12', '\x3', '\x12', '\x3', 136 | '\x12', '\x3', '\x13', '\x5', '\x13', '\x8A', '\n', '\x13', '\x3', '\x13', 137 | '\x3', '\x13', '\x3', '\x13', '\a', '\x13', '\x8F', '\n', '\x13', '\f', 138 | '\x13', '\xE', '\x13', '\x92', '\v', '\x13', '\x3', '\x13', '\x3', '\x13', 139 | '\x5', '\x13', '\x96', '\n', '\x13', '\x3', '\x13', '\x5', '\x13', '\x99', 140 | '\n', '\x13', '\x3', '\x14', '\x3', '\x14', '\x3', '\x14', '\x3', '\x14', 141 | '\x3', '\x14', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', 142 | '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x16', '\x3', '\x16', 143 | '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', 144 | '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', 145 | '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', '\x3', '\x16', 146 | '\x3', '\x17', '\x3', '\x17', '\x3', '\x17', '\x3', '\x17', '\x3', '\x17', 147 | '\x3', '\x17', '\x3', '\x17', '\x3', '\x17', '\x3', '\x17', '\x3', '\x17', 148 | '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', 149 | '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', 150 | '\x3', '\x18', '\x3', '\x18', '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', 151 | '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', '\x3', '\x1A', 152 | '\x3', '\x1A', '\x3', '\x1A', '\x3', '\x1B', '\x3', '\x1B', '\x3', '\x1B', 153 | '\x3', '\x1B', '\x3', '\x1B', '\x3', '\x1B', '\x3', '\x1B', '\x3', '\x1B', 154 | '\x3', '\x1B', '\x3', '\x1B', '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1C', 155 | '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1C', 156 | '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1C', 157 | '\x3', '\x1C', '\x3', '\x1D', '\x3', '\x1D', '\a', '\x1D', '\xF2', '\n', 158 | '\x1D', '\f', '\x1D', '\xE', '\x1D', '\xF5', '\v', '\x1D', '\x3', '\x1D', 159 | '\x3', '\x1D', '\x3', '\x1E', '\x3', '\x1E', '\x3', '\x1E', '\a', '\x1E', 160 | '\xFC', '\n', '\x1E', '\f', '\x1E', '\xE', '\x1E', '\xFF', '\v', '\x1E', 161 | '\x3', '\x1F', '\x3', '\x1F', '\x3', ' ', '\x3', ' ', '\a', ' ', '\x105', 162 | '\n', ' ', '\f', ' ', '\xE', ' ', '\x108', '\v', ' ', '\x3', ' ', '\x3', 163 | ' ', '\x3', '!', '\x6', '!', '\x10D', '\n', '!', '\r', '!', '\xE', '!', 164 | '\x10E', '\x3', '!', '\x3', '!', '\x3', '\"', '\x6', '\"', '\x114', '\n', 165 | '\"', '\r', '\"', '\xE', '\"', '\x115', '\x3', '\"', '\x3', '\"', '\x3', 166 | '#', '\x3', '#', '\x3', '#', '\x3', '#', '\a', '#', '\x11E', '\n', '#', 167 | '\f', '#', '\xE', '#', '\x121', '\v', '#', '\x3', '#', '\x3', '#', '\x3', 168 | '#', '\x3', '#', '\x3', '#', '\x4', '\x106', '\x11F', '\x2', '$', '\x3', 169 | '\x3', '\x5', '\x4', '\a', '\x5', '\t', '\x6', '\v', '\a', '\r', '\b', 170 | '\xF', '\t', '\x11', '\n', '\x13', '\x2', '\x15', '\x2', '\x17', '\v', 171 | '\x19', '\f', '\x1B', '\r', '\x1D', '\xE', '\x1F', '\xF', '!', '\x10', 172 | '#', '\x11', '%', '\x12', '\'', '\x13', ')', '\x14', '+', '\x15', '-', 173 | '\x16', '/', '\x17', '\x31', '\x18', '\x33', '\x19', '\x35', '\x1A', '\x37', 174 | '\x1B', '\x39', '\x1C', ';', '\x1D', '=', '\x1E', '?', '\x1F', '\x41', 175 | ' ', '\x43', '!', '\x45', '\"', '\x3', '\x2', '\n', '\x3', '\x2', '\x32', 176 | ';', '\x4', '\x2', '\x43', '\\', '\x63', '|', '\x3', '\x2', '\x43', '\\', 177 | '\x4', '\x2', 'H', 'H', 'V', 'W', '\x5', '\x2', '\x32', ';', '\x43', '\\', 178 | '\x61', '\x61', '\x4', '\x2', 'G', 'G', 'g', 'g', '\x4', '\x2', '\f', 179 | '\f', '\xE', '\xF', '\x5', '\x2', '\v', '\f', '\xE', '\xF', '\"', '\"', 180 | '\x2', '\x132', '\x2', '\x3', '\x3', '\x2', '\x2', '\x2', '\x2', '\x5', 181 | '\x3', '\x2', '\x2', '\x2', '\x2', '\a', '\x3', '\x2', '\x2', '\x2', '\x2', 182 | '\t', '\x3', '\x2', '\x2', '\x2', '\x2', '\v', '\x3', '\x2', '\x2', '\x2', 183 | '\x2', '\r', '\x3', '\x2', '\x2', '\x2', '\x2', '\xF', '\x3', '\x2', '\x2', 184 | '\x2', '\x2', '\x11', '\x3', '\x2', '\x2', '\x2', '\x2', '\x17', '\x3', 185 | '\x2', '\x2', '\x2', '\x2', '\x19', '\x3', '\x2', '\x2', '\x2', '\x2', 186 | '\x1B', '\x3', '\x2', '\x2', '\x2', '\x2', '\x1D', '\x3', '\x2', '\x2', 187 | '\x2', '\x2', '\x1F', '\x3', '\x2', '\x2', '\x2', '\x2', '!', '\x3', '\x2', 188 | '\x2', '\x2', '\x2', '#', '\x3', '\x2', '\x2', '\x2', '\x2', '%', '\x3', 189 | '\x2', '\x2', '\x2', '\x2', '\'', '\x3', '\x2', '\x2', '\x2', '\x2', ')', 190 | '\x3', '\x2', '\x2', '\x2', '\x2', '+', '\x3', '\x2', '\x2', '\x2', '\x2', 191 | '-', '\x3', '\x2', '\x2', '\x2', '\x2', '/', '\x3', '\x2', '\x2', '\x2', 192 | '\x2', '\x31', '\x3', '\x2', '\x2', '\x2', '\x2', '\x33', '\x3', '\x2', 193 | '\x2', '\x2', '\x2', '\x35', '\x3', '\x2', '\x2', '\x2', '\x2', '\x37', 194 | '\x3', '\x2', '\x2', '\x2', '\x2', '\x39', '\x3', '\x2', '\x2', '\x2', 195 | '\x2', ';', '\x3', '\x2', '\x2', '\x2', '\x2', '=', '\x3', '\x2', '\x2', 196 | '\x2', '\x2', '?', '\x3', '\x2', '\x2', '\x2', '\x2', '\x41', '\x3', '\x2', 197 | '\x2', '\x2', '\x2', '\x43', '\x3', '\x2', '\x2', '\x2', '\x2', '\x45', 198 | '\x3', '\x2', '\x2', '\x2', '\x3', 'G', '\x3', '\x2', '\x2', '\x2', '\x5', 199 | 'I', '\x3', '\x2', '\x2', '\x2', '\a', 'K', '\x3', '\x2', '\x2', '\x2', 200 | '\t', 'M', '\x3', '\x2', '\x2', '\x2', '\v', 'P', '\x3', '\x2', '\x2', 201 | '\x2', '\r', 'R', '\x3', '\x2', '\x2', '\x2', '\xF', 'T', '\x3', '\x2', 202 | '\x2', '\x2', '\x11', 'V', '\x3', '\x2', '\x2', '\x2', '\x13', 'X', '\x3', 203 | '\x2', '\x2', '\x2', '\x15', 'Z', '\x3', '\x2', '\x2', '\x2', '\x17', 204 | '\x62', '\x3', '\x2', '\x2', '\x2', '\x19', '\x66', '\x3', '\x2', '\x2', 205 | '\x2', '\x1B', 'h', '\x3', '\x2', '\x2', '\x2', '\x1D', 'j', '\x3', '\x2', 206 | '\x2', '\x2', '\x1F', 'x', '\x3', '\x2', '\x2', '\x2', '!', 'z', '\x3', 207 | '\x2', '\x2', '\x2', '#', '~', '\x3', '\x2', '\x2', '\x2', '%', '\x89', 208 | '\x3', '\x2', '\x2', '\x2', '\'', '\x9A', '\x3', '\x2', '\x2', '\x2', 209 | ')', '\x9F', '\x3', '\x2', '\x2', '\x2', '+', '\xA6', '\x3', '\x2', '\x2', 210 | '\x2', '-', '\xB7', '\x3', '\x2', '\x2', '\x2', '/', '\xC1', '\x3', '\x2', 211 | '\x2', '\x2', '\x31', '\xCD', '\x3', '\x2', '\x2', '\x2', '\x33', '\xD4', 212 | '\x3', '\x2', '\x2', '\x2', '\x35', '\xD7', '\x3', '\x2', '\x2', '\x2', 213 | '\x37', '\xE1', '\x3', '\x2', '\x2', '\x2', '\x39', '\xEF', '\x3', '\x2', 214 | '\x2', '\x2', ';', '\xF8', '\x3', '\x2', '\x2', '\x2', '=', '\x100', '\x3', 215 | '\x2', '\x2', '\x2', '?', '\x102', '\x3', '\x2', '\x2', '\x2', '\x41', 216 | '\x10C', '\x3', '\x2', '\x2', '\x2', '\x43', '\x113', '\x3', '\x2', '\x2', 217 | '\x2', '\x45', '\x119', '\x3', '\x2', '\x2', '\x2', 'G', 'H', '\a', '*', 218 | '\x2', '\x2', 'H', '\x4', '\x3', '\x2', '\x2', '\x2', 'I', 'J', '\a', 219 | '.', '\x2', '\x2', 'J', '\x6', '\x3', '\x2', '\x2', '\x2', 'K', 'L', '\a', 220 | '+', '\x2', '\x2', 'L', '\b', '\x3', '\x2', '\x2', '\x2', 'M', 'N', '\a', 221 | '*', '\x2', '\x2', 'N', 'O', '\a', '+', '\x2', '\x2', 'O', '\n', '\x3', 222 | '\x2', '\x2', '\x2', 'P', 'Q', '\a', '=', '\x2', '\x2', 'Q', '\f', '\x3', 223 | '\x2', '\x2', '\x2', 'R', 'S', '\a', ')', '\x2', '\x2', 'S', '\xE', '\x3', 224 | '\x2', '\x2', '\x2', 'T', 'U', '\a', '\x30', '\x2', '\x2', 'U', '\x10', 225 | '\x3', '\x2', '\x2', '\x2', 'V', 'W', '\a', '?', '\x2', '\x2', 'W', '\x12', 226 | '\x3', '\x2', '\x2', '\x2', 'X', 'Y', '\t', '\x2', '\x2', '\x2', 'Y', 227 | '\x14', '\x3', '\x2', '\x2', '\x2', 'Z', '^', '\x5', '\x13', '\n', '\x2', 228 | '[', ']', '\x5', '\x13', '\n', '\x2', '\\', '[', '\x3', '\x2', '\x2', 229 | '\x2', ']', '`', '\x3', '\x2', '\x2', '\x2', '^', '\\', '\x3', '\x2', 230 | '\x2', '\x2', '^', '_', '\x3', '\x2', '\x2', '\x2', '_', '\x16', '\x3', 231 | '\x2', '\x2', '\x2', '`', '^', '\x3', '\x2', '\x2', '\x2', '\x61', '\x63', 232 | '\a', '/', '\x2', '\x2', '\x62', '\x61', '\x3', '\x2', '\x2', '\x2', '\x62', 233 | '\x63', '\x3', '\x2', '\x2', '\x2', '\x63', '\x64', '\x3', '\x2', '\x2', 234 | '\x2', '\x64', '\x65', '\x5', '\x15', '\v', '\x2', '\x65', '\x18', '\x3', 235 | '\x2', '\x2', '\x2', '\x66', 'g', '\t', '\x3', '\x2', '\x2', 'g', '\x1A', 236 | '\x3', '\x2', '\x2', '\x2', 'h', 'i', '\t', '\x4', '\x2', '\x2', 'i', 237 | '\x1C', '\x3', '\x2', '\x2', '\x2', 'j', 'k', '\a', ')', '\x2', '\x2', 238 | 'k', 'l', '\x5', '\x15', '\v', '\x2', 'l', 'm', '\a', '/', '\x2', '\x2', 239 | 'm', 'n', '\x5', '\x15', '\v', '\x2', 'n', 'o', '\a', '/', '\x2', '\x2', 240 | 'o', 'p', '\x5', '\x15', '\v', '\x2', 'p', 'q', '\a', 'V', '\x2', '\x2', 241 | 'q', 'r', '\x5', '\x15', '\v', '\x2', 'r', 's', '\a', '<', '\x2', '\x2', 242 | 's', 't', '\x5', '\x15', '\v', '\x2', 't', 'u', '\a', '<', '\x2', '\x2', 243 | 'u', 'v', '\x5', '\x15', '\v', '\x2', 'v', 'w', '\a', ')', '\x2', '\x2', 244 | 'w', '\x1E', '\x3', '\x2', '\x2', '\x2', 'x', 'y', '\a', ',', '\x2', '\x2', 245 | 'y', ' ', '\x3', '\x2', '\x2', '\x2', 'z', '{', '\a', '\x30', '\x2', '\x2', 246 | '{', '|', '\t', '\x5', '\x2', '\x2', '|', '}', '\a', '\x30', '\x2', '\x2', 247 | '}', '\"', '\x3', '\x2', '\x2', '\x2', '~', '\x7F', '\a', '\x30', '\x2', 248 | '\x2', '\x7F', '\x83', '\t', '\x4', '\x2', '\x2', '\x80', '\x82', '\t', 249 | '\x6', '\x2', '\x2', '\x81', '\x80', '\x3', '\x2', '\x2', '\x2', '\x82', 250 | '\x85', '\x3', '\x2', '\x2', '\x2', '\x83', '\x81', '\x3', '\x2', '\x2', 251 | '\x2', '\x83', '\x84', '\x3', '\x2', '\x2', '\x2', '\x84', '\x86', '\x3', 252 | '\x2', '\x2', '\x2', '\x85', '\x83', '\x3', '\x2', '\x2', '\x2', '\x86', 253 | '\x87', '\a', '\x30', '\x2', '\x2', '\x87', '$', '\x3', '\x2', '\x2', 254 | '\x2', '\x88', '\x8A', '\a', '/', '\x2', '\x2', '\x89', '\x88', '\x3', 255 | '\x2', '\x2', '\x2', '\x89', '\x8A', '\x3', '\x2', '\x2', '\x2', '\x8A', 256 | '\x8B', '\x3', '\x2', '\x2', '\x2', '\x8B', '\x8C', '\x5', '\x15', '\v', 257 | '\x2', '\x8C', '\x90', '\a', '\x30', '\x2', '\x2', '\x8D', '\x8F', '\x5', 258 | '\x15', '\v', '\x2', '\x8E', '\x8D', '\x3', '\x2', '\x2', '\x2', '\x8F', 259 | '\x92', '\x3', '\x2', '\x2', '\x2', '\x90', '\x8E', '\x3', '\x2', '\x2', 260 | '\x2', '\x90', '\x91', '\x3', '\x2', '\x2', '\x2', '\x91', '\x98', '\x3', 261 | '\x2', '\x2', '\x2', '\x92', '\x90', '\x3', '\x2', '\x2', '\x2', '\x93', 262 | '\x95', '\t', '\a', '\x2', '\x2', '\x94', '\x96', '\a', '/', '\x2', '\x2', 263 | '\x95', '\x94', '\x3', '\x2', '\x2', '\x2', '\x95', '\x96', '\x3', '\x2', 264 | '\x2', '\x2', '\x96', '\x97', '\x3', '\x2', '\x2', '\x2', '\x97', '\x99', 265 | '\x5', '\x15', '\v', '\x2', '\x98', '\x93', '\x3', '\x2', '\x2', '\x2', 266 | '\x98', '\x99', '\x3', '\x2', '\x2', '\x2', '\x99', '&', '\x3', '\x2', 267 | '\x2', '\x2', '\x9A', '\x9B', '\a', '\x46', '\x2', '\x2', '\x9B', '\x9C', 268 | '\a', '\x43', '\x2', '\x2', '\x9C', '\x9D', '\a', 'V', '\x2', '\x2', '\x9D', 269 | '\x9E', '\a', '\x43', '\x2', '\x2', '\x9E', '(', '\x3', '\x2', '\x2', 270 | '\x2', '\x9F', '\xA0', '\a', 'G', '\x2', '\x2', '\xA0', '\xA1', '\a', 271 | 'P', '\x2', '\x2', '\xA1', '\xA2', '\a', '\x46', '\x2', '\x2', '\xA2', 272 | '\xA3', '\a', 'U', '\x2', '\x2', '\xA3', '\xA4', '\a', 'G', '\x2', '\x2', 273 | '\xA4', '\xA5', '\a', '\x45', '\x2', '\x2', '\xA5', '*', '\x3', '\x2', 274 | '\x2', '\x2', '\xA6', '\xA7', '\a', 'H', '\x2', '\x2', '\xA7', '\xA8', 275 | '\a', 'K', '\x2', '\x2', '\xA8', '\xA9', '\a', 'N', '\x2', '\x2', '\xA9', 276 | '\xAA', '\a', 'G', '\x2', '\x2', '\xAA', '\xAB', '\a', '\x61', '\x2', 277 | '\x2', '\xAB', '\xAC', '\a', '\x46', '\x2', '\x2', '\xAC', '\xAD', '\a', 278 | 'G', '\x2', '\x2', '\xAD', '\xAE', '\a', 'U', '\x2', '\x2', '\xAE', '\xAF', 279 | '\a', '\x45', '\x2', '\x2', '\xAF', '\xB0', '\a', 'T', '\x2', '\x2', '\xB0', 280 | '\xB1', '\a', 'K', '\x2', '\x2', '\xB1', '\xB2', '\a', 'R', '\x2', '\x2', 281 | '\xB2', '\xB3', '\a', 'V', '\x2', '\x2', '\xB3', '\xB4', '\a', 'K', '\x2', 282 | '\x2', '\xB4', '\xB5', '\a', 'Q', '\x2', '\x2', '\xB5', '\xB6', '\a', 283 | 'P', '\x2', '\x2', '\xB6', ',', '\x3', '\x2', '\x2', '\x2', '\xB7', '\xB8', 284 | '\a', 'H', '\x2', '\x2', '\xB8', '\xB9', '\a', 'K', '\x2', '\x2', '\xB9', 285 | '\xBA', '\a', 'N', '\x2', '\x2', '\xBA', '\xBB', '\a', 'G', '\x2', '\x2', 286 | '\xBB', '\xBC', '\a', '\x61', '\x2', '\x2', '\xBC', '\xBD', '\a', 'P', 287 | '\x2', '\x2', '\xBD', '\xBE', '\a', '\x43', '\x2', '\x2', '\xBE', '\xBF', 288 | '\a', 'O', '\x2', '\x2', '\xBF', '\xC0', '\a', 'G', '\x2', '\x2', '\xC0', 289 | '.', '\x3', '\x2', '\x2', '\x2', '\xC1', '\xC2', '\a', 'H', '\x2', '\x2', 290 | '\xC2', '\xC3', '\a', 'K', '\x2', '\x2', '\xC3', '\xC4', '\a', 'N', '\x2', 291 | '\x2', '\xC4', '\xC5', '\a', 'G', '\x2', '\x2', '\xC5', '\xC6', '\a', 292 | '\x61', '\x2', '\x2', '\xC6', '\xC7', '\a', 'U', '\x2', '\x2', '\xC7', 293 | '\xC8', '\a', '\x45', '\x2', '\x2', '\xC8', '\xC9', '\a', 'J', '\x2', 294 | '\x2', '\xC9', '\xCA', '\a', 'G', '\x2', '\x2', '\xCA', '\xCB', '\a', 295 | 'O', '\x2', '\x2', '\xCB', '\xCC', '\a', '\x43', '\x2', '\x2', '\xCC', 296 | '\x30', '\x3', '\x2', '\x2', '\x2', '\xCD', '\xCE', '\a', 'J', '\x2', 297 | '\x2', '\xCE', '\xCF', '\a', 'G', '\x2', '\x2', '\xCF', '\xD0', '\a', 298 | '\x43', '\x2', '\x2', '\xD0', '\xD1', '\a', '\x46', '\x2', '\x2', '\xD1', 299 | '\xD2', '\a', 'G', '\x2', '\x2', '\xD2', '\xD3', '\a', 'T', '\x2', '\x2', 300 | '\xD3', '\x32', '\x3', '\x2', '\x2', '\x2', '\xD4', '\xD5', '\a', '%', 301 | '\x2', '\x2', '\xD5', '\xD6', '\x5', '\x15', '\v', '\x2', '\xD6', '\x34', 302 | '\x3', '\x2', '\x2', '\x2', '\xD7', '\xD8', '\a', 'K', '\x2', '\x2', '\xD8', 303 | '\xD9', '\a', 'U', '\x2', '\x2', '\xD9', '\xDA', '\a', 'Q', '\x2', '\x2', 304 | '\xDA', '\xDB', '\x3', '\x2', '\x2', '\x2', '\xDB', '\xDC', '\a', '/', 305 | '\x2', '\x2', '\xDC', '\xDD', '\x5', '\x15', '\v', '\x2', '\xDD', '\xDE', 306 | '\a', '/', '\x2', '\x2', '\xDE', '\xDF', '\x5', '\x15', '\v', '\x2', '\xDF', 307 | '\xE0', '\a', '=', '\x2', '\x2', '\xE0', '\x36', '\x3', '\x2', '\x2', 308 | '\x2', '\xE1', '\xE2', '\a', 'G', '\x2', '\x2', '\xE2', '\xE3', '\a', 309 | 'P', '\x2', '\x2', '\xE3', '\xE4', '\a', '\x46', '\x2', '\x2', '\xE4', 310 | '\xE5', '\a', '/', '\x2', '\x2', '\xE5', '\xE6', '\a', 'K', '\x2', '\x2', 311 | '\xE6', '\xE7', '\a', 'U', '\x2', '\x2', '\xE7', '\xE8', '\a', 'Q', '\x2', 312 | '\x2', '\xE8', '\xE9', '\x3', '\x2', '\x2', '\x2', '\xE9', '\xEA', '\a', 313 | '/', '\x2', '\x2', '\xEA', '\xEB', '\x5', '\x15', '\v', '\x2', '\xEB', 314 | '\xEC', '\a', '/', '\x2', '\x2', '\xEC', '\xED', '\x5', '\x15', '\v', 315 | '\x2', '\xED', '\xEE', '\a', '=', '\x2', '\x2', '\xEE', '\x38', '\x3', 316 | '\x2', '\x2', '\x2', '\xEF', '\xF3', '\a', '$', '\x2', '\x2', '\xF0', 317 | '\xF2', '\x5', '\x19', '\r', '\x2', '\xF1', '\xF0', '\x3', '\x2', '\x2', 318 | '\x2', '\xF2', '\xF5', '\x3', '\x2', '\x2', '\x2', '\xF3', '\xF1', '\x3', 319 | '\x2', '\x2', '\x2', '\xF3', '\xF4', '\x3', '\x2', '\x2', '\x2', '\xF4', 320 | '\xF6', '\x3', '\x2', '\x2', '\x2', '\xF5', '\xF3', '\x3', '\x2', '\x2', 321 | '\x2', '\xF6', '\xF7', '\a', '$', '\x2', '\x2', '\xF7', ':', '\x3', '\x2', 322 | '\x2', '\x2', '\xF8', '\xFD', '\x5', '\x1B', '\xE', '\x2', '\xF9', '\xFC', 323 | '\x5', '\x1B', '\xE', '\x2', '\xFA', '\xFC', '\x5', '\x13', '\n', '\x2', 324 | '\xFB', '\xF9', '\x3', '\x2', '\x2', '\x2', '\xFB', '\xFA', '\x3', '\x2', 325 | '\x2', '\x2', '\xFC', '\xFF', '\x3', '\x2', '\x2', '\x2', '\xFD', '\xFB', 326 | '\x3', '\x2', '\x2', '\x2', '\xFD', '\xFE', '\x3', '\x2', '\x2', '\x2', 327 | '\xFE', '<', '\x3', '\x2', '\x2', '\x2', '\xFF', '\xFD', '\x3', '\x2', 328 | '\x2', '\x2', '\x100', '\x101', '\a', '&', '\x2', '\x2', '\x101', '>', 329 | '\x3', '\x2', '\x2', '\x2', '\x102', '\x106', '\a', ')', '\x2', '\x2', 330 | '\x103', '\x105', '\v', '\x2', '\x2', '\x2', '\x104', '\x103', '\x3', 331 | '\x2', '\x2', '\x2', '\x105', '\x108', '\x3', '\x2', '\x2', '\x2', '\x106', 332 | '\x107', '\x3', '\x2', '\x2', '\x2', '\x106', '\x104', '\x3', '\x2', '\x2', 333 | '\x2', '\x107', '\x109', '\x3', '\x2', '\x2', '\x2', '\x108', '\x106', 334 | '\x3', '\x2', '\x2', '\x2', '\x109', '\x10A', '\a', ')', '\x2', '\x2', 335 | '\x10A', '@', '\x3', '\x2', '\x2', '\x2', '\x10B', '\x10D', '\t', '\b', 336 | '\x2', '\x2', '\x10C', '\x10B', '\x3', '\x2', '\x2', '\x2', '\x10D', '\x10E', 337 | '\x3', '\x2', '\x2', '\x2', '\x10E', '\x10C', '\x3', '\x2', '\x2', '\x2', 338 | '\x10E', '\x10F', '\x3', '\x2', '\x2', '\x2', '\x10F', '\x110', '\x3', 339 | '\x2', '\x2', '\x2', '\x110', '\x111', '\b', '!', '\x2', '\x2', '\x111', 340 | '\x42', '\x3', '\x2', '\x2', '\x2', '\x112', '\x114', '\t', '\t', '\x2', 341 | '\x2', '\x113', '\x112', '\x3', '\x2', '\x2', '\x2', '\x114', '\x115', 342 | '\x3', '\x2', '\x2', '\x2', '\x115', '\x113', '\x3', '\x2', '\x2', '\x2', 343 | '\x115', '\x116', '\x3', '\x2', '\x2', '\x2', '\x116', '\x117', '\x3', 344 | '\x2', '\x2', '\x2', '\x117', '\x118', '\b', '\"', '\x2', '\x2', '\x118', 345 | '\x44', '\x3', '\x2', '\x2', '\x2', '\x119', '\x11A', '\a', '\x31', '\x2', 346 | '\x2', '\x11A', '\x11B', '\a', ',', '\x2', '\x2', '\x11B', '\x11F', '\x3', 347 | '\x2', '\x2', '\x2', '\x11C', '\x11E', '\v', '\x2', '\x2', '\x2', '\x11D', 348 | '\x11C', '\x3', '\x2', '\x2', '\x2', '\x11E', '\x121', '\x3', '\x2', '\x2', 349 | '\x2', '\x11F', '\x120', '\x3', '\x2', '\x2', '\x2', '\x11F', '\x11D', 350 | '\x3', '\x2', '\x2', '\x2', '\x120', '\x122', '\x3', '\x2', '\x2', '\x2', 351 | '\x121', '\x11F', '\x3', '\x2', '\x2', '\x2', '\x122', '\x123', '\a', 352 | ',', '\x2', '\x2', '\x123', '\x124', '\a', '\x31', '\x2', '\x2', '\x124', 353 | '\x125', '\x3', '\x2', '\x2', '\x2', '\x125', '\x126', '\b', '#', '\x2', 354 | '\x2', '\x126', '\x46', '\x3', '\x2', '\x2', '\x2', '\x12', '\x2', '^', 355 | '\x62', '\x81', '\x83', '\x89', '\x90', '\x95', '\x98', '\xF3', '\xFB', 356 | '\xFD', '\x106', '\x10E', '\x115', '\x11F', '\x3', '\b', '\x2', '\x2', 357 | }; 358 | 359 | public static readonly ATN _ATN = 360 | new ATNDeserializer().Deserialize(_serializedATN); 361 | 362 | 363 | } 364 | } // namespace STEP 365 | -------------------------------------------------------------------------------- /src/IFC-dotnet/antlr/STEPLexer.tokens: -------------------------------------------------------------------------------- 1 | T__0=1 2 | T__1=2 3 | T__2=3 4 | T__3=4 5 | T__4=5 6 | T__5=6 7 | T__6=7 8 | T__7=8 9 | IntegerLiteral=9 10 | Letter=10 11 | CapitalLetter=11 12 | DateTime=12 13 | Derived=13 14 | BoolLogical=14 15 | Enum=15 16 | RealLiteral=16 17 | DATA=17 18 | ENDSEC=18 19 | FILE_DESCRIPTION=19 20 | FILE_NAME=20 21 | FILE_SCHEMA=21 22 | HEADER=22 23 | Id=23 24 | ISO=24 25 | ISO_END=25 26 | StringLiteral=26 27 | TypeRef=27 28 | Undefined=28 29 | AnyString=29 30 | NewlineChar=30 31 | WS=31 32 | Comments=32 33 | '('=1 34 | ','=2 35 | ')'=3 36 | '()'=4 37 | ';'=5 38 | '\''=6 39 | '.'=7 40 | '='=8 41 | '*'=13 42 | 'DATA'=17 43 | 'ENDSEC'=18 44 | 'FILE_DESCRIPTION'=19 45 | 'FILE_NAME'=20 46 | 'FILE_SCHEMA'=21 47 | 'HEADER'=22 48 | '$'=28 49 | -------------------------------------------------------------------------------- /src/IFC-dotnet/antlr/STEPListener.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // ANTLR Version: 4.7 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | // Generated from STEP.g4 by ANTLR 4.7 12 | 13 | // Unreachable code detected 14 | #pragma warning disable 0162 15 | // The variable '...' is assigned but its value is never used 16 | #pragma warning disable 0219 17 | // Missing XML comment for publicly visible type or member '...' 18 | #pragma warning disable 1591 19 | // Ambiguous reference in cref attribute 20 | #pragma warning disable 419 21 | 22 | namespace STEP { 23 | using Antlr4.Runtime.Misc; 24 | using IParseTreeListener = Antlr4.Runtime.Tree.IParseTreeListener; 25 | using IToken = Antlr4.Runtime.IToken; 26 | 27 | /// 28 | /// This interface defines a complete listener for a parse tree produced by 29 | /// . 30 | /// 31 | [System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.7")] 32 | [System.CLSCompliant(false)] 33 | public interface ISTEPListener : IParseTreeListener { 34 | /// 35 | /// Enter a parse tree produced by . 36 | /// 37 | /// The parse tree. 38 | void EnterAuthor([NotNull] STEPParser.AuthorContext context); 39 | /// 40 | /// Exit a parse tree produced by . 41 | /// 42 | /// The parse tree. 43 | void ExitAuthor([NotNull] STEPParser.AuthorContext context); 44 | /// 45 | /// Enter a parse tree produced by . 46 | /// 47 | /// The parse tree. 48 | void EnterAuthorisation([NotNull] STEPParser.AuthorisationContext context); 49 | /// 50 | /// Exit a parse tree produced by . 51 | /// 52 | /// The parse tree. 53 | void ExitAuthorisation([NotNull] STEPParser.AuthorisationContext context); 54 | /// 55 | /// Enter a parse tree produced by . 56 | /// 57 | /// The parse tree. 58 | void EnterCollection([NotNull] STEPParser.CollectionContext context); 59 | /// 60 | /// Exit a parse tree produced by . 61 | /// 62 | /// The parse tree. 63 | void ExitCollection([NotNull] STEPParser.CollectionContext context); 64 | /// 65 | /// Enter a parse tree produced by . 66 | /// 67 | /// The parse tree. 68 | void EnterCollectionValue([NotNull] STEPParser.CollectionValueContext context); 69 | /// 70 | /// Exit a parse tree produced by . 71 | /// 72 | /// The parse tree. 73 | void ExitCollectionValue([NotNull] STEPParser.CollectionValueContext context); 74 | /// 75 | /// Enter a parse tree produced by . 76 | /// 77 | /// The parse tree. 78 | void EnterConstructor([NotNull] STEPParser.ConstructorContext context); 79 | /// 80 | /// Exit a parse tree produced by . 81 | /// 82 | /// The parse tree. 83 | void ExitConstructor([NotNull] STEPParser.ConstructorContext context); 84 | /// 85 | /// Enter a parse tree produced by . 86 | /// 87 | /// The parse tree. 88 | void EnterData([NotNull] STEPParser.DataContext context); 89 | /// 90 | /// Exit a parse tree produced by . 91 | /// 92 | /// The parse tree. 93 | void ExitData([NotNull] STEPParser.DataContext context); 94 | /// 95 | /// Enter a parse tree produced by . 96 | /// 97 | /// The parse tree. 98 | void EnterDescription([NotNull] STEPParser.DescriptionContext context); 99 | /// 100 | /// Exit a parse tree produced by . 101 | /// 102 | /// The parse tree. 103 | void ExitDescription([NotNull] STEPParser.DescriptionContext context); 104 | /// 105 | /// Enter a parse tree produced by . 106 | /// 107 | /// The parse tree. 108 | void EnterFile([NotNull] STEPParser.FileContext context); 109 | /// 110 | /// Exit a parse tree produced by . 111 | /// 112 | /// The parse tree. 113 | void ExitFile([NotNull] STEPParser.FileContext context); 114 | /// 115 | /// Enter a parse tree produced by . 116 | /// 117 | /// The parse tree. 118 | void EnterFileDescription([NotNull] STEPParser.FileDescriptionContext context); 119 | /// 120 | /// Exit a parse tree produced by . 121 | /// 122 | /// The parse tree. 123 | void ExitFileDescription([NotNull] STEPParser.FileDescriptionContext context); 124 | /// 125 | /// Enter a parse tree produced by . 126 | /// 127 | /// The parse tree. 128 | void EnterFileName([NotNull] STEPParser.FileNameContext context); 129 | /// 130 | /// Exit a parse tree produced by . 131 | /// 132 | /// The parse tree. 133 | void ExitFileName([NotNull] STEPParser.FileNameContext context); 134 | /// 135 | /// Enter a parse tree produced by . 136 | /// 137 | /// The parse tree. 138 | void EnterFilePath([NotNull] STEPParser.FilePathContext context); 139 | /// 140 | /// Exit a parse tree produced by . 141 | /// 142 | /// The parse tree. 143 | void ExitFilePath([NotNull] STEPParser.FilePathContext context); 144 | /// 145 | /// Enter a parse tree produced by . 146 | /// 147 | /// The parse tree. 148 | void EnterFileSchema([NotNull] STEPParser.FileSchemaContext context); 149 | /// 150 | /// Exit a parse tree produced by . 151 | /// 152 | /// The parse tree. 153 | void ExitFileSchema([NotNull] STEPParser.FileSchemaContext context); 154 | /// 155 | /// Enter a parse tree produced by . 156 | /// 157 | /// The parse tree. 158 | void EnterHeader([NotNull] STEPParser.HeaderContext context); 159 | /// 160 | /// Exit a parse tree produced by . 161 | /// 162 | /// The parse tree. 163 | void ExitHeader([NotNull] STEPParser.HeaderContext context); 164 | /// 165 | /// Enter a parse tree produced by . 166 | /// 167 | /// The parse tree. 168 | void EnterImplementation([NotNull] STEPParser.ImplementationContext context); 169 | /// 170 | /// Exit a parse tree produced by . 171 | /// 172 | /// The parse tree. 173 | void ExitImplementation([NotNull] STEPParser.ImplementationContext context); 174 | /// 175 | /// Enter a parse tree produced by . 176 | /// 177 | /// The parse tree. 178 | void EnterInstance([NotNull] STEPParser.InstanceContext context); 179 | /// 180 | /// Exit a parse tree produced by . 181 | /// 182 | /// The parse tree. 183 | void ExitInstance([NotNull] STEPParser.InstanceContext context); 184 | /// 185 | /// Enter a parse tree produced by . 186 | /// 187 | /// The parse tree. 188 | void EnterName([NotNull] STEPParser.NameContext context); 189 | /// 190 | /// Exit a parse tree produced by . 191 | /// 192 | /// The parse tree. 193 | void ExitName([NotNull] STEPParser.NameContext context); 194 | /// 195 | /// Enter a parse tree produced by . 196 | /// 197 | /// The parse tree. 198 | void EnterOriginating_system([NotNull] STEPParser.Originating_systemContext context); 199 | /// 200 | /// Exit a parse tree produced by . 201 | /// 202 | /// The parse tree. 203 | void ExitOriginating_system([NotNull] STEPParser.Originating_systemContext context); 204 | /// 205 | /// Enter a parse tree produced by . 206 | /// 207 | /// The parse tree. 208 | void EnterOrganization([NotNull] STEPParser.OrganizationContext context); 209 | /// 210 | /// Exit a parse tree produced by . 211 | /// 212 | /// The parse tree. 213 | void ExitOrganization([NotNull] STEPParser.OrganizationContext context); 214 | /// 215 | /// Enter a parse tree produced by . 216 | /// 217 | /// The parse tree. 218 | void EnterParameter([NotNull] STEPParser.ParameterContext context); 219 | /// 220 | /// Exit a parse tree produced by . 221 | /// 222 | /// The parse tree. 223 | void ExitParameter([NotNull] STEPParser.ParameterContext context); 224 | /// 225 | /// Enter a parse tree produced by . 226 | /// 227 | /// The parse tree. 228 | void EnterPreprocessor_version([NotNull] STEPParser.Preprocessor_versionContext context); 229 | /// 230 | /// Exit a parse tree produced by . 231 | /// 232 | /// The parse tree. 233 | void ExitPreprocessor_version([NotNull] STEPParser.Preprocessor_versionContext context); 234 | /// 235 | /// Enter a parse tree produced by . 236 | /// 237 | /// The parse tree. 238 | void EnterTimeStamp([NotNull] STEPParser.TimeStampContext context); 239 | /// 240 | /// Exit a parse tree produced by . 241 | /// 242 | /// The parse tree. 243 | void ExitTimeStamp([NotNull] STEPParser.TimeStampContext context); 244 | } 245 | } // namespace STEP 246 | -------------------------------------------------------------------------------- /src/IFC-dotnet/antlr/STEPParser.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // ANTLR Version: 4.7 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | // Generated from STEP.g4 by ANTLR 4.7 12 | 13 | // Unreachable code detected 14 | #pragma warning disable 0162 15 | // The variable '...' is assigned but its value is never used 16 | #pragma warning disable 0219 17 | // Missing XML comment for publicly visible type or member '...' 18 | #pragma warning disable 1591 19 | // Ambiguous reference in cref attribute 20 | #pragma warning disable 419 21 | 22 | namespace STEP { 23 | using System; 24 | using System.IO; 25 | using System.Text; 26 | using System.Diagnostics; 27 | using System.Collections.Generic; 28 | using Antlr4.Runtime; 29 | using Antlr4.Runtime.Atn; 30 | using Antlr4.Runtime.Misc; 31 | using Antlr4.Runtime.Tree; 32 | using DFA = Antlr4.Runtime.Dfa.DFA; 33 | 34 | [System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.7")] 35 | [System.CLSCompliant(false)] 36 | public partial class STEPParser : Parser { 37 | protected static DFA[] decisionToDFA; 38 | protected static PredictionContextCache sharedContextCache = new PredictionContextCache(); 39 | public const int 40 | T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, IntegerLiteral=9, 41 | Letter=10, CapitalLetter=11, DateTime=12, Derived=13, BoolLogical=14, 42 | Enum=15, RealLiteral=16, DATA=17, ENDSEC=18, FILE_DESCRIPTION=19, FILE_NAME=20, 43 | FILE_SCHEMA=21, HEADER=22, Id=23, ISO=24, ISO_END=25, StringLiteral=26, 44 | TypeRef=27, Undefined=28, AnyString=29, NewlineChar=30, WS=31, Comments=32; 45 | public const int 46 | RULE_author = 0, RULE_authorisation = 1, RULE_collection = 2, RULE_collectionValue = 3, 47 | RULE_constructor = 4, RULE_data = 5, RULE_description = 6, RULE_file = 7, 48 | RULE_fileDescription = 8, RULE_fileName = 9, RULE_filePath = 10, RULE_fileSchema = 11, 49 | RULE_header = 12, RULE_implementation = 13, RULE_instance = 14, RULE_name = 15, 50 | RULE_originating_system = 16, RULE_organization = 17, RULE_parameter = 18, 51 | RULE_preprocessor_version = 19, RULE_timeStamp = 20; 52 | public static readonly string[] ruleNames = { 53 | "author", "authorisation", "collection", "collectionValue", "constructor", 54 | "data", "description", "file", "fileDescription", "fileName", "filePath", 55 | "fileSchema", "header", "implementation", "instance", "name", "originating_system", 56 | "organization", "parameter", "preprocessor_version", "timeStamp" 57 | }; 58 | 59 | private static readonly string[] _LiteralNames = { 60 | null, "'('", "','", "')'", "'()'", "';'", "'''", "'.'", "'='", null, null, 61 | null, null, "'*'", null, null, null, "'DATA'", "'ENDSEC'", "'FILE_DESCRIPTION'", 62 | "'FILE_NAME'", "'FILE_SCHEMA'", "'HEADER'", null, null, null, null, null, 63 | "'$'" 64 | }; 65 | private static readonly string[] _SymbolicNames = { 66 | null, null, null, null, null, null, null, null, null, "IntegerLiteral", 67 | "Letter", "CapitalLetter", "DateTime", "Derived", "BoolLogical", "Enum", 68 | "RealLiteral", "DATA", "ENDSEC", "FILE_DESCRIPTION", "FILE_NAME", "FILE_SCHEMA", 69 | "HEADER", "Id", "ISO", "ISO_END", "StringLiteral", "TypeRef", "Undefined", 70 | "AnyString", "NewlineChar", "WS", "Comments" 71 | }; 72 | public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); 73 | 74 | [NotNull] 75 | public override IVocabulary Vocabulary 76 | { 77 | get 78 | { 79 | return DefaultVocabulary; 80 | } 81 | } 82 | 83 | public override string GrammarFileName { get { return "STEP.g4"; } } 84 | 85 | public override string[] RuleNames { get { return ruleNames; } } 86 | 87 | public override string SerializedAtn { get { return new string(_serializedATN); } } 88 | 89 | static STEPParser() { 90 | decisionToDFA = new DFA[_ATN.NumberOfDecisions]; 91 | for (int i = 0; i < _ATN.NumberOfDecisions; i++) { 92 | decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i); 93 | } 94 | } 95 | 96 | public STEPParser(ITokenStream input) : this(input, Console.Out, Console.Error) { } 97 | 98 | public STEPParser(ITokenStream input, TextWriter output, TextWriter errorOutput) 99 | : base(input, output, errorOutput) 100 | { 101 | Interpreter = new ParserATNSimulator(this, _ATN, decisionToDFA, sharedContextCache); 102 | } 103 | public partial class AuthorContext : ParserRuleContext { 104 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 105 | public AuthorContext(ParserRuleContext parent, int invokingState) 106 | : base(parent, invokingState) 107 | { 108 | } 109 | public override int RuleIndex { get { return RULE_author; } } 110 | public override void EnterRule(IParseTreeListener listener) { 111 | ISTEPListener typedListener = listener as ISTEPListener; 112 | if (typedListener != null) typedListener.EnterAuthor(this); 113 | } 114 | public override void ExitRule(IParseTreeListener listener) { 115 | ISTEPListener typedListener = listener as ISTEPListener; 116 | if (typedListener != null) typedListener.ExitAuthor(this); 117 | } 118 | } 119 | 120 | [RuleVersion(0)] 121 | public AuthorContext author() { 122 | AuthorContext _localctx = new AuthorContext(Context, State); 123 | EnterRule(_localctx, 0, RULE_author); 124 | try { 125 | EnterOuterAlt(_localctx, 1); 126 | { 127 | State = 42; Match(AnyString); 128 | } 129 | } 130 | catch (RecognitionException re) { 131 | _localctx.exception = re; 132 | ErrorHandler.ReportError(this, re); 133 | ErrorHandler.Recover(this, re); 134 | } 135 | finally { 136 | ExitRule(); 137 | } 138 | return _localctx; 139 | } 140 | 141 | public partial class AuthorisationContext : ParserRuleContext { 142 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 143 | public AuthorisationContext(ParserRuleContext parent, int invokingState) 144 | : base(parent, invokingState) 145 | { 146 | } 147 | public override int RuleIndex { get { return RULE_authorisation; } } 148 | public override void EnterRule(IParseTreeListener listener) { 149 | ISTEPListener typedListener = listener as ISTEPListener; 150 | if (typedListener != null) typedListener.EnterAuthorisation(this); 151 | } 152 | public override void ExitRule(IParseTreeListener listener) { 153 | ISTEPListener typedListener = listener as ISTEPListener; 154 | if (typedListener != null) typedListener.ExitAuthorisation(this); 155 | } 156 | } 157 | 158 | [RuleVersion(0)] 159 | public AuthorisationContext authorisation() { 160 | AuthorisationContext _localctx = new AuthorisationContext(Context, State); 161 | EnterRule(_localctx, 2, RULE_authorisation); 162 | try { 163 | EnterOuterAlt(_localctx, 1); 164 | { 165 | State = 44; Match(AnyString); 166 | } 167 | } 168 | catch (RecognitionException re) { 169 | _localctx.exception = re; 170 | ErrorHandler.ReportError(this, re); 171 | ErrorHandler.Recover(this, re); 172 | } 173 | finally { 174 | ExitRule(); 175 | } 176 | return _localctx; 177 | } 178 | 179 | public partial class CollectionContext : ParserRuleContext { 180 | public CollectionValueContext[] collectionValue() { 181 | return GetRuleContexts(); 182 | } 183 | public CollectionValueContext collectionValue(int i) { 184 | return GetRuleContext(i); 185 | } 186 | public CollectionContext(ParserRuleContext parent, int invokingState) 187 | : base(parent, invokingState) 188 | { 189 | } 190 | public override int RuleIndex { get { return RULE_collection; } } 191 | public override void EnterRule(IParseTreeListener listener) { 192 | ISTEPListener typedListener = listener as ISTEPListener; 193 | if (typedListener != null) typedListener.EnterCollection(this); 194 | } 195 | public override void ExitRule(IParseTreeListener listener) { 196 | ISTEPListener typedListener = listener as ISTEPListener; 197 | if (typedListener != null) typedListener.ExitCollection(this); 198 | } 199 | } 200 | 201 | [RuleVersion(0)] 202 | public CollectionContext collection() { 203 | CollectionContext _localctx = new CollectionContext(Context, State); 204 | EnterRule(_localctx, 4, RULE_collection); 205 | int _la; 206 | try { 207 | State = 58; 208 | ErrorHandler.Sync(this); 209 | switch (TokenStream.LA(1)) { 210 | case T__0: 211 | EnterOuterAlt(_localctx, 1); 212 | { 213 | State = 46; Match(T__0); 214 | State = 47; collectionValue(); 215 | State = 52; 216 | ErrorHandler.Sync(this); 217 | _la = TokenStream.LA(1); 218 | while (_la==T__1) { 219 | { 220 | { 221 | State = 48; Match(T__1); 222 | State = 49; collectionValue(); 223 | } 224 | } 225 | State = 54; 226 | ErrorHandler.Sync(this); 227 | _la = TokenStream.LA(1); 228 | } 229 | State = 55; Match(T__2); 230 | } 231 | break; 232 | case T__3: 233 | EnterOuterAlt(_localctx, 2); 234 | { 235 | State = 57; Match(T__3); 236 | } 237 | break; 238 | default: 239 | throw new NoViableAltException(this); 240 | } 241 | } 242 | catch (RecognitionException re) { 243 | _localctx.exception = re; 244 | ErrorHandler.ReportError(this, re); 245 | ErrorHandler.Recover(this, re); 246 | } 247 | finally { 248 | ExitRule(); 249 | } 250 | return _localctx; 251 | } 252 | 253 | public partial class CollectionValueContext : ParserRuleContext { 254 | public ITerminalNode RealLiteral() { return GetToken(STEPParser.RealLiteral, 0); } 255 | public ITerminalNode IntegerLiteral() { return GetToken(STEPParser.IntegerLiteral, 0); } 256 | public ITerminalNode StringLiteral() { return GetToken(STEPParser.StringLiteral, 0); } 257 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 258 | public ITerminalNode Id() { return GetToken(STEPParser.Id, 0); } 259 | public ConstructorContext constructor() { 260 | return GetRuleContext(0); 261 | } 262 | public ITerminalNode Undefined() { return GetToken(STEPParser.Undefined, 0); } 263 | public CollectionValueContext(ParserRuleContext parent, int invokingState) 264 | : base(parent, invokingState) 265 | { 266 | } 267 | public override int RuleIndex { get { return RULE_collectionValue; } } 268 | public override void EnterRule(IParseTreeListener listener) { 269 | ISTEPListener typedListener = listener as ISTEPListener; 270 | if (typedListener != null) typedListener.EnterCollectionValue(this); 271 | } 272 | public override void ExitRule(IParseTreeListener listener) { 273 | ISTEPListener typedListener = listener as ISTEPListener; 274 | if (typedListener != null) typedListener.ExitCollectionValue(this); 275 | } 276 | } 277 | 278 | [RuleVersion(0)] 279 | public CollectionValueContext collectionValue() { 280 | CollectionValueContext _localctx = new CollectionValueContext(Context, State); 281 | EnterRule(_localctx, 6, RULE_collectionValue); 282 | try { 283 | State = 67; 284 | ErrorHandler.Sync(this); 285 | switch (TokenStream.LA(1)) { 286 | case RealLiteral: 287 | EnterOuterAlt(_localctx, 1); 288 | { 289 | State = 60; Match(RealLiteral); 290 | } 291 | break; 292 | case IntegerLiteral: 293 | EnterOuterAlt(_localctx, 2); 294 | { 295 | State = 61; Match(IntegerLiteral); 296 | } 297 | break; 298 | case StringLiteral: 299 | EnterOuterAlt(_localctx, 3); 300 | { 301 | State = 62; Match(StringLiteral); 302 | } 303 | break; 304 | case AnyString: 305 | EnterOuterAlt(_localctx, 4); 306 | { 307 | State = 63; Match(AnyString); 308 | } 309 | break; 310 | case Id: 311 | EnterOuterAlt(_localctx, 5); 312 | { 313 | State = 64; Match(Id); 314 | } 315 | break; 316 | case TypeRef: 317 | EnterOuterAlt(_localctx, 6); 318 | { 319 | State = 65; constructor(); 320 | } 321 | break; 322 | case Undefined: 323 | EnterOuterAlt(_localctx, 7); 324 | { 325 | State = 66; Match(Undefined); 326 | } 327 | break; 328 | default: 329 | throw new NoViableAltException(this); 330 | } 331 | } 332 | catch (RecognitionException re) { 333 | _localctx.exception = re; 334 | ErrorHandler.ReportError(this, re); 335 | ErrorHandler.Recover(this, re); 336 | } 337 | finally { 338 | ExitRule(); 339 | } 340 | return _localctx; 341 | } 342 | 343 | public partial class ConstructorContext : ParserRuleContext { 344 | public ITerminalNode TypeRef() { return GetToken(STEPParser.TypeRef, 0); } 345 | public ParameterContext[] parameter() { 346 | return GetRuleContexts(); 347 | } 348 | public ParameterContext parameter(int i) { 349 | return GetRuleContext(i); 350 | } 351 | public ConstructorContext(ParserRuleContext parent, int invokingState) 352 | : base(parent, invokingState) 353 | { 354 | } 355 | public override int RuleIndex { get { return RULE_constructor; } } 356 | public override void EnterRule(IParseTreeListener listener) { 357 | ISTEPListener typedListener = listener as ISTEPListener; 358 | if (typedListener != null) typedListener.EnterConstructor(this); 359 | } 360 | public override void ExitRule(IParseTreeListener listener) { 361 | ISTEPListener typedListener = listener as ISTEPListener; 362 | if (typedListener != null) typedListener.ExitConstructor(this); 363 | } 364 | } 365 | 366 | [RuleVersion(0)] 367 | public ConstructorContext constructor() { 368 | ConstructorContext _localctx = new ConstructorContext(Context, State); 369 | EnterRule(_localctx, 8, RULE_constructor); 370 | int _la; 371 | try { 372 | EnterOuterAlt(_localctx, 1); 373 | { 374 | State = 69; Match(TypeRef); 375 | State = 70; Match(T__0); 376 | State = 72; 377 | ErrorHandler.Sync(this); 378 | _la = TokenStream.LA(1); 379 | if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__3) | (1L << IntegerLiteral) | (1L << Derived) | (1L << BoolLogical) | (1L << Enum) | (1L << RealLiteral) | (1L << Id) | (1L << StringLiteral) | (1L << TypeRef) | (1L << Undefined) | (1L << AnyString))) != 0)) { 380 | { 381 | State = 71; parameter(); 382 | } 383 | } 384 | 385 | State = 78; 386 | ErrorHandler.Sync(this); 387 | _la = TokenStream.LA(1); 388 | while (_la==T__1) { 389 | { 390 | { 391 | State = 74; Match(T__1); 392 | State = 75; parameter(); 393 | } 394 | } 395 | State = 80; 396 | ErrorHandler.Sync(this); 397 | _la = TokenStream.LA(1); 398 | } 399 | State = 81; Match(T__2); 400 | } 401 | } 402 | catch (RecognitionException re) { 403 | _localctx.exception = re; 404 | ErrorHandler.ReportError(this, re); 405 | ErrorHandler.Recover(this, re); 406 | } 407 | finally { 408 | ExitRule(); 409 | } 410 | return _localctx; 411 | } 412 | 413 | public partial class DataContext : ParserRuleContext { 414 | public ITerminalNode DATA() { return GetToken(STEPParser.DATA, 0); } 415 | public ITerminalNode ENDSEC() { return GetToken(STEPParser.ENDSEC, 0); } 416 | public InstanceContext[] instance() { 417 | return GetRuleContexts(); 418 | } 419 | public InstanceContext instance(int i) { 420 | return GetRuleContext(i); 421 | } 422 | public DataContext(ParserRuleContext parent, int invokingState) 423 | : base(parent, invokingState) 424 | { 425 | } 426 | public override int RuleIndex { get { return RULE_data; } } 427 | public override void EnterRule(IParseTreeListener listener) { 428 | ISTEPListener typedListener = listener as ISTEPListener; 429 | if (typedListener != null) typedListener.EnterData(this); 430 | } 431 | public override void ExitRule(IParseTreeListener listener) { 432 | ISTEPListener typedListener = listener as ISTEPListener; 433 | if (typedListener != null) typedListener.ExitData(this); 434 | } 435 | } 436 | 437 | [RuleVersion(0)] 438 | public DataContext data() { 439 | DataContext _localctx = new DataContext(Context, State); 440 | EnterRule(_localctx, 10, RULE_data); 441 | int _la; 442 | try { 443 | EnterOuterAlt(_localctx, 1); 444 | { 445 | State = 83; Match(DATA); 446 | State = 84; Match(T__4); 447 | State = 88; 448 | ErrorHandler.Sync(this); 449 | _la = TokenStream.LA(1); 450 | while (_la==Id) { 451 | { 452 | { 453 | State = 85; instance(); 454 | } 455 | } 456 | State = 90; 457 | ErrorHandler.Sync(this); 458 | _la = TokenStream.LA(1); 459 | } 460 | State = 91; Match(ENDSEC); 461 | State = 92; Match(T__4); 462 | } 463 | } 464 | catch (RecognitionException re) { 465 | _localctx.exception = re; 466 | ErrorHandler.ReportError(this, re); 467 | ErrorHandler.Recover(this, re); 468 | } 469 | finally { 470 | ExitRule(); 471 | } 472 | return _localctx; 473 | } 474 | 475 | public partial class DescriptionContext : ParserRuleContext { 476 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 477 | public CollectionContext collection() { 478 | return GetRuleContext(0); 479 | } 480 | public DescriptionContext(ParserRuleContext parent, int invokingState) 481 | : base(parent, invokingState) 482 | { 483 | } 484 | public override int RuleIndex { get { return RULE_description; } } 485 | public override void EnterRule(IParseTreeListener listener) { 486 | ISTEPListener typedListener = listener as ISTEPListener; 487 | if (typedListener != null) typedListener.EnterDescription(this); 488 | } 489 | public override void ExitRule(IParseTreeListener listener) { 490 | ISTEPListener typedListener = listener as ISTEPListener; 491 | if (typedListener != null) typedListener.ExitDescription(this); 492 | } 493 | } 494 | 495 | [RuleVersion(0)] 496 | public DescriptionContext description() { 497 | DescriptionContext _localctx = new DescriptionContext(Context, State); 498 | EnterRule(_localctx, 12, RULE_description); 499 | try { 500 | State = 96; 501 | ErrorHandler.Sync(this); 502 | switch (TokenStream.LA(1)) { 503 | case AnyString: 504 | EnterOuterAlt(_localctx, 1); 505 | { 506 | State = 94; Match(AnyString); 507 | } 508 | break; 509 | case T__0: 510 | case T__3: 511 | EnterOuterAlt(_localctx, 2); 512 | { 513 | State = 95; collection(); 514 | } 515 | break; 516 | default: 517 | throw new NoViableAltException(this); 518 | } 519 | } 520 | catch (RecognitionException re) { 521 | _localctx.exception = re; 522 | ErrorHandler.ReportError(this, re); 523 | ErrorHandler.Recover(this, re); 524 | } 525 | finally { 526 | ExitRule(); 527 | } 528 | return _localctx; 529 | } 530 | 531 | public partial class FileContext : ParserRuleContext { 532 | public ITerminalNode ISO() { return GetToken(STEPParser.ISO, 0); } 533 | public HeaderContext header() { 534 | return GetRuleContext(0); 535 | } 536 | public DataContext data() { 537 | return GetRuleContext(0); 538 | } 539 | public ITerminalNode ISO_END() { return GetToken(STEPParser.ISO_END, 0); } 540 | public FileContext(ParserRuleContext parent, int invokingState) 541 | : base(parent, invokingState) 542 | { 543 | } 544 | public override int RuleIndex { get { return RULE_file; } } 545 | public override void EnterRule(IParseTreeListener listener) { 546 | ISTEPListener typedListener = listener as ISTEPListener; 547 | if (typedListener != null) typedListener.EnterFile(this); 548 | } 549 | public override void ExitRule(IParseTreeListener listener) { 550 | ISTEPListener typedListener = listener as ISTEPListener; 551 | if (typedListener != null) typedListener.ExitFile(this); 552 | } 553 | } 554 | 555 | [RuleVersion(0)] 556 | public FileContext file() { 557 | FileContext _localctx = new FileContext(Context, State); 558 | EnterRule(_localctx, 14, RULE_file); 559 | try { 560 | EnterOuterAlt(_localctx, 1); 561 | { 562 | State = 98; Match(ISO); 563 | State = 99; header(); 564 | State = 100; data(); 565 | State = 101; Match(ISO_END); 566 | } 567 | } 568 | catch (RecognitionException re) { 569 | _localctx.exception = re; 570 | ErrorHandler.ReportError(this, re); 571 | ErrorHandler.Recover(this, re); 572 | } 573 | finally { 574 | ExitRule(); 575 | } 576 | return _localctx; 577 | } 578 | 579 | public partial class FileDescriptionContext : ParserRuleContext { 580 | public ITerminalNode FILE_DESCRIPTION() { return GetToken(STEPParser.FILE_DESCRIPTION, 0); } 581 | public DescriptionContext description() { 582 | return GetRuleContext(0); 583 | } 584 | public ImplementationContext implementation() { 585 | return GetRuleContext(0); 586 | } 587 | public FileDescriptionContext(ParserRuleContext parent, int invokingState) 588 | : base(parent, invokingState) 589 | { 590 | } 591 | public override int RuleIndex { get { return RULE_fileDescription; } } 592 | public override void EnterRule(IParseTreeListener listener) { 593 | ISTEPListener typedListener = listener as ISTEPListener; 594 | if (typedListener != null) typedListener.EnterFileDescription(this); 595 | } 596 | public override void ExitRule(IParseTreeListener listener) { 597 | ISTEPListener typedListener = listener as ISTEPListener; 598 | if (typedListener != null) typedListener.ExitFileDescription(this); 599 | } 600 | } 601 | 602 | [RuleVersion(0)] 603 | public FileDescriptionContext fileDescription() { 604 | FileDescriptionContext _localctx = new FileDescriptionContext(Context, State); 605 | EnterRule(_localctx, 16, RULE_fileDescription); 606 | try { 607 | EnterOuterAlt(_localctx, 1); 608 | { 609 | State = 103; Match(FILE_DESCRIPTION); 610 | State = 104; Match(T__0); 611 | State = 105; description(); 612 | State = 106; Match(T__1); 613 | State = 107; implementation(); 614 | State = 108; Match(T__2); 615 | State = 109; Match(T__4); 616 | } 617 | } 618 | catch (RecognitionException re) { 619 | _localctx.exception = re; 620 | ErrorHandler.ReportError(this, re); 621 | ErrorHandler.Recover(this, re); 622 | } 623 | finally { 624 | ExitRule(); 625 | } 626 | return _localctx; 627 | } 628 | 629 | public partial class FileNameContext : ParserRuleContext { 630 | public ITerminalNode FILE_NAME() { return GetToken(STEPParser.FILE_NAME, 0); } 631 | public NameContext name() { 632 | return GetRuleContext(0); 633 | } 634 | public TimeStampContext timeStamp() { 635 | return GetRuleContext(0); 636 | } 637 | public Preprocessor_versionContext preprocessor_version() { 638 | return GetRuleContext(0); 639 | } 640 | public Originating_systemContext originating_system() { 641 | return GetRuleContext(0); 642 | } 643 | public AuthorisationContext authorisation() { 644 | return GetRuleContext(0); 645 | } 646 | public AuthorContext author() { 647 | return GetRuleContext(0); 648 | } 649 | public CollectionContext[] collection() { 650 | return GetRuleContexts(); 651 | } 652 | public CollectionContext collection(int i) { 653 | return GetRuleContext(i); 654 | } 655 | public OrganizationContext organization() { 656 | return GetRuleContext(0); 657 | } 658 | public FileNameContext(ParserRuleContext parent, int invokingState) 659 | : base(parent, invokingState) 660 | { 661 | } 662 | public override int RuleIndex { get { return RULE_fileName; } } 663 | public override void EnterRule(IParseTreeListener listener) { 664 | ISTEPListener typedListener = listener as ISTEPListener; 665 | if (typedListener != null) typedListener.EnterFileName(this); 666 | } 667 | public override void ExitRule(IParseTreeListener listener) { 668 | ISTEPListener typedListener = listener as ISTEPListener; 669 | if (typedListener != null) typedListener.ExitFileName(this); 670 | } 671 | } 672 | 673 | [RuleVersion(0)] 674 | public FileNameContext fileName() { 675 | FileNameContext _localctx = new FileNameContext(Context, State); 676 | EnterRule(_localctx, 18, RULE_fileName); 677 | try { 678 | EnterOuterAlt(_localctx, 1); 679 | { 680 | State = 111; Match(FILE_NAME); 681 | State = 112; Match(T__0); 682 | State = 113; name(); 683 | State = 114; Match(T__1); 684 | State = 115; timeStamp(); 685 | State = 116; Match(T__1); 686 | State = 119; 687 | ErrorHandler.Sync(this); 688 | switch (TokenStream.LA(1)) { 689 | case AnyString: 690 | { 691 | State = 117; author(); 692 | } 693 | break; 694 | case T__0: 695 | case T__3: 696 | { 697 | State = 118; collection(); 698 | } 699 | break; 700 | default: 701 | throw new NoViableAltException(this); 702 | } 703 | State = 121; Match(T__1); 704 | State = 124; 705 | ErrorHandler.Sync(this); 706 | switch (TokenStream.LA(1)) { 707 | case AnyString: 708 | { 709 | State = 122; organization(); 710 | } 711 | break; 712 | case T__0: 713 | case T__3: 714 | { 715 | State = 123; collection(); 716 | } 717 | break; 718 | default: 719 | throw new NoViableAltException(this); 720 | } 721 | State = 126; Match(T__1); 722 | State = 127; preprocessor_version(); 723 | State = 128; Match(T__1); 724 | State = 129; originating_system(); 725 | State = 130; Match(T__1); 726 | State = 131; authorisation(); 727 | State = 132; Match(T__2); 728 | State = 133; Match(T__4); 729 | } 730 | } 731 | catch (RecognitionException re) { 732 | _localctx.exception = re; 733 | ErrorHandler.ReportError(this, re); 734 | ErrorHandler.Recover(this, re); 735 | } 736 | finally { 737 | ExitRule(); 738 | } 739 | return _localctx; 740 | } 741 | 742 | public partial class FilePathContext : ParserRuleContext { 743 | public ITerminalNode[] Letter() { return GetTokens(STEPParser.Letter); } 744 | public ITerminalNode Letter(int i) { 745 | return GetToken(STEPParser.Letter, i); 746 | } 747 | public FilePathContext(ParserRuleContext parent, int invokingState) 748 | : base(parent, invokingState) 749 | { 750 | } 751 | public override int RuleIndex { get { return RULE_filePath; } } 752 | public override void EnterRule(IParseTreeListener listener) { 753 | ISTEPListener typedListener = listener as ISTEPListener; 754 | if (typedListener != null) typedListener.EnterFilePath(this); 755 | } 756 | public override void ExitRule(IParseTreeListener listener) { 757 | ISTEPListener typedListener = listener as ISTEPListener; 758 | if (typedListener != null) typedListener.ExitFilePath(this); 759 | } 760 | } 761 | 762 | [RuleVersion(0)] 763 | public FilePathContext filePath() { 764 | FilePathContext _localctx = new FilePathContext(Context, State); 765 | EnterRule(_localctx, 20, RULE_filePath); 766 | int _la; 767 | try { 768 | EnterOuterAlt(_localctx, 1); 769 | { 770 | State = 135; Match(T__5); 771 | State = 139; 772 | ErrorHandler.Sync(this); 773 | _la = TokenStream.LA(1); 774 | while (_la==Letter) { 775 | { 776 | { 777 | State = 136; Match(Letter); 778 | } 779 | } 780 | State = 141; 781 | ErrorHandler.Sync(this); 782 | _la = TokenStream.LA(1); 783 | } 784 | State = 142; Match(T__6); 785 | State = 146; 786 | ErrorHandler.Sync(this); 787 | _la = TokenStream.LA(1); 788 | while (_la==Letter) { 789 | { 790 | { 791 | State = 143; Match(Letter); 792 | } 793 | } 794 | State = 148; 795 | ErrorHandler.Sync(this); 796 | _la = TokenStream.LA(1); 797 | } 798 | State = 149; Match(T__5); 799 | } 800 | } 801 | catch (RecognitionException re) { 802 | _localctx.exception = re; 803 | ErrorHandler.ReportError(this, re); 804 | ErrorHandler.Recover(this, re); 805 | } 806 | finally { 807 | ExitRule(); 808 | } 809 | return _localctx; 810 | } 811 | 812 | public partial class FileSchemaContext : ParserRuleContext { 813 | public ITerminalNode FILE_SCHEMA() { return GetToken(STEPParser.FILE_SCHEMA, 0); } 814 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 815 | public FileSchemaContext(ParserRuleContext parent, int invokingState) 816 | : base(parent, invokingState) 817 | { 818 | } 819 | public override int RuleIndex { get { return RULE_fileSchema; } } 820 | public override void EnterRule(IParseTreeListener listener) { 821 | ISTEPListener typedListener = listener as ISTEPListener; 822 | if (typedListener != null) typedListener.EnterFileSchema(this); 823 | } 824 | public override void ExitRule(IParseTreeListener listener) { 825 | ISTEPListener typedListener = listener as ISTEPListener; 826 | if (typedListener != null) typedListener.ExitFileSchema(this); 827 | } 828 | } 829 | 830 | [RuleVersion(0)] 831 | public FileSchemaContext fileSchema() { 832 | FileSchemaContext _localctx = new FileSchemaContext(Context, State); 833 | EnterRule(_localctx, 22, RULE_fileSchema); 834 | try { 835 | EnterOuterAlt(_localctx, 1); 836 | { 837 | State = 151; Match(FILE_SCHEMA); 838 | State = 152; Match(T__0); 839 | State = 153; Match(T__0); 840 | State = 154; Match(AnyString); 841 | State = 155; Match(T__2); 842 | State = 156; Match(T__2); 843 | State = 157; Match(T__4); 844 | } 845 | } 846 | catch (RecognitionException re) { 847 | _localctx.exception = re; 848 | ErrorHandler.ReportError(this, re); 849 | ErrorHandler.Recover(this, re); 850 | } 851 | finally { 852 | ExitRule(); 853 | } 854 | return _localctx; 855 | } 856 | 857 | public partial class HeaderContext : ParserRuleContext { 858 | public ITerminalNode HEADER() { return GetToken(STEPParser.HEADER, 0); } 859 | public FileDescriptionContext fileDescription() { 860 | return GetRuleContext(0); 861 | } 862 | public FileNameContext fileName() { 863 | return GetRuleContext(0); 864 | } 865 | public FileSchemaContext fileSchema() { 866 | return GetRuleContext(0); 867 | } 868 | public ITerminalNode ENDSEC() { return GetToken(STEPParser.ENDSEC, 0); } 869 | public HeaderContext(ParserRuleContext parent, int invokingState) 870 | : base(parent, invokingState) 871 | { 872 | } 873 | public override int RuleIndex { get { return RULE_header; } } 874 | public override void EnterRule(IParseTreeListener listener) { 875 | ISTEPListener typedListener = listener as ISTEPListener; 876 | if (typedListener != null) typedListener.EnterHeader(this); 877 | } 878 | public override void ExitRule(IParseTreeListener listener) { 879 | ISTEPListener typedListener = listener as ISTEPListener; 880 | if (typedListener != null) typedListener.ExitHeader(this); 881 | } 882 | } 883 | 884 | [RuleVersion(0)] 885 | public HeaderContext header() { 886 | HeaderContext _localctx = new HeaderContext(Context, State); 887 | EnterRule(_localctx, 24, RULE_header); 888 | try { 889 | EnterOuterAlt(_localctx, 1); 890 | { 891 | State = 159; Match(HEADER); 892 | State = 160; Match(T__4); 893 | State = 161; fileDescription(); 894 | State = 162; fileName(); 895 | State = 163; fileSchema(); 896 | State = 164; Match(ENDSEC); 897 | State = 165; Match(T__4); 898 | } 899 | } 900 | catch (RecognitionException re) { 901 | _localctx.exception = re; 902 | ErrorHandler.ReportError(this, re); 903 | ErrorHandler.Recover(this, re); 904 | } 905 | finally { 906 | ExitRule(); 907 | } 908 | return _localctx; 909 | } 910 | 911 | public partial class ImplementationContext : ParserRuleContext { 912 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 913 | public ImplementationContext(ParserRuleContext parent, int invokingState) 914 | : base(parent, invokingState) 915 | { 916 | } 917 | public override int RuleIndex { get { return RULE_implementation; } } 918 | public override void EnterRule(IParseTreeListener listener) { 919 | ISTEPListener typedListener = listener as ISTEPListener; 920 | if (typedListener != null) typedListener.EnterImplementation(this); 921 | } 922 | public override void ExitRule(IParseTreeListener listener) { 923 | ISTEPListener typedListener = listener as ISTEPListener; 924 | if (typedListener != null) typedListener.ExitImplementation(this); 925 | } 926 | } 927 | 928 | [RuleVersion(0)] 929 | public ImplementationContext implementation() { 930 | ImplementationContext _localctx = new ImplementationContext(Context, State); 931 | EnterRule(_localctx, 26, RULE_implementation); 932 | try { 933 | EnterOuterAlt(_localctx, 1); 934 | { 935 | State = 167; Match(AnyString); 936 | } 937 | } 938 | catch (RecognitionException re) { 939 | _localctx.exception = re; 940 | ErrorHandler.ReportError(this, re); 941 | ErrorHandler.Recover(this, re); 942 | } 943 | finally { 944 | ExitRule(); 945 | } 946 | return _localctx; 947 | } 948 | 949 | public partial class InstanceContext : ParserRuleContext { 950 | public ITerminalNode Id() { return GetToken(STEPParser.Id, 0); } 951 | public ConstructorContext constructor() { 952 | return GetRuleContext(0); 953 | } 954 | public InstanceContext(ParserRuleContext parent, int invokingState) 955 | : base(parent, invokingState) 956 | { 957 | } 958 | public override int RuleIndex { get { return RULE_instance; } } 959 | public override void EnterRule(IParseTreeListener listener) { 960 | ISTEPListener typedListener = listener as ISTEPListener; 961 | if (typedListener != null) typedListener.EnterInstance(this); 962 | } 963 | public override void ExitRule(IParseTreeListener listener) { 964 | ISTEPListener typedListener = listener as ISTEPListener; 965 | if (typedListener != null) typedListener.ExitInstance(this); 966 | } 967 | } 968 | 969 | [RuleVersion(0)] 970 | public InstanceContext instance() { 971 | InstanceContext _localctx = new InstanceContext(Context, State); 972 | EnterRule(_localctx, 28, RULE_instance); 973 | try { 974 | EnterOuterAlt(_localctx, 1); 975 | { 976 | State = 169; Match(Id); 977 | State = 170; Match(T__7); 978 | State = 171; constructor(); 979 | State = 172; Match(T__4); 980 | } 981 | } 982 | catch (RecognitionException re) { 983 | _localctx.exception = re; 984 | ErrorHandler.ReportError(this, re); 985 | ErrorHandler.Recover(this, re); 986 | } 987 | finally { 988 | ExitRule(); 989 | } 990 | return _localctx; 991 | } 992 | 993 | public partial class NameContext : ParserRuleContext { 994 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 995 | public FilePathContext filePath() { 996 | return GetRuleContext(0); 997 | } 998 | public NameContext(ParserRuleContext parent, int invokingState) 999 | : base(parent, invokingState) 1000 | { 1001 | } 1002 | public override int RuleIndex { get { return RULE_name; } } 1003 | public override void EnterRule(IParseTreeListener listener) { 1004 | ISTEPListener typedListener = listener as ISTEPListener; 1005 | if (typedListener != null) typedListener.EnterName(this); 1006 | } 1007 | public override void ExitRule(IParseTreeListener listener) { 1008 | ISTEPListener typedListener = listener as ISTEPListener; 1009 | if (typedListener != null) typedListener.ExitName(this); 1010 | } 1011 | } 1012 | 1013 | [RuleVersion(0)] 1014 | public NameContext name() { 1015 | NameContext _localctx = new NameContext(Context, State); 1016 | EnterRule(_localctx, 30, RULE_name); 1017 | try { 1018 | State = 176; 1019 | ErrorHandler.Sync(this); 1020 | switch (TokenStream.LA(1)) { 1021 | case AnyString: 1022 | EnterOuterAlt(_localctx, 1); 1023 | { 1024 | State = 174; Match(AnyString); 1025 | } 1026 | break; 1027 | case T__5: 1028 | EnterOuterAlt(_localctx, 2); 1029 | { 1030 | State = 175; filePath(); 1031 | } 1032 | break; 1033 | default: 1034 | throw new NoViableAltException(this); 1035 | } 1036 | } 1037 | catch (RecognitionException re) { 1038 | _localctx.exception = re; 1039 | ErrorHandler.ReportError(this, re); 1040 | ErrorHandler.Recover(this, re); 1041 | } 1042 | finally { 1043 | ExitRule(); 1044 | } 1045 | return _localctx; 1046 | } 1047 | 1048 | public partial class Originating_systemContext : ParserRuleContext { 1049 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 1050 | public Originating_systemContext(ParserRuleContext parent, int invokingState) 1051 | : base(parent, invokingState) 1052 | { 1053 | } 1054 | public override int RuleIndex { get { return RULE_originating_system; } } 1055 | public override void EnterRule(IParseTreeListener listener) { 1056 | ISTEPListener typedListener = listener as ISTEPListener; 1057 | if (typedListener != null) typedListener.EnterOriginating_system(this); 1058 | } 1059 | public override void ExitRule(IParseTreeListener listener) { 1060 | ISTEPListener typedListener = listener as ISTEPListener; 1061 | if (typedListener != null) typedListener.ExitOriginating_system(this); 1062 | } 1063 | } 1064 | 1065 | [RuleVersion(0)] 1066 | public Originating_systemContext originating_system() { 1067 | Originating_systemContext _localctx = new Originating_systemContext(Context, State); 1068 | EnterRule(_localctx, 32, RULE_originating_system); 1069 | try { 1070 | EnterOuterAlt(_localctx, 1); 1071 | { 1072 | State = 178; Match(AnyString); 1073 | } 1074 | } 1075 | catch (RecognitionException re) { 1076 | _localctx.exception = re; 1077 | ErrorHandler.ReportError(this, re); 1078 | ErrorHandler.Recover(this, re); 1079 | } 1080 | finally { 1081 | ExitRule(); 1082 | } 1083 | return _localctx; 1084 | } 1085 | 1086 | public partial class OrganizationContext : ParserRuleContext { 1087 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 1088 | public OrganizationContext(ParserRuleContext parent, int invokingState) 1089 | : base(parent, invokingState) 1090 | { 1091 | } 1092 | public override int RuleIndex { get { return RULE_organization; } } 1093 | public override void EnterRule(IParseTreeListener listener) { 1094 | ISTEPListener typedListener = listener as ISTEPListener; 1095 | if (typedListener != null) typedListener.EnterOrganization(this); 1096 | } 1097 | public override void ExitRule(IParseTreeListener listener) { 1098 | ISTEPListener typedListener = listener as ISTEPListener; 1099 | if (typedListener != null) typedListener.ExitOrganization(this); 1100 | } 1101 | } 1102 | 1103 | [RuleVersion(0)] 1104 | public OrganizationContext organization() { 1105 | OrganizationContext _localctx = new OrganizationContext(Context, State); 1106 | EnterRule(_localctx, 34, RULE_organization); 1107 | try { 1108 | EnterOuterAlt(_localctx, 1); 1109 | { 1110 | State = 180; Match(AnyString); 1111 | } 1112 | } 1113 | catch (RecognitionException re) { 1114 | _localctx.exception = re; 1115 | ErrorHandler.ReportError(this, re); 1116 | ErrorHandler.Recover(this, re); 1117 | } 1118 | finally { 1119 | ExitRule(); 1120 | } 1121 | return _localctx; 1122 | } 1123 | 1124 | public partial class ParameterContext : ParserRuleContext { 1125 | public ConstructorContext constructor() { 1126 | return GetRuleContext(0); 1127 | } 1128 | public CollectionContext collection() { 1129 | return GetRuleContext(0); 1130 | } 1131 | public ITerminalNode Undefined() { return GetToken(STEPParser.Undefined, 0); } 1132 | public ITerminalNode StringLiteral() { return GetToken(STEPParser.StringLiteral, 0); } 1133 | public ITerminalNode Derived() { return GetToken(STEPParser.Derived, 0); } 1134 | public ITerminalNode Enum() { return GetToken(STEPParser.Enum, 0); } 1135 | public ITerminalNode BoolLogical() { return GetToken(STEPParser.BoolLogical, 0); } 1136 | public ITerminalNode RealLiteral() { return GetToken(STEPParser.RealLiteral, 0); } 1137 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 1138 | public ITerminalNode Id() { return GetToken(STEPParser.Id, 0); } 1139 | public ITerminalNode IntegerLiteral() { return GetToken(STEPParser.IntegerLiteral, 0); } 1140 | public ParameterContext(ParserRuleContext parent, int invokingState) 1141 | : base(parent, invokingState) 1142 | { 1143 | } 1144 | public override int RuleIndex { get { return RULE_parameter; } } 1145 | public override void EnterRule(IParseTreeListener listener) { 1146 | ISTEPListener typedListener = listener as ISTEPListener; 1147 | if (typedListener != null) typedListener.EnterParameter(this); 1148 | } 1149 | public override void ExitRule(IParseTreeListener listener) { 1150 | ISTEPListener typedListener = listener as ISTEPListener; 1151 | if (typedListener != null) typedListener.ExitParameter(this); 1152 | } 1153 | } 1154 | 1155 | [RuleVersion(0)] 1156 | public ParameterContext parameter() { 1157 | ParameterContext _localctx = new ParameterContext(Context, State); 1158 | EnterRule(_localctx, 36, RULE_parameter); 1159 | try { 1160 | State = 193; 1161 | ErrorHandler.Sync(this); 1162 | switch (TokenStream.LA(1)) { 1163 | case TypeRef: 1164 | EnterOuterAlt(_localctx, 1); 1165 | { 1166 | State = 182; constructor(); 1167 | } 1168 | break; 1169 | case T__0: 1170 | case T__3: 1171 | EnterOuterAlt(_localctx, 2); 1172 | { 1173 | State = 183; collection(); 1174 | } 1175 | break; 1176 | case Undefined: 1177 | EnterOuterAlt(_localctx, 3); 1178 | { 1179 | State = 184; Match(Undefined); 1180 | } 1181 | break; 1182 | case StringLiteral: 1183 | EnterOuterAlt(_localctx, 4); 1184 | { 1185 | State = 185; Match(StringLiteral); 1186 | } 1187 | break; 1188 | case Derived: 1189 | EnterOuterAlt(_localctx, 5); 1190 | { 1191 | State = 186; Match(Derived); 1192 | } 1193 | break; 1194 | case Enum: 1195 | EnterOuterAlt(_localctx, 6); 1196 | { 1197 | State = 187; Match(Enum); 1198 | } 1199 | break; 1200 | case BoolLogical: 1201 | EnterOuterAlt(_localctx, 7); 1202 | { 1203 | State = 188; Match(BoolLogical); 1204 | } 1205 | break; 1206 | case RealLiteral: 1207 | EnterOuterAlt(_localctx, 8); 1208 | { 1209 | State = 189; Match(RealLiteral); 1210 | } 1211 | break; 1212 | case AnyString: 1213 | EnterOuterAlt(_localctx, 9); 1214 | { 1215 | State = 190; Match(AnyString); 1216 | } 1217 | break; 1218 | case Id: 1219 | EnterOuterAlt(_localctx, 10); 1220 | { 1221 | State = 191; Match(Id); 1222 | } 1223 | break; 1224 | case IntegerLiteral: 1225 | EnterOuterAlt(_localctx, 11); 1226 | { 1227 | State = 192; Match(IntegerLiteral); 1228 | } 1229 | break; 1230 | default: 1231 | throw new NoViableAltException(this); 1232 | } 1233 | } 1234 | catch (RecognitionException re) { 1235 | _localctx.exception = re; 1236 | ErrorHandler.ReportError(this, re); 1237 | ErrorHandler.Recover(this, re); 1238 | } 1239 | finally { 1240 | ExitRule(); 1241 | } 1242 | return _localctx; 1243 | } 1244 | 1245 | public partial class Preprocessor_versionContext : ParserRuleContext { 1246 | public ITerminalNode AnyString() { return GetToken(STEPParser.AnyString, 0); } 1247 | public Preprocessor_versionContext(ParserRuleContext parent, int invokingState) 1248 | : base(parent, invokingState) 1249 | { 1250 | } 1251 | public override int RuleIndex { get { return RULE_preprocessor_version; } } 1252 | public override void EnterRule(IParseTreeListener listener) { 1253 | ISTEPListener typedListener = listener as ISTEPListener; 1254 | if (typedListener != null) typedListener.EnterPreprocessor_version(this); 1255 | } 1256 | public override void ExitRule(IParseTreeListener listener) { 1257 | ISTEPListener typedListener = listener as ISTEPListener; 1258 | if (typedListener != null) typedListener.ExitPreprocessor_version(this); 1259 | } 1260 | } 1261 | 1262 | [RuleVersion(0)] 1263 | public Preprocessor_versionContext preprocessor_version() { 1264 | Preprocessor_versionContext _localctx = new Preprocessor_versionContext(Context, State); 1265 | EnterRule(_localctx, 38, RULE_preprocessor_version); 1266 | try { 1267 | EnterOuterAlt(_localctx, 1); 1268 | { 1269 | State = 195; Match(AnyString); 1270 | } 1271 | } 1272 | catch (RecognitionException re) { 1273 | _localctx.exception = re; 1274 | ErrorHandler.ReportError(this, re); 1275 | ErrorHandler.Recover(this, re); 1276 | } 1277 | finally { 1278 | ExitRule(); 1279 | } 1280 | return _localctx; 1281 | } 1282 | 1283 | public partial class TimeStampContext : ParserRuleContext { 1284 | public ITerminalNode DateTime() { return GetToken(STEPParser.DateTime, 0); } 1285 | public TimeStampContext(ParserRuleContext parent, int invokingState) 1286 | : base(parent, invokingState) 1287 | { 1288 | } 1289 | public override int RuleIndex { get { return RULE_timeStamp; } } 1290 | public override void EnterRule(IParseTreeListener listener) { 1291 | ISTEPListener typedListener = listener as ISTEPListener; 1292 | if (typedListener != null) typedListener.EnterTimeStamp(this); 1293 | } 1294 | public override void ExitRule(IParseTreeListener listener) { 1295 | ISTEPListener typedListener = listener as ISTEPListener; 1296 | if (typedListener != null) typedListener.ExitTimeStamp(this); 1297 | } 1298 | } 1299 | 1300 | [RuleVersion(0)] 1301 | public TimeStampContext timeStamp() { 1302 | TimeStampContext _localctx = new TimeStampContext(Context, State); 1303 | EnterRule(_localctx, 40, RULE_timeStamp); 1304 | try { 1305 | EnterOuterAlt(_localctx, 1); 1306 | { 1307 | State = 197; Match(DateTime); 1308 | } 1309 | } 1310 | catch (RecognitionException re) { 1311 | _localctx.exception = re; 1312 | ErrorHandler.ReportError(this, re); 1313 | ErrorHandler.Recover(this, re); 1314 | } 1315 | finally { 1316 | ExitRule(); 1317 | } 1318 | return _localctx; 1319 | } 1320 | 1321 | private static char[] _serializedATN = { 1322 | '\x3', '\x608B', '\xA72A', '\x8133', '\xB9ED', '\x417C', '\x3BE7', '\x7786', 1323 | '\x5964', '\x3', '\"', '\xCA', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', 1324 | '\t', '\x3', '\x4', '\x4', '\t', '\x4', '\x4', '\x5', '\t', '\x5', '\x4', 1325 | '\x6', '\t', '\x6', '\x4', '\a', '\t', '\a', '\x4', '\b', '\t', '\b', 1326 | '\x4', '\t', '\t', '\t', '\x4', '\n', '\t', '\n', '\x4', '\v', '\t', '\v', 1327 | '\x4', '\f', '\t', '\f', '\x4', '\r', '\t', '\r', '\x4', '\xE', '\t', 1328 | '\xE', '\x4', '\xF', '\t', '\xF', '\x4', '\x10', '\t', '\x10', '\x4', 1329 | '\x11', '\t', '\x11', '\x4', '\x12', '\t', '\x12', '\x4', '\x13', '\t', 1330 | '\x13', '\x4', '\x14', '\t', '\x14', '\x4', '\x15', '\t', '\x15', '\x4', 1331 | '\x16', '\t', '\x16', '\x3', '\x2', '\x3', '\x2', '\x3', '\x3', '\x3', 1332 | '\x3', '\x3', '\x4', '\x3', '\x4', '\x3', '\x4', '\x3', '\x4', '\a', '\x4', 1333 | '\x35', '\n', '\x4', '\f', '\x4', '\xE', '\x4', '\x38', '\v', '\x4', '\x3', 1334 | '\x4', '\x3', '\x4', '\x3', '\x4', '\x5', '\x4', '=', '\n', '\x4', '\x3', 1335 | '\x5', '\x3', '\x5', '\x3', '\x5', '\x3', '\x5', '\x3', '\x5', '\x3', 1336 | '\x5', '\x3', '\x5', '\x5', '\x5', '\x46', '\n', '\x5', '\x3', '\x6', 1337 | '\x3', '\x6', '\x3', '\x6', '\x5', '\x6', 'K', '\n', '\x6', '\x3', '\x6', 1338 | '\x3', '\x6', '\a', '\x6', 'O', '\n', '\x6', '\f', '\x6', '\xE', '\x6', 1339 | 'R', '\v', '\x6', '\x3', '\x6', '\x3', '\x6', '\x3', '\a', '\x3', '\a', 1340 | '\x3', '\a', '\a', '\a', 'Y', '\n', '\a', '\f', '\a', '\xE', '\a', '\\', 1341 | '\v', '\a', '\x3', '\a', '\x3', '\a', '\x3', '\a', '\x3', '\b', '\x3', 1342 | '\b', '\x5', '\b', '\x63', '\n', '\b', '\x3', '\t', '\x3', '\t', '\x3', 1343 | '\t', '\x3', '\t', '\x3', '\t', '\x3', '\n', '\x3', '\n', '\x3', '\n', 1344 | '\x3', '\n', '\x3', '\n', '\x3', '\n', '\x3', '\n', '\x3', '\n', '\x3', 1345 | '\v', '\x3', '\v', '\x3', '\v', '\x3', '\v', '\x3', '\v', '\x3', '\v', 1346 | '\x3', '\v', '\x3', '\v', '\x5', '\v', 'z', '\n', '\v', '\x3', '\v', '\x3', 1347 | '\v', '\x3', '\v', '\x5', '\v', '\x7F', '\n', '\v', '\x3', '\v', '\x3', 1348 | '\v', '\x3', '\v', '\x3', '\v', '\x3', '\v', '\x3', '\v', '\x3', '\v', 1349 | '\x3', '\v', '\x3', '\v', '\x3', '\f', '\x3', '\f', '\a', '\f', '\x8C', 1350 | '\n', '\f', '\f', '\f', '\xE', '\f', '\x8F', '\v', '\f', '\x3', '\f', 1351 | '\x3', '\f', '\a', '\f', '\x93', '\n', '\f', '\f', '\f', '\xE', '\f', 1352 | '\x96', '\v', '\f', '\x3', '\f', '\x3', '\f', '\x3', '\r', '\x3', '\r', 1353 | '\x3', '\r', '\x3', '\r', '\x3', '\r', '\x3', '\r', '\x3', '\r', '\x3', 1354 | '\r', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', 1355 | '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xF', '\x3', '\xF', 1356 | '\x3', '\x10', '\x3', '\x10', '\x3', '\x10', '\x3', '\x10', '\x3', '\x10', 1357 | '\x3', '\x11', '\x3', '\x11', '\x5', '\x11', '\xB3', '\n', '\x11', '\x3', 1358 | '\x12', '\x3', '\x12', '\x3', '\x13', '\x3', '\x13', '\x3', '\x14', '\x3', 1359 | '\x14', '\x3', '\x14', '\x3', '\x14', '\x3', '\x14', '\x3', '\x14', '\x3', 1360 | '\x14', '\x3', '\x14', '\x3', '\x14', '\x3', '\x14', '\x3', '\x14', '\x5', 1361 | '\x14', '\xC4', '\n', '\x14', '\x3', '\x15', '\x3', '\x15', '\x3', '\x16', 1362 | '\x3', '\x16', '\x3', '\x16', '\x2', '\x2', '\x17', '\x2', '\x4', '\x6', 1363 | '\b', '\n', '\f', '\xE', '\x10', '\x12', '\x14', '\x16', '\x18', '\x1A', 1364 | '\x1C', '\x1E', ' ', '\"', '$', '&', '(', '*', '\x2', '\x2', '\x2', '\xCF', 1365 | '\x2', ',', '\x3', '\x2', '\x2', '\x2', '\x4', '.', '\x3', '\x2', '\x2', 1366 | '\x2', '\x6', '<', '\x3', '\x2', '\x2', '\x2', '\b', '\x45', '\x3', '\x2', 1367 | '\x2', '\x2', '\n', 'G', '\x3', '\x2', '\x2', '\x2', '\f', 'U', '\x3', 1368 | '\x2', '\x2', '\x2', '\xE', '\x62', '\x3', '\x2', '\x2', '\x2', '\x10', 1369 | '\x64', '\x3', '\x2', '\x2', '\x2', '\x12', 'i', '\x3', '\x2', '\x2', 1370 | '\x2', '\x14', 'q', '\x3', '\x2', '\x2', '\x2', '\x16', '\x89', '\x3', 1371 | '\x2', '\x2', '\x2', '\x18', '\x99', '\x3', '\x2', '\x2', '\x2', '\x1A', 1372 | '\xA1', '\x3', '\x2', '\x2', '\x2', '\x1C', '\xA9', '\x3', '\x2', '\x2', 1373 | '\x2', '\x1E', '\xAB', '\x3', '\x2', '\x2', '\x2', ' ', '\xB2', '\x3', 1374 | '\x2', '\x2', '\x2', '\"', '\xB4', '\x3', '\x2', '\x2', '\x2', '$', '\xB6', 1375 | '\x3', '\x2', '\x2', '\x2', '&', '\xC3', '\x3', '\x2', '\x2', '\x2', '(', 1376 | '\xC5', '\x3', '\x2', '\x2', '\x2', '*', '\xC7', '\x3', '\x2', '\x2', 1377 | '\x2', ',', '-', '\a', '\x1F', '\x2', '\x2', '-', '\x3', '\x3', '\x2', 1378 | '\x2', '\x2', '.', '/', '\a', '\x1F', '\x2', '\x2', '/', '\x5', '\x3', 1379 | '\x2', '\x2', '\x2', '\x30', '\x31', '\a', '\x3', '\x2', '\x2', '\x31', 1380 | '\x36', '\x5', '\b', '\x5', '\x2', '\x32', '\x33', '\a', '\x4', '\x2', 1381 | '\x2', '\x33', '\x35', '\x5', '\b', '\x5', '\x2', '\x34', '\x32', '\x3', 1382 | '\x2', '\x2', '\x2', '\x35', '\x38', '\x3', '\x2', '\x2', '\x2', '\x36', 1383 | '\x34', '\x3', '\x2', '\x2', '\x2', '\x36', '\x37', '\x3', '\x2', '\x2', 1384 | '\x2', '\x37', '\x39', '\x3', '\x2', '\x2', '\x2', '\x38', '\x36', '\x3', 1385 | '\x2', '\x2', '\x2', '\x39', ':', '\a', '\x5', '\x2', '\x2', ':', '=', 1386 | '\x3', '\x2', '\x2', '\x2', ';', '=', '\a', '\x6', '\x2', '\x2', '<', 1387 | '\x30', '\x3', '\x2', '\x2', '\x2', '<', ';', '\x3', '\x2', '\x2', '\x2', 1388 | '=', '\a', '\x3', '\x2', '\x2', '\x2', '>', '\x46', '\a', '\x12', '\x2', 1389 | '\x2', '?', '\x46', '\a', '\v', '\x2', '\x2', '@', '\x46', '\a', '\x1C', 1390 | '\x2', '\x2', '\x41', '\x46', '\a', '\x1F', '\x2', '\x2', '\x42', '\x46', 1391 | '\a', '\x19', '\x2', '\x2', '\x43', '\x46', '\x5', '\n', '\x6', '\x2', 1392 | '\x44', '\x46', '\a', '\x1E', '\x2', '\x2', '\x45', '>', '\x3', '\x2', 1393 | '\x2', '\x2', '\x45', '?', '\x3', '\x2', '\x2', '\x2', '\x45', '@', '\x3', 1394 | '\x2', '\x2', '\x2', '\x45', '\x41', '\x3', '\x2', '\x2', '\x2', '\x45', 1395 | '\x42', '\x3', '\x2', '\x2', '\x2', '\x45', '\x43', '\x3', '\x2', '\x2', 1396 | '\x2', '\x45', '\x44', '\x3', '\x2', '\x2', '\x2', '\x46', '\t', '\x3', 1397 | '\x2', '\x2', '\x2', 'G', 'H', '\a', '\x1D', '\x2', '\x2', 'H', 'J', '\a', 1398 | '\x3', '\x2', '\x2', 'I', 'K', '\x5', '&', '\x14', '\x2', 'J', 'I', '\x3', 1399 | '\x2', '\x2', '\x2', 'J', 'K', '\x3', '\x2', '\x2', '\x2', 'K', 'P', '\x3', 1400 | '\x2', '\x2', '\x2', 'L', 'M', '\a', '\x4', '\x2', '\x2', 'M', 'O', '\x5', 1401 | '&', '\x14', '\x2', 'N', 'L', '\x3', '\x2', '\x2', '\x2', 'O', 'R', '\x3', 1402 | '\x2', '\x2', '\x2', 'P', 'N', '\x3', '\x2', '\x2', '\x2', 'P', 'Q', '\x3', 1403 | '\x2', '\x2', '\x2', 'Q', 'S', '\x3', '\x2', '\x2', '\x2', 'R', 'P', '\x3', 1404 | '\x2', '\x2', '\x2', 'S', 'T', '\a', '\x5', '\x2', '\x2', 'T', '\v', '\x3', 1405 | '\x2', '\x2', '\x2', 'U', 'V', '\a', '\x13', '\x2', '\x2', 'V', 'Z', '\a', 1406 | '\a', '\x2', '\x2', 'W', 'Y', '\x5', '\x1E', '\x10', '\x2', 'X', 'W', 1407 | '\x3', '\x2', '\x2', '\x2', 'Y', '\\', '\x3', '\x2', '\x2', '\x2', 'Z', 1408 | 'X', '\x3', '\x2', '\x2', '\x2', 'Z', '[', '\x3', '\x2', '\x2', '\x2', 1409 | '[', ']', '\x3', '\x2', '\x2', '\x2', '\\', 'Z', '\x3', '\x2', '\x2', 1410 | '\x2', ']', '^', '\a', '\x14', '\x2', '\x2', '^', '_', '\a', '\a', '\x2', 1411 | '\x2', '_', '\r', '\x3', '\x2', '\x2', '\x2', '`', '\x63', '\a', '\x1F', 1412 | '\x2', '\x2', '\x61', '\x63', '\x5', '\x6', '\x4', '\x2', '\x62', '`', 1413 | '\x3', '\x2', '\x2', '\x2', '\x62', '\x61', '\x3', '\x2', '\x2', '\x2', 1414 | '\x63', '\xF', '\x3', '\x2', '\x2', '\x2', '\x64', '\x65', '\a', '\x1A', 1415 | '\x2', '\x2', '\x65', '\x66', '\x5', '\x1A', '\xE', '\x2', '\x66', 'g', 1416 | '\x5', '\f', '\a', '\x2', 'g', 'h', '\a', '\x1B', '\x2', '\x2', 'h', '\x11', 1417 | '\x3', '\x2', '\x2', '\x2', 'i', 'j', '\a', '\x15', '\x2', '\x2', 'j', 1418 | 'k', '\a', '\x3', '\x2', '\x2', 'k', 'l', '\x5', '\xE', '\b', '\x2', 'l', 1419 | 'm', '\a', '\x4', '\x2', '\x2', 'm', 'n', '\x5', '\x1C', '\xF', '\x2', 1420 | 'n', 'o', '\a', '\x5', '\x2', '\x2', 'o', 'p', '\a', '\a', '\x2', '\x2', 1421 | 'p', '\x13', '\x3', '\x2', '\x2', '\x2', 'q', 'r', '\a', '\x16', '\x2', 1422 | '\x2', 'r', 's', '\a', '\x3', '\x2', '\x2', 's', 't', '\x5', ' ', '\x11', 1423 | '\x2', 't', 'u', '\a', '\x4', '\x2', '\x2', 'u', 'v', '\x5', '*', '\x16', 1424 | '\x2', 'v', 'y', '\a', '\x4', '\x2', '\x2', 'w', 'z', '\x5', '\x2', '\x2', 1425 | '\x2', 'x', 'z', '\x5', '\x6', '\x4', '\x2', 'y', 'w', '\x3', '\x2', '\x2', 1426 | '\x2', 'y', 'x', '\x3', '\x2', '\x2', '\x2', 'z', '{', '\x3', '\x2', '\x2', 1427 | '\x2', '{', '~', '\a', '\x4', '\x2', '\x2', '|', '\x7F', '\x5', '$', '\x13', 1428 | '\x2', '}', '\x7F', '\x5', '\x6', '\x4', '\x2', '~', '|', '\x3', '\x2', 1429 | '\x2', '\x2', '~', '}', '\x3', '\x2', '\x2', '\x2', '\x7F', '\x80', '\x3', 1430 | '\x2', '\x2', '\x2', '\x80', '\x81', '\a', '\x4', '\x2', '\x2', '\x81', 1431 | '\x82', '\x5', '(', '\x15', '\x2', '\x82', '\x83', '\a', '\x4', '\x2', 1432 | '\x2', '\x83', '\x84', '\x5', '\"', '\x12', '\x2', '\x84', '\x85', '\a', 1433 | '\x4', '\x2', '\x2', '\x85', '\x86', '\x5', '\x4', '\x3', '\x2', '\x86', 1434 | '\x87', '\a', '\x5', '\x2', '\x2', '\x87', '\x88', '\a', '\a', '\x2', 1435 | '\x2', '\x88', '\x15', '\x3', '\x2', '\x2', '\x2', '\x89', '\x8D', '\a', 1436 | '\b', '\x2', '\x2', '\x8A', '\x8C', '\a', '\f', '\x2', '\x2', '\x8B', 1437 | '\x8A', '\x3', '\x2', '\x2', '\x2', '\x8C', '\x8F', '\x3', '\x2', '\x2', 1438 | '\x2', '\x8D', '\x8B', '\x3', '\x2', '\x2', '\x2', '\x8D', '\x8E', '\x3', 1439 | '\x2', '\x2', '\x2', '\x8E', '\x90', '\x3', '\x2', '\x2', '\x2', '\x8F', 1440 | '\x8D', '\x3', '\x2', '\x2', '\x2', '\x90', '\x94', '\a', '\t', '\x2', 1441 | '\x2', '\x91', '\x93', '\a', '\f', '\x2', '\x2', '\x92', '\x91', '\x3', 1442 | '\x2', '\x2', '\x2', '\x93', '\x96', '\x3', '\x2', '\x2', '\x2', '\x94', 1443 | '\x92', '\x3', '\x2', '\x2', '\x2', '\x94', '\x95', '\x3', '\x2', '\x2', 1444 | '\x2', '\x95', '\x97', '\x3', '\x2', '\x2', '\x2', '\x96', '\x94', '\x3', 1445 | '\x2', '\x2', '\x2', '\x97', '\x98', '\a', '\b', '\x2', '\x2', '\x98', 1446 | '\x17', '\x3', '\x2', '\x2', '\x2', '\x99', '\x9A', '\a', '\x17', '\x2', 1447 | '\x2', '\x9A', '\x9B', '\a', '\x3', '\x2', '\x2', '\x9B', '\x9C', '\a', 1448 | '\x3', '\x2', '\x2', '\x9C', '\x9D', '\a', '\x1F', '\x2', '\x2', '\x9D', 1449 | '\x9E', '\a', '\x5', '\x2', '\x2', '\x9E', '\x9F', '\a', '\x5', '\x2', 1450 | '\x2', '\x9F', '\xA0', '\a', '\a', '\x2', '\x2', '\xA0', '\x19', '\x3', 1451 | '\x2', '\x2', '\x2', '\xA1', '\xA2', '\a', '\x18', '\x2', '\x2', '\xA2', 1452 | '\xA3', '\a', '\a', '\x2', '\x2', '\xA3', '\xA4', '\x5', '\x12', '\n', 1453 | '\x2', '\xA4', '\xA5', '\x5', '\x14', '\v', '\x2', '\xA5', '\xA6', '\x5', 1454 | '\x18', '\r', '\x2', '\xA6', '\xA7', '\a', '\x14', '\x2', '\x2', '\xA7', 1455 | '\xA8', '\a', '\a', '\x2', '\x2', '\xA8', '\x1B', '\x3', '\x2', '\x2', 1456 | '\x2', '\xA9', '\xAA', '\a', '\x1F', '\x2', '\x2', '\xAA', '\x1D', '\x3', 1457 | '\x2', '\x2', '\x2', '\xAB', '\xAC', '\a', '\x19', '\x2', '\x2', '\xAC', 1458 | '\xAD', '\a', '\n', '\x2', '\x2', '\xAD', '\xAE', '\x5', '\n', '\x6', 1459 | '\x2', '\xAE', '\xAF', '\a', '\a', '\x2', '\x2', '\xAF', '\x1F', '\x3', 1460 | '\x2', '\x2', '\x2', '\xB0', '\xB3', '\a', '\x1F', '\x2', '\x2', '\xB1', 1461 | '\xB3', '\x5', '\x16', '\f', '\x2', '\xB2', '\xB0', '\x3', '\x2', '\x2', 1462 | '\x2', '\xB2', '\xB1', '\x3', '\x2', '\x2', '\x2', '\xB3', '!', '\x3', 1463 | '\x2', '\x2', '\x2', '\xB4', '\xB5', '\a', '\x1F', '\x2', '\x2', '\xB5', 1464 | '#', '\x3', '\x2', '\x2', '\x2', '\xB6', '\xB7', '\a', '\x1F', '\x2', 1465 | '\x2', '\xB7', '%', '\x3', '\x2', '\x2', '\x2', '\xB8', '\xC4', '\x5', 1466 | '\n', '\x6', '\x2', '\xB9', '\xC4', '\x5', '\x6', '\x4', '\x2', '\xBA', 1467 | '\xC4', '\a', '\x1E', '\x2', '\x2', '\xBB', '\xC4', '\a', '\x1C', '\x2', 1468 | '\x2', '\xBC', '\xC4', '\a', '\xF', '\x2', '\x2', '\xBD', '\xC4', '\a', 1469 | '\x11', '\x2', '\x2', '\xBE', '\xC4', '\a', '\x10', '\x2', '\x2', '\xBF', 1470 | '\xC4', '\a', '\x12', '\x2', '\x2', '\xC0', '\xC4', '\a', '\x1F', '\x2', 1471 | '\x2', '\xC1', '\xC4', '\a', '\x19', '\x2', '\x2', '\xC2', '\xC4', '\a', 1472 | '\v', '\x2', '\x2', '\xC3', '\xB8', '\x3', '\x2', '\x2', '\x2', '\xC3', 1473 | '\xB9', '\x3', '\x2', '\x2', '\x2', '\xC3', '\xBA', '\x3', '\x2', '\x2', 1474 | '\x2', '\xC3', '\xBB', '\x3', '\x2', '\x2', '\x2', '\xC3', '\xBC', '\x3', 1475 | '\x2', '\x2', '\x2', '\xC3', '\xBD', '\x3', '\x2', '\x2', '\x2', '\xC3', 1476 | '\xBE', '\x3', '\x2', '\x2', '\x2', '\xC3', '\xBF', '\x3', '\x2', '\x2', 1477 | '\x2', '\xC3', '\xC0', '\x3', '\x2', '\x2', '\x2', '\xC3', '\xC1', '\x3', 1478 | '\x2', '\x2', '\x2', '\xC3', '\xC2', '\x3', '\x2', '\x2', '\x2', '\xC4', 1479 | '\'', '\x3', '\x2', '\x2', '\x2', '\xC5', '\xC6', '\a', '\x1F', '\x2', 1480 | '\x2', '\xC6', ')', '\x3', '\x2', '\x2', '\x2', '\xC7', '\xC8', '\a', 1481 | '\xE', '\x2', '\x2', '\xC8', '+', '\x3', '\x2', '\x2', '\x2', '\xF', '\x36', 1482 | '<', '\x45', 'J', 'P', 'Z', '\x62', 'y', '~', '\x8D', '\x94', '\xB2', 1483 | '\xC3', 1484 | }; 1485 | 1486 | public static readonly ATN _ATN = 1487 | new ATNDeserializer().Deserialize(_serializedATN); 1488 | 1489 | 1490 | } 1491 | } // namespace STEP 1492 | -------------------------------------------------------------------------------- /tests/IFC-dotnet-test/IFC-dotnet-test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp2.0 4 | false 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/IFC-dotnet-test/SerializationTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml.Serialization; 7 | using Xunit; 8 | using Xunit.Abstractions; 9 | using IFC4; 10 | using Newtonsoft.Json; 11 | 12 | namespace test 13 | { 14 | public class SerializationTests 15 | { 16 | private readonly ITestOutputHelper output; 17 | 18 | public SerializationTests(ITestOutputHelper output) 19 | { 20 | this.output = output; 21 | } 22 | 23 | [Fact] 24 | public void SerializeProject() 25 | { 26 | var id = new IfcGloballyUniqueId("12345"); 27 | 28 | var p1 = new IfcProject(id); 29 | p1.Name = "Test Project"; 30 | p1.Description = "A test of IFC-dotnet."; 31 | 32 | var p2 = JsonConvert.DeserializeObject(p1.ToJSON()); 33 | Assert.Equal(p1.Name.Value, p2.Name.Value); 34 | Assert.Equal(p1.Description.Value, p2.Description.Value); 35 | 36 | var wall = new IfcWall(new IfcGloballyUniqueId("wall1")); 37 | } 38 | 39 | [Fact] 40 | public void ExampleModel_Serialize_JSON() 41 | { 42 | var stepPath = "../../../models/example.ifc"; 43 | IList errors; 44 | var model = Model.FromSTEP(stepPath, out errors); 45 | var json = model.ToJSON(); 46 | } 47 | 48 | [Fact] 49 | public void ExampleModel_Serialize_DOT() 50 | { 51 | var stepPath = "../../../models/example.ifc"; 52 | IList errors; 53 | var model = Model.FromSTEP(stepPath, out errors); 54 | var dot = model.ToDOT(); 55 | } 56 | 57 | [Fact] 58 | public void ExampleModel_Deserialize_STEP() 59 | { 60 | var sw = new System.Diagnostics.Stopwatch(); 61 | sw.Start(); 62 | var stepPath = "../../../models/example.ifc"; 63 | IList errors; 64 | var model = Model.FromSTEP(stepPath, out errors); 65 | sw.Stop(); 66 | Console.WriteLine($"{sw.Elapsed.ToString()} elapsed for reading the model."); 67 | ReportErrors(stepPath, errors); 68 | } 69 | 70 | [Fact] 71 | public void OfficeBuilding_Deserialize_STEP() 72 | { 73 | var sw = new System.Diagnostics.Stopwatch(); 74 | sw.Start(); 75 | var stepPath = "../../../models/AC-20-Smiley-West-10-Bldg.ifc"; 76 | IList errors; 77 | var model = Model.FromSTEP(stepPath, out errors); 78 | sw.Stop(); 79 | Console.WriteLine($"{sw.Elapsed.ToString()} elapsed for reading the model."); 80 | ReportErrors(stepPath, errors); 81 | } 82 | 83 | [Fact] 84 | public void Hospital_Deserialize_STEP() 85 | { 86 | var sw = new System.Diagnostics.Stopwatch(); 87 | sw.Start(); 88 | var stepPath = "../../../models/20160125WestRiverSide Hospital - IFC4-Autodesk_Hospital_Sprinkle.ifc"; 89 | IList errors; 90 | var model = Model.FromSTEP(stepPath, out errors); 91 | sw.Stop(); 92 | Console.WriteLine($"{sw.Elapsed.ToString()} elapsed for reading the model."); 93 | ReportErrors(stepPath, errors); 94 | } 95 | 96 | private void ReportErrors(string filePath, IEnumerable errors) 97 | { 98 | if(!errors.Any()) 99 | { 100 | return; 101 | } 102 | 103 | Console.WriteLine($"The following errors occurred while parsing {filePath}:"); 104 | foreach(var e in errors) 105 | { 106 | Console.WriteLine(e.Message); 107 | } 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /tests/IFC-dotnet-test/models/example.ifc: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | FILE_DESCRIPTION ( 4 | ('ViewDefinition [CoordinationView, QuantityTakeOffAddOnView]'), 5 | '2;1'); 6 | FILE_NAME ( 7 | 'example.ifc', 8 | '2012-09-24T14:40:06', 9 | ('Architect'), 10 | ('Building Designer Office'), 11 | 'IFC Engine DLL version 1.03 beta', 12 | 'IFC Engine DLL version 1.03 beta', 13 | 'The authorising person'); 14 | FILE_SCHEMA (('IFC4RC4')); 15 | ENDSEC; 16 | DATA; 17 | 18 | /* --------------------------------------------------------------------------------------------- */ 19 | /* general entities required for all IFC data sets, defining the context for the exchange ------ */ 20 | #1 = IFCPROJECT('3yPRnn7zfEjO2IWgiG2wfc', #2, 'Default Project', 'Description of Default Project', $, $, $, (#20), #7); 21 | 22 | /* single owner history sufficient if not otherwise required by the view definition ------------ */ 23 | /* provides the person and application creating the data set, and the time it is created ------- */ 24 | #2 = IFCOWNERHISTORY(#3, #6, $, .NOTDEFINED., $, $, $, 1348486806); 25 | #3 = IFCPERSONANDORGANIZATION(#4, #5, $); 26 | #4 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); 27 | #5 = IFCORGANIZATION($, 'RDF', 'RDF Ltd.', $, $); 28 | #6 = IFCAPPLICATION(#5, '0.10', 'Test Application', 'TA 1001'); 29 | 30 | /* each IFC data set containing geometry has to define at absolute minimum length and angle ---- */ 31 | /* here length is milli metre as SI unit, and plane angle is 'degree' as non SI unit ----------- */ 32 | #7 = IFCUNITASSIGNMENT((#8, #9, #10, #11, #15, #16, #17, #18, #19)); 33 | #8 = IFCSIUNIT(*, .LENGTHUNIT., .MILLI., .METRE.); 34 | #9 = IFCSIUNIT(*, .AREAUNIT., $, .SQUARE_METRE.); 35 | #10 = IFCSIUNIT(*, .VOLUMEUNIT., $, .CUBIC_METRE.); 36 | #11 = IFCCONVERSIONBASEDUNIT(#12, .PLANEANGLEUNIT., 'DEGREE', #13); 37 | #12 = IFCDIMENSIONALEXPONENTS(0, 0, 0, 0, 0, 0, 0); 38 | #13 = IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(1.745E-2), #14); 39 | #14 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); 40 | #15 = IFCSIUNIT(*, .SOLIDANGLEUNIT., $, .STERADIAN.); 41 | #16 = IFCSIUNIT(*, .MASSUNIT., $, .GRAM.); 42 | #17 = IFCSIUNIT(*, .TIMEUNIT., $, .SECOND.); 43 | #18 = IFCSIUNIT(*, .THERMODYNAMICTEMPERATUREUNIT., $, .DEGREE_CELSIUS.); 44 | #19 = IFCSIUNIT(*, .LUMINOUSINTENSITYUNIT., $, .LUMEN.); 45 | #20 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'Model', 3, 1.E-5, #21, #23); 46 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 47 | #21 = IFCAXIS2PLACEMENT3D(#22, $, $); 48 | #22 = IFCCARTESIANPOINT((0., 0., 0.)); 49 | #23 = IFCDIRECTION((0., 1., 0.)); 50 | 51 | /* shared coordinates - it is permissable to share common instances to reduce file size -------- */ 52 | #24 = IFCCARTESIANPOINT((0., 0., 0.)); 53 | #25 = IFCDIRECTION((1., 0., 0.)); 54 | #26 = IFCDIRECTION((0., 1., 0.)); 55 | #27 = IFCDIRECTION((0., 0., 1.)); 56 | #28 = IFCDIRECTION((-1., 0., 0.)); 57 | #29 = IFCDIRECTION((0., -1., 0.)); 58 | #30 = IFCDIRECTION((0., 0., -1.)); 59 | 60 | /* if site is irrelevant Building could be connected to project directly ----------------------- */ 61 | #31 = IFCSITE('3BoQ8L5UXBEOT1kW0PLzej', #2, 'Default Site', 'Description of Default Site', $, #32, $, $, .ELEMENT., (24, 28, 0), (54, 25, 0), 10., $, $); 62 | #32 = IFCLOCALPLACEMENT($, #33); 63 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 64 | #33 = IFCAXIS2PLACEMENT3D(#24, $, $); 65 | 66 | /* each IFC data set containing elements in a building context has to include a building ------- */ 67 | /* at absolute minimum (could have a site and stories as well) --------------------------------- */ 68 | #34 = IFCBUILDING('0WE2bIjCj8sAuWvkNGFsRh', #2, 'Default Building', 'Description of Default Building', $, #35, $, $, .ELEMENT., $, $, #37); 69 | /* if the building is the uppermost spatial structure element it defines the absolut position -- */ 70 | #35 = IFCLOCALPLACEMENT(#32, #36); 71 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 72 | #36 = IFCAXIS2PLACEMENT3D(#24, $, $); 73 | #37 = IFCPOSTALADDRESS($, $, $, $, ('RDF Ltd.', 'Main Office'), '32', 'Bankya', 'Sofia', '1320', 'Bulgaria'); 74 | #38 = IFCBUILDINGSTOREY('0TqcpX835BMOFRhGvB6_Tu', #2, 'Default Building Storey', 'Description of Default Building Storey', $, #39, $, $, .ELEMENT., 0.); 75 | #39 = IFCLOCALPLACEMENT(#35, #40); 76 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 77 | #40 = IFCAXIS2PLACEMENT3D(#24, $, $); 78 | #41 = IFCRELAGGREGATES('0iL9EJKq95bRo5gB3il1c2', #2, 'BuildingContainer', 'BuildingContainer for BuildigStories', #34, (#38)); 79 | #42 = IFCRELAGGREGATES('2jatLdN_z0WeSagQKLy$7j', #2, 'SiteContainer', 'SiteContainer For Buildings', #31, (#34)); 80 | #43 = IFCRELAGGREGATES('15yRTZWFvF$O7$FwQVn1cn', #2, 'ProjectContainer', 'ProjectContainer for Sites', #1, (#31)); 81 | #44 = IFCRELCONTAINEDINSPATIALSTRUCTURE('3$zwcwnLv1_QDYHw6p7GXO', #2, 'Default Building', 'Contents of Building Storey', (#60, #87, #111, #134, #158, #173, #188), #38); 82 | 83 | /* properties for the wall, standard property set from PSet collection ------------------------- */ 84 | #45 = IFCPROPERTYSET('3tHNUXbZH5vxePn_rLyQFg', #2, 'Pset_WallCommon', $, (#46, #47, #48, #49, #50, #51, #52, #53, #54, #55)); 85 | #46 = IFCPROPERTYSINGLEVALUE('Reference', 'Reference', IFCIDENTIFIER(''), $); 86 | #47 = IFCPROPERTYSINGLEVALUE('AcousticRating', 'AcousticRating', IFCLABEL(''), $); 87 | #48 = IFCPROPERTYSINGLEVALUE('FireRating', 'FireRating', IFCLABEL(''), $); 88 | #49 = IFCPROPERTYSINGLEVALUE('Combustible', 'Combustible', IFCBOOLEAN(.F.), $); 89 | #50 = IFCPROPERTYSINGLEVALUE('SurfaceSpreadOfFlame', 'SurfaceSpreadOfFlame', IFCLABEL(''), $); 90 | #51 = IFCPROPERTYSINGLEVALUE('ThermalTransmittance', 'ThermalTransmittance', IFCTHERMALTRANSMITTANCEMEASURE(2.4E-1), $); 91 | #52 = IFCPROPERTYSINGLEVALUE('IsExternal', 'IsExternal', IFCBOOLEAN(.T.), $); 92 | #53 = IFCPROPERTYSINGLEVALUE('ExtendToStructure', 'ExtendToStructure', IFCBOOLEAN(.F.), $); 93 | #54 = IFCPROPERTYSINGLEVALUE('LoadBearing', 'LoadBearing', IFCBOOLEAN(.F.), $); 94 | #55 = IFCPROPERTYSINGLEVALUE('Compartmentation', 'Compartmentation', IFCBOOLEAN(.F.), $); 95 | #56 = IFCMATERIALLAYERSETUSAGE(#57, .AXIS2., .POSITIVE., -150., $); 96 | #57 = IFCMATERIALLAYERSET((#58), $, $); 97 | #58 = IFCMATERIALLAYER(#59, 300., $, $, $, $, $); 98 | #59 = IFCMATERIAL('Name of the material used for the wall', $, $); 99 | #60 = IFCWALL('3IclONJQ5D5gm$TM3V7U1j', #2, 'Outer Wall Back', 'Description of Wall', $, #61, #65, $, .STANDARD.); 100 | #61 = IFCLOCALPLACEMENT(#39, #62); 101 | #62 = IFCAXIS2PLACEMENT3D(#63, #27, #64); 102 | #63 = IFCCARTESIANPOINT((3950., 6000., 0.)); 103 | #64 = IFCDIRECTION((-9.999987317E-1, -1.592652916E-3, 0.)); 104 | #65 = IFCPRODUCTDEFINITIONSHAPE($, $, (#77)); 105 | #66 = IFCWALLTYPE('0gdkW8K411DwAbwkQeyDKo', #2, 'Outer Wall Back', 'Description of Window Type', $, $, $, $, $, .STANDARD.); 106 | #67 = IFCRELDEFINESBYTYPE('2lF9AHcET2svkKuyfUegwb', #2, $, $, (#60), #66); 107 | #68 = IFCRELDECLARES('3uukm7EKDFPOUbFxQ$qVVN', #2, $, $, #69, (#66, #93, #116, #140)); 108 | #69 = IFCPROJECTLIBRARY('2SEa_NMfv9lOphiPOi$air', #2, $, $, $, $, $, $, $); 109 | #70 = IFCRELDECLARES('3h6$l6MKL25wDhFLQrbqpQ', #2, $, $, #69, (#1)); 110 | #71 = IFCRELDEFINESBYPROPERTIES('216ALtDN52CwWJ8J4fpIVi', #2, $, $, (#60), #45); 111 | 112 | /* material (layers) of the wall --------------------------------------------------------------- */ 113 | #72 = IFCMATERIALLAYERSETUSAGE(#73, .AXIS2., .POSITIVE., -2.16907085E7, $); 114 | #73 = IFCMATERIALLAYERSET((#74), $, $); 115 | #74 = IFCMATERIALLAYER(#75, 4.3381417E7, $, $, $, $, $); 116 | #75 = IFCMATERIAL('Name of the material used for the wall', $, $); 117 | /* connection of material description to the wall ---------------------------------------------- */ 118 | #76 = IFCRELASSOCIATESMATERIAL('2B$$FAy3TCFRmytNeHGO89', #2, $, $, (#60), #72); 119 | 120 | /* geometry (shape representation), extruded polygon in z direction ---------------------------- */ 121 | #77 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#78)); 122 | #78 = IFCEXTRUDEDAREASOLID(#79, #86, #27, 2800.); 123 | #79 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #80); 124 | #80 = IFCPOLYLINE((#81, #82, #83, #84, #85)); 125 | #81 = IFCCARTESIANPOINT((-150., -150.)); 126 | #82 = IFCCARTESIANPOINT((150., 150.)); 127 | #83 = IFCCARTESIANPOINT((3650., 150.)); 128 | #84 = IFCCARTESIANPOINT((3950., -150.)); 129 | #85 = IFCCARTESIANPOINT((-150., -150.)); 130 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 131 | #86 = IFCAXIS2PLACEMENT3D(#24, $, $); 132 | #87 = IFCWALL('3DUVa8WNv44vpjf_VXmcpb', #2, 'Outer Wall Left', 'Description of Wall', $, #88, #92, $, .STANDARD.); 133 | #88 = IFCLOCALPLACEMENT(#39, #89); 134 | #89 = IFCAXIS2PLACEMENT3D(#90, #27, #91); 135 | #90 = IFCCARTESIANPOINT((150., 6000., 0.)); 136 | #91 = IFCDIRECTION((7.963267107E-4, -9.999996829E-1, 0.)); 137 | #92 = IFCPRODUCTDEFINITIONSHAPE($, $, (#101)); 138 | #93 = IFCWALLTYPE('1mrgnu0C55ceTTelA8G5dx', #2, 'Outer Wall Left', 'Description of Window Type', $, $, $, $, $, .STANDARD.); 139 | #94 = IFCRELDEFINESBYTYPE('3Ow4zlZMX8p9e6EdVJaxfZ', #2, $, $, (#87), #93); 140 | #95 = IFCRELDEFINESBYPROPERTIES('36NxysuFXFngObqpJ4oz$D', #2, $, $, (#87), #45); 141 | 142 | /* material (layers) of the wall --------------------------------------------------------------- */ 143 | #96 = IFCMATERIALLAYERSETUSAGE(#97, .AXIS2., .POSITIVE., -2.16907085E7, $); 144 | #97 = IFCMATERIALLAYERSET((#98), $, $); 145 | #98 = IFCMATERIALLAYER(#99, 4.3381417E7, $, $, $, $, $); 146 | #99 = IFCMATERIAL('Name of the material used for the wall', $, $); 147 | /* connection of material description to the wall ---------------------------------------------- */ 148 | #100 = IFCRELASSOCIATESMATERIAL('234PUIwhP9XfHgSGM7sAvU', #2, $, $, (#87), #96); 149 | 150 | /* geometry (shape representation), extruded polygon in z direction ---------------------------- */ 151 | #101 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#102)); 152 | #102 = IFCEXTRUDEDAREASOLID(#103, #110, #27, 2800.); 153 | #103 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #104); 154 | #104 = IFCPOLYLINE((#105, #106, #107, #108, #109)); 155 | #105 = IFCCARTESIANPOINT((-150., -150.)); 156 | #106 = IFCCARTESIANPOINT((150., 150.)); 157 | #107 = IFCCARTESIANPOINT((4650., 150.)); 158 | #108 = IFCCARTESIANPOINT((4950., -150.)); 159 | #109 = IFCCARTESIANPOINT((-150., -150.)); 160 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 161 | #110 = IFCAXIS2PLACEMENT3D(#24, $, $); 162 | #111 = IFCWALL('2oph4E6kD8c8E0H7fsOtL_', #2, 'Outer Wall Front', 'Description of Wall', $, #112, #115, $, .STANDARD.); 163 | #112 = IFCLOCALPLACEMENT(#39, #113); 164 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 165 | #113 = IFCAXIS2PLACEMENT3D(#114, $, $); 166 | #114 = IFCCARTESIANPOINT((150., 1200., 0.)); 167 | #115 = IFCPRODUCTDEFINITIONSHAPE($, $, (#124)); 168 | #116 = IFCWALLTYPE('0Q$c8FVxz5vPNexMoFHU_T', #2, 'Outer Wall Front', 'Description of Window Type', $, $, $, $, $, .STANDARD.); 169 | #117 = IFCRELDEFINESBYTYPE('0uIFnadBrBYgjhKDPiWlPn', #2, $, $, (#111), #116); 170 | #118 = IFCRELDEFINESBYPROPERTIES('1836sJKtb1ox0kiQoQ8TsC', #2, $, $, (#111), #45); 171 | 172 | /* material (layers) of the wall --------------------------------------------------------------- */ 173 | #119 = IFCMATERIALLAYERSETUSAGE(#120, .AXIS2., .POSITIVE., -2.16907085E7, $); 174 | #120 = IFCMATERIALLAYERSET((#121), $, $); 175 | #121 = IFCMATERIALLAYER(#122, 4.3381417E7, $, $, $, $, $); 176 | #122 = IFCMATERIAL('Name of the material used for the wall', $, $); 177 | /* connection of material description to the wall ---------------------------------------------- */ 178 | #123 = IFCRELASSOCIATESMATERIAL('3Wq2lmdXL96uhhISadL2f5', #2, $, $, (#111), #119); 179 | 180 | /* geometry (shape representation), extruded polygon in z direction ---------------------------- */ 181 | #124 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#125)); 182 | #125 = IFCEXTRUDEDAREASOLID(#126, #133, #27, 2800.); 183 | #126 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #127); 184 | #127 = IFCPOLYLINE((#128, #129, #130, #131, #132)); 185 | #128 = IFCCARTESIANPOINT((-150., -150.)); 186 | #129 = IFCCARTESIANPOINT((150., 150.)); 187 | #130 = IFCCARTESIANPOINT((3650., 150.)); 188 | #131 = IFCCARTESIANPOINT((3950., -150.)); 189 | #132 = IFCCARTESIANPOINT((-150., -150.)); 190 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 191 | #133 = IFCAXIS2PLACEMENT3D(#24, $, $); 192 | #134 = IFCWALL('06tMcU2CTCA8K37K_3uqzH', #2, 'Outer Wall Right', 'Description of Wall', $, #135, #139, $, .STANDARD.); 193 | #135 = IFCLOCALPLACEMENT(#39, #136); 194 | #136 = IFCAXIS2PLACEMENT3D(#137, #27, #138); 195 | #137 = IFCCARTESIANPOINT((3950., 1200., 0.)); 196 | #138 = IFCDIRECTION((-2.388978112E-3, 9.999971464E-1, 0.)); 197 | #139 = IFCPRODUCTDEFINITIONSHAPE($, $, (#148)); 198 | #140 = IFCWALLTYPE('0chhmc_fT3SRm4SMZlzC9Q', #2, 'Outer Wall Right', 'Description of Window Type', $, $, $, $, $, .STANDARD.); 199 | #141 = IFCRELDEFINESBYTYPE('07gWSgjGv7PAorT1iiJo$_', #2, $, $, (#134), #140); 200 | #142 = IFCRELDEFINESBYPROPERTIES('2wAmnFEwP4I9k29AizJgjh', #2, $, $, (#134), #45); 201 | 202 | /* material (layers) of the wall --------------------------------------------------------------- */ 203 | #143 = IFCMATERIALLAYERSETUSAGE(#144, .AXIS2., .POSITIVE., -2.16907085E7, $); 204 | #144 = IFCMATERIALLAYERSET((#145), $, $); 205 | #145 = IFCMATERIALLAYER(#146, 4.3381417E7, $, $, $, $, $); 206 | #146 = IFCMATERIAL('Name of the material used for the wall', $, $); 207 | /* connection of material description to the wall ---------------------------------------------- */ 208 | #147 = IFCRELASSOCIATESMATERIAL('0ppI0UEBP0TgVWm4ufpgS4', #2, $, $, (#134), #143); 209 | 210 | /* geometry (shape representation), extruded polygon in z direction ---------------------------- */ 211 | #148 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#149)); 212 | #149 = IFCEXTRUDEDAREASOLID(#150, #157, #27, 2800.); 213 | #150 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #151); 214 | #151 = IFCPOLYLINE((#152, #153, #154, #155, #156)); 215 | #152 = IFCCARTESIANPOINT((-150., -150.)); 216 | #153 = IFCCARTESIANPOINT((150., 150.)); 217 | #154 = IFCCARTESIANPOINT((4650., 150.)); 218 | #155 = IFCCARTESIANPOINT((4950., -150.)); 219 | #156 = IFCCARTESIANPOINT((-150., -150.)); 220 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 221 | #157 = IFCAXIS2PLACEMENT3D(#24, $, $); 222 | #158 = IFCSLAB('30KDbIwvz0TvaeeFaxIyOI', #2, 'Floor', 'Description of Slab', $, #159, #162, $, $); 223 | #159 = IFCLOCALPLACEMENT(#39, #160); 224 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 225 | #160 = IFCAXIS2PLACEMENT3D(#161, $, $); 226 | #161 = IFCCARTESIANPOINT((0., 0., -300.)); 227 | #162 = IFCPRODUCTDEFINITIONSHAPE($, $, (#163)); 228 | 229 | /* geometry (shape representation), extruded polygon in z direction ---------------------------- */ 230 | #163 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#164)); 231 | #164 = IFCEXTRUDEDAREASOLID(#165, #172, #27, 300.); 232 | #165 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #166); 233 | #166 = IFCPOLYLINE((#167, #168, #169, #170, #171)); 234 | #167 = IFCCARTESIANPOINT((0., 1050.)); 235 | #168 = IFCCARTESIANPOINT((0., 6150.)); 236 | #169 = IFCCARTESIANPOINT((4100., 6150.)); 237 | #170 = IFCCARTESIANPOINT((4100., 1050.)); 238 | #171 = IFCCARTESIANPOINT((0., 1050.)); 239 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 240 | #172 = IFCAXIS2PLACEMENT3D(#24, $, $); 241 | #173 = IFCROOF('2Boan9KyD2MwwgDRwhXKUL', #2, 'Roof', 'Description of Roof', $, #174, #177, $, $); 242 | #174 = IFCLOCALPLACEMENT(#39, #175); 243 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 244 | #175 = IFCAXIS2PLACEMENT3D(#176, $, $); 245 | #176 = IFCCARTESIANPOINT((0., 0., 2800.)); 246 | #177 = IFCPRODUCTDEFINITIONSHAPE($, $, (#178)); 247 | 248 | /* geometry (shape representation), extruded polygon in z direction ---------------------------- */ 249 | #178 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#179)); 250 | #179 = IFCEXTRUDEDAREASOLID(#180, #187, #27, 300.); 251 | #180 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #181); 252 | #181 = IFCPOLYLINE((#182, #183, #184, #185, #186)); 253 | #182 = IFCCARTESIANPOINT((0., 1050.)); 254 | #183 = IFCCARTESIANPOINT((0., 6150.)); 255 | #184 = IFCCARTESIANPOINT((4100., 6150.)); 256 | #185 = IFCCARTESIANPOINT((4100., 1050.)); 257 | #186 = IFCCARTESIANPOINT((0., 1050.)); 258 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 259 | #187 = IFCAXIS2PLACEMENT3D(#24, $, $); 260 | #188 = IFCSPACE('2s0CkOMXXBRgU1nmmQpb6z', #2, 'Room I', 'Description of Space', $, #189, #192, $, $, $, $); 261 | #189 = IFCLOCALPLACEMENT(#39, #190); 262 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 263 | #190 = IFCAXIS2PLACEMENT3D(#191, $, $); 264 | #191 = IFCCARTESIANPOINT((300., 1350., 0.)); 265 | #192 = IFCPRODUCTDEFINITIONSHAPE($, $, (#193)); 266 | 267 | /* geometry (shape representation), extruded polygon in z direction ---------------------------- */ 268 | #193 = IFCSHAPEREPRESENTATION(#20, 'Body', 'SweptSolid', (#194)); 269 | #194 = IFCEXTRUDEDAREASOLID(#195, #202, #27, 2800.); 270 | #195 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., $, #196); 271 | #196 = IFCPOLYLINE((#197, #198, #199, #200, #201)); 272 | #197 = IFCCARTESIANPOINT((0., 0.)); 273 | #198 = IFCCARTESIANPOINT((0., 4500.)); 274 | #199 = IFCCARTESIANPOINT((3500., 4500.)); 275 | #200 = IFCCARTESIANPOINT((3500., 0.)); 276 | #201 = IFCCARTESIANPOINT((0., 0.)); 277 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 278 | #202 = IFCAXIS2PLACEMENT3D(#24, $, $); 279 | 280 | /* Create Space Boundary (Second Level Space boundary, ----------------------------------------- */ 281 | /* although in this example these are the same objects as first level) ------------------------- */ 282 | #203 = IFCRELSPACEBOUNDARY2NDLEVEL('0C6Cdu5$j0Pf3dWTRbe7xr', #2, '2ndLevel', 'Space Boundary Bottom', #188, #158, #204, .PHYSICAL., .EXTERNAL., $, $); 283 | #204 = IFCCONNECTIONSURFACEGEOMETRY(#205, $); 284 | #205 = IFCCURVEBOUNDEDPLANE(#206, #208, ()); 285 | #206 = IFCPLANE(#207); 286 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 287 | #207 = IFCAXIS2PLACEMENT3D(#24, $, $); 288 | #208 = IFCCOMPOSITECURVE((#209), .U.); 289 | #209 = IFCCOMPOSITECURVESEGMENT(.CONTINUOUS., .F., #210); 290 | #210 = IFCPOLYLINE((#211, #212, #213, #214, #215)); 291 | #211 = IFCCARTESIANPOINT((0., 0.)); 292 | #212 = IFCCARTESIANPOINT((3500., 0.)); 293 | #213 = IFCCARTESIANPOINT((3500., 4500.)); 294 | #214 = IFCCARTESIANPOINT((0., 4500.)); 295 | #215 = IFCCARTESIANPOINT((0., 0.)); 296 | 297 | /* Create Space Boundary (Second Level Space boundary, ----------------------------------------- */ 298 | /* although in this example these are the same objects as first level) ------------------------- */ 299 | #216 = IFCRELSPACEBOUNDARY2NDLEVEL('1o1HJeNT9899eqqd_ig9de', #2, '2ndLevel', 'Space Boundary Top', #188, #158, #217, .PHYSICAL., .EXTERNAL., $, $); 300 | #217 = IFCCONNECTIONSURFACEGEOMETRY(#218, $); 301 | #218 = IFCCURVEBOUNDEDPLANE(#219, #222, ()); 302 | #219 = IFCPLANE(#220); 303 | /* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */ 304 | #220 = IFCAXIS2PLACEMENT3D(#221, $, $); 305 | #221 = IFCCARTESIANPOINT((0., 0., 2800.)); 306 | #222 = IFCCOMPOSITECURVE((#223), .U.); 307 | #223 = IFCCOMPOSITECURVESEGMENT(.CONTINUOUS., .F., #224); 308 | #224 = IFCPOLYLINE((#225, #226, #227, #228, #229)); 309 | #225 = IFCCARTESIANPOINT((0., 0.)); 310 | #226 = IFCCARTESIANPOINT((3500., 0.)); 311 | #227 = IFCCARTESIANPOINT((3500., 2200.)); 312 | #228 = IFCCARTESIANPOINT((0., 2200.)); 313 | #229 = IFCCARTESIANPOINT((0., 0.)); 314 | 315 | /* Create Space Boundary (Second Level Space boundary, ----------------------------------------- */ 316 | /* although in this example these are the same objects as first level) ------------------------- */ 317 | #230 = IFCRELSPACEBOUNDARY2NDLEVEL('0U6hnv3c91HA09Yrzxts4c', #2, '2ndLevel', 'Space Boundary Back Wall', #188, #60, #231, .PHYSICAL., .EXTERNAL., $, $); 318 | #231 = IFCCONNECTIONSURFACEGEOMETRY(#232, $); 319 | #232 = IFCCURVEBOUNDEDPLANE(#233, #236, ()); 320 | #233 = IFCPLANE(#234); 321 | #234 = IFCAXIS2PLACEMENT3D(#235, #29, #25); 322 | #235 = IFCCARTESIANPOINT((0., 4500., 0.)); 323 | #236 = IFCCOMPOSITECURVE((#237), .U.); 324 | #237 = IFCCOMPOSITECURVESEGMENT(.CONTINUOUS., .F., #238); 325 | #238 = IFCPOLYLINE((#239, #240, #241, #242, #243)); 326 | #239 = IFCCARTESIANPOINT((0., 0.)); 327 | #240 = IFCCARTESIANPOINT((3500., 0.)); 328 | #241 = IFCCARTESIANPOINT((3500., 2800.)); 329 | #242 = IFCCARTESIANPOINT((0., 2800.)); 330 | #243 = IFCCARTESIANPOINT((0., 0.)); 331 | 332 | /* Create Space Boundary (Second Level Space boundary, ----------------------------------------- */ 333 | /* although in this example these are the same objects as first level) ------------------------- */ 334 | #244 = IFCRELSPACEBOUNDARY2NDLEVEL('0eUoHns0b4fwRhWDDJaR0x', #2, '2ndLevel', 'Space Boundary Left Wall', #188, #87, #245, .PHYSICAL., .EXTERNAL., $, $); 335 | #245 = IFCCONNECTIONSURFACEGEOMETRY(#246, $); 336 | #246 = IFCCURVEBOUNDEDPLANE(#247, #249, ()); 337 | #247 = IFCPLANE(#248); 338 | #248 = IFCAXIS2PLACEMENT3D(#24, #25, #26); 339 | #249 = IFCCOMPOSITECURVE((#250), .U.); 340 | #250 = IFCCOMPOSITECURVESEGMENT(.CONTINUOUS., .F., #251); 341 | #251 = IFCPOLYLINE((#252, #253, #254, #255, #256)); 342 | #252 = IFCCARTESIANPOINT((0., 0.)); 343 | #253 = IFCCARTESIANPOINT((4500., 0.)); 344 | #254 = IFCCARTESIANPOINT((4500., 2800.)); 345 | #255 = IFCCARTESIANPOINT((0., 2800.)); 346 | #256 = IFCCARTESIANPOINT((0., 0.)); 347 | 348 | /* Create Space Boundary (Second Level Space boundary, ----------------------------------------- */ 349 | /* although in this example these are the same objects as first level) ------------------------- */ 350 | #257 = IFCRELSPACEBOUNDARY2NDLEVEL('1tlPcQCsf3ZhJbNFdV1x5t', #2, '2ndLevel', 'Space Boundary Front Wall', #188, #111, #258, .PHYSICAL., .EXTERNAL., $, $); 351 | #258 = IFCCONNECTIONSURFACEGEOMETRY(#259, $); 352 | #259 = IFCCURVEBOUNDEDPLANE(#260, #262, ()); 353 | #260 = IFCPLANE(#261); 354 | #261 = IFCAXIS2PLACEMENT3D(#24, #29, #25); 355 | #262 = IFCCOMPOSITECURVE((#263), .U.); 356 | #263 = IFCCOMPOSITECURVESEGMENT(.CONTINUOUS., .F., #264); 357 | #264 = IFCPOLYLINE((#265, #266, #267, #268, #269)); 358 | #265 = IFCCARTESIANPOINT((0., 0.)); 359 | #266 = IFCCARTESIANPOINT((3500., 0.)); 360 | #267 = IFCCARTESIANPOINT((3500., 2800.)); 361 | #268 = IFCCARTESIANPOINT((0., 2800.)); 362 | #269 = IFCCARTESIANPOINT((0., 0.)); 363 | 364 | /* Create Space Boundary (Second Level Space boundary, ----------------------------------------- */ 365 | /* although in this example these are the same objects as first level) ------------------------- */ 366 | #270 = IFCRELSPACEBOUNDARY2NDLEVEL('39iunT4y92UOBmk37WYXix', #2, '2ndLevel', 'Space Boundary Right Wall', #188, #134, #271, .PHYSICAL., .EXTERNAL., $, $); 367 | #271 = IFCCONNECTIONSURFACEGEOMETRY(#272, $); 368 | #272 = IFCCURVEBOUNDEDPLANE(#273, #276, ()); 369 | #273 = IFCPLANE(#274); 370 | #274 = IFCAXIS2PLACEMENT3D(#275, #25, #26); 371 | #275 = IFCCARTESIANPOINT((3500., 0., 0.)); 372 | #276 = IFCCOMPOSITECURVE((#277), .U.); 373 | #277 = IFCCOMPOSITECURVESEGMENT(.CONTINUOUS., .F., #278); 374 | #278 = IFCPOLYLINE((#279, #280, #281, #282, #283)); 375 | #279 = IFCCARTESIANPOINT((0., 0.)); 376 | #280 = IFCCARTESIANPOINT((4500., 0.)); 377 | #281 = IFCCARTESIANPOINT((4500., 2800.)); 378 | #282 = IFCCARTESIANPOINT((0., 2800.)); 379 | #283 = IFCCARTESIANPOINT((0., 0.)); 380 | ENDSEC; 381 | END-ISO-10303-21; 382 | --------------------------------------------------------------------------------